diff --git a/tools/ui/node_modules/unist-util-is/index.d.ts b/tools/ui/node_modules/unist-util-is/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d1bbbb35468074a2a795160581073d7ce3f504a --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/index.d.ts @@ -0,0 +1,5 @@ +export type Check = import("./lib/index.js").Check; +export type Test = import("./lib/index.js").Test; +export type TestFunction = import("./lib/index.js").TestFunction; +export { is, convert } from "./lib/index.js"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-is/index.d.ts.map b/tools/ui/node_modules/unist-util-is/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..ba2e37a1fe50b52a3bb2dd2612c41f0e6124ef92 --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"oBACa,OAAO,gBAAgB,EAAE,KAAK;mBAC9B,OAAO,gBAAgB,EAAE,IAAI;2BAC7B,OAAO,gBAAgB,EAAE,YAAY"} \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-is/index.js b/tools/ui/node_modules/unist-util-is/index.js new file mode 100644 index 0000000000000000000000000000000000000000..08faf55da50f73495a4e5d5d892fe958c089d510 --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/index.js @@ -0,0 +1,7 @@ +/** + * @typedef {import('./lib/index.js').Check} Check + * @typedef {import('./lib/index.js').Test} Test + * @typedef {import('./lib/index.js').TestFunction} TestFunction + */ + +export {is, convert} from './lib/index.js' diff --git a/tools/ui/node_modules/unist-util-is/lib/index.d.ts b/tools/ui/node_modules/unist-util-is/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..406f1e0c20edab7feed55277b16846c17f1f3199 --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/lib/index.d.ts @@ -0,0 +1,111 @@ +/** + * @import {Node, Parent} from 'unist' + */ +/** + * @template Fn + * @template Fallback + * @typedef {Fn extends (value: any) => value is infer Thing ? Thing : Fallback} Predicate + */ +/** + * @callback Check + * Check that an arbitrary value is a node. + * @param {unknown} this + * The given context. + * @param {unknown} [node] + * Anything (typically a node). + * @param {number | null | undefined} [index] + * The node’s position in its parent. + * @param {Parent | null | undefined} [parent] + * The node’s parent. + * @returns {boolean} + * Whether this is a node and passes a test. + * + * @typedef {Record | Node} Props + * Object to check for equivalence. + * + * Note: `Node` is included as it is common but is not indexable. + * + * @typedef {Array | ReadonlyArray | Props | TestFunction | string | null | undefined} Test + * Check for an arbitrary node. + * + * @callback TestFunction + * Check if a node passes a test. + * @param {unknown} this + * The given context. + * @param {Node} node + * A node. + * @param {number | undefined} [index] + * The node’s position in its parent. + * @param {Parent | undefined} [parent] + * The node’s parent. + * @returns {boolean | undefined | void} + * Whether this node passes the test. + * + * Note: `void` is included until TS sees no return as `undefined`. + */ +/** + * Check if `node` is a `Node` and whether it passes the given test. + * + * @param {unknown} node + * Thing to check, typically `Node`. + * @param {Test} test + * A check for a specific node. + * @param {number | null | undefined} index + * The node’s position in its parent. + * @param {Parent | null | undefined} parent + * The node’s parent. + * @param {unknown} context + * Context object (`this`) to pass to `test` functions. + * @returns {boolean} + * Whether `node` is a node and passes a test. + */ +export const is: ((>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & { + type: Condition[number]; +}) & (>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & { + type: Condition[number]; +}) & ((node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & { + type: Condition; +}) & ((node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) & ((node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate) & ((node?: null | undefined) => false) & ((node: unknown, test?: null | undefined, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) & ((node: unknown, test?: Test, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => boolean)); +/** + * Generate an assertion from a test. + * + * Useful if you’re going to test many nodes, for example when creating a + * utility where something else passes a compatible test. + * + * The created function is a bit faster because it expects valid input only: + * a `node`, `index`, and `parent`. + * + * @param {Test} test + * * when nullish, checks if `node` is a `Node`. + * * when `string`, works like passing `(node) => node.type === test`. + * * when `function` checks if function passed the node is true. + * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values. + * * when `array`, checks if any one of the subtests pass. + * @returns {Check} + * An assertion. + */ +export const convert: (((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & { + type: Condition; +}) & ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) & ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate) & ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) & ((test?: Test) => Check)); +export type Predicate = Fn extends (value: any) => value is infer Thing ? Thing : Fallback; +/** + * Check that an arbitrary value is a node. + */ +export type Check = (this: unknown, node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined) => boolean; +/** + * Object to check for equivalence. + * + * Note: `Node` is included as it is common but is not indexable. + */ +export type Props = Record | Node; +/** + * Check for an arbitrary node. + */ +export type Test = Array | ReadonlyArray | Props | TestFunction | string | null | undefined; +/** + * Check if a node passes a test. + */ +export type TestFunction = (this: unknown, node: Node, index?: number | undefined, parent?: Parent | undefined) => boolean | undefined | void; +import type { Parent } from 'unist'; +import type { Node } from 'unist'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-is/lib/index.d.ts.map b/tools/ui/node_modules/unist-util-is/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..3618c36aaf5320c37a0c819ed9346f7c1e849a8d --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,iBAGY,CACT,CAAK,CAAC,SAAS,SAAS,aAAa,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG;IAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAAC,CAAC,GACrN,CAAK,CAAC,SAAS,SAAS,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG;IAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAAC,CAAC,GAC7M,CAAK,CAAC,SAAS,SAAS,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG;IAAC,IAAI,EAAE,SAAS,CAAA;CAAC,CAAC,GAC9L,CAAK,CAAC,SAAS,SAAS,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG,SAAS,CAAC,GACrL,CAAK,CAAC,SAAS,SAAS,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,GAC7M,CAAK,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,KAAK,KAAK,CAAC,GACxC,CAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,GACxJ,CAAK,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,CACpI,CA4CH;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,sBAGY,CACT,CAAK,CAAC,SAAS,SAAS,MAAM,EAAE,IAAI,EAAE,SAAS,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG;IAAC,IAAI,EAAE,SAAS,CAAA;CAAC,CAAC,GAClM,CAAK,CAAC,SAAS,SAAS,KAAK,EAAE,IAAI,EAAE,SAAS,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG,SAAS,CAAC,GACzL,CAAK,CAAC,SAAS,SAAS,YAAY,EAAE,IAAI,EAAE,SAAS,KAAK,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG,SAAS,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC,GACjN,CAAK,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,GAC7J,CAAK,CAAC,IAAI,CAAC,EAAE,IAAI,KAAK,KAAK,CAAC,CACzB,CA8BH;sBA9KU,EAAE,EACF,QAAQ,IACR,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,MAAM,KAAK,GAAG,KAAK,GAAG,QAAQ;;;;2BAMpE,OAAO,SAEP,OAAO,UAEP,MAAM,GAAG,IAAI,GAAG,SAAS,WAEzB,MAAM,GAAG,IAAI,GAAG,SAAS,KAEvB,OAAO;;;;;;oBAGP,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;;;;mBAK9B,KAAK,CAAC,KAAK,GAAG,YAAY,GAAG,MAAM,CAAC,GAAG,aAAa,CAAC,KAAK,GAAG,YAAY,GAAG,MAAM,CAAC,GAAG,KAAK,GAAG,YAAY,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;;;;kCAKxI,OAAO,QAEP,IAAI,UAEJ,MAAM,GAAG,SAAS,WAElB,MAAM,GAAG,SAAS,KAEhB,OAAO,GAAG,SAAS,GAAG,IAAI;4BAzCR,OAAO;0BAAP,OAAO"} \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-is/lib/index.js b/tools/ui/node_modules/unist-util-is/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4acb3c3cfd3de58249c036ac3f46e2e2470fd3ce --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/lib/index.js @@ -0,0 +1,296 @@ +/** + * @import {Node, Parent} from 'unist' + */ + +/** + * @template Fn + * @template Fallback + * @typedef {Fn extends (value: any) => value is infer Thing ? Thing : Fallback} Predicate + */ + +/** + * @callback Check + * Check that an arbitrary value is a node. + * @param {unknown} this + * The given context. + * @param {unknown} [node] + * Anything (typically a node). + * @param {number | null | undefined} [index] + * The node’s position in its parent. + * @param {Parent | null | undefined} [parent] + * The node’s parent. + * @returns {boolean} + * Whether this is a node and passes a test. + * + * @typedef {Record | Node} Props + * Object to check for equivalence. + * + * Note: `Node` is included as it is common but is not indexable. + * + * @typedef {Array | ReadonlyArray | Props | TestFunction | string | null | undefined} Test + * Check for an arbitrary node. + * + * @callback TestFunction + * Check if a node passes a test. + * @param {unknown} this + * The given context. + * @param {Node} node + * A node. + * @param {number | undefined} [index] + * The node’s position in its parent. + * @param {Parent | undefined} [parent] + * The node’s parent. + * @returns {boolean | undefined | void} + * Whether this node passes the test. + * + * Note: `void` is included until TS sees no return as `undefined`. + */ + +/** + * Check if `node` is a `Node` and whether it passes the given test. + * + * @param {unknown} node + * Thing to check, typically `Node`. + * @param {Test} test + * A check for a specific node. + * @param {number | null | undefined} index + * The node’s position in its parent. + * @param {Parent | null | undefined} parent + * The node’s parent. + * @param {unknown} context + * Context object (`this`) to pass to `test` functions. + * @returns {boolean} + * Whether `node` is a node and passes a test. + */ +export const is = + // Note: overloads in JSDoc can’t yet use different `@template`s. + /** + * @type {( + * (>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition[number]}) & + * (>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition[number]}) & + * ((node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) & + * ((node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) & + * ((node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate) & + * ((node?: null | undefined) => false) & + * ((node: unknown, test?: null | undefined, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) & + * ((node: unknown, test?: Test, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => boolean) + * )} + */ + ( + /** + * @param {unknown} [node] + * @param {Test} [test] + * @param {number | null | undefined} [index] + * @param {Parent | null | undefined} [parent] + * @param {unknown} [context] + * @returns {boolean} + */ + // eslint-disable-next-line max-params + function (node, test, index, parent, context) { + const check = convert(test) + + if ( + index !== undefined && + index !== null && + (typeof index !== 'number' || + index < 0 || + index === Number.POSITIVE_INFINITY) + ) { + throw new Error('Expected positive finite index') + } + + if ( + parent !== undefined && + parent !== null && + (!is(parent) || !parent.children) + ) { + throw new Error('Expected parent node') + } + + if ( + (parent === undefined || parent === null) !== + (index === undefined || index === null) + ) { + throw new Error('Expected both parent and index') + } + + return looksLikeANode(node) + ? check.call(context, node, index, parent) + : false + } + ) + +/** + * Generate an assertion from a test. + * + * Useful if you’re going to test many nodes, for example when creating a + * utility where something else passes a compatible test. + * + * The created function is a bit faster because it expects valid input only: + * a `node`, `index`, and `parent`. + * + * @param {Test} test + * * when nullish, checks if `node` is a `Node`. + * * when `string`, works like passing `(node) => node.type === test`. + * * when `function` checks if function passed the node is true. + * * when `object`, checks that all keys in test are in node, and that they have (strictly) equal values. + * * when `array`, checks if any one of the subtests pass. + * @returns {Check} + * An assertion. + */ +export const convert = + // Note: overloads in JSDoc can’t yet use different `@template`s. + /** + * @type {( + * ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) & + * ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) & + * ((test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate) & + * ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) & + * ((test?: Test) => Check) + * )} + */ + ( + /** + * @param {Test} [test] + * @returns {Check} + */ + function (test) { + if (test === null || test === undefined) { + return ok + } + + if (typeof test === 'function') { + return castFactory(test) + } + + if (typeof test === 'object') { + return Array.isArray(test) + ? anyFactory(test) + : // Cast because `ReadonlyArray` goes into the above but `isArray` + // narrows to `Array`. + propertiesFactory(/** @type {Props} */ (test)) + } + + if (typeof test === 'string') { + return typeFactory(test) + } + + throw new Error('Expected function, string, or object as test') + } + ) + +/** + * @param {Array} tests + * @returns {Check} + */ +function anyFactory(tests) { + /** @type {Array} */ + const checks = [] + let index = -1 + + while (++index < tests.length) { + checks[index] = convert(tests[index]) + } + + return castFactory(any) + + /** + * @this {unknown} + * @type {TestFunction} + */ + function any(...parameters) { + let index = -1 + + while (++index < checks.length) { + if (checks[index].apply(this, parameters)) return true + } + + return false + } +} + +/** + * Turn an object into a test for a node with a certain fields. + * + * @param {Props} check + * @returns {Check} + */ +function propertiesFactory(check) { + const checkAsRecord = /** @type {Record} */ (check) + + return castFactory(all) + + /** + * @param {Node} node + * @returns {boolean} + */ + function all(node) { + const nodeAsRecord = /** @type {Record} */ ( + /** @type {unknown} */ (node) + ) + + /** @type {string} */ + let key + + for (key in check) { + if (nodeAsRecord[key] !== checkAsRecord[key]) return false + } + + return true + } +} + +/** + * Turn a string into a test for a node with a certain type. + * + * @param {string} check + * @returns {Check} + */ +function typeFactory(check) { + return castFactory(type) + + /** + * @param {Node} node + */ + function type(node) { + return node && node.type === check + } +} + +/** + * Turn a custom test into a test for a node that passes that test. + * + * @param {TestFunction} testFunction + * @returns {Check} + */ +function castFactory(testFunction) { + return check + + /** + * @this {unknown} + * @type {Check} + */ + function check(value, index, parent) { + return Boolean( + looksLikeANode(value) && + testFunction.call( + this, + value, + typeof index === 'number' ? index : undefined, + parent || undefined + ) + ) + } +} + +function ok() { + return true +} + +/** + * @param {unknown} value + * @returns {value is Node} + */ +function looksLikeANode(value) { + return value !== null && typeof value === 'object' && 'type' in value +} diff --git a/tools/ui/node_modules/unist-util-is/license b/tools/ui/node_modules/unist-util-is/license new file mode 100644 index 0000000000000000000000000000000000000000..cfa79e66cfc07297ae8d72f0ff63891347ed9bf7 --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/license @@ -0,0 +1,22 @@ +(The MIT license) + +Copyright (c) 2015 Titus Wormer + +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/unist-util-is/node_modules/@types/unist/LICENSE b/tools/ui/node_modules/unist-util-is/node_modules/@types/unist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/node_modules/@types/unist/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + 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/unist-util-is/node_modules/@types/unist/README.md b/tools/ui/node_modules/unist-util-is/node_modules/@types/unist/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b84e51bfb836f999b47b6d8e233b64cb372e48df --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/node_modules/@types/unist/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/unist` + +# Summary +This package contains type definitions for unist (https://github.com/syntax-tree/unist). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist. + +### Additional Details + * Last updated: Thu, 15 Aug 2024 02:18:53 GMT + * Dependencies: none + +# Credits +These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), [JounQin](https://github.com/JounQin), and [Remco Haszing](https://github.com/remcohaszing). diff --git a/tools/ui/node_modules/unist-util-is/node_modules/@types/unist/index.d.ts b/tools/ui/node_modules/unist-util-is/node_modules/@types/unist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..513ddee5e9e2acb1e5c88c26da384212e52ed90b --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/node_modules/@types/unist/index.d.ts @@ -0,0 +1,119 @@ +// ## Interfaces + +/** + * Info associated with nodes by the ecosystem. + * + * This space is guaranteed to never be specified by unist or specifications + * implementing unist. + * But you can use it in utilities and plugins to store data. + * + * This type can be augmented to register custom data. + * For example: + * + * ```ts + * declare module 'unist' { + * interface Data { + * // `someNode.data.myId` is typed as `number | undefined` + * myId?: number | undefined + * } + * } + * ``` + */ +export interface Data {} + +/** + * One place in a source file. + */ +export interface Point { + /** + * Line in a source file (1-indexed integer). + */ + line: number; + + /** + * Column in a source file (1-indexed integer). + */ + column: number; + /** + * Character in a source file (0-indexed integer). + */ + offset?: number | undefined; +} + +/** + * Position of a node in a source document. + * + * A position is a range between two points. + */ +export interface Position { + /** + * Place of the first character of the parsed source region. + */ + start: Point; + + /** + * Place of the first character after the parsed source region. + */ + end: Point; +} + +// ## Abstract nodes + +/** + * Abstract unist node that contains the smallest possible value. + * + * This interface is supposed to be extended. + * + * For example, in HTML, a `text` node is a leaf that contains text. + */ +export interface Literal extends Node { + /** + * Plain value. + */ + value: unknown; +} + +/** + * Abstract unist node. + * + * The syntactic unit in unist syntax trees are called nodes. + * + * This interface is supposed to be extended. + * If you can use {@link Literal} or {@link Parent}, you should. + * But for example in markdown, a `thematicBreak` (`***`), is neither literal + * nor parent, but still a node. + */ +export interface Node { + /** + * Node type. + */ + type: string; + + /** + * Info from the ecosystem. + */ + data?: Data | undefined; + + /** + * Position of a node in a source document. + * + * Nodes that are generated (not in the original source document) must not + * have a position. + */ + position?: Position | undefined; +} + +/** + * Abstract unist node that contains other nodes (*children*). + * + * This interface is supposed to be extended. + * + * For example, in XML, an element is a parent of different things, such as + * comments, text, and further elements. + */ +export interface Parent extends Node { + /** + * List of children. + */ + children: Node[]; +} diff --git a/tools/ui/node_modules/unist-util-is/node_modules/@types/unist/package.json b/tools/ui/node_modules/unist-util-is/node_modules/@types/unist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d2092dba8f2208817af3e1811569d90b6358ad8f --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/node_modules/@types/unist/package.json @@ -0,0 +1,60 @@ +{ + "name": "@types/unist", + "version": "3.0.3", + "description": "TypeScript definitions for unist", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist", + "license": "MIT", + "contributors": [ + { + "name": "bizen241", + "githubUsername": "bizen241", + "url": "https://github.com/bizen241" + }, + { + "name": "Jun Lu", + "githubUsername": "lujun2", + "url": "https://github.com/lujun2" + }, + { + "name": "Hernan Rajchert", + "githubUsername": "hrajchert", + "url": "https://github.com/hrajchert" + }, + { + "name": "Titus Wormer", + "githubUsername": "wooorm", + "url": "https://github.com/wooorm" + }, + { + "name": "Junyoung Choi", + "githubUsername": "rokt33r", + "url": "https://github.com/rokt33r" + }, + { + "name": "Ben Moon", + "githubUsername": "GuiltyDolphin", + "url": "https://github.com/GuiltyDolphin" + }, + { + "name": "JounQin", + "githubUsername": "JounQin", + "url": "https://github.com/JounQin" + }, + { + "name": "Remco Haszing", + "githubUsername": "remcohaszing", + "url": "https://github.com/remcohaszing" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/unist" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "7f3d5ce8d56003f3583a5317f98d444bdc99910c7b486c6b10af4f38694e61fe", + "typeScriptVersion": "4.8" +} \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-is/package.json b/tools/ui/node_modules/unist-util-is/package.json new file mode 100644 index 0000000000000000000000000000000000000000..88ca667bd0878e1ed674ba480ef9422473f5f75e --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/package.json @@ -0,0 +1,103 @@ +{ + "name": "unist-util-is", + "version": "6.0.1", + "description": "unist utility to check if a node passes a test", + "license": "MIT", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "tree", + "node", + "is", + "equal", + "check", + "test", + "type" + ], + "repository": "syntax-tree/unist-util-is", + "bugs": "https://github.com/syntax-tree/unist-util-is/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)", + "Christian Murphy ", + "Lucas Brandstaetter (https://github.com/Roang-zero1)" + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts.map", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/unist": "^3.0.0" + }, + "devDependencies": { + "@types/mdast": "^4.0.0", + "@types/node": "^24.0.0", + "c8": "^10.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^11.0.0", + "tsd": "^0.33.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.58.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && tsd && type-coverage", + "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix", + "test-api": "node --conditions development test/index.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "#": "needed `any`s", + "ignoreFiles": [ + "lib/index.d.ts" + ], + "ignoreCatch": true, + "strict": true + }, + "xo": { + "overrides": [ + { + "files": [ + "**/*.ts" + ], + "rules": { + "@typescript-eslint/consistent-type-definitions": "off", + "@typescript-eslint/no-unnecessary-type-arguments": "off", + "@typescript-eslint/no-unsafe-argument": "off", + "@typescript-eslint/no-unsafe-assignment": "off", + "import/no-extraneous-dependencies": "off" + } + } + ], + "prettier": true + } +} diff --git a/tools/ui/node_modules/unist-util-is/readme.md b/tools/ui/node_modules/unist-util-is/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..86aa997dc2aed377727d1aef2981586d0d6febc7 --- /dev/null +++ b/tools/ui/node_modules/unist-util-is/readme.md @@ -0,0 +1,351 @@ +# unist-util-is + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[unist][] utility to check if nodes pass a test. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`is(node[, test[, index, parent[, context]]])`](#isnode-test-index-parent-context) + * [`convert(test)`](#converttest) + * [`Check`](#check) + * [`Test`](#test) + * [`TestFunction`](#testfunction) +* [Examples](#examples) + * [Example of `convert`](#example-of-convert) +* [Types](#types) +* [Compatibility](#compatibility) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package is a small utility that checks that a node is a certain node. + +## When should I use this? + +Use this small utility if you find yourself repeating code for checking what +nodes are. + +A similar package, [`hast-util-is-element`][hast-util-is-element], works on hast +elements. + +For more advanced tests, [`unist-util-select`][unist-util-select] can be used +to match against CSS selectors. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install unist-util-is +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {is} from 'https://esm.sh/unist-util-is@6' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {is} from 'unist-util-is' + +const node = {type: 'strong'} +const parent = {type: 'paragraph', children: [node]} + +is() // => false +is({children: []}) // => false +is(node) // => true +is(node, 'strong') // => true +is(node, 'emphasis') // => false + +is(node, node) // => true +is(parent, {type: 'paragraph'}) // => true +is(parent, {type: 'strong'}) // => false + +is(node, test) // => false +is(node, test, 4, parent) // => false +is(node, test, 5, parent) // => true + +function test(node, n) { + return n === 5 +} +``` + +## API + +This package exports the identifiers [`convert`][api-convert] and +[`is`][api-is]. +There is no default export. + +### `is(node[, test[, index, parent[, context]]])` + +Check if `node` is a `Node` and whether it passes the given test. + +###### Parameters + +* `node` (`unknown`, optional) + — thing to check, typically [`Node`][node] +* `test` ([`Test`][api-test], optional) + — a test for a specific element +* `index` (`number`, optional) + — the node’s position in its parent +* `parent` ([`Node`][node], optional) + — the node’s parent +* `context` (`unknown`, optional) + — context object (`this`) to call `test` with + +###### Returns + +Whether `node` is a [`Node`][node] and passes a test (`boolean`). + +###### Throws + +When an incorrect `test`, `index`, or `parent` is given. +There is no error thrown when `node` is not a node. + +### `convert(test)` + +Generate a check from a test. + +Useful if you’re going to test many nodes, for example when creating a +utility where something else passes a compatible test. + +The created function is a bit faster because it expects valid input only: +a `node`, `index`, and `parent`. + +###### Parameters + +* `test` ([`Test`][api-test], optional) + — a test for a specific node + +###### Returns + +A check ([`Check`][api-check]). + +### `Check` + +Check that an arbitrary value is a node (TypeScript type). + +###### Parameters + +* `this` (`unknown`, optional) + — context object (`this`) to call `test` with +* `node` (`unknown`) + — anything (typically a node) +* `index` (`number`, optional) + — the node’s position in its parent +* `parent` ([`Node`][node], optional) + — the node’s parent + +###### Returns + +Whether this is a node and passes a test (`boolean`). + +### `Test` + +Check for an arbitrary node (TypeScript type). + +###### Type + +```ts +type Test = + | Array | TestFunction | string> + | Record + | TestFunction + | string + | null + | undefined +``` + +Checks that the given thing is a node, and then: + +* when `string`, checks that the node has that tag name +* when `function`, see [`TestFunction`][api-test-function] +* when `object`, checks that all keys in test are in node, and that they have + (strictly) equal values +* when `Array`, checks if one of the subtests pass + +### `TestFunction` + +Check if a node passes a test (TypeScript type). + +###### Parameters + +* `node` ([`Node`][node]) + — a node +* `index` (`number` or `undefined`) + — the node’s position in its parent +* `parent` ([`Node`][node] or `undefined`) + — the node’s parent + +###### Returns + +Whether this node passes the test (`boolean`, optional). + +## Examples + +### Example of `convert` + +```js +import {u} from 'unist-builder' +import {convert} from 'unist-util-is' + +const test = convert('leaf') + +const tree = u('tree', [ + u('node', [u('leaf', '1')]), + u('leaf', '2'), + u('node', [u('leaf', '3'), u('leaf', '4')]), + u('leaf', '5') +]) + +const leafs = tree.children.filter(function (child, index) { + return test(child, index, tree) +}) + +console.log(leafs) +``` + +Yields: + +```js +[{type: 'leaf', value: '2'}, {type: 'leaf', value: '5'}] +``` + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional types [`Check`][api-check], +[`Test`][api-test], +[`TestFunction`][api-test-function]. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `unist-util-is@^6`, +compatible with Node.js 16. + +## Related + +* [`unist-util-find-after`](https://github.com/syntax-tree/unist-util-find-after) + — find a node after another node +* [`unist-util-find-before`](https://github.com/syntax-tree/unist-util-find-before) + — find a node before another node +* [`unist-util-find-all-after`](https://github.com/syntax-tree/unist-util-find-all-after) + — find all nodes after another node +* [`unist-util-find-all-before`](https://github.com/syntax-tree/unist-util-find-all-before) + — find all nodes before another node +* [`unist-util-find-all-between`](https://github.com/mrzmmr/unist-util-find-all-between) + — find all nodes between two nodes +* [`unist-util-filter`](https://github.com/syntax-tree/unist-util-filter) + — create a new tree with nodes that pass a check +* [`unist-util-remove`](https://github.com/syntax-tree/unist-util-remove) + — remove nodes from tree + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[api-check]: #check + +[api-convert]: #converttest + +[api-is]: #isnode-test-index-parent-context + +[api-test]: #test + +[api-test-function]: #testfunction + +[author]: https://wooorm.com + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[build]: https://github.com/syntax-tree/unist-util-is/actions + +[build-badge]: https://github.com/syntax-tree/unist-util-is/workflows/main/badge.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[collective]: https://opencollective.com/unified + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[coverage]: https://codecov.io/github/syntax-tree/unist-util-is + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-is.svg + +[downloads]: https://www.npmjs.com/package/unist-util-is + +[downloads-badge]: https://img.shields.io/npm/dm/unist-util-is.svg + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[hast-util-is-element]: https://github.com/syntax-tree/hast-util-is-element + +[health]: https://github.com/syntax-tree/.github + +[license]: license + +[node]: https://github.com/syntax-tree/unist#node + +[npm]: https://docs.npmjs.com/cli/install + +[size]: https://bundlejs.com/?q=unist-util-is + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=unist-util-is + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[typescript]: https://www.typescriptlang.org + +[unist]: https://github.com/syntax-tree/unist + +[unist-util-select]: https://github.com/syntax-tree/unist-util-select diff --git a/tools/ui/node_modules/unist-util-position/index.d.ts b/tools/ui/node_modules/unist-util-position/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..74cdd90b9f13ba75d8aee4c49cf57196d991dbed --- /dev/null +++ b/tools/ui/node_modules/unist-util-position/index.d.ts @@ -0,0 +1 @@ +export {pointEnd, pointStart, position} from './lib/index.js' diff --git a/tools/ui/node_modules/unist-util-position/index.js b/tools/ui/node_modules/unist-util-position/index.js new file mode 100644 index 0000000000000000000000000000000000000000..74cdd90b9f13ba75d8aee4c49cf57196d991dbed --- /dev/null +++ b/tools/ui/node_modules/unist-util-position/index.js @@ -0,0 +1 @@ +export {pointEnd, pointStart, position} from './lib/index.js' diff --git a/tools/ui/node_modules/unist-util-position/lib/index.d.ts b/tools/ui/node_modules/unist-util-position/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..162f5f9158cb6a849b39bfd3695726a0a9d48188 --- /dev/null +++ b/tools/ui/node_modules/unist-util-position/lib/index.d.ts @@ -0,0 +1,45 @@ +/** + * Get the positional info of `node`. + * + * @param {Node | NodeLike | null | undefined} [node] + * Node. + * @returns {Position | undefined} + * Position. + */ +export function position( + node?: Node | NodeLike | null | undefined +): Position | undefined +/** + * Get the point info of `node` at a bound side. + * + * @param {Node | NodeLike | null | undefined} [node] + * @returns {Point | undefined} + */ +export function pointEnd( + node?: Node | NodeLike | null | undefined +): Point | undefined +/** + * Get the point info of `node` at a bound side. + * + * @param {Node | NodeLike | null | undefined} [node] + * @returns {Point | undefined} + */ +export function pointStart( + node?: Node | NodeLike | null | undefined +): Point | undefined +export type Node = import('unist').Node +export type Point = import('unist').Point +export type Position = import('unist').Position +export type NodeLike = { + type: string + position?: PositionLike | null | undefined +} +export type PositionLike = { + start?: PointLike | null | undefined + end?: PointLike | null | undefined +} +export type PointLike = { + line?: number | null | undefined + column?: number | null | undefined + offset?: number | null | undefined +} diff --git a/tools/ui/node_modules/unist-util-position/lib/index.js b/tools/ui/node_modules/unist-util-position/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8d3f342d5d58e6791906ef7f720ba34087987523 --- /dev/null +++ b/tools/ui/node_modules/unist-util-position/lib/index.js @@ -0,0 +1,95 @@ +/** + * @typedef {import('unist').Node} Node + * @typedef {import('unist').Point} Point + * @typedef {import('unist').Position} Position + */ + +/** + * @typedef NodeLike + * @property {string} type + * @property {PositionLike | null | undefined} [position] + * + * @typedef PositionLike + * @property {PointLike | null | undefined} [start] + * @property {PointLike | null | undefined} [end] + * + * @typedef PointLike + * @property {number | null | undefined} [line] + * @property {number | null | undefined} [column] + * @property {number | null | undefined} [offset] + */ + +/** + * Get the ending point of `node`. + * + * @param node + * Node. + * @returns + * Point. + */ +export const pointEnd = point('end') + +/** + * Get the starting point of `node`. + * + * @param node + * Node. + * @returns + * Point. + */ +export const pointStart = point('start') + +/** + * Get the positional info of `node`. + * + * @param {'end' | 'start'} type + * Side. + * @returns + * Getter. + */ +function point(type) { + return point + + /** + * Get the point info of `node` at a bound side. + * + * @param {Node | NodeLike | null | undefined} [node] + * @returns {Point | undefined} + */ + function point(node) { + const point = (node && node.position && node.position[type]) || {} + + if ( + typeof point.line === 'number' && + point.line > 0 && + typeof point.column === 'number' && + point.column > 0 + ) { + return { + line: point.line, + column: point.column, + offset: + typeof point.offset === 'number' && point.offset > -1 + ? point.offset + : undefined + } + } + } +} + +/** + * Get the positional info of `node`. + * + * @param {Node | NodeLike | null | undefined} [node] + * Node. + * @returns {Position | undefined} + * Position. + */ +export function position(node) { + const start = pointStart(node) + const end = pointEnd(node) + + if (start && end) { + return {start, end} + } +} diff --git a/tools/ui/node_modules/unist-util-position/license b/tools/ui/node_modules/unist-util-position/license new file mode 100644 index 0000000000000000000000000000000000000000..32e7a3d93ca5a2b8cce57405841a44e78f3fbb55 --- /dev/null +++ b/tools/ui/node_modules/unist-util-position/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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/unist-util-position/node_modules/@types/unist/LICENSE b/tools/ui/node_modules/unist-util-position/node_modules/@types/unist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/tools/ui/node_modules/unist-util-position/node_modules/@types/unist/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + 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/unist-util-position/node_modules/@types/unist/README.md b/tools/ui/node_modules/unist-util-position/node_modules/@types/unist/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b84e51bfb836f999b47b6d8e233b64cb372e48df --- /dev/null +++ b/tools/ui/node_modules/unist-util-position/node_modules/@types/unist/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/unist` + +# Summary +This package contains type definitions for unist (https://github.com/syntax-tree/unist). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist. + +### Additional Details + * Last updated: Thu, 15 Aug 2024 02:18:53 GMT + * Dependencies: none + +# Credits +These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), [JounQin](https://github.com/JounQin), and [Remco Haszing](https://github.com/remcohaszing). diff --git a/tools/ui/node_modules/unist-util-position/node_modules/@types/unist/index.d.ts b/tools/ui/node_modules/unist-util-position/node_modules/@types/unist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..513ddee5e9e2acb1e5c88c26da384212e52ed90b --- /dev/null +++ b/tools/ui/node_modules/unist-util-position/node_modules/@types/unist/index.d.ts @@ -0,0 +1,119 @@ +// ## Interfaces + +/** + * Info associated with nodes by the ecosystem. + * + * This space is guaranteed to never be specified by unist or specifications + * implementing unist. + * But you can use it in utilities and plugins to store data. + * + * This type can be augmented to register custom data. + * For example: + * + * ```ts + * declare module 'unist' { + * interface Data { + * // `someNode.data.myId` is typed as `number | undefined` + * myId?: number | undefined + * } + * } + * ``` + */ +export interface Data {} + +/** + * One place in a source file. + */ +export interface Point { + /** + * Line in a source file (1-indexed integer). + */ + line: number; + + /** + * Column in a source file (1-indexed integer). + */ + column: number; + /** + * Character in a source file (0-indexed integer). + */ + offset?: number | undefined; +} + +/** + * Position of a node in a source document. + * + * A position is a range between two points. + */ +export interface Position { + /** + * Place of the first character of the parsed source region. + */ + start: Point; + + /** + * Place of the first character after the parsed source region. + */ + end: Point; +} + +// ## Abstract nodes + +/** + * Abstract unist node that contains the smallest possible value. + * + * This interface is supposed to be extended. + * + * For example, in HTML, a `text` node is a leaf that contains text. + */ +export interface Literal extends Node { + /** + * Plain value. + */ + value: unknown; +} + +/** + * Abstract unist node. + * + * The syntactic unit in unist syntax trees are called nodes. + * + * This interface is supposed to be extended. + * If you can use {@link Literal} or {@link Parent}, you should. + * But for example in markdown, a `thematicBreak` (`***`), is neither literal + * nor parent, but still a node. + */ +export interface Node { + /** + * Node type. + */ + type: string; + + /** + * Info from the ecosystem. + */ + data?: Data | undefined; + + /** + * Position of a node in a source document. + * + * Nodes that are generated (not in the original source document) must not + * have a position. + */ + position?: Position | undefined; +} + +/** + * Abstract unist node that contains other nodes (*children*). + * + * This interface is supposed to be extended. + * + * For example, in XML, an element is a parent of different things, such as + * comments, text, and further elements. + */ +export interface Parent extends Node { + /** + * List of children. + */ + children: Node[]; +} diff --git a/tools/ui/node_modules/unist-util-position/node_modules/@types/unist/package.json b/tools/ui/node_modules/unist-util-position/node_modules/@types/unist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d2092dba8f2208817af3e1811569d90b6358ad8f --- /dev/null +++ b/tools/ui/node_modules/unist-util-position/node_modules/@types/unist/package.json @@ -0,0 +1,60 @@ +{ + "name": "@types/unist", + "version": "3.0.3", + "description": "TypeScript definitions for unist", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist", + "license": "MIT", + "contributors": [ + { + "name": "bizen241", + "githubUsername": "bizen241", + "url": "https://github.com/bizen241" + }, + { + "name": "Jun Lu", + "githubUsername": "lujun2", + "url": "https://github.com/lujun2" + }, + { + "name": "Hernan Rajchert", + "githubUsername": "hrajchert", + "url": "https://github.com/hrajchert" + }, + { + "name": "Titus Wormer", + "githubUsername": "wooorm", + "url": "https://github.com/wooorm" + }, + { + "name": "Junyoung Choi", + "githubUsername": "rokt33r", + "url": "https://github.com/rokt33r" + }, + { + "name": "Ben Moon", + "githubUsername": "GuiltyDolphin", + "url": "https://github.com/GuiltyDolphin" + }, + { + "name": "JounQin", + "githubUsername": "JounQin", + "url": "https://github.com/JounQin" + }, + { + "name": "Remco Haszing", + "githubUsername": "remcohaszing", + "url": "https://github.com/remcohaszing" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/unist" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "7f3d5ce8d56003f3583a5317f98d444bdc99910c7b486c6b10af4f38694e61fe", + "typeScriptVersion": "4.8" +} \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-position/package.json b/tools/ui/node_modules/unist-util-position/package.json new file mode 100644 index 0000000000000000000000000000000000000000..7c2469dee48ce16c146aa4aa9706da9d3dd16ea1 --- /dev/null +++ b/tools/ui/node_modules/unist-util-position/package.json @@ -0,0 +1,76 @@ +{ + "name": "unist-util-position", + "version": "5.0.0", + "description": "unist utility to get the position of a node", + "license": "MIT", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "node", + "position", + "point" + ], + "repository": "syntax-tree/unist-util-position", + "bugs": "https://github.com/syntax-tree/unist-util-position/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/unist": "^3.0.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "c8": "^8.0.0", + "prettier": "^2.0.0", + "remark-cli": "^11.0.0", + "remark-preset-wooorm": "^9.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.54.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "prettier": true + } +} diff --git a/tools/ui/node_modules/unist-util-position/readme.md b/tools/ui/node_modules/unist-util-position/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..4dd2e9c2279296895344725acc436b06486c6174 --- /dev/null +++ b/tools/ui/node_modules/unist-util-position/readme.md @@ -0,0 +1,243 @@ +# unist-util-position + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[unist][] utility to get positional info of nodes. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`position(node)`](#positionnode) + * [`pointEnd(node)`](#pointendnode) + * [`pointStart(node)`](#pointstartnode) +* [Types](#types) +* [Compatibility](#compatibility) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This utility helps with accessing positional info on a potentially dirty tree. + +## When should I use this? + +The positional info is typically consistent and proper in unist trees generated +by our ecosystem, but, user plugins could mess that up. +If you’re making a reusable plugin, and accessing the positional info often, you +might want to guard against that by using this utility. + +You might also find the utility [`unist-util-generated`][unist-util-generated] +useful to check whether a node is considered to be generated (not in the +original input file). + +You might also enjoy +[`unist-util-stringify-position`][unist-util-stringify-position] when you want +to display positional info to users. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install unist-util-position +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {pointEnd, pointStart, position} from 'https://esm.sh/unist-util-position@5' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {fromMarkdown} from 'mdast-util-from-markdown' +import {pointEnd, pointStart, position} from 'unist-util-position' + +const tree = fromMarkdown('# foo\n\n* bar\n') + +console.log(position(tree)) +console.log(pointStart(tree)) +console.log(pointEnd(tree)) +``` + +Yields: + +```js +{start: {line: 1, column: 1, offset: 0}, end: {line: 4, column: 1, offset: 13}} +{line: 1, column: 1, offset: 0} +{line: 4, column: 1, offset: 13} +``` + +## API + +This package exports the identifiers [`pointEnd`][pointend], +[`pointStart`][pointstart], and [`position`][position]. +There is no default export. + +### `position(node)` + +Get the positional info of `node`. + +###### Parameters + +* `node` ([`Node`][node]) + — node + +###### Returns + +Position, if valid ([`Position`][unist-position] or `undefined`). + +### `pointEnd(node)` + +Get the ending point of `node`. + +###### Parameters + +* `node` ([`Node`][node]) + — node + +###### Returns + +Point, if valid ([`Point`][unist-point] or `undefined`). + +### `pointStart(node)` + +Get the starting point of `node`. + +###### Parameters + +* `node` ([`Node`][node]) + — node + +###### Returns + +Point, if valid ([`Point`][unist-point] or `undefined`). + +## Types + +This package is fully typed with [TypeScript][]. +It exports no additional types. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `unist-util-position@^5`, +compatible with Node.js 16. + +## Related + +* [`unist-util-stringify-position`](https://github.com/syntax-tree/unist-util-stringify-position) + — serialize a node, position, or point as a human readable location +* [`unist-util-position-from-estree`](https://github.com/syntax-tree/unist-util-position-from-estree) + — get a position from an estree node +* [`unist-util-remove-position`](https://github.com/syntax-tree/unist-util-remove-position) + — remove positions from tree +* [`unist-util-generated`](https://github.com/syntax-tree/unist-util-generated) + — check if a node is generated +* [`unist-util-source`](https://github.com/syntax-tree/unist-util-source) + — get the source of a node + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/unist-util-position/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/unist-util-position/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-position.svg + +[coverage]: https://codecov.io/github/syntax-tree/unist-util-position + +[downloads-badge]: https://img.shields.io/npm/dm/unist-util-position.svg + +[downloads]: https://www.npmjs.com/package/unist-util-position + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=unist-util-position + +[size]: https://bundlejs.com/?q=unist-util-position + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[license]: license + +[author]: https://wooorm.com + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[unist]: https://github.com/syntax-tree/unist + +[node]: https://github.com/syntax-tree/unist#node + +[unist-position]: https://github.com/syntax-tree/unist#position + +[unist-point]: https://github.com/syntax-tree/unist#point + +[unist-util-generated]: https://github.com/syntax-tree/unist-util-generated + +[unist-util-stringify-position]: https://github.com/syntax-tree/unist-util-stringify-position + +[position]: #positionnode + +[pointend]: #pointendnode + +[pointstart]: #pointstartnode diff --git a/tools/ui/node_modules/unist-util-remove-position/index.d.ts b/tools/ui/node_modules/unist-util-remove-position/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..324bb1ab3e7e730a9bf6f96a388c821e97e49f0c --- /dev/null +++ b/tools/ui/node_modules/unist-util-remove-position/index.d.ts @@ -0,0 +1,2 @@ +export {removePosition} from './lib/index.js' +export type Options = import('./lib/index.js').Options diff --git a/tools/ui/node_modules/unist-util-remove-position/index.js b/tools/ui/node_modules/unist-util-remove-position/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e4b1aea0134e36071415b4b6519bff605de77874 --- /dev/null +++ b/tools/ui/node_modules/unist-util-remove-position/index.js @@ -0,0 +1,5 @@ +/** + * @typedef {import('./lib/index.js').Options} Options + */ + +export {removePosition} from './lib/index.js' diff --git a/tools/ui/node_modules/unist-util-remove-position/lib/index.d.ts b/tools/ui/node_modules/unist-util-remove-position/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f62334521fbfe91167b7244e528bf9121af52292 --- /dev/null +++ b/tools/ui/node_modules/unist-util-remove-position/lib/index.d.ts @@ -0,0 +1,26 @@ +/** + * Remove the `position` field from a tree. + * + * @param {Node} tree + * Tree to clean. + * @param {Options | null | undefined} [options={force: false}] + * Configuration (default: `{force: false}`). + * @returns {undefined} + * Nothing. + */ +export function removePosition( + tree: Node, + options?: Options | null | undefined +): undefined +export type Node = import('unist').Node +/** + * Configuration. + */ +export type Options = { + /** + * Whether to use `delete` to remove `position` fields. + * + * The default is to set them to `undefined`. + */ + force?: boolean | null | undefined +} diff --git a/tools/ui/node_modules/unist-util-remove-position/lib/index.js b/tools/ui/node_modules/unist-util-remove-position/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..15d0b8629fcf4850ee9298040dfacf13b0ba09e3 --- /dev/null +++ b/tools/ui/node_modules/unist-util-remove-position/lib/index.js @@ -0,0 +1,42 @@ +/** + * @typedef {import('unist').Node} Node + */ + +/** + * @typedef Options + * Configuration. + * @property {boolean | null | undefined} [force=false] + * Whether to use `delete` to remove `position` fields. + * + * The default is to set them to `undefined`. + */ + +import {visit} from 'unist-util-visit' + +/** + * Remove the `position` field from a tree. + * + * @param {Node} tree + * Tree to clean. + * @param {Options | null | undefined} [options={force: false}] + * Configuration (default: `{force: false}`). + * @returns {undefined} + * Nothing. + */ +export function removePosition(tree, options) { + const config = options || {} + const force = config.force || false + + visit(tree, remove) + + /** + * @param {Node} node + */ + function remove(node) { + if (force) { + delete node.position + } else { + node.position = undefined + } + } +} diff --git a/tools/ui/node_modules/unist-util-remove-position/license b/tools/ui/node_modules/unist-util-remove-position/license new file mode 100644 index 0000000000000000000000000000000000000000..8d8660d36ef2eced1f9cce91e17ae0290261734c --- /dev/null +++ b/tools/ui/node_modules/unist-util-remove-position/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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/unist-util-remove-position/node_modules/@types/unist/LICENSE b/tools/ui/node_modules/unist-util-remove-position/node_modules/@types/unist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/tools/ui/node_modules/unist-util-remove-position/node_modules/@types/unist/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + 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/unist-util-remove-position/node_modules/@types/unist/README.md b/tools/ui/node_modules/unist-util-remove-position/node_modules/@types/unist/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b84e51bfb836f999b47b6d8e233b64cb372e48df --- /dev/null +++ b/tools/ui/node_modules/unist-util-remove-position/node_modules/@types/unist/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/unist` + +# Summary +This package contains type definitions for unist (https://github.com/syntax-tree/unist). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist. + +### Additional Details + * Last updated: Thu, 15 Aug 2024 02:18:53 GMT + * Dependencies: none + +# Credits +These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), [JounQin](https://github.com/JounQin), and [Remco Haszing](https://github.com/remcohaszing). diff --git a/tools/ui/node_modules/unist-util-remove-position/node_modules/@types/unist/index.d.ts b/tools/ui/node_modules/unist-util-remove-position/node_modules/@types/unist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..513ddee5e9e2acb1e5c88c26da384212e52ed90b --- /dev/null +++ b/tools/ui/node_modules/unist-util-remove-position/node_modules/@types/unist/index.d.ts @@ -0,0 +1,119 @@ +// ## Interfaces + +/** + * Info associated with nodes by the ecosystem. + * + * This space is guaranteed to never be specified by unist or specifications + * implementing unist. + * But you can use it in utilities and plugins to store data. + * + * This type can be augmented to register custom data. + * For example: + * + * ```ts + * declare module 'unist' { + * interface Data { + * // `someNode.data.myId` is typed as `number | undefined` + * myId?: number | undefined + * } + * } + * ``` + */ +export interface Data {} + +/** + * One place in a source file. + */ +export interface Point { + /** + * Line in a source file (1-indexed integer). + */ + line: number; + + /** + * Column in a source file (1-indexed integer). + */ + column: number; + /** + * Character in a source file (0-indexed integer). + */ + offset?: number | undefined; +} + +/** + * Position of a node in a source document. + * + * A position is a range between two points. + */ +export interface Position { + /** + * Place of the first character of the parsed source region. + */ + start: Point; + + /** + * Place of the first character after the parsed source region. + */ + end: Point; +} + +// ## Abstract nodes + +/** + * Abstract unist node that contains the smallest possible value. + * + * This interface is supposed to be extended. + * + * For example, in HTML, a `text` node is a leaf that contains text. + */ +export interface Literal extends Node { + /** + * Plain value. + */ + value: unknown; +} + +/** + * Abstract unist node. + * + * The syntactic unit in unist syntax trees are called nodes. + * + * This interface is supposed to be extended. + * If you can use {@link Literal} or {@link Parent}, you should. + * But for example in markdown, a `thematicBreak` (`***`), is neither literal + * nor parent, but still a node. + */ +export interface Node { + /** + * Node type. + */ + type: string; + + /** + * Info from the ecosystem. + */ + data?: Data | undefined; + + /** + * Position of a node in a source document. + * + * Nodes that are generated (not in the original source document) must not + * have a position. + */ + position?: Position | undefined; +} + +/** + * Abstract unist node that contains other nodes (*children*). + * + * This interface is supposed to be extended. + * + * For example, in XML, an element is a parent of different things, such as + * comments, text, and further elements. + */ +export interface Parent extends Node { + /** + * List of children. + */ + children: Node[]; +} diff --git a/tools/ui/node_modules/unist-util-remove-position/node_modules/@types/unist/package.json b/tools/ui/node_modules/unist-util-remove-position/node_modules/@types/unist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d2092dba8f2208817af3e1811569d90b6358ad8f --- /dev/null +++ b/tools/ui/node_modules/unist-util-remove-position/node_modules/@types/unist/package.json @@ -0,0 +1,60 @@ +{ + "name": "@types/unist", + "version": "3.0.3", + "description": "TypeScript definitions for unist", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist", + "license": "MIT", + "contributors": [ + { + "name": "bizen241", + "githubUsername": "bizen241", + "url": "https://github.com/bizen241" + }, + { + "name": "Jun Lu", + "githubUsername": "lujun2", + "url": "https://github.com/lujun2" + }, + { + "name": "Hernan Rajchert", + "githubUsername": "hrajchert", + "url": "https://github.com/hrajchert" + }, + { + "name": "Titus Wormer", + "githubUsername": "wooorm", + "url": "https://github.com/wooorm" + }, + { + "name": "Junyoung Choi", + "githubUsername": "rokt33r", + "url": "https://github.com/rokt33r" + }, + { + "name": "Ben Moon", + "githubUsername": "GuiltyDolphin", + "url": "https://github.com/GuiltyDolphin" + }, + { + "name": "JounQin", + "githubUsername": "JounQin", + "url": "https://github.com/JounQin" + }, + { + "name": "Remco Haszing", + "githubUsername": "remcohaszing", + "url": "https://github.com/remcohaszing" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/unist" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "7f3d5ce8d56003f3583a5317f98d444bdc99910c7b486c6b10af4f38694e61fe", + "typeScriptVersion": "4.8" +} \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-remove-position/package.json b/tools/ui/node_modules/unist-util-remove-position/package.json new file mode 100644 index 0000000000000000000000000000000000000000..36a2e32e630fa754c2a9180d4c9341c4eaf6ba83 --- /dev/null +++ b/tools/ui/node_modules/unist-util-remove-position/package.json @@ -0,0 +1,84 @@ +{ + "name": "unist-util-remove-position", + "version": "5.0.0", + "description": "unist utility to remove positions from a tree", + "license": "MIT", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "remove", + "position", + "location", + "clean", + "force" + ], + "repository": "syntax-tree/unist-util-remove-position", + "bugs": "https://github.com/syntax-tree/unist-util-remove-position/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)", + "Merlijn Vos " + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-visit": "^5.0.0" + }, + "devDependencies": { + "@types/mdast": "^4.0.0", + "@types/node": "^20.0.0", + "c8": "^8.0.0", + "mdast-util-from-markdown": "^1.0.0", + "prettier": "^2.0.0", + "remark-cli": "^11.0.0", + "remark-preset-wooorm": "^9.0.0", + "tsd": "^0.28.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "unist-builder": "^3.0.0", + "xo": "^0.54.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && tsd && type-coverage", + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "prettier": true + } +} diff --git a/tools/ui/node_modules/unist-util-remove-position/readme.md b/tools/ui/node_modules/unist-util-remove-position/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..5b2de36cd76559b30cf90e717389e24a04fd4806 --- /dev/null +++ b/tools/ui/node_modules/unist-util-remove-position/readme.md @@ -0,0 +1,227 @@ +# unist-util-remove-position + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[unist][] utility to remove positional info from a tree. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`removePosition(node[, options])`](#removepositionnode-options) + * [`Options`](#options) +* [Types](#types) +* [Compatibility](#compatibility) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This is a small utility that helps you remove the `position` field from nodes in +a unist tree. + +## When should I use this? + +Often, positional info is the whole reason, or an important reason, for using +ASTs. +Sometimes, especially when comparing trees, or when inserting one tree into +another, the positional info is at best useless and at worst harmful. +In those cases, you can use this utility to remove `position` fields from a +tree. + +You might find the utility [`unist-util-position`][unist-util-position] +useful to instead get clean position info from a tree, or +[`unist-util-generated`][unist-util-generated] useful to check whether a node is +considered to be generated (not in the original input file). + +You might also enjoy +[`unist-util-stringify-position`][unist-util-stringify-position] when you want +to display positional info to users. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install unist-util-remove-position +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {removePosition} from 'https://esm.sh/unist-util-remove-position@5' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {fromMarkdown} from 'mdast-util-from-markdown' +import {removePosition} from 'unist-util-remove-position' + +const tree = fromMarkdown('Some _emphasis_, **importance**, and `code`.') + +removePosition(tree, {force: true}) + +console.dir(tree, {depth: null}) +``` + +Yields: + +```js +{ + type: 'root', + children: [ + { + type: 'paragraph', + children: [ + {type: 'text', value: 'Some '}, + {type: 'emphasis', children: [{type: 'text', value: 'emphasis'}]}, + {type: 'text', value: ', '}, + {type: 'strong', children: [{type: 'text', value: 'importance'}]}, + {type: 'text', value: ', and '}, + {type: 'inlineCode', value: 'code'}, + {type: 'text', value: '.'} + ] + } + ] +} +``` + +## API + +This package exports the identifier [`removePosition`][removeposition]. +There is no default export. + +### `removePosition(node[, options])` + +Remove the `position` field from a tree. + +###### Parameters + +* `node` ([`Node`][node]) + — tree to clean +* `options` ([`Options`][options], optional) + — configuration + +###### Returns + +Nothing (`undefined`). + +### `Options` + +Configuration (TypeScript type). + +###### Fields + +* `force` (`boolean`, default: `false`) + — whether to use `delete` to remove `position` fields, the default is to + set them to `undefined` + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional type [`Options`][options]. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, +`unist-util-remove-position@^5`, compatible with Node.js 16. + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/unist-util-remove-position/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/unist-util-remove-position/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-remove-position.svg + +[coverage]: https://codecov.io/github/syntax-tree/unist-util-remove-position + +[downloads-badge]: https://img.shields.io/npm/dm/unist-util-remove-position.svg + +[downloads]: https://www.npmjs.com/package/unist-util-remove-position + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=unist-util-remove-position + +[size]: https://bundlejs.com/?q=unist-util-remove-position + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[license]: license + +[author]: https://wooorm.com + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[unist]: https://github.com/syntax-tree/unist + +[node]: https://github.com/syntax-tree/unist#node + +[unist-util-position]: https://github.com/syntax-tree/unist-util-position + +[unist-util-generated]: https://github.com/syntax-tree/unist-util-generated + +[unist-util-stringify-position]: https://github.com/syntax-tree/unist-util-stringify-position + +[removeposition]: #removepositionnode-options + +[options]: #options diff --git a/tools/ui/node_modules/unist-util-stringify-position/index.d.ts b/tools/ui/node_modules/unist-util-stringify-position/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..93163eae4ffa742e0fb6cc10caf30c050f9e489b --- /dev/null +++ b/tools/ui/node_modules/unist-util-stringify-position/index.d.ts @@ -0,0 +1 @@ +export {stringifyPosition} from './lib/index.js' diff --git a/tools/ui/node_modules/unist-util-stringify-position/index.js b/tools/ui/node_modules/unist-util-stringify-position/index.js new file mode 100644 index 0000000000000000000000000000000000000000..93163eae4ffa742e0fb6cc10caf30c050f9e489b --- /dev/null +++ b/tools/ui/node_modules/unist-util-stringify-position/index.js @@ -0,0 +1 @@ +export {stringifyPosition} from './lib/index.js' diff --git a/tools/ui/node_modules/unist-util-stringify-position/lib/index.d.ts b/tools/ui/node_modules/unist-util-stringify-position/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..40320afe656fe3ab36246b8f08bc30fe78327e07 --- /dev/null +++ b/tools/ui/node_modules/unist-util-stringify-position/lib/index.d.ts @@ -0,0 +1,61 @@ +/** + * @typedef {import('unist').Node} Node + * @typedef {import('unist').Point} Point + * @typedef {import('unist').Position} Position + */ +/** + * @typedef NodeLike + * @property {string} type + * @property {PositionLike | null | undefined} [position] + * + * @typedef PointLike + * @property {number | null | undefined} [line] + * @property {number | null | undefined} [column] + * @property {number | null | undefined} [offset] + * + * @typedef PositionLike + * @property {PointLike | null | undefined} [start] + * @property {PointLike | null | undefined} [end] + */ +/** + * Serialize the positional info of a point, position (start and end points), + * or node. + * + * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value] + * Node, position, or point. + * @returns {string} + * Pretty printed positional info of a node (`string`). + * + * In the format of a range `ls:cs-le:ce` (when given `node` or `position`) + * or a point `l:c` (when given `point`), where `l` stands for line, `c` for + * column, `s` for `start`, and `e` for end. + * An empty string (`''`) is returned if the given value is neither `node`, + * `position`, nor `point`. + */ +export function stringifyPosition( + value?: + | Node + | NodeLike + | Point + | PointLike + | Position + | PositionLike + | null + | undefined +): string +export type Node = import('unist').Node +export type Point = import('unist').Point +export type Position = import('unist').Position +export type NodeLike = { + type: string + position?: PositionLike | null | undefined +} +export type PointLike = { + line?: number | null | undefined + column?: number | null | undefined + offset?: number | null | undefined +} +export type PositionLike = { + start?: PointLike | null | undefined + end?: PointLike | null | undefined +} diff --git a/tools/ui/node_modules/unist-util-stringify-position/lib/index.js b/tools/ui/node_modules/unist-util-stringify-position/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..109b64605a61dfb649de4c7c3bd9b9a2cc17bfa9 --- /dev/null +++ b/tools/ui/node_modules/unist-util-stringify-position/lib/index.js @@ -0,0 +1,84 @@ +/** + * @typedef {import('unist').Node} Node + * @typedef {import('unist').Point} Point + * @typedef {import('unist').Position} Position + */ + +/** + * @typedef NodeLike + * @property {string} type + * @property {PositionLike | null | undefined} [position] + * + * @typedef PointLike + * @property {number | null | undefined} [line] + * @property {number | null | undefined} [column] + * @property {number | null | undefined} [offset] + * + * @typedef PositionLike + * @property {PointLike | null | undefined} [start] + * @property {PointLike | null | undefined} [end] + */ + +/** + * Serialize the positional info of a point, position (start and end points), + * or node. + * + * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value] + * Node, position, or point. + * @returns {string} + * Pretty printed positional info of a node (`string`). + * + * In the format of a range `ls:cs-le:ce` (when given `node` or `position`) + * or a point `l:c` (when given `point`), where `l` stands for line, `c` for + * column, `s` for `start`, and `e` for end. + * An empty string (`''`) is returned if the given value is neither `node`, + * `position`, nor `point`. + */ +export function stringifyPosition(value) { + // Nothing. + if (!value || typeof value !== 'object') { + return '' + } + + // Node. + if ('position' in value || 'type' in value) { + return position(value.position) + } + + // Position. + if ('start' in value || 'end' in value) { + return position(value) + } + + // Point. + if ('line' in value || 'column' in value) { + return point(value) + } + + // ? + return '' +} + +/** + * @param {Point | PointLike | null | undefined} point + * @returns {string} + */ +function point(point) { + return index(point && point.line) + ':' + index(point && point.column) +} + +/** + * @param {Position | PositionLike | null | undefined} pos + * @returns {string} + */ +function position(pos) { + return point(pos && pos.start) + '-' + point(pos && pos.end) +} + +/** + * @param {number | null | undefined} value + * @returns {number} + */ +function index(value) { + return value && typeof value === 'number' ? value : 1 +} diff --git a/tools/ui/node_modules/unist-util-stringify-position/license b/tools/ui/node_modules/unist-util-stringify-position/license new file mode 100644 index 0000000000000000000000000000000000000000..8d8660d36ef2eced1f9cce91e17ae0290261734c --- /dev/null +++ b/tools/ui/node_modules/unist-util-stringify-position/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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/unist-util-stringify-position/node_modules/@types/unist/LICENSE b/tools/ui/node_modules/unist-util-stringify-position/node_modules/@types/unist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/tools/ui/node_modules/unist-util-stringify-position/node_modules/@types/unist/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + 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/unist-util-stringify-position/node_modules/@types/unist/README.md b/tools/ui/node_modules/unist-util-stringify-position/node_modules/@types/unist/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b84e51bfb836f999b47b6d8e233b64cb372e48df --- /dev/null +++ b/tools/ui/node_modules/unist-util-stringify-position/node_modules/@types/unist/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/unist` + +# Summary +This package contains type definitions for unist (https://github.com/syntax-tree/unist). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist. + +### Additional Details + * Last updated: Thu, 15 Aug 2024 02:18:53 GMT + * Dependencies: none + +# Credits +These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), [JounQin](https://github.com/JounQin), and [Remco Haszing](https://github.com/remcohaszing). diff --git a/tools/ui/node_modules/unist-util-stringify-position/node_modules/@types/unist/index.d.ts b/tools/ui/node_modules/unist-util-stringify-position/node_modules/@types/unist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..513ddee5e9e2acb1e5c88c26da384212e52ed90b --- /dev/null +++ b/tools/ui/node_modules/unist-util-stringify-position/node_modules/@types/unist/index.d.ts @@ -0,0 +1,119 @@ +// ## Interfaces + +/** + * Info associated with nodes by the ecosystem. + * + * This space is guaranteed to never be specified by unist or specifications + * implementing unist. + * But you can use it in utilities and plugins to store data. + * + * This type can be augmented to register custom data. + * For example: + * + * ```ts + * declare module 'unist' { + * interface Data { + * // `someNode.data.myId` is typed as `number | undefined` + * myId?: number | undefined + * } + * } + * ``` + */ +export interface Data {} + +/** + * One place in a source file. + */ +export interface Point { + /** + * Line in a source file (1-indexed integer). + */ + line: number; + + /** + * Column in a source file (1-indexed integer). + */ + column: number; + /** + * Character in a source file (0-indexed integer). + */ + offset?: number | undefined; +} + +/** + * Position of a node in a source document. + * + * A position is a range between two points. + */ +export interface Position { + /** + * Place of the first character of the parsed source region. + */ + start: Point; + + /** + * Place of the first character after the parsed source region. + */ + end: Point; +} + +// ## Abstract nodes + +/** + * Abstract unist node that contains the smallest possible value. + * + * This interface is supposed to be extended. + * + * For example, in HTML, a `text` node is a leaf that contains text. + */ +export interface Literal extends Node { + /** + * Plain value. + */ + value: unknown; +} + +/** + * Abstract unist node. + * + * The syntactic unit in unist syntax trees are called nodes. + * + * This interface is supposed to be extended. + * If you can use {@link Literal} or {@link Parent}, you should. + * But for example in markdown, a `thematicBreak` (`***`), is neither literal + * nor parent, but still a node. + */ +export interface Node { + /** + * Node type. + */ + type: string; + + /** + * Info from the ecosystem. + */ + data?: Data | undefined; + + /** + * Position of a node in a source document. + * + * Nodes that are generated (not in the original source document) must not + * have a position. + */ + position?: Position | undefined; +} + +/** + * Abstract unist node that contains other nodes (*children*). + * + * This interface is supposed to be extended. + * + * For example, in XML, an element is a parent of different things, such as + * comments, text, and further elements. + */ +export interface Parent extends Node { + /** + * List of children. + */ + children: Node[]; +} diff --git a/tools/ui/node_modules/unist-util-stringify-position/node_modules/@types/unist/package.json b/tools/ui/node_modules/unist-util-stringify-position/node_modules/@types/unist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d2092dba8f2208817af3e1811569d90b6358ad8f --- /dev/null +++ b/tools/ui/node_modules/unist-util-stringify-position/node_modules/@types/unist/package.json @@ -0,0 +1,60 @@ +{ + "name": "@types/unist", + "version": "3.0.3", + "description": "TypeScript definitions for unist", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist", + "license": "MIT", + "contributors": [ + { + "name": "bizen241", + "githubUsername": "bizen241", + "url": "https://github.com/bizen241" + }, + { + "name": "Jun Lu", + "githubUsername": "lujun2", + "url": "https://github.com/lujun2" + }, + { + "name": "Hernan Rajchert", + "githubUsername": "hrajchert", + "url": "https://github.com/hrajchert" + }, + { + "name": "Titus Wormer", + "githubUsername": "wooorm", + "url": "https://github.com/wooorm" + }, + { + "name": "Junyoung Choi", + "githubUsername": "rokt33r", + "url": "https://github.com/rokt33r" + }, + { + "name": "Ben Moon", + "githubUsername": "GuiltyDolphin", + "url": "https://github.com/GuiltyDolphin" + }, + { + "name": "JounQin", + "githubUsername": "JounQin", + "url": "https://github.com/JounQin" + }, + { + "name": "Remco Haszing", + "githubUsername": "remcohaszing", + "url": "https://github.com/remcohaszing" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/unist" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "7f3d5ce8d56003f3583a5317f98d444bdc99910c7b486c6b10af4f38694e61fe", + "typeScriptVersion": "4.8" +} \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-stringify-position/package.json b/tools/ui/node_modules/unist-util-stringify-position/package.json new file mode 100644 index 0000000000000000000000000000000000000000..334550f927d513f8167c5dec06876ccea2ae692d --- /dev/null +++ b/tools/ui/node_modules/unist-util-stringify-position/package.json @@ -0,0 +1,80 @@ +{ + "name": "unist-util-stringify-position", + "version": "4.0.0", + "description": "unist utility to serialize a node, position, or point as a human readable location", + "license": "MIT", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "position", + "location", + "point", + "node", + "stringify", + "tostring" + ], + "repository": "syntax-tree/unist-util-stringify-position", + "bugs": "https://github.com/syntax-tree/unist-util-stringify-position/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/unist": "^3.0.0" + }, + "devDependencies": { + "@types/mdast": "^4.0.0", + "@types/node": "^20.0.0", + "c8": "^8.0.0", + "prettier": "^2.0.0", + "remark-cli": "^11.0.0", + "remark-preset-wooorm": "^9.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.54.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "prettier": true + } +} diff --git a/tools/ui/node_modules/unist-util-stringify-position/readme.md b/tools/ui/node_modules/unist-util-stringify-position/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..af692c81fd74c2921a8f280469ea8567ac4277f6 --- /dev/null +++ b/tools/ui/node_modules/unist-util-stringify-position/readme.md @@ -0,0 +1,206 @@ +# unist-util-stringify-position + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[unist][] utility to pretty print the positional info of a node. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`stringifyPosition(node|position|point)`](#stringifypositionnodepositionpoint) +* [Types](#types) +* [Compatibility](#compatibility) +* [Security](#security) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package is a utility that takes any [unist][] (whether mdast, hast, etc) +node, position, or point, and serializes its positional info. + +## When should I use this? + +This utility is useful to display where something occurred in the original +document, in one standard way, for humans. +For example, when throwing errors or warning messages about something. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install unist-util-stringify-position +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {stringifyPosition} from 'https://esm.sh/unist-util-stringify-position@4' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {stringifyPosition} from 'unist-util-stringify-position' + +stringifyPosition({line: 2, column: 3}) // => '2:3' (point) +stringifyPosition({start: {line: 2}, end: {line: 3}}) // => '2:1-3:1' (position) +stringifyPosition({ + type: 'text', + value: '!', + position: { + start: {line: 5, column: 11}, + end: {line: 5, column: 12} + } +}) // => '5:11-5:12' (node) +``` + +## API + +This package exports the identifier [`stringifyPosition`][stringifyposition]. +There is no default export. + +### `stringifyPosition(node|position|point)` + +Serialize the positional info of a point, position (start and end points), or +node. + +###### Parameters + +* `node` ([`Node`][node]) + — node whose `position` fields to serialize +* `position` ([`Position`][position]) + — position whose `start` and `end` points to serialize +* `point` ([`Point`][point]) + — point whose `line` and `column` fields to serialize + +###### Returns + +Pretty printed positional info of a node (`string`). + +In the format of a range `ls:cs-le:ce` (when given `node` or `position`) or a +point `l:c` (when given `point`), where `l` stands for line, `c` for column, `s` +for `start`, and `e` for end. +An empty string (`''`) is returned if the given value is neither `node`, +`position`, nor `point`. + +## Types + +This package is fully typed with [TypeScript][]. +It exports no additional types. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, +`unist-util-stringify-position@^4`, compatible with Node.js 16. + +## Security + +This project is safe. + +## Related + +* [`unist-util-generated`](https://github.com/syntax-tree/unist-util-generated) + — check if a node is generated +* [`unist-util-position`](https://github.com/syntax-tree/unist-util-position) + — get positional info of nodes +* [`unist-util-remove-position`](https://github.com/syntax-tree/unist-util-remove-position) + — remove positional info from trees +* [`unist-util-source`](https://github.com/syntax-tree/unist-util-source) + — get the source of a value (node or position) in a file + +## Contribute + +See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get +started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/unist-util-stringify-position/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/unist-util-stringify-position/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-stringify-position.svg + +[coverage]: https://codecov.io/github/syntax-tree/unist-util-stringify-position + +[downloads-badge]: https://img.shields.io/npm/dm/unist-util-stringify-position.svg + +[downloads]: https://www.npmjs.com/package/unist-util-stringify-position + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=unist-util-stringify-position + +[size]: https://bundlejs.com/?q=unist-util-stringify-position + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[unist]: https://github.com/syntax-tree/unist + +[node]: https://github.com/syntax-tree/unist#node + +[position]: https://github.com/syntax-tree/unist#position + +[point]: https://github.com/syntax-tree/unist#point + +[stringifyposition]: #stringifypositionnodepositionpoint diff --git a/tools/ui/node_modules/unist-util-visit-parents/index.d.ts b/tools/ui/node_modules/unist-util-visit-parents/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..abd196cd9b213a874949b407690b984403889b06 --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/index.d.ts @@ -0,0 +1,14 @@ +export type {Test} from 'unist-util-is' +export type { + Action, + ActionTuple, + BuildVisitor, + // Undocumented: used in `unist-util-visit`: + InclusiveDescendant, + Index, + // Undocumented: used in `unist-util-visit`: + Matches, + Visitor, + VisitorResult +} from './lib/index.js' +export {CONTINUE, EXIT, SKIP, visitParents} from './lib/index.js' diff --git a/tools/ui/node_modules/unist-util-visit-parents/index.js b/tools/ui/node_modules/unist-util-visit-parents/index.js new file mode 100644 index 0000000000000000000000000000000000000000..995e97b661b869d7386e104affba16378372a428 --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/index.js @@ -0,0 +1,2 @@ +// Note: types exported from `index.d.ts` +export {CONTINUE, EXIT, SKIP, visitParents} from './lib/index.js' diff --git a/tools/ui/node_modules/unist-util-visit-parents/lib/color.d.ts b/tools/ui/node_modules/unist-util-visit-parents/lib/color.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d2d9917092d958a3a21708d94ec411e2671da03b --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/lib/color.d.ts @@ -0,0 +1,6 @@ +/** + * @param {string} d + * @returns {string} + */ +export function color(d: string): string; +//# sourceMappingURL=color.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-visit-parents/lib/color.d.ts.map b/tools/ui/node_modules/unist-util-visit-parents/lib/color.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..51943a6e54c118ab758632844818f5d2b282c284 --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/lib/color.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["color.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,yBAHW,MAAM,GACJ,MAAM,CAIlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-visit-parents/lib/color.js b/tools/ui/node_modules/unist-util-visit-parents/lib/color.js new file mode 100644 index 0000000000000000000000000000000000000000..1685a155d17e26c88798f3af6a98609aead70dcb --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/lib/color.js @@ -0,0 +1,7 @@ +/** + * @param {string} d + * @returns {string} + */ +export function color(d) { + return d +} diff --git a/tools/ui/node_modules/unist-util-visit-parents/lib/color.node.d.ts b/tools/ui/node_modules/unist-util-visit-parents/lib/color.node.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e450f08196dbf27f41e6249a68b59690ab1b1d7d --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/lib/color.node.d.ts @@ -0,0 +1,6 @@ +/** + * @param {string} d + * @returns {string} + */ +export function color(d: string): string; +//# sourceMappingURL=color.node.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-visit-parents/lib/color.node.d.ts.map b/tools/ui/node_modules/unist-util-visit-parents/lib/color.node.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..2ee80568d81b17f5d3e80ccd0493ba72fc7dabd9 --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/lib/color.node.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"color.node.d.ts","sourceRoot":"","sources":["color.node.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,yBAHW,MAAM,GACJ,MAAM,CAIlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-visit-parents/lib/color.node.js b/tools/ui/node_modules/unist-util-visit-parents/lib/color.node.js new file mode 100644 index 0000000000000000000000000000000000000000..3634ae9484c9f1beb7ee25d0b8b6cdf6b8aa420c --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/lib/color.node.js @@ -0,0 +1,7 @@ +/** + * @param {string} d + * @returns {string} + */ +export function color(d) { + return '\u001B[33m' + d + '\u001B[39m' +} diff --git a/tools/ui/node_modules/unist-util-visit-parents/lib/index.d.ts b/tools/ui/node_modules/unist-util-visit-parents/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..1c16685206ef9d5fbc32e4e043ae5b170635e24f --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/lib/index.d.ts @@ -0,0 +1,219 @@ +/** + * Visit nodes, with ancestral information. + * + * This algorithm performs *depth-first* *tree traversal* in *preorder* + * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**). + * + * You can choose for which nodes `visitor` is called by passing a `test`. + * For complex tests, you should test yourself in `visitor`, as it will be + * faster and will have improved type information. + * + * Walking the tree is an intensive task. + * Make use of the return values of the visitor when possible. + * Instead of walking a tree multiple times, walk it once, use `unist-util-is` + * to check if a node matches, and then perform different operations. + * + * You can change the tree. + * See `Visitor` for more info. + * + * @overload + * @param {Tree} tree + * @param {Check} check + * @param {BuildVisitor} visitor + * @param {boolean | null | undefined} [reverse] + * @returns {undefined} + * + * @overload + * @param {Tree} tree + * @param {BuildVisitor} visitor + * @param {boolean | null | undefined} [reverse] + * @returns {undefined} + * + * @param {UnistNode} tree + * Tree to traverse. + * @param {Visitor | Test} test + * `unist-util-is`-compatible test + * @param {Visitor | boolean | null | undefined} [visitor] + * Handle each node. + * @param {boolean | null | undefined} [reverse] + * Traverse in reverse preorder (NRL) instead of the default preorder (NLR). + * @returns {undefined} + * Nothing. + * + * @template {UnistNode} Tree + * Node type. + * @template {Test} Check + * `unist-util-is`-compatible test. + */ +export function visitParents(tree: Tree, check: Check, visitor: BuildVisitor, reverse?: boolean | null | undefined): undefined; +/** + * Visit nodes, with ancestral information. + * + * This algorithm performs *depth-first* *tree traversal* in *preorder* + * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**). + * + * You can choose for which nodes `visitor` is called by passing a `test`. + * For complex tests, you should test yourself in `visitor`, as it will be + * faster and will have improved type information. + * + * Walking the tree is an intensive task. + * Make use of the return values of the visitor when possible. + * Instead of walking a tree multiple times, walk it once, use `unist-util-is` + * to check if a node matches, and then perform different operations. + * + * You can change the tree. + * See `Visitor` for more info. + * + * @overload + * @param {Tree} tree + * @param {Check} check + * @param {BuildVisitor} visitor + * @param {boolean | null | undefined} [reverse] + * @returns {undefined} + * + * @overload + * @param {Tree} tree + * @param {BuildVisitor} visitor + * @param {boolean | null | undefined} [reverse] + * @returns {undefined} + * + * @param {UnistNode} tree + * Tree to traverse. + * @param {Visitor | Test} test + * `unist-util-is`-compatible test + * @param {Visitor | boolean | null | undefined} [visitor] + * Handle each node. + * @param {boolean | null | undefined} [reverse] + * Traverse in reverse preorder (NRL) instead of the default preorder (NLR). + * @returns {undefined} + * Nothing. + * + * @template {UnistNode} Tree + * Node type. + * @template {Test} Check + * `unist-util-is`-compatible test. + */ +export function visitParents(tree: Tree, visitor: BuildVisitor, reverse?: boolean | null | undefined): undefined; +/** + * Continue traversing as normal. + */ +export const CONTINUE: true; +/** + * Stop traversing immediately. + */ +export const EXIT: false; +/** + * Do not traverse this node’s children. + */ +export const SKIP: "skip"; +/** + * Test from `unist-util-is`. + * + * Note: we have remove and add `undefined`, because otherwise when generating + * automatic `.d.ts` files, TS tries to flatten paths from a local perspective, + * which doesn’t work when publishing on npm. + */ +export type Test = Exclude | undefined; +/** + * Get the value of a type guard `Fn`. + */ +export type Predicate = (Fn extends (value: any) => value is infer Thing ? Thing : Fallback); +/** + * Check whether a node matches a primitive check in the type system. + */ +export type MatchesOne = (Check extends null | undefined ? Value : Value extends { + type: Check; +} ? Value : Value extends Check ? Value : Check extends Function ? Predicate extends Value ? Predicate : never : never); +/** + * Check whether a node matches a check in the type system. + */ +export type Matches = (Check extends ReadonlyArray ? MatchesOne : Check extends Array ? MatchesOne : MatchesOne); +/** + * Number; capped reasonably. + */ +export type Uint = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; +/** + * Increment a number in the type system. + */ +export type Increment = I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10; +/** + * Collect nodes that can be parents of `Child`. + */ +export type InternalParent = (Node extends UnistParent ? Node extends { + children: Array; +} ? Child extends Children ? Node : never : never : never); +/** + * Collect nodes in `Tree` that can be parents of `Child`. + */ +export type Parent = InternalParent, Child>; +/** + * Collect nodes in `Tree` that can be ancestors of `Child`. + */ +export type InternalAncestor = (Depth extends Max ? never : InternalParent | InternalAncestor, Max, Increment>); +/** + * Collect nodes in `Tree` that can be ancestors of `Child`. + */ +export type Ancestor = InternalAncestor, Child>; +/** + * Collect all (inclusive) descendants of `Tree`. + * + * > 👉 **Note**: for performance reasons, this seems to be the fastest way to + * > recurse without actually running into an infinite loop, which the + * > previous version did. + * > + * > Practically, a max of `2` is typically enough assuming a `Root` is + * > passed, but it doesn’t improve performance. + * > It gets higher with `List > ListItem > Table > TableRow > TableCell`. + * > Using up to `10` doesn’t hurt or help either. + */ +export type InclusiveDescendant = (Tree extends UnistParent ? Depth extends Max ? Tree : Tree | InclusiveDescendant> : Tree); +/** + * Union of the action types. + */ +export type Action = "skip" | boolean; +/** + * Move to the sibling at `index` next (after node itself is completely + * traversed). + * + * Useful if mutating the tree, such as removing the node the visitor is + * currently on, or any of its previous siblings. + * Results less than 0 or greater than or equal to `children.length` stop + * traversing the parent. + */ +export type Index = number; +/** + * List with one or two values, the first an action, the second an index. + */ +export type ActionTuple = [(Action | null | undefined | void)?, (Index | null | undefined)?]; +/** + * Any value that can be returned from a visitor. + */ +export type VisitorResult = Action | ActionTuple | Index | null | undefined | void; +/** + * Handle a node (matching `test`, if given). + * + * Visitors are free to transform `node`. + * They can also transform the parent of node (the last of `ancestors`). + * + * Replacing `node` itself, if `SKIP` is not returned, still causes its + * descendants to be walked (which is a bug). + * + * When adding or removing previous siblings of `node` (or next siblings, in + * case of reverse), the `Visitor` should return a new `Index` to specify the + * sibling to traverse after `node` is traversed. + * Adding or removing next siblings of `node` (or previous siblings, in case + * of reverse) is handled as expected without needing to return a new `Index`. + * + * Removing the children property of an ancestor still results in them being + * traversed. + */ +export type Visitor = (node: Visited, ancestors: Array) => VisitorResult; +/** + * Build a typed `Visitor` function from a tree and a test. + * + * It will infer which values are passed as `node` and which as `parents`. + */ +export type BuildVisitor = Visitor, Check>, Ancestor, Check>>>; +import type { Node as UnistNode } from 'unist'; +import type { Parent as UnistParent } from 'unist'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-visit-parents/lib/index.d.ts.map b/tools/ui/node_modules/unist-util-visit-parents/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..1bcdba8845ef12737cf15b62d1c223bd928e8b2e --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmQG,6BAwBsB,IAAI,SAAhB,SAAW,EAEJ,KAAK,SAAX,IAAK,QAzBR,IAAI,SACJ,KAAK,WACL,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,YACzB,OAAO,GAAG,IAAI,GAAG,SAAS,GACxB,SAAS,CAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAiBsB,IAAI,SAAhB,SAAW,EAEJ,KAAK,SAAX,IAAK,QAlBR,IAAI,WACJ,YAAY,CAAC,IAAI,CAAC,YAClB,OAAO,GAAG,IAAI,GAAG,SAAS,GACxB,SAAS,CAEnB;AA9CH;;GAEG;AACH,uBAAwB,IAAI,CAAA;AAE5B;;GAEG;AACH,mBAAoB,KAAK,CAAA;AAEzB;;GAEG;AACH,mBAAoB,MAAM,CAAA;;;;;;;;mBA1Ob,OAAO,CAAC,OAAO,eAAe,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,SAAS;;;;sBAe5D,EAAE,EAEF,QAAQ,IARR,CACR,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,MAAM,KAAK,GAC7C,KAAK,GACL,QAAQ,CACX;;;;uBAuBS,KAAK,EAEL,KAAK,IAhBL,CACR,KAAK,SAAS,IAAI,GAAG,SAAS,GAC5B,KAAK,GACL,KAAK,SAAS;IAAC,IAAI,EAAE,KAAK,CAAA;CAAC,GAC3B,KAAK,GACL,KAAK,SAAS,KAAK,GACnB,KAAK,GACL,KAAK,oBACL,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,KAAK,GACnC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,GACvB,KAAK,GACP,KAAK,CACR;;;;oBAiBS,KAAK,EAEL,KAAK,IAVL,CACR,KAAK,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAClC,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,GACpB,KAAK,SAAS,KAAK,CAAC,MAAM,CAAC,CAAC,GAC5B,UAAU,CAAC,KAAK,EAAE,CAAC,CAAC,GACpB,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAC3B;;;;mBASS,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE;;;;sBAOlC,CAAC,SAAR,IAAK,QAFN,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE;;;;2BAexJ,IAAI,SAAhB,SAAW,EAEC,KAAK,SAAjB,SAAW,IAVX,CACR,IAAI,SAAS,WAAW,GACtB,IAAI,SAAS;IAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAA;CAAC,GAC5C,KAAK,SAAS,QAAQ,GAAG,IAAI,GAAG,KAAK,GACrC,KAAK,GACP,KAAK,CACR;;;;mBAWqB,IAAI,SAAhB,SAAW,EAEC,KAAK,SAAjB,SAAW,IAJX,cAAc,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;;;;6BAiBpC,IAAI,SAAhB,SAAW,EAEC,KAAK,SAAjB,SAAW,EAEH,GAAG,SAAV,IAAK,OAEE,KAAK,SAAZ,IAAK,QAdN,CACR,KAAK,SAAS,GAAG,GACf,KAAK,GAEH,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,GAC3B,gBAAgB,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAC/E;;;;qBAeqB,IAAI,SAAhB,SAAW,EAEC,KAAK,SAAjB,SAAW,IAJX,gBAAgB,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;;;;;;;;;;;;;gCA0BtC,IAAI,SAAhB,SAAW,EAEH,GAAG,SAAV,IAAK,OAEE,KAAK,SAAZ,IAAK,QArBN,CACR,IAAI,SAAS,WAAW,GACpB,KAAK,SAAS,GAAG,GACf,IAAI,GACJ,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,GAC7E,IAAI,CACT;;;;qBAoBS,MAAM,GAAG,OAAO;;;;;;;;;;oBAGhB,MAAM;;;;0BASN,CAAC,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,CAAC;;;;4BAGlE,MAAM,GAAG,WAAW,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;;;;;;;;;;;;;;;;;;;oBAmCzC,OAAO,SAApB,SAAW,cAEI,cAAc,SAA7B,WAAa,yBAff,OAAO,aAEP,KAAK,CAAC,cAAc,CAAC,KAEnB,aAAa;;;;;;yBAoBA,IAAI,SAAjB,SAAW,cAEH,KAAK,SAAZ,IAAK,WANN,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;uCAjN/D,OAAO;2CAAP,OAAO"} \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-visit-parents/lib/index.js b/tools/ui/node_modules/unist-util-visit-parents/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..713595d4bd8c45f10f87c428c84c49c312b9c9b3 --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/lib/index.js @@ -0,0 +1,399 @@ +/** + * @import {Node as UnistNode, Parent as UnistParent} from 'unist' + */ + +/** + * @typedef {Exclude | undefined} Test + * Test from `unist-util-is`. + * + * Note: we have remove and add `undefined`, because otherwise when generating + * automatic `.d.ts` files, TS tries to flatten paths from a local perspective, + * which doesn’t work when publishing on npm. + */ + +/** + * @typedef {( + * Fn extends (value: any) => value is infer Thing + * ? Thing + * : Fallback + * )} Predicate + * Get the value of a type guard `Fn`. + * @template Fn + * Value; typically function that is a type guard (such as `(x): x is Y`). + * @template Fallback + * Value to yield if `Fn` is not a type guard. + */ + +/** + * @typedef {( + * Check extends null | undefined // No test. + * ? Value + * : Value extends {type: Check} // String (type) test. + * ? Value + * : Value extends Check // Partial test. + * ? Value + * : Check extends Function // Function test. + * ? Predicate extends Value + * ? Predicate + * : never + * : never // Some other test? + * )} MatchesOne + * Check whether a node matches a primitive check in the type system. + * @template Value + * Value; typically unist `Node`. + * @template Check + * Value; typically `unist-util-is`-compatible test, but not arrays. + */ + +/** + * @typedef {( + * Check extends ReadonlyArray + * ? MatchesOne + * : Check extends Array + * ? MatchesOne + * : MatchesOne + * )} Matches + * Check whether a node matches a check in the type system. + * @template Value + * Value; typically unist `Node`. + * @template Check + * Value; typically `unist-util-is`-compatible test. + */ + +/** + * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint + * Number; capped reasonably. + */ + +/** + * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment + * Increment a number in the type system. + * @template {Uint} [I=0] + * Index. + */ + +/** + * @typedef {( + * Node extends UnistParent + * ? Node extends {children: Array} + * ? Child extends Children ? Node : never + * : never + * : never + * )} InternalParent + * Collect nodes that can be parents of `Child`. + * @template {UnistNode} Node + * All node types in a tree. + * @template {UnistNode} Child + * Node to search for. + */ + +/** + * @typedef {InternalParent, Child>} Parent + * Collect nodes in `Tree` that can be parents of `Child`. + * @template {UnistNode} Tree + * All node types in a tree. + * @template {UnistNode} Child + * Node to search for. + */ + +/** + * @typedef {( + * Depth extends Max + * ? never + * : + * | InternalParent + * | InternalAncestor, Max, Increment> + * )} InternalAncestor + * Collect nodes in `Tree` that can be ancestors of `Child`. + * @template {UnistNode} Node + * All node types in a tree. + * @template {UnistNode} Child + * Node to search for. + * @template {Uint} [Max=10] + * Max; searches up to this depth. + * @template {Uint} [Depth=0] + * Current depth. + */ + +/** + * @typedef {InternalAncestor, Child>} Ancestor + * Collect nodes in `Tree` that can be ancestors of `Child`. + * @template {UnistNode} Tree + * All node types in a tree. + * @template {UnistNode} Child + * Node to search for. + */ + +/** + * @typedef {( + * Tree extends UnistParent + * ? Depth extends Max + * ? Tree + * : Tree | InclusiveDescendant> + * : Tree + * )} InclusiveDescendant + * Collect all (inclusive) descendants of `Tree`. + * + * > 👉 **Note**: for performance reasons, this seems to be the fastest way to + * > recurse without actually running into an infinite loop, which the + * > previous version did. + * > + * > Practically, a max of `2` is typically enough assuming a `Root` is + * > passed, but it doesn’t improve performance. + * > It gets higher with `List > ListItem > Table > TableRow > TableCell`. + * > Using up to `10` doesn’t hurt or help either. + * @template {UnistNode} Tree + * Tree type. + * @template {Uint} [Max=10] + * Max; searches up to this depth. + * @template {Uint} [Depth=0] + * Current depth. + */ + +/** + * @typedef {'skip' | boolean} Action + * Union of the action types. + * + * @typedef {number} Index + * Move to the sibling at `index` next (after node itself is completely + * traversed). + * + * Useful if mutating the tree, such as removing the node the visitor is + * currently on, or any of its previous siblings. + * Results less than 0 or greater than or equal to `children.length` stop + * traversing the parent. + * + * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple + * List with one or two values, the first an action, the second an index. + * + * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult + * Any value that can be returned from a visitor. + */ + +/** + * @callback Visitor + * Handle a node (matching `test`, if given). + * + * Visitors are free to transform `node`. + * They can also transform the parent of node (the last of `ancestors`). + * + * Replacing `node` itself, if `SKIP` is not returned, still causes its + * descendants to be walked (which is a bug). + * + * When adding or removing previous siblings of `node` (or next siblings, in + * case of reverse), the `Visitor` should return a new `Index` to specify the + * sibling to traverse after `node` is traversed. + * Adding or removing next siblings of `node` (or previous siblings, in case + * of reverse) is handled as expected without needing to return a new `Index`. + * + * Removing the children property of an ancestor still results in them being + * traversed. + * @param {Visited} node + * Found node. + * @param {Array} ancestors + * Ancestors of `node`. + * @returns {VisitorResult} + * What to do next. + * + * An `Index` is treated as a tuple of `[CONTINUE, Index]`. + * An `Action` is treated as a tuple of `[Action]`. + * + * Passing a tuple back only makes sense if the `Action` is `SKIP`. + * When the `Action` is `EXIT`, that action can be returned. + * When the `Action` is `CONTINUE`, `Index` can be returned. + * @template {UnistNode} [Visited=UnistNode] + * Visited node type. + * @template {UnistParent} [VisitedParents=UnistParent] + * Ancestor type. + */ + +/** + * @typedef {Visitor, Check>, Ancestor, Check>>>} BuildVisitor + * Build a typed `Visitor` function from a tree and a test. + * + * It will infer which values are passed as `node` and which as `parents`. + * @template {UnistNode} [Tree=UnistNode] + * Tree type. + * @template {Test} [Check=Test] + * Test type. + */ + +import {convert} from 'unist-util-is' +import {color} from 'unist-util-visit-parents/do-not-use-color' + +/** @type {Readonly} */ +const empty = [] + +/** + * Continue traversing as normal. + */ +export const CONTINUE = true + +/** + * Stop traversing immediately. + */ +export const EXIT = false + +/** + * Do not traverse this node’s children. + */ +export const SKIP = 'skip' + +/** + * Visit nodes, with ancestral information. + * + * This algorithm performs *depth-first* *tree traversal* in *preorder* + * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**). + * + * You can choose for which nodes `visitor` is called by passing a `test`. + * For complex tests, you should test yourself in `visitor`, as it will be + * faster and will have improved type information. + * + * Walking the tree is an intensive task. + * Make use of the return values of the visitor when possible. + * Instead of walking a tree multiple times, walk it once, use `unist-util-is` + * to check if a node matches, and then perform different operations. + * + * You can change the tree. + * See `Visitor` for more info. + * + * @overload + * @param {Tree} tree + * @param {Check} check + * @param {BuildVisitor} visitor + * @param {boolean | null | undefined} [reverse] + * @returns {undefined} + * + * @overload + * @param {Tree} tree + * @param {BuildVisitor} visitor + * @param {boolean | null | undefined} [reverse] + * @returns {undefined} + * + * @param {UnistNode} tree + * Tree to traverse. + * @param {Visitor | Test} test + * `unist-util-is`-compatible test + * @param {Visitor | boolean | null | undefined} [visitor] + * Handle each node. + * @param {boolean | null | undefined} [reverse] + * Traverse in reverse preorder (NRL) instead of the default preorder (NLR). + * @returns {undefined} + * Nothing. + * + * @template {UnistNode} Tree + * Node type. + * @template {Test} Check + * `unist-util-is`-compatible test. + */ +export function visitParents(tree, test, visitor, reverse) { + /** @type {Test} */ + let check + + if (typeof test === 'function' && typeof visitor !== 'function') { + reverse = visitor + // @ts-expect-error no visitor given, so `visitor` is test. + visitor = test + } else { + // @ts-expect-error visitor given, so `test` isn’t a visitor. + check = test + } + + const is = convert(check) + const step = reverse ? -1 : 1 + + factory(tree, undefined, [])() + + /** + * @param {UnistNode} node + * @param {number | undefined} index + * @param {Array} parents + */ + function factory(node, index, parents) { + const value = /** @type {Record} */ ( + node && typeof node === 'object' ? node : {} + ) + + if (typeof value.type === 'string') { + const name = + // `hast` + typeof value.tagName === 'string' + ? value.tagName + : // `xast` + typeof value.name === 'string' + ? value.name + : undefined + + Object.defineProperty(visit, 'name', { + value: + 'node (' + color(node.type + (name ? '<' + name + '>' : '')) + ')' + }) + } + + return visit + + function visit() { + /** @type {Readonly} */ + let result = empty + /** @type {Readonly} */ + let subresult + /** @type {number} */ + let offset + /** @type {Array} */ + let grandparents + + if (!test || is(node, index, parents[parents.length - 1] || undefined)) { + // @ts-expect-error: `visitor` is now a visitor. + result = toResult(visitor(node, parents)) + + if (result[0] === EXIT) { + return result + } + } + + if ('children' in node && node.children) { + const nodeAsParent = /** @type {UnistParent} */ (node) + + if (nodeAsParent.children && result[0] !== SKIP) { + offset = (reverse ? nodeAsParent.children.length : -1) + step + grandparents = parents.concat(nodeAsParent) + + while (offset > -1 && offset < nodeAsParent.children.length) { + const child = nodeAsParent.children[offset] + + subresult = factory(child, offset, grandparents)() + + if (subresult[0] === EXIT) { + return subresult + } + + offset = + typeof subresult[1] === 'number' ? subresult[1] : offset + step + } + } + } + + return result + } + } +} + +/** + * Turn a return value into a clean result. + * + * @param {VisitorResult} value + * Valid return values from visitors. + * @returns {Readonly} + * Clean result. + */ +function toResult(value) { + if (Array.isArray(value)) { + return value + } + + if (typeof value === 'number') { + return [CONTINUE, value] + } + + return value === null || value === undefined ? empty : [value] +} diff --git a/tools/ui/node_modules/unist-util-visit-parents/license b/tools/ui/node_modules/unist-util-visit-parents/license new file mode 100644 index 0000000000000000000000000000000000000000..8d8660d36ef2eced1f9cce91e17ae0290261734c --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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/unist-util-visit-parents/node_modules/@types/unist/LICENSE b/tools/ui/node_modules/unist-util-visit-parents/node_modules/@types/unist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/node_modules/@types/unist/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + 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/unist-util-visit-parents/node_modules/@types/unist/README.md b/tools/ui/node_modules/unist-util-visit-parents/node_modules/@types/unist/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b84e51bfb836f999b47b6d8e233b64cb372e48df --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/node_modules/@types/unist/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/unist` + +# Summary +This package contains type definitions for unist (https://github.com/syntax-tree/unist). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist. + +### Additional Details + * Last updated: Thu, 15 Aug 2024 02:18:53 GMT + * Dependencies: none + +# Credits +These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), [JounQin](https://github.com/JounQin), and [Remco Haszing](https://github.com/remcohaszing). diff --git a/tools/ui/node_modules/unist-util-visit-parents/node_modules/@types/unist/index.d.ts b/tools/ui/node_modules/unist-util-visit-parents/node_modules/@types/unist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..513ddee5e9e2acb1e5c88c26da384212e52ed90b --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/node_modules/@types/unist/index.d.ts @@ -0,0 +1,119 @@ +// ## Interfaces + +/** + * Info associated with nodes by the ecosystem. + * + * This space is guaranteed to never be specified by unist or specifications + * implementing unist. + * But you can use it in utilities and plugins to store data. + * + * This type can be augmented to register custom data. + * For example: + * + * ```ts + * declare module 'unist' { + * interface Data { + * // `someNode.data.myId` is typed as `number | undefined` + * myId?: number | undefined + * } + * } + * ``` + */ +export interface Data {} + +/** + * One place in a source file. + */ +export interface Point { + /** + * Line in a source file (1-indexed integer). + */ + line: number; + + /** + * Column in a source file (1-indexed integer). + */ + column: number; + /** + * Character in a source file (0-indexed integer). + */ + offset?: number | undefined; +} + +/** + * Position of a node in a source document. + * + * A position is a range between two points. + */ +export interface Position { + /** + * Place of the first character of the parsed source region. + */ + start: Point; + + /** + * Place of the first character after the parsed source region. + */ + end: Point; +} + +// ## Abstract nodes + +/** + * Abstract unist node that contains the smallest possible value. + * + * This interface is supposed to be extended. + * + * For example, in HTML, a `text` node is a leaf that contains text. + */ +export interface Literal extends Node { + /** + * Plain value. + */ + value: unknown; +} + +/** + * Abstract unist node. + * + * The syntactic unit in unist syntax trees are called nodes. + * + * This interface is supposed to be extended. + * If you can use {@link Literal} or {@link Parent}, you should. + * But for example in markdown, a `thematicBreak` (`***`), is neither literal + * nor parent, but still a node. + */ +export interface Node { + /** + * Node type. + */ + type: string; + + /** + * Info from the ecosystem. + */ + data?: Data | undefined; + + /** + * Position of a node in a source document. + * + * Nodes that are generated (not in the original source document) must not + * have a position. + */ + position?: Position | undefined; +} + +/** + * Abstract unist node that contains other nodes (*children*). + * + * This interface is supposed to be extended. + * + * For example, in XML, an element is a parent of different things, such as + * comments, text, and further elements. + */ +export interface Parent extends Node { + /** + * List of children. + */ + children: Node[]; +} diff --git a/tools/ui/node_modules/unist-util-visit-parents/node_modules/@types/unist/package.json b/tools/ui/node_modules/unist-util-visit-parents/node_modules/@types/unist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d2092dba8f2208817af3e1811569d90b6358ad8f --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/node_modules/@types/unist/package.json @@ -0,0 +1,60 @@ +{ + "name": "@types/unist", + "version": "3.0.3", + "description": "TypeScript definitions for unist", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist", + "license": "MIT", + "contributors": [ + { + "name": "bizen241", + "githubUsername": "bizen241", + "url": "https://github.com/bizen241" + }, + { + "name": "Jun Lu", + "githubUsername": "lujun2", + "url": "https://github.com/lujun2" + }, + { + "name": "Hernan Rajchert", + "githubUsername": "hrajchert", + "url": "https://github.com/hrajchert" + }, + { + "name": "Titus Wormer", + "githubUsername": "wooorm", + "url": "https://github.com/wooorm" + }, + { + "name": "Junyoung Choi", + "githubUsername": "rokt33r", + "url": "https://github.com/rokt33r" + }, + { + "name": "Ben Moon", + "githubUsername": "GuiltyDolphin", + "url": "https://github.com/GuiltyDolphin" + }, + { + "name": "JounQin", + "githubUsername": "JounQin", + "url": "https://github.com/JounQin" + }, + { + "name": "Remco Haszing", + "githubUsername": "remcohaszing", + "url": "https://github.com/remcohaszing" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/unist" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "7f3d5ce8d56003f3583a5317f98d444bdc99910c7b486c6b10af4f38694e61fe", + "typeScriptVersion": "4.8" +} \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-visit-parents/package.json b/tools/ui/node_modules/unist-util-visit-parents/package.json new file mode 100644 index 0000000000000000000000000000000000000000..899f317000d30467490621c4f41285437c96619f --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/package.json @@ -0,0 +1,106 @@ +{ + "name": "unist-util-visit-parents", + "version": "6.0.2", + "description": "unist utility to recursively walk over nodes, with ancestral information", + "license": "MIT", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "tree", + "ast", + "visit", + "traverse", + "walk", + "check", + "parent", + "parents" + ], + "repository": "syntax-tree/unist-util-visit-parents", + "bugs": "https://github.com/syntax-tree/unist-util-visit-parents/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "exports": { + ".": "./index.js", + "./do-not-use-color": { + "node": "./lib/color.node.js", + "default": "./lib/color.js" + } + }, + "types": "index.d.ts", + "files": [ + "lib/", + "index.d.ts.map", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0" + }, + "devDependencies": { + "@types/hast": "^3.0.0", + "@types/mdast": "^4.0.0", + "@types/node": "^24.0.0", + "@types/xast": "^2.0.0", + "c8": "^10.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-gfm": "^3.0.0", + "micromark-extension-gfm": "^3.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^10.0.0", + "strip-ansi": "^7.0.0", + "tsd": "^0.33.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.58.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && tsd && type-coverage", + "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "#": "needed `any`s", + "ignoreFiles": [ + "lib/index.d.ts" + ], + "ignoreCatch": true, + "strict": true + }, + "xo": { + "prettier": true, + "rules": { + "unicorn/prefer-at": "off", + "unicorn/prefer-string-replace-all": "off" + } + } +} diff --git a/tools/ui/node_modules/unist-util-visit-parents/readme.md b/tools/ui/node_modules/unist-util-visit-parents/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..be99bc2ea7cd5a0f3040cec6408c31503ec1045b --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit-parents/readme.md @@ -0,0 +1,388 @@ +# unist-util-visit-parents + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[unist][] utility to walk the tree with a stack of parents. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`visitParents(tree[, test], visitor[, reverse])`](#visitparentstree-test-visitor-reverse) + * [`CONTINUE`](#continue) + * [`EXIT`](#exit) + * [`SKIP`](#skip) + * [`Action`](#action) + * [`ActionTuple`](#actiontuple) + * [`BuildVisitor`](#buildvisitor) + * [`Index`](#index) + * [`Test`](#test) + * [`Visitor`](#visitor) + * [`VisitorResult`](#visitorresult) +* [Types](#types) +* [Compatibility](#compatibility) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This is a very important utility for working with unist as it lets you walk the +tree. + +## When should I use this? + +You can use this utility when you want to walk the tree and want to know about +every parent of each node. +You can use [`unist-util-visit`][unist-util-visit] if you don’t care about the +entire stack of parents. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install unist-util-visit-parents +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {visitParents} from 'https://esm.sh/unist-util-visit-parents@6' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {visitParents} from 'unist-util-visit-parents' +import {fromMarkdown} from 'mdast-util-from-markdown' + +const tree = fromMarkdown('Some *emphasis*, **strong**, and `code`.') + +visitParents(tree, 'strong', function (node, ancestors) { + console.log(node.type, ancestors.map(ancestor => ancestor.type)) +}) +``` + +Yields: + +```js +strong ['root', 'paragraph'] +``` + +## API + +This package exports the identifiers [`CONTINUE`][api-continue], +[`EXIT`][api-exit], [`SKIP`][api-skip], and [`visitParents`][api-visitparents]. +There is no default export. + +### `visitParents(tree[, test], visitor[, reverse])` + +Visit nodes, with ancestral information. + +This algorithm performs *[depth-first][]* *[tree traversal][tree-traversal]* +in *[preorder][]* (**NLR**) or if `reverse` is given, in *reverse preorder* +(**NRL**). + +You can choose for which nodes `visitor` is called by passing a `test`. +For complex tests, you should test yourself in `visitor`, as it will be +faster and will have improved type information. + +Walking the tree is an intensive task. +Make use of the return values of the visitor when possible. +Instead of walking a tree multiple times, walk it once, use +[`unist-util-is`][unist-util-is] to check if a node matches, and then perform +different operations. + +You can change the tree. +See [`Visitor`][api-visitor] for more info. + +###### Parameters + +* `tree` ([`Node`][node]) + — tree to traverse +* `test` ([`Test`][api-test], optional) + — [`unist-util-is`][unist-util-is]-compatible test +* `visitor` ([`Visitor`][api-visitor]) + — handle each node +* `reverse` (`boolean`, default: `false`) + — traverse in reverse preorder (NRL) instead of the default preorder (NLR) + +###### Returns + +Nothing (`undefined`). + +### `CONTINUE` + +Continue traversing as normal (`true`). + +### `EXIT` + +Stop traversing immediately (`false`). + +### `SKIP` + +Do not traverse this node’s children (`'skip'`). + +### `Action` + +Union of the action types (TypeScript type). + +###### Type + +```ts +type Action = typeof CONTINUE | typeof EXIT | typeof SKIP +``` + +### `ActionTuple` + +List with one or two values, the first an action, the second an index +(TypeScript type). + +###### Type + +```ts +type ActionTuple = [ + (Action | null | undefined | void)?, + (Index | null | undefined)? +] +``` + +### `BuildVisitor` + +Build a typed `Visitor` function from a tree and a test (TypeScript type). + +It will infer which values are passed as `node` and which as `parents`. + +###### Type parameters + +* `Tree` ([`Node`][node], default: `Node`) + — tree type +* `Check` ([`Test`][api-test], default: `Test`) + — test type + +###### Returns + +[`Visitor`][api-visitor]. + +### `Index` + +Move to the sibling at `index` next (after node itself is completely +traversed) (TypeScript type). + +Useful if mutating the tree, such as removing the node the visitor is currently +on, or any of its previous siblings. +Results less than `0` or greater than or equal to `children.length` stop +traversing the parent. + +###### Type + +```ts +type Index = number +``` + +### `Test` + +[`unist-util-is`][unist-util-is] compatible test (TypeScript type). + +### `Visitor` + +Handle a node (matching `test`, if given) (TypeScript type). + +Visitors are free to transform `node`. +They can also transform the parent of node (the last of `ancestors`). + +Replacing `node` itself, if `SKIP` is not returned, still causes its +descendants to be walked (which is a bug). + +When adding or removing previous siblings of `node` (or next siblings, in +case of reverse), the `Visitor` should return a new `Index` to specify the +sibling to traverse after `node` is traversed. +Adding or removing next siblings of `node` (or previous siblings, in case +of reverse) is handled as expected without needing to return a new `Index`. + +Removing the children property of an ancestor still results in them being +traversed. + +###### Parameters + +* `node` ([`Node`][node]) + — found node +* `parents` ([`Array`][node]) + — ancestors of `node` + +###### Returns + +What to do next. + +An `Index` is treated as a tuple of `[CONTINUE, Index]`. +An `Action` is treated as a tuple of `[Action]`. + +Passing a tuple back only makes sense if the `Action` is `SKIP`. +When the `Action` is `EXIT`, that action can be returned. +When the `Action` is `CONTINUE`, `Index` can be returned. + +### `VisitorResult` + +Any value that can be returned from a visitor (TypeScript type). + +###### Type + +```ts +type VisitorResult = + | Action + | ActionTuple + | Index + | null + | undefined + | void +``` + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional types [`Action`][api-action], +[`ActionTuple`][api-actiontuple], [`BuildVisitor`][api-buildvisitor], +[`Index`][api-index], [`Test`][api-test], [`Visitor`][api-visitor], and +[`VisitorResult`][api-visitorresult]. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, +`unist-util-visit-parents@^6`, compatible with Node.js 16. + +## Related + +* [`unist-util-visit`](https://github.com/syntax-tree/unist-util-visit) + — walk the tree with one parent +* [`unist-util-filter`](https://github.com/syntax-tree/unist-util-filter) + — create a new tree with all nodes that pass a test +* [`unist-util-map`](https://github.com/syntax-tree/unist-util-map) + — create a new tree with all nodes mapped by a given function +* [`unist-util-flatmap`](https://gitlab.com/staltz/unist-util-flatmap) + — create a new tree by mapping (to an array) with the given function +* [`unist-util-remove`](https://github.com/syntax-tree/unist-util-remove) + — remove nodes from a tree that pass a test +* [`unist-util-select`](https://github.com/syntax-tree/unist-util-select) + — select nodes with CSS-like selectors + +## Contribute + +See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for +ways to get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/syntax-tree/unist-util-visit-parents/workflows/main/badge.svg + +[build]: https://github.com/syntax-tree/unist-util-visit-parents/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-visit-parents.svg + +[coverage]: https://codecov.io/github/syntax-tree/unist-util-visit-parents + +[downloads-badge]: https://img.shields.io/npm/dm/unist-util-visit-parents.svg + +[downloads]: https://www.npmjs.com/package/unist-util-visit-parents + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=unist-util-visit-parents + +[size]: https://bundlejs.com/?q=unist-util-visit-parents + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/syntax-tree/unist/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[license]: license + +[author]: https://wooorm.com + +[health]: https://github.com/syntax-tree/.github + +[contributing]: https://github.com/syntax-tree/.github/blob/HEAD/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/HEAD/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/HEAD/code-of-conduct.md + +[unist]: https://github.com/syntax-tree/unist + +[node]: https://github.com/syntax-tree/unist#node + +[depth-first]: https://github.com/syntax-tree/unist#depth-first-traversal + +[tree-traversal]: https://github.com/syntax-tree/unist#tree-traversal + +[preorder]: https://github.com/syntax-tree/unist#preorder + +[unist-util-visit]: https://github.com/syntax-tree/unist-util-visit + +[unist-util-is]: https://github.com/syntax-tree/unist-util-is + +[api-visitparents]: #visitparentstree-test-visitor-reverse + +[api-continue]: #continue + +[api-exit]: #exit + +[api-skip]: #skip + +[api-action]: #action + +[api-actiontuple]: #actiontuple + +[api-buildvisitor]: #buildvisitor + +[api-index]: #index + +[api-test]: #test + +[api-visitor]: #visitor + +[api-visitorresult]: #visitorresult diff --git a/tools/ui/node_modules/unist-util-visit/index.d.ts b/tools/ui/node_modules/unist-util-visit/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6ebdb0a0833b55a4842a377463acc9fb7603373 --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit/index.d.ts @@ -0,0 +1,9 @@ +export type {Test} from 'unist-util-is' +export type { + Action, + ActionTuple, + Index, + VisitorResult +} from 'unist-util-visit-parents' +export type {Visitor, BuildVisitor} from './lib/index.js' +export {CONTINUE, EXIT, SKIP, visit} from './lib/index.js' diff --git a/tools/ui/node_modules/unist-util-visit/index.js b/tools/ui/node_modules/unist-util-visit/index.js new file mode 100644 index 0000000000000000000000000000000000000000..4747999927eb17cda9ffce7e06e77a12a81f667a --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit/index.js @@ -0,0 +1,2 @@ +// Note: types exported from `index.d.ts` +export {CONTINUE, EXIT, SKIP, visit} from './lib/index.js' diff --git a/tools/ui/node_modules/unist-util-visit/lib/index.d.ts b/tools/ui/node_modules/unist-util-visit/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fe153a0cc70de6f2c605816916bff08aee08b94d --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit/lib/index.d.ts @@ -0,0 +1,195 @@ +/** + * Visit nodes. + * + * This algorithm performs *depth-first* *tree traversal* in *preorder* + * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**). + * + * You can choose for which nodes `visitor` is called by passing a `test`. + * For complex tests, you should test yourself in `visitor`, as it will be + * faster and will have improved type information. + * + * Walking the tree is an intensive task. + * Make use of the return values of the visitor when possible. + * Instead of walking a tree multiple times, walk it once, use `unist-util-is` + * to check if a node matches, and then perform different operations. + * + * You can change the tree. + * See `Visitor` for more info. + * + * @overload + * @param {Tree} tree + * @param {Check} check + * @param {BuildVisitor} visitor + * @param {boolean | null | undefined} [reverse] + * @returns {undefined} + * + * @overload + * @param {Tree} tree + * @param {BuildVisitor} visitor + * @param {boolean | null | undefined} [reverse] + * @returns {undefined} + * + * @param {UnistNode} tree + * Tree to traverse. + * @param {Visitor | Test} testOrVisitor + * `unist-util-is`-compatible test (optional, omit to pass a visitor). + * @param {Visitor | boolean | null | undefined} [visitorOrReverse] + * Handle each node (when test is omitted, pass `reverse`). + * @param {boolean | null | undefined} [maybeReverse=false] + * Traverse in reverse preorder (NRL) instead of the default preorder (NLR). + * @returns {undefined} + * Nothing. + * + * @template {UnistNode} Tree + * Node type. + * @template {Test} Check + * `unist-util-is`-compatible test. + */ +export function visit(tree: Tree, check: Check, visitor: BuildVisitor, reverse?: boolean | null | undefined): undefined; +/** + * Visit nodes. + * + * This algorithm performs *depth-first* *tree traversal* in *preorder* + * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**). + * + * You can choose for which nodes `visitor` is called by passing a `test`. + * For complex tests, you should test yourself in `visitor`, as it will be + * faster and will have improved type information. + * + * Walking the tree is an intensive task. + * Make use of the return values of the visitor when possible. + * Instead of walking a tree multiple times, walk it once, use `unist-util-is` + * to check if a node matches, and then perform different operations. + * + * You can change the tree. + * See `Visitor` for more info. + * + * @overload + * @param {Tree} tree + * @param {Check} check + * @param {BuildVisitor} visitor + * @param {boolean | null | undefined} [reverse] + * @returns {undefined} + * + * @overload + * @param {Tree} tree + * @param {BuildVisitor} visitor + * @param {boolean | null | undefined} [reverse] + * @returns {undefined} + * + * @param {UnistNode} tree + * Tree to traverse. + * @param {Visitor | Test} testOrVisitor + * `unist-util-is`-compatible test (optional, omit to pass a visitor). + * @param {Visitor | boolean | null | undefined} [visitorOrReverse] + * Handle each node (when test is omitted, pass `reverse`). + * @param {boolean | null | undefined} [maybeReverse=false] + * Traverse in reverse preorder (NRL) instead of the default preorder (NLR). + * @returns {undefined} + * Nothing. + * + * @template {UnistNode} Tree + * Node type. + * @template {Test} Check + * `unist-util-is`-compatible test. + */ +export function visit(tree: Tree, visitor: BuildVisitor, reverse?: boolean | null | undefined): undefined; +/** + * Test from `unist-util-is`. + * + * Note: we have remove and add `undefined`, because otherwise when generating + * automatic `.d.ts` files, TS tries to flatten paths from a local perspective, + * which doesn’t work when publishing on npm. + */ +export type Test = Exclude | undefined; +/** + * Get the value of a type guard `Fn`. + */ +export type Predicate = (Fn extends (value: any) => value is infer Thing ? Thing : Fallback); +/** + * Check whether a node matches a primitive check in the type system. + */ +export type MatchesOne = (Check extends null | undefined ? Value : Value extends { + type: Check; +} ? Value : Value extends Check ? Value : Check extends Function ? Predicate extends Value ? Predicate : never : never); +/** + * Check whether a node matches a check in the type system. + */ +export type Matches = (Check extends ReadonlyArray ? MatchesOne : MatchesOne); +/** + * Number; capped reasonably. + */ +export type Uint = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; +/** + * Increment a number in the type system. + */ +export type Increment = I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10; +/** + * Collect nodes that can be parents of `Child`. + */ +export type InternalParent = (Node extends UnistParent ? Node extends { + children: Array; +} ? Child extends Children ? Node : never : never : never); +/** + * Collect nodes in `Tree` that can be parents of `Child`. + */ +export type Parent = InternalParent, Child>; +/** + * Collect nodes in `Tree` that can be ancestors of `Child`. + */ +export type InternalAncestor = (Depth extends Max ? never : InternalParent | InternalAncestor, Max, Increment>); +/** + * Collect all (inclusive) descendants of `Tree`. + * + * > 👉 **Note**: for performance reasons, this seems to be the fastest way to + * > recurse without actually running into an infinite loop, which the + * > previous version did. + * > + * > Practically, a max of `2` is typically enough assuming a `Root` is + * > passed, but it doesn’t improve performance. + * > It gets higher with `List > ListItem > Table > TableRow > TableCell`. + * > Using up to `10` doesn’t hurt or help either. + */ +export type InclusiveDescendant = (Tree extends UnistParent ? Depth extends Max ? Tree : Tree | InclusiveDescendant> : Tree); +/** + * Handle a node (matching `test`, if given). + * + * Visitors are free to transform `node`. + * They can also transform `parent`. + * + * Replacing `node` itself, if `SKIP` is not returned, still causes its + * descendants to be walked (which is a bug). + * + * When adding or removing previous siblings of `node` (or next siblings, in + * case of reverse), the `Visitor` should return a new `Index` to specify the + * sibling to traverse after `node` is traversed. + * Adding or removing next siblings of `node` (or previous siblings, in case + * of reverse) is handled as expected without needing to return a new `Index`. + * + * Removing the children property of `parent` still results in them being + * traversed. + */ +export type Visitor = (node: Visited, index: Visited extends UnistNode ? number | undefined : never, parent: Ancestor extends UnistParent ? Ancestor | undefined : never) => VisitorResult; +/** + * Build a typed `Visitor` function from a node and all possible parents. + * + * It will infer which values are passed as `node` and which as `parent`. + */ +export type BuildVisitorFromMatch = Visitor>; +/** + * Build a typed `Visitor` function from a list of descendants and a test. + * + * It will infer which values are passed as `node` and which as `parent`. + */ +export type BuildVisitorFromDescendants = (BuildVisitorFromMatch, Extract>); +/** + * Build a typed `Visitor` function from a tree and a test. + * + * It will infer which values are passed as `node` and which as `parent`. + */ +export type BuildVisitor = (BuildVisitorFromDescendants, Check>); +import type { Node as UnistNode } from 'unist'; +import type { Parent as UnistParent } from 'unist'; +import type { VisitorResult } from 'unist-util-visit-parents'; +export { CONTINUE, EXIT, SKIP } from "unist-util-visit-parents"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-visit/lib/index.d.ts.map b/tools/ui/node_modules/unist-util-visit/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..2d5d7a4af8619953ba2aa61326b97b4248d5b3aa --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwPG,sBAwBsB,IAAI,SAAhB,SAAW,EAEJ,KAAK,SAAX,IAAK,QAzBR,IAAI,SACJ,KAAK,WACL,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,YACzB,OAAO,GAAG,IAAI,GAAG,SAAS,GACxB,SAAS,CAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sBAiBsB,IAAI,SAAhB,SAAW,EAEJ,KAAK,SAAX,IAAK,QAlBR,IAAI,WACJ,YAAY,CAAC,IAAI,CAAC,YAClB,OAAO,GAAG,IAAI,GAAG,SAAS,GACxB,SAAS,CAEnB;;;;;;;;mBA/PU,OAAO,CAAC,OAAO,eAAe,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,SAAS;;;;sBAiB5D,EAAE,EAEF,QAAQ,IARR,CACR,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,MAAM,KAAK,GAC7C,KAAK,GACL,QAAQ,CACX;;;;uBAuBS,KAAK,EAEL,KAAK,IAhBL,CACR,KAAK,SAAS,IAAI,GAAG,SAAS,GAC5B,KAAK,GACL,KAAK,SAAS;IAAC,IAAI,EAAE,KAAK,CAAA;CAAC,GAC3B,KAAK,GACL,KAAK,SAAS,KAAK,GACnB,KAAK,GACL,KAAK,oBACL,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,KAAK,GACnC,SAAS,CAAC,KAAK,EAAE,KAAK,CAAC,GACvB,KAAK,GACP,KAAK,CACR;;;;oBAeS,KAAK,EAEL,KAAK,IARL,CACR,KAAK,SAAS,aAAa,CAAC,GAAG,CAAC,GAC9B,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,GAChC,UAAU,CAAC,KAAK,EAAE,KAAK,CAAC,CAC3B;;;;mBASS,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE;;;;sBAOlC,CAAC,SAAR,IAAK,QAFN,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE;;;;2BAexJ,IAAI,SAAhB,SAAW,EAEC,KAAK,SAAjB,SAAW,IAVX,CACR,IAAI,SAAS,WAAW,GACtB,IAAI,SAAS;IAAC,QAAQ,EAAE,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAA;CAAC,GAC5C,KAAK,SAAS,QAAQ,GAAG,IAAI,GAAG,KAAK,GACrC,KAAK,GACP,KAAK,CACR;;;;mBAWqB,IAAI,SAAhB,SAAW,EAEC,KAAK,SAAjB,SAAW,IAJX,cAAc,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC;;;;6BAiBpC,IAAI,SAAhB,SAAW,EAEC,KAAK,SAAjB,SAAW,EAEH,GAAG,SAAV,IAAK,OAEE,KAAK,SAAZ,IAAK,QAdN,CACR,KAAK,SAAS,GAAG,GACf,KAAK,GAEH,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,GAC3B,gBAAgB,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,CAC/E;;;;;;;;;;;;;gCA8BqB,IAAI,SAAhB,SAAW,EAEH,GAAG,SAAV,IAAK,OAEE,KAAK,SAAZ,IAAK,QArBN,CACR,IAAI,SAAS,WAAW,GACpB,KAAK,SAAS,GAAG,GACf,IAAI,GACJ,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,EAAE,GAAG,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC,GAC7E,IAAI,CACT;;;;;;;;;;;;;;;;;;;oBAoDsB,OAAO,SAApB,SAAW,cAEI,QAAQ,SAAvB,WAAa,yBAjBf,OAAO,SAEP,OAAO,SAAS,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,UAEtD,QAAQ,SAAS,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,KAEzD,aAAa;;;;;;kCAoBD,OAAO,SAAnB,SAAW,EAEG,QAAQ,SAAtB,WAAa,IANb,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;;;;;;wCAoB/B,UAAU,SAAtB,SAAW,EAEJ,KAAK,SAAX,IAAK,IAXN,CACR,qBAAqB,CACnB,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,EAC1B,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,CACjC,CACF;;;;;;yBAoBsB,IAAI,SAAjB,SAAW,cAEH,KAAK,SAAZ,IAAK,WAXN,CACR,2BAA2B,CACzB,mBAAmB,CAAC,IAAI,CAAC,EACzB,KAAK,CACN,CACF;uCAvNuD,OAAO;2CAAP,OAAO;mCAClC,0BAA0B"} \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-visit/lib/index.js b/tools/ui/node_modules/unist-util-visit/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..697b299b0bf9028e44eb9fd68b689dce3a949343 --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit/lib/index.js @@ -0,0 +1,312 @@ +/** + * @import {Node as UnistNode, Parent as UnistParent} from 'unist' + * @import {VisitorResult} from 'unist-util-visit-parents' + */ + +/** + * @typedef {Exclude | undefined} Test + * Test from `unist-util-is`. + * + * Note: we have remove and add `undefined`, because otherwise when generating + * automatic `.d.ts` files, TS tries to flatten paths from a local perspective, + * which doesn’t work when publishing on npm. + */ + +// To do: use types from `unist-util-visit-parents` when it’s released. + +/** + * @typedef {( + * Fn extends (value: any) => value is infer Thing + * ? Thing + * : Fallback + * )} Predicate + * Get the value of a type guard `Fn`. + * @template Fn + * Value; typically function that is a type guard (such as `(x): x is Y`). + * @template Fallback + * Value to yield if `Fn` is not a type guard. + */ + +/** + * @typedef {( + * Check extends null | undefined // No test. + * ? Value + * : Value extends {type: Check} // String (type) test. + * ? Value + * : Value extends Check // Partial test. + * ? Value + * : Check extends Function // Function test. + * ? Predicate extends Value + * ? Predicate + * : never + * : never // Some other test? + * )} MatchesOne + * Check whether a node matches a primitive check in the type system. + * @template Value + * Value; typically unist `Node`. + * @template Check + * Value; typically `unist-util-is`-compatible test, but not arrays. + */ + +/** + * @typedef {( + * Check extends ReadonlyArray + * ? MatchesOne + * : MatchesOne + * )} Matches + * Check whether a node matches a check in the type system. + * @template Value + * Value; typically unist `Node`. + * @template Check + * Value; typically `unist-util-is`-compatible test. + */ + +/** + * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint + * Number; capped reasonably. + */ + +/** + * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment + * Increment a number in the type system. + * @template {Uint} [I=0] + * Index. + */ + +/** + * @typedef {( + * Node extends UnistParent + * ? Node extends {children: Array} + * ? Child extends Children ? Node : never + * : never + * : never + * )} InternalParent + * Collect nodes that can be parents of `Child`. + * @template {UnistNode} Node + * All node types in a tree. + * @template {UnistNode} Child + * Node to search for. + */ + +/** + * @typedef {InternalParent, Child>} Parent + * Collect nodes in `Tree` that can be parents of `Child`. + * @template {UnistNode} Tree + * All node types in a tree. + * @template {UnistNode} Child + * Node to search for. + */ + +/** + * @typedef {( + * Depth extends Max + * ? never + * : + * | InternalParent + * | InternalAncestor, Max, Increment> + * )} InternalAncestor + * Collect nodes in `Tree` that can be ancestors of `Child`. + * @template {UnistNode} Node + * All node types in a tree. + * @template {UnistNode} Child + * Node to search for. + * @template {Uint} [Max=10] + * Max; searches up to this depth. + * @template {Uint} [Depth=0] + * Current depth. + */ + +/** + * @typedef {( + * Tree extends UnistParent + * ? Depth extends Max + * ? Tree + * : Tree | InclusiveDescendant> + * : Tree + * )} InclusiveDescendant + * Collect all (inclusive) descendants of `Tree`. + * + * > 👉 **Note**: for performance reasons, this seems to be the fastest way to + * > recurse without actually running into an infinite loop, which the + * > previous version did. + * > + * > Practically, a max of `2` is typically enough assuming a `Root` is + * > passed, but it doesn’t improve performance. + * > It gets higher with `List > ListItem > Table > TableRow > TableCell`. + * > Using up to `10` doesn’t hurt or help either. + * @template {UnistNode} Tree + * Tree type. + * @template {Uint} [Max=10] + * Max; searches up to this depth. + * @template {Uint} [Depth=0] + * Current depth. + */ + +/** + * @callback Visitor + * Handle a node (matching `test`, if given). + * + * Visitors are free to transform `node`. + * They can also transform `parent`. + * + * Replacing `node` itself, if `SKIP` is not returned, still causes its + * descendants to be walked (which is a bug). + * + * When adding or removing previous siblings of `node` (or next siblings, in + * case of reverse), the `Visitor` should return a new `Index` to specify the + * sibling to traverse after `node` is traversed. + * Adding or removing next siblings of `node` (or previous siblings, in case + * of reverse) is handled as expected without needing to return a new `Index`. + * + * Removing the children property of `parent` still results in them being + * traversed. + * @param {Visited} node + * Found node. + * @param {Visited extends UnistNode ? number | undefined : never} index + * Index of `node` in `parent`. + * @param {Ancestor extends UnistParent ? Ancestor | undefined : never} parent + * Parent of `node`. + * @returns {VisitorResult} + * What to do next. + * + * An `Index` is treated as a tuple of `[CONTINUE, Index]`. + * An `Action` is treated as a tuple of `[Action]`. + * + * Passing a tuple back only makes sense if the `Action` is `SKIP`. + * When the `Action` is `EXIT`, that action can be returned. + * When the `Action` is `CONTINUE`, `Index` can be returned. + * @template {UnistNode} [Visited=UnistNode] + * Visited node type. + * @template {UnistParent} [Ancestor=UnistParent] + * Ancestor type. + */ + +/** + * @typedef {Visitor>} BuildVisitorFromMatch + * Build a typed `Visitor` function from a node and all possible parents. + * + * It will infer which values are passed as `node` and which as `parent`. + * @template {UnistNode} Visited + * Node type. + * @template {UnistParent} Ancestor + * Parent type. + */ + +/** + * @typedef {( + * BuildVisitorFromMatch< + * Matches, + * Extract + * > + * )} BuildVisitorFromDescendants + * Build a typed `Visitor` function from a list of descendants and a test. + * + * It will infer which values are passed as `node` and which as `parent`. + * @template {UnistNode} Descendant + * Node type. + * @template {Test} Check + * Test type. + */ + +/** + * @typedef {( + * BuildVisitorFromDescendants< + * InclusiveDescendant, + * Check + * > + * )} BuildVisitor + * Build a typed `Visitor` function from a tree and a test. + * + * It will infer which values are passed as `node` and which as `parent`. + * @template {UnistNode} [Tree=UnistNode] + * Node type. + * @template {Test} [Check=Test] + * Test type. + */ + +import {visitParents} from 'unist-util-visit-parents' + +export {CONTINUE, EXIT, SKIP} from 'unist-util-visit-parents' + +/** + * Visit nodes. + * + * This algorithm performs *depth-first* *tree traversal* in *preorder* + * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**). + * + * You can choose for which nodes `visitor` is called by passing a `test`. + * For complex tests, you should test yourself in `visitor`, as it will be + * faster and will have improved type information. + * + * Walking the tree is an intensive task. + * Make use of the return values of the visitor when possible. + * Instead of walking a tree multiple times, walk it once, use `unist-util-is` + * to check if a node matches, and then perform different operations. + * + * You can change the tree. + * See `Visitor` for more info. + * + * @overload + * @param {Tree} tree + * @param {Check} check + * @param {BuildVisitor} visitor + * @param {boolean | null | undefined} [reverse] + * @returns {undefined} + * + * @overload + * @param {Tree} tree + * @param {BuildVisitor} visitor + * @param {boolean | null | undefined} [reverse] + * @returns {undefined} + * + * @param {UnistNode} tree + * Tree to traverse. + * @param {Visitor | Test} testOrVisitor + * `unist-util-is`-compatible test (optional, omit to pass a visitor). + * @param {Visitor | boolean | null | undefined} [visitorOrReverse] + * Handle each node (when test is omitted, pass `reverse`). + * @param {boolean | null | undefined} [maybeReverse=false] + * Traverse in reverse preorder (NRL) instead of the default preorder (NLR). + * @returns {undefined} + * Nothing. + * + * @template {UnistNode} Tree + * Node type. + * @template {Test} Check + * `unist-util-is`-compatible test. + */ +export function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) { + /** @type {boolean | null | undefined} */ + let reverse + /** @type {Test} */ + let test + /** @type {Visitor} */ + let visitor + + if ( + typeof testOrVisitor === 'function' && + typeof visitorOrReverse !== 'function' + ) { + test = undefined + visitor = testOrVisitor + reverse = visitorOrReverse + } else { + // @ts-expect-error: assume the overload with test was given. + test = testOrVisitor + // @ts-expect-error: assume the overload with test was given. + visitor = visitorOrReverse + reverse = maybeReverse + } + + visitParents(tree, test, overload, reverse) + + /** + * @param {UnistNode} node + * @param {Array} parents + */ + function overload(node, parents) { + const parent = parents[parents.length - 1] + const index = parent ? parent.children.indexOf(node) : undefined + return visitor(node, index, parent) + } +} diff --git a/tools/ui/node_modules/unist-util-visit/license b/tools/ui/node_modules/unist-util-visit/license new file mode 100644 index 0000000000000000000000000000000000000000..32e7a3d93ca5a2b8cce57405841a44e78f3fbb55 --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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/unist-util-visit/node_modules/@types/unist/LICENSE b/tools/ui/node_modules/unist-util-visit/node_modules/@types/unist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit/node_modules/@types/unist/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + 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/unist-util-visit/node_modules/@types/unist/README.md b/tools/ui/node_modules/unist-util-visit/node_modules/@types/unist/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b84e51bfb836f999b47b6d8e233b64cb372e48df --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit/node_modules/@types/unist/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/unist` + +# Summary +This package contains type definitions for unist (https://github.com/syntax-tree/unist). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist. + +### Additional Details + * Last updated: Thu, 15 Aug 2024 02:18:53 GMT + * Dependencies: none + +# Credits +These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), [JounQin](https://github.com/JounQin), and [Remco Haszing](https://github.com/remcohaszing). diff --git a/tools/ui/node_modules/unist-util-visit/node_modules/@types/unist/index.d.ts b/tools/ui/node_modules/unist-util-visit/node_modules/@types/unist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..513ddee5e9e2acb1e5c88c26da384212e52ed90b --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit/node_modules/@types/unist/index.d.ts @@ -0,0 +1,119 @@ +// ## Interfaces + +/** + * Info associated with nodes by the ecosystem. + * + * This space is guaranteed to never be specified by unist or specifications + * implementing unist. + * But you can use it in utilities and plugins to store data. + * + * This type can be augmented to register custom data. + * For example: + * + * ```ts + * declare module 'unist' { + * interface Data { + * // `someNode.data.myId` is typed as `number | undefined` + * myId?: number | undefined + * } + * } + * ``` + */ +export interface Data {} + +/** + * One place in a source file. + */ +export interface Point { + /** + * Line in a source file (1-indexed integer). + */ + line: number; + + /** + * Column in a source file (1-indexed integer). + */ + column: number; + /** + * Character in a source file (0-indexed integer). + */ + offset?: number | undefined; +} + +/** + * Position of a node in a source document. + * + * A position is a range between two points. + */ +export interface Position { + /** + * Place of the first character of the parsed source region. + */ + start: Point; + + /** + * Place of the first character after the parsed source region. + */ + end: Point; +} + +// ## Abstract nodes + +/** + * Abstract unist node that contains the smallest possible value. + * + * This interface is supposed to be extended. + * + * For example, in HTML, a `text` node is a leaf that contains text. + */ +export interface Literal extends Node { + /** + * Plain value. + */ + value: unknown; +} + +/** + * Abstract unist node. + * + * The syntactic unit in unist syntax trees are called nodes. + * + * This interface is supposed to be extended. + * If you can use {@link Literal} or {@link Parent}, you should. + * But for example in markdown, a `thematicBreak` (`***`), is neither literal + * nor parent, but still a node. + */ +export interface Node { + /** + * Node type. + */ + type: string; + + /** + * Info from the ecosystem. + */ + data?: Data | undefined; + + /** + * Position of a node in a source document. + * + * Nodes that are generated (not in the original source document) must not + * have a position. + */ + position?: Position | undefined; +} + +/** + * Abstract unist node that contains other nodes (*children*). + * + * This interface is supposed to be extended. + * + * For example, in XML, an element is a parent of different things, such as + * comments, text, and further elements. + */ +export interface Parent extends Node { + /** + * List of children. + */ + children: Node[]; +} diff --git a/tools/ui/node_modules/unist-util-visit/node_modules/@types/unist/package.json b/tools/ui/node_modules/unist-util-visit/node_modules/@types/unist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d2092dba8f2208817af3e1811569d90b6358ad8f --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit/node_modules/@types/unist/package.json @@ -0,0 +1,60 @@ +{ + "name": "@types/unist", + "version": "3.0.3", + "description": "TypeScript definitions for unist", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist", + "license": "MIT", + "contributors": [ + { + "name": "bizen241", + "githubUsername": "bizen241", + "url": "https://github.com/bizen241" + }, + { + "name": "Jun Lu", + "githubUsername": "lujun2", + "url": "https://github.com/lujun2" + }, + { + "name": "Hernan Rajchert", + "githubUsername": "hrajchert", + "url": "https://github.com/hrajchert" + }, + { + "name": "Titus Wormer", + "githubUsername": "wooorm", + "url": "https://github.com/wooorm" + }, + { + "name": "Junyoung Choi", + "githubUsername": "rokt33r", + "url": "https://github.com/rokt33r" + }, + { + "name": "Ben Moon", + "githubUsername": "GuiltyDolphin", + "url": "https://github.com/GuiltyDolphin" + }, + { + "name": "JounQin", + "githubUsername": "JounQin", + "url": "https://github.com/JounQin" + }, + { + "name": "Remco Haszing", + "githubUsername": "remcohaszing", + "url": "https://github.com/remcohaszing" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/unist" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "7f3d5ce8d56003f3583a5317f98d444bdc99910c7b486c6b10af4f38694e61fe", + "typeScriptVersion": "4.8" +} \ No newline at end of file diff --git a/tools/ui/node_modules/unist-util-visit/package.json b/tools/ui/node_modules/unist-util-visit/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1008d273ee608311fcd3b8da0ec7a2e68a3d3134 --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit/package.json @@ -0,0 +1,108 @@ +{ + "name": "unist-util-visit", + "version": "5.1.0", + "description": "unist utility to visit nodes", + "license": "MIT", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "remark", + "retext", + "rehype", + "mdast", + "hast", + "xast", + "nlcst", + "natural", + "language", + "markdown", + "html", + "xml", + "tree", + "ast", + "node", + "visit", + "walk" + ], + "repository": "syntax-tree/unist-util-visit", + "bugs": "https://github.com/syntax-tree/unist-util-visit/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)", + "Eugene Sharygin ", + "Richard Gibson " + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "files": [ + "lib/", + "index.d.ts.map", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-is": "^6.0.0", + "unist-util-visit-parents": "^6.0.0" + }, + "devDependencies": { + "@types/mdast": "^4.0.0", + "@types/node": "^25.0.0", + "c8": "^10.0.0", + "mdast-util-from-markdown": "^2.0.0", + "mdast-util-gfm": "^3.0.0", + "micromark-extension-gfm": "^3.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^11.0.0", + "tsd": "^0.33.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^1.0.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && tsd && type-coverage", + "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "#": "needed `any`s", + "ignoreFiles": [ + "lib/index.d.ts" + ], + "ignoreCatch": true, + "strict": true + }, + "xo": { + "space": true, + "prettier": true, + "rules": { + "unicorn/prefer-at": "off" + } + } +} diff --git a/tools/ui/node_modules/unist-util-visit/readme.md b/tools/ui/node_modules/unist-util-visit/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..4f22d4691dbcc10f8b40dd5769a11a494da90832 --- /dev/null +++ b/tools/ui/node_modules/unist-util-visit/readme.md @@ -0,0 +1,313 @@ +# unist-util-visit + +[![Build][badge-build-image]][badge-build-url] +[![Coverage][badge-coverage-image]][badge-coverage-url] +[![Downloads][badge-downloads-image]][badge-downloads-url] +[![Size][badge-size-image]][badge-size-url] + +[unist][github-unist] utility to walk the tree. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`visit(tree[, test], visitor[, reverse])`](#visittree-test-visitor-reverse) + * [`CONTINUE`](#continue) + * [`EXIT`](#exit) + * [`SKIP`](#skip) + * [`Action`](#action) + * [`ActionTuple`](#actiontuple) + * [`BuildVisitor`](#buildvisitor) + * [`Index`](#index) + * [`Test`](#test) + * [`Visitor`](#visitor) + * [`VisitorResult`](#visitorresult) +* [Compatibility](#compatibility) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This is a very important utility for working with unist as it lets you walk the +tree. + +## When should I use this? + +You can use this utility when you want to walk the tree. +You can use [`unist-util-visit-parents`][github-vp] if you care about the +entire stack of parents. + +## Install + +This package is [ESM only][github-gist-esm]. +In Node.js (version 16+), +install with [npm][npmjs-install]: + +```sh +npm install unist-util-visit +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {CONTINUE, EXIT, SKIP, visit} from 'https://esm.sh/unist-util-visit@5' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {fromMarkdown} from 'mdast-util-from-markdown' +import {visit} from 'unist-util-visit' + +const tree = fromMarkdown('Some *emphasis*, **strong**, and `code`.') + +visit(tree, 'text', function (node, index, parent) { + console.log([node.value, parent ? parent.type : index]) +}) +``` + +Yields: + +```js +[ 'Some ', 'paragraph' ] +[ 'emphasis', 'emphasis' ] +[ ', ', 'paragraph' ] +[ 'strong', 'strong' ] +[ ', and ', 'paragraph' ] +[ '.', 'paragraph' ] +``` + +## API + +This package exports the identifiers +[`CONTINUE`][api-continue], +[`EXIT`][api-exit], +[`SKIP`][api-skip], and +[`visit`][api-visit]. +It exports the [TypeScript][] types +[`ActionTuple`][api-action-tuple], +[`Action`][api-action], +[`BuildVisitor`][api-build-visitor], +[`Index`][api-index], +[`Test`][api-test], +[`VisitorResult`][api-visitor-result], and +[`Visitor`][api-visitor]. +There is no default export. + +### `visit(tree[, test], visitor[, reverse])` + +This function works exactly the same as +[`unist-util-visit-parents`][github-vp], +but [`Visitor`][api-visitor] has a different signature. + +### `CONTINUE` + +Continue traversing as normal (`true`). + +### `EXIT` + +Stop traversing immediately (`false`). + +### `SKIP` + +Do not traverse this node’s children (`'skip'`). + +### `Action` + +Union of the action types (TypeScript type). +See [`Action` in `unist-util-visit-parents`][github-vp-action]. + +### `ActionTuple` + +List with an action and an index (TypeScript type). +See [`ActionTuple` in `unist-util-visit-parents`][github-vp-action-tuple]. + +### `BuildVisitor` + +Build a typed `Visitor` function from a tree and a test (TypeScript type). +See [`BuildVisitor` in `unist-util-visit-parents`][github-vp-build-visitor]. + +### `Index` + +Move to the sibling at `index` next (TypeScript type). +See [`Index` in `unist-util-visit-parents`][github-vp-index]. + +### `Test` + +[`unist-util-is`][github-unist-util-is] compatible test +(TypeScript type). + +### `Visitor` + +Handle a node (matching `test`, if given) (TypeScript type). + +Visitors are free to transform `node`. +They can also transform `parent`. + +Replacing `node` itself, if `SKIP` is not returned, still causes its +descendants to be walked (which is a bug). + +When adding or removing previous siblings of `node` (or next siblings, in +case of reverse), the `Visitor` should return a new `Index` to specify the +sibling to traverse after `node` is traversed. +Adding or removing next siblings of `node` (or previous siblings, in case +of reverse) is handled as expected without needing to return a new `Index`. + +Removing the children property of `parent` still results in them being +traversed. + +###### Parameters + +* `node` ([`Node`][github-unist-node]) + — found node +* `index` (`number` or `undefined`) + — index of `node` in `parent` +* `parent` ([`Node`][github-unist-node] or `undefined`) + — parent of `node` + +###### Returns + +What to do next. + +An `Index` is treated as a tuple of `[CONTINUE, Index]`. +An `Action` is treated as a tuple of `[Action]`. + +Passing a tuple back only makes sense if the `Action` is `SKIP`. +When the `Action` is `EXIT`, that action can be returned. +When the `Action` is `CONTINUE`, `Index` can be returned. + +### `VisitorResult` + +Any value that can be returned from a visitor (TypeScript type). +See [`VisitorResult` in +`unist-util-visit-parents`][github-vp-visitor-result]. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `unist-util-visit@^5`, +compatible with Node.js 16. + +## Related + +* [`unist-util-visit-parents`][github-vp] + — walk the tree with a stack of parents +* [`unist-util-filter`](https://github.com/syntax-tree/unist-util-filter) + — create a new tree with all nodes that pass a test +* [`unist-util-map`](https://github.com/syntax-tree/unist-util-map) + — create a new tree with all nodes mapped by a given function +* [`unist-util-flatmap`](https://gitlab.com/staltz/unist-util-flatmap) + — create a new tree by mapping (to an array) with the given function +* [`unist-util-remove`](https://github.com/syntax-tree/unist-util-remove) + — remove nodes from a tree that pass a test +* [`unist-util-select`](https://github.com/syntax-tree/unist-util-select) + — select nodes with CSS-like selectors + +## Contribute + +See [`contributing.md`][health-contributing] in [`syntax-tree/.github`][health] +for ways to get started. +See [`support.md`][health-support] for ways to get help. + +This project has a [code of conduct][health-coc]. +By interacting with this repository, +organization, +or community you agree to abide by its terms. + +## License + +[MIT][file-license] © [Titus Wormer][wooorm] + + + +[api-action]: #action + +[api-action-tuple]: #actiontuple + +[api-build-visitor]: #buildvisitor + +[api-continue]: #continue + +[api-exit]: #exit + +[api-index]: #index + +[api-skip]: #skip + +[api-test]: #test + +[api-visit]: #visittree-test-visitor-reverse + +[api-visitor]: #visitor + +[api-visitor-result]: #visitorresult + +[badge-build-image]: https://github.com/syntax-tree/unist-util-visit/workflows/main/badge.svg + +[badge-build-url]: https://github.com/syntax-tree/unist-util-visit/actions + +[badge-coverage-image]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-visit.svg + +[badge-coverage-url]: https://codecov.io/github/syntax-tree/unist-util-visit + +[badge-downloads-image]: https://img.shields.io/npm/dm/unist-util-visit.svg + +[badge-downloads-url]: https://www.npmjs.com/package/unist-util-visit + +[badge-size-image]: https://img.shields.io/bundlejs/size/unist-util-visit + +[badge-size-url]: https://bundlejs.com/?q=unist-util-visit + +[esmsh]: https://esm.sh + +[file-license]: license + +[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[github-unist]: https://github.com/syntax-tree/unist + +[github-unist-node]: https://github.com/syntax-tree/unist#nodes + +[github-unist-util-is]: https://github.com/syntax-tree/unist-util-is + +[github-vp]: https://github.com/syntax-tree/unist-util-visit-parents + +[github-vp-action]: https://github.com/syntax-tree/unist-util-visit-parents#action + +[github-vp-action-tuple]: https://github.com/syntax-tree/unist-util-visit-parents#actiontuple + +[github-vp-build-visitor]: https://github.com/syntax-tree/unist-util-visit-parents#buildvisitor + +[github-vp-index]: https://github.com/syntax-tree/unist-util-visit-parents#index + +[github-vp-visitor-result]: https://github.com/syntax-tree/unist-util-visit-parents#visitorresult + +[health]: https://github.com/syntax-tree/.github + +[health-coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md + +[health-contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md + +[health-support]: https://github.com/syntax-tree/.github/blob/main/support.md + +[npmjs-install]: https://docs.npmjs.com/cli/install + +[typescript]: https://www.typescriptlang.org + +[wooorm]: https://wooorm.com diff --git a/tools/ui/node_modules/universalify/LICENSE b/tools/ui/node_modules/universalify/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..514e84e648df769fb1725ce4b9baf01bd67aae24 --- /dev/null +++ b/tools/ui/node_modules/universalify/LICENSE @@ -0,0 +1,20 @@ +(The MIT License) + +Copyright (c) 2017, Ryan Zimmerman + +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/universalify/README.md b/tools/ui/node_modules/universalify/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1184939d23e2157405a5ef6e0f0d3140dd0bab0c --- /dev/null +++ b/tools/ui/node_modules/universalify/README.md @@ -0,0 +1,76 @@ +# universalify + +![GitHub Workflow Status (branch)](https://img.shields.io/github/actions/workflow/status/RyanZim/universalify/ci.yml?branch=master) +![Coveralls github branch](https://img.shields.io/coveralls/github/RyanZim/universalify/master.svg) +![npm](https://img.shields.io/npm/dm/universalify.svg) +![npm](https://img.shields.io/npm/l/universalify.svg) + +Make a callback- or promise-based function support both promises and callbacks. + +Uses the native promise implementation. + +## Installation + +```bash +npm install universalify +``` + +## API + +### `universalify.fromCallback(fn)` + +Takes a callback-based function to universalify, and returns the universalified function. + +Function must take a callback as the last parameter that will be called with the signature `(error, result)`. `universalify` does not support calling the callback with three or more arguments, and does not ensure that the callback is only called once. + +```js +function callbackFn (n, cb) { + setTimeout(() => cb(null, n), 15) +} + +const fn = universalify.fromCallback(callbackFn) + +// Works with Promises: +fn('Hello World!') +.then(result => console.log(result)) // -> Hello World! +.catch(error => console.error(error)) + +// Works with Callbacks: +fn('Hi!', (error, result) => { + if (error) return console.error(error) + console.log(result) + // -> Hi! +}) +``` + +### `universalify.fromPromise(fn)` + +Takes a promise-based function to universalify, and returns the universalified function. + +Function must return a valid JS promise. `universalify` does not ensure that a valid promise is returned. + +```js +function promiseFn (n) { + return new Promise(resolve => { + setTimeout(() => resolve(n), 15) + }) +} + +const fn = universalify.fromPromise(promiseFn) + +// Works with Promises: +fn('Hello World!') +.then(result => console.log(result)) // -> Hello World! +.catch(error => console.error(error)) + +// Works with Callbacks: +fn('Hi!', (error, result) => { + if (error) return console.error(error) + console.log(result) + // -> Hi! +}) +``` + +## License + +MIT diff --git a/tools/ui/node_modules/universalify/index.js b/tools/ui/node_modules/universalify/index.js new file mode 100644 index 0000000000000000000000000000000000000000..233beac75c7f5551ae77776bf16cf5caa371359a --- /dev/null +++ b/tools/ui/node_modules/universalify/index.js @@ -0,0 +1,24 @@ +'use strict' + +exports.fromCallback = function (fn) { + return Object.defineProperty(function (...args) { + if (typeof args[args.length - 1] === 'function') fn.apply(this, args) + else { + return new Promise((resolve, reject) => { + args.push((err, res) => (err != null) ? reject(err) : resolve(res)) + fn.apply(this, args) + }) + } + }, 'name', { value: fn.name }) +} + +exports.fromPromise = function (fn) { + return Object.defineProperty(function (...args) { + const cb = args[args.length - 1] + if (typeof cb !== 'function') return fn.apply(this, args) + else { + args.pop() + fn.apply(this, args).then(r => cb(null, r), cb) + } + }, 'name', { value: fn.name }) +} diff --git a/tools/ui/node_modules/universalify/package.json b/tools/ui/node_modules/universalify/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d60fccb5059c5aac2c633cd831fc32eec623df85 --- /dev/null +++ b/tools/ui/node_modules/universalify/package.json @@ -0,0 +1,34 @@ +{ + "name": "universalify", + "version": "2.0.1", + "description": "Make a callback- or promise-based function support both promises and callbacks.", + "keywords": [ + "callback", + "native", + "promise" + ], + "homepage": "https://github.com/RyanZim/universalify#readme", + "bugs": "https://github.com/RyanZim/universalify/issues", + "license": "MIT", + "author": "Ryan Zimmerman ", + "files": [ + "index.js" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/RyanZim/universalify.git" + }, + "scripts": { + "test": "standard && nyc --reporter text --reporter lcovonly tape test/*.js | colortape" + }, + "devDependencies": { + "colortape": "^0.1.2", + "coveralls": "^3.0.1", + "nyc": "^15.0.0", + "standard": "^14.3.1", + "tape": "^5.0.1" + }, + "engines": { + "node": ">= 10.0.0" + } +} diff --git a/tools/ui/node_modules/unpipe/HISTORY.md b/tools/ui/node_modules/unpipe/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..85e0f8d747dc2a960e1ae6640c8bf081631ac0ec --- /dev/null +++ b/tools/ui/node_modules/unpipe/HISTORY.md @@ -0,0 +1,4 @@ +1.0.0 / 2015-06-14 +================== + + * Initial release diff --git a/tools/ui/node_modules/unpipe/LICENSE b/tools/ui/node_modules/unpipe/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..aed0138278a940d6e7b2d43903e04eee233b957e --- /dev/null +++ b/tools/ui/node_modules/unpipe/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2015 Douglas Christopher Wilson + +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/unpipe/README.md b/tools/ui/node_modules/unpipe/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e536ad2c045bba26e9d1f93202a44833656adfad --- /dev/null +++ b/tools/ui/node_modules/unpipe/README.md @@ -0,0 +1,43 @@ +# unpipe + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-image]][node-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Unpipe a stream from all destinations. + +## Installation + +```sh +$ npm install unpipe +``` + +## API + +```js +var unpipe = require('unpipe') +``` + +### unpipe(stream) + +Unpipes all destinations from a given stream. With stream 2+, this is +equivalent to `stream.unpipe()`. When used with streams 1 style streams +(typically Node.js 0.8 and below), this module attempts to undo the +actions done in `stream.pipe(dest)`. + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/unpipe.svg +[npm-url]: https://npmjs.org/package/unpipe +[node-image]: https://img.shields.io/node/v/unpipe.svg +[node-url]: http://nodejs.org/download/ +[travis-image]: https://img.shields.io/travis/stream-utils/unpipe.svg +[travis-url]: https://travis-ci.org/stream-utils/unpipe +[coveralls-image]: https://img.shields.io/coveralls/stream-utils/unpipe.svg +[coveralls-url]: https://coveralls.io/r/stream-utils/unpipe?branch=master +[downloads-image]: https://img.shields.io/npm/dm/unpipe.svg +[downloads-url]: https://npmjs.org/package/unpipe diff --git a/tools/ui/node_modules/unpipe/index.js b/tools/ui/node_modules/unpipe/index.js new file mode 100644 index 0000000000000000000000000000000000000000..15c3d97a12b484c2a1c9735e24c952c3079876d0 --- /dev/null +++ b/tools/ui/node_modules/unpipe/index.js @@ -0,0 +1,69 @@ +/*! + * unpipe + * Copyright(c) 2015 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + * @public + */ + +module.exports = unpipe + +/** + * Determine if there are Node.js pipe-like data listeners. + * @private + */ + +function hasPipeDataListeners(stream) { + var listeners = stream.listeners('data') + + for (var i = 0; i < listeners.length; i++) { + if (listeners[i].name === 'ondata') { + return true + } + } + + return false +} + +/** + * Unpipe a stream from all destinations. + * + * @param {object} stream + * @public + */ + +function unpipe(stream) { + if (!stream) { + throw new TypeError('argument stream is required') + } + + if (typeof stream.unpipe === 'function') { + // new-style + stream.unpipe() + return + } + + // Node.js 0.8 hack + if (!hasPipeDataListeners(stream)) { + return + } + + var listener + var listeners = stream.listeners('close') + + for (var i = 0; i < listeners.length; i++) { + listener = listeners[i] + + if (listener.name !== 'cleanup' && listener.name !== 'onclose') { + continue + } + + // invoke the listener + listener.call(stream) + } +} diff --git a/tools/ui/node_modules/unpipe/package.json b/tools/ui/node_modules/unpipe/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a2b73583bd6e39d785dc00256bd162c4fe2564e7 --- /dev/null +++ b/tools/ui/node_modules/unpipe/package.json @@ -0,0 +1,27 @@ +{ + "name": "unpipe", + "description": "Unpipe a stream from all destinations", + "version": "1.0.0", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "repository": "stream-utils/unpipe", + "devDependencies": { + "istanbul": "0.3.15", + "mocha": "2.2.5", + "readable-stream": "1.1.13" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/tools/ui/node_modules/unplugin/LICENSE b/tools/ui/node_modules/unplugin/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..1c6fb7a5197488558c260c897ddf18addf3dc9ad --- /dev/null +++ b/tools/ui/node_modules/unplugin/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021-PRESENT Nuxt Contrib + +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/unplugin/README.md b/tools/ui/node_modules/unplugin/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2f7157fafbd3f0bc31ae7256f6df3f879581ff43 --- /dev/null +++ b/tools/ui/node_modules/unplugin/README.md @@ -0,0 +1,35 @@ +# Unplugin + +[![npm version][npm-version-src]][npm-version-href] +[![npm downloads][npm-downloads-src]][npm-downloads-href] +[![License][license-src]][license-href] + +Unified plugin system for build tools. + +Currently supports: + +- [Vite](https://vite.dev/) +- [Rollup](https://rollupjs.org/) +- [Webpack](https://webpack.js.org/) +- [esbuild](https://esbuild.github.io/) +- [Rspack](https://www.rspack.dev/) +- [Rolldown](https://rolldown.rs/) +- [Farm](https://www.farmfe.org/) +- And every framework built on top of them. + +## Documentations + +Learn more on the [Documentation](https://unplugin.unjs.io/) + +## License + +[MIT](./LICENSE) License © 2021-PRESENT Nuxt Contrib + + + +[npm-version-src]: https://img.shields.io/npm/v/unplugin?style=flat&colorA=18181B&colorB=F0DB4F +[npm-version-href]: https://npmjs.com/package/unplugin +[npm-downloads-src]: https://img.shields.io/npm/dm/unplugin?style=flat&colorA=18181B&colorB=F0DB4F +[npm-downloads-href]: https://npmjs.com/package/unplugin +[license-src]: https://img.shields.io/github/license/unjs/unplugin.svg?style=flat&colorA=18181B&colorB=F0DB4F +[license-href]: https://github.com/unjs/unplugin/blob/main/LICENSE diff --git a/tools/ui/node_modules/unplugin/dist/context-CQfDPcdE.cjs b/tools/ui/node_modules/unplugin/dist/context-CQfDPcdE.cjs new file mode 100644 index 0000000000000000000000000000000000000000..0f9ed04a2977d10102fb2bbdfae2929cf79b802b --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/context-CQfDPcdE.cjs @@ -0,0 +1,169 @@ +//#region rolldown:runtime +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { + key = keys[i]; + if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { + get: ((k) => from[k]).bind(null, key), + enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable + }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { + value: mod, + enumerable: true +}) : target, mod)); + +//#endregion +let node_path = require("node:path"); +node_path = __toESM(node_path); +let picomatch = require("picomatch"); +picomatch = __toESM(picomatch); +let acorn = require("acorn"); +acorn = __toESM(acorn); + +//#region src/utils/general.ts +function toArray(array) { + array = array || []; + if (Array.isArray(array)) return array; + return [array]; +} + +//#endregion +//#region src/utils/filter.ts +const BACKSLASH_REGEX = /\\/g; +function normalize(path) { + return path.replace(BACKSLASH_REGEX, "/"); +} +const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Z]:)?[/\\|])/i; +function isAbsolute(path) { + return ABSOLUTE_PATH_REGEX.test(path); +} +function getMatcherString(glob, cwd) { + if (glob.startsWith("**") || isAbsolute(glob)) return normalize(glob); + return normalize((0, node_path.resolve)(cwd, glob)); +} +function patternToIdFilter(pattern) { + if (pattern instanceof RegExp) return (id) => { + const normalizedId = normalize(id); + const result = pattern.test(normalizedId); + pattern.lastIndex = 0; + return result; + }; + const matcher = (0, picomatch.default)(getMatcherString(pattern, process.cwd()), { dot: true }); + return (id) => { + return matcher(normalize(id)); + }; +} +function patternToCodeFilter(pattern) { + if (pattern instanceof RegExp) return (code) => { + const result = pattern.test(code); + pattern.lastIndex = 0; + return result; + }; + return (code) => code.includes(pattern); +} +function createFilter(exclude, include) { + if (!exclude && !include) return; + return (input) => { + if (exclude?.some((filter) => filter(input))) return false; + if (include?.some((filter) => filter(input))) return true; + return !(include && include.length > 0); + }; +} +function normalizeFilter(filter) { + if (typeof filter === "string" || filter instanceof RegExp) return { include: [filter] }; + if (Array.isArray(filter)) return { include: filter }; + return { + exclude: filter.exclude ? toArray(filter.exclude) : void 0, + include: filter.include ? toArray(filter.include) : void 0 + }; +} +function createIdFilter(filter) { + if (!filter) return; + const { exclude, include } = normalizeFilter(filter); + const excludeFilter = exclude?.map(patternToIdFilter); + const includeFilter = include?.map(patternToIdFilter); + return createFilter(excludeFilter, includeFilter); +} +function createCodeFilter(filter) { + if (!filter) return; + const { exclude, include } = normalizeFilter(filter); + const excludeFilter = exclude?.map(patternToCodeFilter); + const includeFilter = include?.map(patternToCodeFilter); + return createFilter(excludeFilter, includeFilter); +} +function createFilterForId(filter) { + const filterFunction = createIdFilter(filter); + return filterFunction ? (id) => !!filterFunction(id) : void 0; +} +function createFilterForTransform(idFilter, codeFilter) { + if (!idFilter && !codeFilter) return; + const idFilterFunction = createIdFilter(idFilter); + const codeFilterFunction = createCodeFilter(codeFilter); + return (id, code) => { + let fallback = true; + if (idFilterFunction) fallback &&= idFilterFunction(id); + if (!fallback) return false; + if (codeFilterFunction) fallback &&= codeFilterFunction(code); + return fallback; + }; +} +function normalizeObjectHook(name, hook) { + let handler; + let filter; + if (typeof hook === "function") handler = hook; + else { + handler = hook.handler; + const hookFilter = hook.filter; + if (name === "resolveId" || name === "load") filter = createFilterForId(hookFilter?.id); + else filter = createFilterForTransform(hookFilter?.id, hookFilter?.code); + } + return { + handler, + filter: filter || (() => true) + }; +} + +//#endregion +//#region src/utils/context.ts +function parse(code, opts = {}) { + return acorn.Parser.parse(code, { + sourceType: "module", + ecmaVersion: "latest", + locations: true, + ...opts + }); +} + +//#endregion +Object.defineProperty(exports, '__toESM', { + enumerable: true, + get: function () { + return __toESM; + } +}); +Object.defineProperty(exports, 'normalizeObjectHook', { + enumerable: true, + get: function () { + return normalizeObjectHook; + } +}); +Object.defineProperty(exports, 'parse', { + enumerable: true, + get: function () { + return parse; + } +}); +Object.defineProperty(exports, 'toArray', { + enumerable: true, + get: function () { + return toArray; + } +}); \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/context-CrbHoDid.cjs b/tools/ui/node_modules/unplugin/dist/context-CrbHoDid.cjs new file mode 100644 index 0000000000000000000000000000000000000000..2805de614f2082898d94572f421fdf704fd7b921 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/context-CrbHoDid.cjs @@ -0,0 +1,69 @@ +const require_context = require('./context-CQfDPcdE.cjs'); +let node_path = require("node:path"); +node_path = require_context.__toESM(node_path); +let node_buffer = require("node:buffer"); +node_buffer = require_context.__toESM(node_buffer); + +//#region src/rspack/context.ts +function createBuildContext(compiler, compilation, loaderContext, inputSourceMap) { + return { + getNativeBuildContext() { + return { + framework: "rspack", + compiler, + compilation, + loaderContext, + inputSourceMap + }; + }, + addWatchFile(file) { + const cwd = process.cwd(); + compilation.fileDependencies.add((0, node_path.resolve)(cwd, file)); + }, + getWatchFiles() { + return Array.from(compilation.fileDependencies); + }, + parse: require_context.parse, + emitFile(emittedFile) { + const outFileName = emittedFile.fileName || emittedFile.name; + if (emittedFile.source && outFileName) { + const { sources } = compilation.compiler.webpack; + compilation.emitAsset(outFileName, new sources.RawSource(typeof emittedFile.source === "string" ? emittedFile.source : node_buffer.Buffer.from(emittedFile.source))); + } + } + }; +} +function createContext(loader) { + return { + error: (error) => loader.emitError(normalizeMessage(error)), + warn: (message) => loader.emitWarning(normalizeMessage(message)) + }; +} +function normalizeMessage(error) { + const err = new Error(typeof error === "string" ? error : error.message); + if (typeof error === "object") { + err.stack = error.stack; + err.cause = error.meta; + } + return err; +} + +//#endregion +Object.defineProperty(exports, 'createBuildContext', { + enumerable: true, + get: function () { + return createBuildContext; + } +}); +Object.defineProperty(exports, 'createContext', { + enumerable: true, + get: function () { + return createContext; + } +}); +Object.defineProperty(exports, 'normalizeMessage', { + enumerable: true, + get: function () { + return normalizeMessage; + } +}); \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/context-Csj9j3eN.js b/tools/ui/node_modules/unplugin/dist/context-Csj9j3eN.js new file mode 100644 index 0000000000000000000000000000000000000000..2af37f5cd5a58502812d3bd141ea2dc013f4541f --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/context-Csj9j3eN.js @@ -0,0 +1,120 @@ +import { resolve } from "node:path"; +import picomatch from "picomatch"; +import { Parser } from "acorn"; + +//#region src/utils/general.ts +function toArray(array) { + array = array || []; + if (Array.isArray(array)) return array; + return [array]; +} + +//#endregion +//#region src/utils/filter.ts +const BACKSLASH_REGEX = /\\/g; +function normalize$1(path$1) { + return path$1.replace(BACKSLASH_REGEX, "/"); +} +const ABSOLUTE_PATH_REGEX = /^(?:\/|(?:[A-Z]:)?[/\\|])/i; +function isAbsolute$1(path$1) { + return ABSOLUTE_PATH_REGEX.test(path$1); +} +function getMatcherString(glob, cwd) { + if (glob.startsWith("**") || isAbsolute$1(glob)) return normalize$1(glob); + return normalize$1(resolve(cwd, glob)); +} +function patternToIdFilter(pattern) { + if (pattern instanceof RegExp) return (id) => { + const normalizedId = normalize$1(id); + const result = pattern.test(normalizedId); + pattern.lastIndex = 0; + return result; + }; + const matcher = picomatch(getMatcherString(pattern, process.cwd()), { dot: true }); + return (id) => { + return matcher(normalize$1(id)); + }; +} +function patternToCodeFilter(pattern) { + if (pattern instanceof RegExp) return (code) => { + const result = pattern.test(code); + pattern.lastIndex = 0; + return result; + }; + return (code) => code.includes(pattern); +} +function createFilter(exclude, include) { + if (!exclude && !include) return; + return (input) => { + if (exclude?.some((filter) => filter(input))) return false; + if (include?.some((filter) => filter(input))) return true; + return !(include && include.length > 0); + }; +} +function normalizeFilter(filter) { + if (typeof filter === "string" || filter instanceof RegExp) return { include: [filter] }; + if (Array.isArray(filter)) return { include: filter }; + return { + exclude: filter.exclude ? toArray(filter.exclude) : void 0, + include: filter.include ? toArray(filter.include) : void 0 + }; +} +function createIdFilter(filter) { + if (!filter) return; + const { exclude, include } = normalizeFilter(filter); + const excludeFilter = exclude?.map(patternToIdFilter); + const includeFilter = include?.map(patternToIdFilter); + return createFilter(excludeFilter, includeFilter); +} +function createCodeFilter(filter) { + if (!filter) return; + const { exclude, include } = normalizeFilter(filter); + const excludeFilter = exclude?.map(patternToCodeFilter); + const includeFilter = include?.map(patternToCodeFilter); + return createFilter(excludeFilter, includeFilter); +} +function createFilterForId(filter) { + const filterFunction = createIdFilter(filter); + return filterFunction ? (id) => !!filterFunction(id) : void 0; +} +function createFilterForTransform(idFilter, codeFilter) { + if (!idFilter && !codeFilter) return; + const idFilterFunction = createIdFilter(idFilter); + const codeFilterFunction = createCodeFilter(codeFilter); + return (id, code) => { + let fallback = true; + if (idFilterFunction) fallback &&= idFilterFunction(id); + if (!fallback) return false; + if (codeFilterFunction) fallback &&= codeFilterFunction(code); + return fallback; + }; +} +function normalizeObjectHook(name, hook) { + let handler; + let filter; + if (typeof hook === "function") handler = hook; + else { + handler = hook.handler; + const hookFilter = hook.filter; + if (name === "resolveId" || name === "load") filter = createFilterForId(hookFilter?.id); + else filter = createFilterForTransform(hookFilter?.id, hookFilter?.code); + } + return { + handler, + filter: filter || (() => true) + }; +} + +//#endregion +//#region src/utils/context.ts +function parse(code, opts = {}) { + return Parser.parse(code, { + sourceType: "module", + ecmaVersion: "latest", + locations: true, + ...opts + }); +} + +//#endregion +export { normalizeObjectHook as n, toArray as r, parse as t }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/context-D7WFmOmt.cjs b/tools/ui/node_modules/unplugin/dist/context-D7WFmOmt.cjs new file mode 100644 index 0000000000000000000000000000000000000000..b11158f0eeeb70f95c0bb864121387c38d371a63 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/context-D7WFmOmt.cjs @@ -0,0 +1,92 @@ +const require_context = require('./context-CQfDPcdE.cjs'); +let node_path = require("node:path"); +node_path = require_context.__toESM(node_path); +let node_buffer = require("node:buffer"); +node_buffer = require_context.__toESM(node_buffer); +let node_process = require("node:process"); +node_process = require_context.__toESM(node_process); +let node_module = require("node:module"); +node_module = require_context.__toESM(node_module); + +//#region src/webpack/context.ts +function contextOptionsFromCompilation(compilation) { + return { + addWatchFile(file) { + (compilation.fileDependencies ?? compilation.compilationDependencies).add(file); + }, + getWatchFiles() { + return Array.from(compilation.fileDependencies ?? compilation.compilationDependencies); + } + }; +} +const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href); +function getSource(fileSource) { + return new (require$1("webpack")).sources.RawSource(typeof fileSource === "string" ? fileSource : node_buffer.Buffer.from(fileSource.buffer)); +} +function createBuildContext(options, compiler, compilation, loaderContext, inputSourceMap) { + return { + parse: require_context.parse, + addWatchFile(id) { + options.addWatchFile((0, node_path.resolve)(node_process.default.cwd(), id)); + }, + emitFile(emittedFile) { + const outFileName = emittedFile.fileName || emittedFile.name; + if (emittedFile.source && outFileName) { + if (!compilation) throw new Error("unplugin/webpack: emitFile outside supported hooks (buildStart, buildEnd, load, transform, watchChange)"); + compilation.emitAsset(outFileName, getSource(emittedFile.source)); + } + }, + getWatchFiles() { + return options.getWatchFiles(); + }, + getNativeBuildContext() { + return { + framework: "webpack", + compiler, + compilation, + loaderContext, + inputSourceMap + }; + } + }; +} +function createContext(loader) { + return { + error: (error) => loader.emitError(normalizeMessage(error)), + warn: (message) => loader.emitWarning(normalizeMessage(message)) + }; +} +function normalizeMessage(error) { + const err = new Error(typeof error === "string" ? error : error.message); + if (typeof error === "object") { + err.stack = error.stack; + err.cause = error.meta; + } + return err; +} + +//#endregion +Object.defineProperty(exports, 'contextOptionsFromCompilation', { + enumerable: true, + get: function () { + return contextOptionsFromCompilation; + } +}); +Object.defineProperty(exports, 'createBuildContext', { + enumerable: true, + get: function () { + return createBuildContext; + } +}); +Object.defineProperty(exports, 'createContext', { + enumerable: true, + get: function () { + return createContext; + } +}); +Object.defineProperty(exports, 'normalizeMessage', { + enumerable: true, + get: function () { + return normalizeMessage; + } +}); \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/context-DkYlx1xL.js b/tools/ui/node_modules/unplugin/dist/context-DkYlx1xL.js new file mode 100644 index 0000000000000000000000000000000000000000..3669ecc263bc94217f3f73c06b509dcfb19787eb --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/context-DkYlx1xL.js @@ -0,0 +1,50 @@ +import { t as parse } from "./context-Csj9j3eN.js"; +import { resolve } from "node:path"; +import { Buffer } from "node:buffer"; + +//#region src/rspack/context.ts +function createBuildContext(compiler, compilation, loaderContext, inputSourceMap) { + return { + getNativeBuildContext() { + return { + framework: "rspack", + compiler, + compilation, + loaderContext, + inputSourceMap + }; + }, + addWatchFile(file) { + const cwd = process.cwd(); + compilation.fileDependencies.add(resolve(cwd, file)); + }, + getWatchFiles() { + return Array.from(compilation.fileDependencies); + }, + parse, + emitFile(emittedFile) { + const outFileName = emittedFile.fileName || emittedFile.name; + if (emittedFile.source && outFileName) { + const { sources } = compilation.compiler.webpack; + compilation.emitAsset(outFileName, new sources.RawSource(typeof emittedFile.source === "string" ? emittedFile.source : Buffer.from(emittedFile.source))); + } + } + }; +} +function createContext(loader) { + return { + error: (error) => loader.emitError(normalizeMessage(error)), + warn: (message) => loader.emitWarning(normalizeMessage(message)) + }; +} +function normalizeMessage(error) { + const err = new Error(typeof error === "string" ? error : error.message); + if (typeof error === "object") { + err.stack = error.stack; + err.cause = error.meta; + } + return err; +} + +//#endregion +export { createContext as n, normalizeMessage as r, createBuildContext as t }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/context-OCFO8EW1.js b/tools/ui/node_modules/unplugin/dist/context-OCFO8EW1.js new file mode 100644 index 0000000000000000000000000000000000000000..8d2e9dfcde21bab2896229748b3976b354eb2f9b --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/context-OCFO8EW1.js @@ -0,0 +1,65 @@ +import { t as parse } from "./context-Csj9j3eN.js"; +import { createRequire } from "node:module"; +import { resolve } from "node:path"; +import { Buffer } from "node:buffer"; +import process from "node:process"; + +//#region src/webpack/context.ts +function contextOptionsFromCompilation(compilation) { + return { + addWatchFile(file) { + (compilation.fileDependencies ?? compilation.compilationDependencies).add(file); + }, + getWatchFiles() { + return Array.from(compilation.fileDependencies ?? compilation.compilationDependencies); + } + }; +} +const require = createRequire(import.meta.url); +function getSource(fileSource) { + return new (require("webpack")).sources.RawSource(typeof fileSource === "string" ? fileSource : Buffer.from(fileSource.buffer)); +} +function createBuildContext(options, compiler, compilation, loaderContext, inputSourceMap) { + return { + parse, + addWatchFile(id) { + options.addWatchFile(resolve(process.cwd(), id)); + }, + emitFile(emittedFile) { + const outFileName = emittedFile.fileName || emittedFile.name; + if (emittedFile.source && outFileName) { + if (!compilation) throw new Error("unplugin/webpack: emitFile outside supported hooks (buildStart, buildEnd, load, transform, watchChange)"); + compilation.emitAsset(outFileName, getSource(emittedFile.source)); + } + }, + getWatchFiles() { + return options.getWatchFiles(); + }, + getNativeBuildContext() { + return { + framework: "webpack", + compiler, + compilation, + loaderContext, + inputSourceMap + }; + } + }; +} +function createContext(loader) { + return { + error: (error) => loader.emitError(normalizeMessage(error)), + warn: (message) => loader.emitWarning(normalizeMessage(message)) + }; +} +function normalizeMessage(error) { + const err = new Error(typeof error === "string" ? error : error.message); + if (typeof error === "object") { + err.stack = error.stack; + err.cause = error.meta; + } + return err; +} + +//#endregion +export { normalizeMessage as i, createBuildContext as n, createContext as r, contextOptionsFromCompilation as t }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/index.cjs b/tools/ui/node_modules/unplugin/dist/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..ea16378374869fad2350a468f8fb6298ba94ba97 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/index.cjs @@ -0,0 +1,1013 @@ +const require_context = require('./context-CQfDPcdE.cjs'); +const require_webpack_like = require('./webpack-like-DDVwPJ4e.cjs'); +const require_context$1 = require('./context-CrbHoDid.cjs'); +const require_utils = require('./utils-CJMEEaD7.cjs'); +const require_context$2 = require('./context-D7WFmOmt.cjs'); +let node_fs = require("node:fs"); +node_fs = require_context.__toESM(node_fs); +let node_path = require("node:path"); +node_path = require_context.__toESM(node_path); +let node_buffer = require("node:buffer"); +node_buffer = require_context.__toESM(node_buffer); +let __jridgewell_remapping = require("@jridgewell/remapping"); +__jridgewell_remapping = require_context.__toESM(__jridgewell_remapping); +let node_querystring = require("node:querystring"); +node_querystring = require_context.__toESM(node_querystring); +let node_process = require("node:process"); +node_process = require_context.__toESM(node_process); +let webpack_virtual_modules = require("webpack-virtual-modules"); +webpack_virtual_modules = require_context.__toESM(webpack_virtual_modules); + +//#region src/esbuild/utils.ts +const ExtToLoader = { + ".js": "js", + ".mjs": "js", + ".cjs": "js", + ".jsx": "jsx", + ".ts": "ts", + ".cts": "ts", + ".mts": "ts", + ".tsx": "tsx", + ".css": "css", + ".less": "css", + ".stylus": "css", + ".scss": "css", + ".sass": "css", + ".json": "json", + ".txt": "text" +}; +function guessLoader(code, id) { + return ExtToLoader[node_path.default.extname(id).toLowerCase()] || "js"; +} +function unwrapLoader(loader, code, id) { + if (typeof loader === "function") return loader(code, id); + return loader; +} +function fixSourceMap(map) { + if (!Object.prototype.hasOwnProperty.call(map, "toString")) Object.defineProperty(map, "toString", { + enumerable: false, + value: function toString() { + return JSON.stringify(this); + } + }); + if (!Object.prototype.hasOwnProperty.call(map, "toUrl")) Object.defineProperty(map, "toUrl", { + enumerable: false, + value: function toUrl() { + return `data:application/json;charset=utf-8;base64,${node_buffer.Buffer.from(this.toString()).toString("base64")}`; + } + }); + return map; +} +const nullSourceMap = { + names: [], + sources: [], + mappings: "", + version: 3 +}; +function combineSourcemaps(filename, sourcemapList) { + sourcemapList = sourcemapList.filter((m) => m.sources); + if (sourcemapList.length === 0 || sourcemapList.every((m) => m.sources.length === 0)) return { ...nullSourceMap }; + let map; + let mapIndex = 1; + if (sourcemapList.slice(0, -1).find((m) => m.sources.length !== 1) === void 0) map = (0, __jridgewell_remapping.default)(sourcemapList, () => null, true); + else map = (0, __jridgewell_remapping.default)(sourcemapList[0], (sourcefile) => { + if (sourcefile === filename && sourcemapList[mapIndex]) return sourcemapList[mapIndex++]; + else return { ...nullSourceMap }; + }, true); + if (!map.file) delete map.file; + return map; +} +function createBuildContext$2(build) { + const watchFiles = []; + const { initialOptions } = build; + return { + parse: require_context.parse, + addWatchFile() { + throw new Error("unplugin/esbuild: addWatchFile outside supported hooks (resolveId, load, transform)"); + }, + emitFile(emittedFile) { + const outFileName = emittedFile.fileName || emittedFile.name; + if (initialOptions.outdir && emittedFile.source && outFileName) { + const outPath = node_path.default.resolve(initialOptions.outdir, outFileName); + const outDir = node_path.default.dirname(outPath); + if (!node_fs.default.existsSync(outDir)) node_fs.default.mkdirSync(outDir, { recursive: true }); + node_fs.default.writeFileSync(outPath, emittedFile.source); + } + }, + getWatchFiles() { + return watchFiles; + }, + getNativeBuildContext() { + return { + framework: "esbuild", + build + }; + } + }; +} +function createPluginContext(context) { + const errors = []; + const warnings = []; + const pluginContext = { + error(message) { + errors.push(normalizeMessage$2(message)); + }, + warn(message) { + warnings.push(normalizeMessage$2(message)); + } + }; + return { + errors, + warnings, + mixedContext: { + ...context, + ...pluginContext, + addWatchFile(id) { + context.getWatchFiles().push(id); + } + } + }; +} +function normalizeMessage$2(message) { + if (typeof message === "string") message = { message }; + return { + id: message.id, + pluginName: message.plugin, + text: message.message, + location: message.loc ? { + file: message.loc.file, + line: message.loc.line, + column: message.loc.column + } : null, + detail: message.meta, + notes: [] + }; +} +function processCodeWithSourceMap(map, code) { + if (map) { + if (!map.sourcesContent || map.sourcesContent.length === 0) map.sourcesContent = [code]; + map = fixSourceMap(map); + code += `\n//# sourceMappingURL=${map.toUrl()}`; + } + return code; +} + +//#endregion +//#region src/esbuild/index.ts +function getEsbuildPlugin(factory) { + return (userOptions) => { + const meta = { framework: "esbuild" }; + const plugins = require_context.toArray(factory(userOptions, meta)); + const setupPlugins = async (build) => { + const setup = buildSetup(); + const loaders = []; + for (const plugin of plugins) { + const loader = {}; + await setup(plugin)({ + ...build, + onLoad(_options, callback) { + loader.options = _options; + loader.onLoadCb = callback; + }, + onTransform(_options, callback) { + loader.options ||= _options; + loader.onTransformCb = callback; + } + }, build); + if (loader.onLoadCb || loader.onTransformCb) loaders.push(loader); + } + if (loaders.length) build.onLoad(loaders.length === 1 ? loaders[0].options : { filter: /.*/ }, async (args) => { + function checkFilter(options) { + return loaders.length === 1 || !options?.filter || options.filter.test(args.path); + } + let result; + for (const { options, onLoadCb } of loaders) { + if (!checkFilter(options)) continue; + if (onLoadCb) result = await onLoadCb(args); + if (result?.contents) break; + } + let fsContentsCache; + for (const { options, onTransformCb } of loaders) { + if (!checkFilter(options)) continue; + if (onTransformCb) { + const _result = await onTransformCb({ + ...result, + ...args, + async getContents() { + if (result?.contents) return result.contents; + if (fsContentsCache) return fsContentsCache; + return fsContentsCache = await node_fs.default.promises.readFile(args.path, "utf8"); + } + }); + if (_result?.contents) result = _result; + } + } + if (result?.contents) return result; + }); + }; + return { + name: (plugins.length === 1 ? plugins[0].name : meta.esbuildHostName) ?? `unplugin-host:${plugins.map((p) => p.name).join(":")}`, + setup: setupPlugins + }; + }; +} +function buildSetup() { + return (plugin) => { + return (build, rawBuild) => { + const context = createBuildContext$2(rawBuild); + const { onStart, onEnd, onResolve, onLoad, onTransform, initialOptions } = build; + const onResolveFilter = plugin.esbuild?.onResolveFilter ?? /.*/; + const onLoadFilter = plugin.esbuild?.onLoadFilter ?? /.*/; + const loader = plugin.esbuild?.loader ?? guessLoader; + plugin.esbuild?.config?.call(context, initialOptions); + if (plugin.buildStart) onStart(() => plugin.buildStart.call(context)); + if (plugin.buildEnd || plugin.writeBundle) onEnd(async () => { + if (plugin.buildEnd) await plugin.buildEnd.call(context); + if (plugin.writeBundle) await plugin.writeBundle(); + }); + if (plugin.resolveId) onResolve({ filter: onResolveFilter }, async (args) => { + const id = args.path; + if (initialOptions.external?.includes(id)) return; + const { handler, filter } = require_context.normalizeObjectHook("resolveId", plugin.resolveId); + if (!filter(id)) return; + const { errors, warnings, mixedContext } = createPluginContext(context); + const isEntry = args.kind === "entry-point"; + const result = await handler.call(mixedContext, id, isEntry ? void 0 : args.importer, { isEntry }); + if (typeof result === "string") return { + path: result, + namespace: plugin.name, + errors, + warnings, + watchFiles: mixedContext.getWatchFiles() + }; + else if (typeof result === "object" && result !== null) return { + path: result.id, + external: result.external, + namespace: plugin.name, + errors, + warnings, + watchFiles: mixedContext.getWatchFiles() + }; + }); + if (plugin.load) onLoad({ filter: onLoadFilter }, async (args) => { + const { handler, filter } = require_context.normalizeObjectHook("load", plugin.load); + const id = args.path + (args.suffix || ""); + if (plugin.loadInclude && !plugin.loadInclude(id)) return; + if (!filter(id)) return; + const { errors, warnings, mixedContext } = createPluginContext(context); + let code; + let map; + const result = await handler.call(mixedContext, id); + if (typeof result === "string") code = result; + else if (typeof result === "object" && result !== null) { + code = result.code; + map = result.map; + } + if (code === void 0) return null; + if (map) code = processCodeWithSourceMap(map, code); + const resolveDir = node_path.default.dirname(args.path); + return { + contents: code, + errors, + warnings, + watchFiles: mixedContext.getWatchFiles(), + loader: unwrapLoader(loader, code, args.path), + resolveDir + }; + }); + if (plugin.transform) onTransform({ filter: onLoadFilter }, async (args) => { + const { handler, filter } = require_context.normalizeObjectHook("transform", plugin.transform); + const id = args.path + (args.suffix || ""); + if (plugin.transformInclude && !plugin.transformInclude(id)) return; + let code = await args.getContents(); + if (!filter(id, code)) return; + const { mixedContext, errors, warnings } = createPluginContext(context); + const resolveDir = node_path.default.dirname(args.path); + let map; + const result = await handler.call(mixedContext, code, id); + if (typeof result === "string") code = result; + else if (typeof result === "object" && result !== null) { + code = result.code; + if (map && result.map) map = combineSourcemaps(args.path, [result.map === "string" ? JSON.parse(result.map) : result.map, map]); + else if (typeof result.map === "string") map = JSON.parse(result.map); + else map = result.map; + } + if (code) { + if (map) code = processCodeWithSourceMap(map, code); + return { + contents: code, + errors, + warnings, + watchFiles: mixedContext.getWatchFiles(), + loader: unwrapLoader(loader, code, args.path), + resolveDir + }; + } + }); + if (plugin.esbuild?.setup) return plugin.esbuild.setup(rawBuild); + }; + }; +} + +//#endregion +//#region src/farm/context.ts +function createFarmContext(context, currentResolveId) { + return { + parse: require_context.parse, + addWatchFile(id) { + context.addWatchFile(id, currentResolveId || id); + }, + emitFile(emittedFile) { + const outFileName = emittedFile.fileName || emittedFile.name; + if (emittedFile.source && outFileName) context.emitFile({ + resolvedPath: outFileName, + name: outFileName, + content: [...node_buffer.Buffer.from(emittedFile.source)], + resourceType: (0, node_path.extname)(outFileName) + }); + }, + getWatchFiles() { + return context.getWatchFiles(); + }, + getNativeBuildContext() { + return { + framework: "farm", + context + }; + } + }; +} +function unpluginContext(context) { + return { + error: (error) => context.error(typeof error === "string" ? new Error(error) : error), + warn: (error) => context.warn(typeof error === "string" ? new Error(error) : error) + }; +} + +//#endregion +//#region src/farm/utils.ts +function convertEnforceToPriority(value) { + const defaultPriority = 100; + const enforceToPriority = { + pre: 102, + post: 98 + }; + return enforceToPriority[value] !== void 0 ? enforceToPriority[value] : defaultPriority; +} +function convertWatchEventChange(value) { + return { + Added: "create", + Updated: "update", + Removed: "delete" + }[value]; +} +function isString(variable) { + return typeof variable === "string"; +} +function isObject(variable) { + return typeof variable === "object" && variable !== null; +} +function customParseQueryString(url) { + if (!url) return []; + const queryString = url.split("?")[1]; + const parsedParams = node_querystring.parse(queryString); + const paramsArray = []; + for (const key in parsedParams) paramsArray.push([key, parsedParams[key]]); + return paramsArray; +} +function encodeStr(str) { + const len = str.length; + if (len === 0) return str; + const firstNullIndex = str.indexOf("\0"); + if (firstNullIndex === -1) return str; + const result = Array.from({ length: len + countNulls(str, firstNullIndex) }); + let pos = 0; + for (let i = 0; i < firstNullIndex; i++) result[pos++] = str[i]; + for (let i = firstNullIndex; i < len; i++) { + const char = str[i]; + if (char === "\0") { + result[pos++] = "\\"; + result[pos++] = "0"; + } else result[pos++] = char; + } + return node_path.default.posix.normalize(result.join("")); +} +function decodeStr(str) { + const len = str.length; + if (len === 0) return str; + const firstIndex = str.indexOf("\\0"); + if (firstIndex === -1) return str; + const result = Array.from({ length: len - countBackslashZeros(str, firstIndex) }); + let pos = 0; + for (let i$1 = 0; i$1 < firstIndex; i$1++) result[pos++] = str[i$1]; + let i = firstIndex; + while (i < len) if (str[i] === "\\" && str[i + 1] === "0") { + result[pos++] = "\0"; + i += 2; + } else result[pos++] = str[i++]; + return node_path.default.posix.normalize(result.join("")); +} +function getContentValue(content) { + if (content === null || content === void 0) throw new Error("Content cannot be null or undefined"); + return encodeStr(typeof content === "string" ? content : content.code || ""); +} +function countNulls(str, startIndex) { + let count = 0; + const len = str.length; + for (let i = startIndex; i < len; i++) if (str[i] === "\0") count++; + return count; +} +function countBackslashZeros(str, startIndex) { + let count = 0; + const len = str.length; + for (let i = startIndex; i < len - 1; i++) if (str[i] === "\\" && str[i + 1] === "0") { + count++; + i++; + } + return count; +} +function removeQuery(pathe) { + const queryIndex = pathe.indexOf("?"); + if (queryIndex !== -1) return node_path.default.posix.normalize(pathe.slice(0, queryIndex)); + return node_path.default.posix.normalize(pathe); +} +function isStartsWithSlash(str) { + return str?.startsWith("/"); +} +function appendQuery(id, query) { + if (!query.length) return id; + return `${id}?${stringifyQuery(query)}`; +} +function stringifyQuery(query) { + if (!query.length) return ""; + let queryStr = ""; + for (const [key, value] of query) queryStr += `${key}${value ? `=${value}` : ""}&`; + return `${queryStr.slice(0, -1)}`; +} +const CSS_LANGS_RES = [ + [/\.(less)(?:$|\?)/, "less"], + [/\.(scss|sass)(?:$|\?)/, "sass"], + [/\.(styl|stylus)(?:$|\?)/, "stylus"], + [/\.(css)(?:$|\?)/, "css"] +]; +const JS_LANGS_RES = [ + [/\.(js|mjs|cjs)(?:$|\?)/, "js"], + [/\.(jsx)(?:$|\?)/, "jsx"], + [/\.(ts|cts|mts)(?:$|\?)/, "ts"], + [/\.(tsx)(?:$|\?)/, "tsx"] +]; +function getCssModuleType(id) { + for (const [reg, lang] of CSS_LANGS_RES) if (reg.test(id)) return lang; + return null; +} +function getJsModuleType(id) { + for (const [reg, lang] of JS_LANGS_RES) if (reg.test(id)) return lang; + return null; +} +function formatLoadModuleType(id) { + const cssModuleType = getCssModuleType(id); + if (cssModuleType) return cssModuleType; + const jsModuleType = getJsModuleType(id); + if (jsModuleType) return jsModuleType; + return "js"; +} +function formatTransformModuleType(id) { + return formatLoadModuleType(id); +} + +//#endregion +//#region src/farm/index.ts +function getFarmPlugin(factory) { + return ((userOptions) => { + const plugins = require_context.toArray(factory(userOptions, { framework: "farm" })).map((rawPlugin) => { + const plugin = toFarmPlugin(rawPlugin, userOptions); + if (rawPlugin.farm) Object.assign(plugin, rawPlugin.farm); + return plugin; + }); + return plugins.length === 1 ? plugins[0] : plugins; + }); +} +function toFarmPlugin(plugin, options) { + const farmPlugin = { + name: plugin.name, + priority: convertEnforceToPriority(plugin.enforce) + }; + if (plugin.farm) Object.keys(plugin.farm).forEach((key) => { + const value = plugin.farm[key]; + if (value) Reflect.set(farmPlugin, key, value); + }); + if (plugin.buildStart) { + const _buildStart = plugin.buildStart; + farmPlugin.buildStart = { async executor(_, context) { + await _buildStart.call(createFarmContext(context)); + } }; + } + if (plugin.resolveId) { + const _resolveId = plugin.resolveId; + let filters = []; + if (options) filters = options?.filters ?? []; + farmPlugin.resolve = { + filters: { + sources: filters.length ? filters : [".*"], + importers: [".*"] + }, + async executor(params, context) { + const resolvedIdPath = node_path.default.resolve(params.importer ?? ""); + const id = decodeStr(params.source); + const { handler, filter } = require_context.normalizeObjectHook("resolveId", _resolveId); + if (!filter(id)) return null; + let isEntry = false; + if (isObject(params.kind) && "entry" in params.kind) isEntry = params.kind.entry === "index"; + const farmContext = createFarmContext(context, resolvedIdPath); + const resolveIdResult = await handler.call(Object.assign(unpluginContext(context), farmContext), id, resolvedIdPath ?? null, { isEntry }); + if (isString(resolveIdResult)) return { + resolvedPath: removeQuery(encodeStr(resolveIdResult)), + query: customParseQueryString(resolveIdResult), + sideEffects: true, + external: false, + meta: {} + }; + if (isObject(resolveIdResult)) return { + resolvedPath: removeQuery(encodeStr(resolveIdResult?.id)), + query: customParseQueryString(resolveIdResult?.id), + sideEffects: false, + external: Boolean(resolveIdResult?.external), + meta: {} + }; + if (!isStartsWithSlash(params.source)) return null; + } + }; + } + if (plugin.load) { + const _load = plugin.load; + farmPlugin.load = { + filters: { resolvedPaths: [".*"] }, + async executor(params, context) { + const id = appendQuery(decodeStr(params.resolvedPath), params.query); + const loader = formatTransformModuleType(id); + if (plugin.loadInclude && !plugin.loadInclude?.(id)) return null; + const { handler, filter } = require_context.normalizeObjectHook("load", _load); + if (!filter(id)) return null; + const farmContext = createFarmContext(context, id); + return { + content: getContentValue(await handler.call(Object.assign(unpluginContext(context), farmContext), id)), + moduleType: loader + }; + } + }; + } + if (plugin.transform) { + const _transform = plugin.transform; + farmPlugin.transform = { + filters: { + resolvedPaths: [".*"], + moduleTypes: [".*"] + }, + async executor(params, context) { + const id = appendQuery(decodeStr(params.resolvedPath), params.query); + const loader = formatTransformModuleType(id); + if (plugin.transformInclude && !plugin.transformInclude(id)) return null; + const { handler, filter } = require_context.normalizeObjectHook("transform", _transform); + if (!filter(id, params.content)) return null; + const farmContext = createFarmContext(context, id); + const resource = await handler.call(Object.assign(unpluginContext(context), farmContext), params.content, id); + if (resource && typeof resource !== "string") return { + content: getContentValue(resource), + moduleType: loader, + sourceMap: typeof resource.map === "object" && resource.map !== null ? JSON.stringify(resource.map) : void 0 + }; + } + }; + } + if (plugin.watchChange) { + const _watchChange = plugin.watchChange; + farmPlugin.updateModules = { async executor(param, context) { + const updatePathContent = param.paths[0]; + const ModifiedPath = updatePathContent[0]; + const eventChange = convertWatchEventChange(updatePathContent[1]); + await _watchChange.call(createFarmContext(context), ModifiedPath, { event: eventChange }); + } }; + } + if (plugin.buildEnd) { + const _buildEnd = plugin.buildEnd; + farmPlugin.buildEnd = { async executor(_, context) { + await _buildEnd.call(createFarmContext(context)); + } }; + } + if (plugin.writeBundle) { + const _writeBundle = plugin.writeBundle; + farmPlugin.finish = { async executor() { + await _writeBundle(); + } }; + } + return farmPlugin; +} + +//#endregion +//#region src/rollup/index.ts +function getRollupPlugin(factory) { + return ((userOptions) => { + const plugins = require_context.toArray(factory(userOptions, { framework: "rollup" })).map((plugin) => toRollupPlugin(plugin, "rollup")); + return plugins.length === 1 ? plugins[0] : plugins; + }); +} +function toRollupPlugin(plugin, key) { + const nativeFilter = key === "rolldown"; + if (plugin.resolveId && !nativeFilter && typeof plugin.resolveId === "object" && plugin.resolveId.filter) { + const resolveIdHook = plugin.resolveId; + const { handler, filter } = require_context.normalizeObjectHook("load", resolveIdHook); + replaceHookHandler("resolveId", resolveIdHook, function(...args) { + const [id] = args; + if (!supportNativeFilter(this, key) && !filter(id)) return; + return handler.apply(this, args); + }); + } + if (plugin.load && (plugin.loadInclude || !nativeFilter && typeof plugin.load === "object" && plugin.load.filter)) { + const loadHook = plugin.load; + const { handler, filter } = require_context.normalizeObjectHook("load", loadHook); + replaceHookHandler("load", loadHook, function(...args) { + const [id] = args; + if (plugin.loadInclude && !plugin.loadInclude(id)) return; + if (!supportNativeFilter(this, key) && !filter(id)) return; + return handler.apply(this, args); + }); + } + if (plugin.transform && (plugin.transformInclude || !nativeFilter && typeof plugin.transform === "object" && plugin.transform.filter)) { + const transformHook = plugin.transform; + const { handler, filter } = require_context.normalizeObjectHook("transform", transformHook); + replaceHookHandler("transform", transformHook, function(...args) { + const [code, id] = args; + if (plugin.transformInclude && !plugin.transformInclude(id)) return; + if (!supportNativeFilter(this, key) && !filter(id, code)) return; + return handler.apply(this, args); + }); + } + if (plugin[key]) Object.assign(plugin, plugin[key]); + return plugin; + function replaceHookHandler(name, hook, handler) { + if (typeof hook === "function") plugin[name] = handler; + else hook.handler = handler; + } +} +function supportNativeFilter(context, framework) { + if (framework === "unloader") return false; + if (framework === "vite") return !!context?.meta?.viteVersion; + if (framework === "rolldown") return true; + const rollupVersion = context?.meta?.rollupVersion; + if (!rollupVersion) return false; + const [major, minor] = rollupVersion.split("."); + return Number(major) > 4 || Number(major) === 4 && Number(minor) >= 40; +} + +//#endregion +//#region src/rolldown/index.ts +function getRolldownPlugin(factory) { + return ((userOptions) => { + const plugins = require_context.toArray(factory(userOptions, { framework: "rolldown" })).map((rawPlugin) => { + return toRollupPlugin(rawPlugin, "rolldown"); + }); + return plugins.length === 1 ? plugins[0] : plugins; + }); +} + +//#endregion +//#region src/rspack/index.ts +const TRANSFORM_LOADER$1 = (0, node_path.resolve)(__dirname, "rspack/loaders/transform"); +const LOAD_LOADER$1 = (0, node_path.resolve)(__dirname, "rspack/loaders/load"); +function getRspackPlugin(factory) { + return (userOptions) => { + return { apply(compiler) { + const VIRTUAL_MODULE_PREFIX = (0, node_path.resolve)(compiler.options.context ?? process.cwd(), "node_modules/.virtual", compiler.rspack.experiments.VirtualModulesPlugin ? "" : process.pid.toString()); + const meta = { + framework: "rspack", + rspack: { compiler } + }; + const rawPlugins = require_context.toArray(factory(userOptions, meta)); + for (const rawPlugin of rawPlugins) { + const plugin = Object.assign(rawPlugin, { + __unpluginMeta: meta, + __virtualModulePrefix: VIRTUAL_MODULE_PREFIX + }); + const externalModules = /* @__PURE__ */ new Set(); + if (plugin.resolveId) { + const createPlugin = (plugin$1) => { + if (compiler.rspack.experiments.VirtualModulesPlugin) return new compiler.rspack.experiments.VirtualModulesPlugin(); + return new require_utils.FakeVirtualModulesPlugin(plugin$1); + }; + const vfs = createPlugin(plugin); + vfs.apply(compiler); + const vfsModules = /* @__PURE__ */ new Map(); + plugin.__vfsModules = vfsModules; + plugin.__vfs = vfs; + compiler.hooks.compilation.tap(plugin.name, (compilation, { normalModuleFactory }) => { + normalModuleFactory.hooks.resolve.tapPromise(plugin.name, async (resolveData) => { + const id = require_webpack_like.normalizeAbsolutePath(resolveData.request); + const requestContext = resolveData.contextInfo; + let importer = requestContext.issuer !== "" ? requestContext.issuer : void 0; + const isEntry = requestContext.issuer === ""; + if (importer?.startsWith(plugin.__virtualModulePrefix)) importer = decodeURIComponent(importer.slice(plugin.__virtualModulePrefix.length)); + const context = require_context$1.createBuildContext(compiler, compilation); + let error; + const pluginContext = { + error(msg) { + if (error == null) error = require_context$1.normalizeMessage(msg); + else console.error(`unplugin/rspack: multiple errors returned from resolveId hook: ${msg}`); + }, + warn(msg) { + console.warn(`unplugin/rspack: warning from resolveId hook: ${msg}`); + } + }; + const { handler, filter } = require_context.normalizeObjectHook("resolveId", plugin.resolveId); + if (!filter(id)) return; + const resolveIdResult = await handler.call({ + ...context, + ...pluginContext + }, id, importer, { isEntry }); + if (error != null) throw error; + if (resolveIdResult == null) return; + let resolved = typeof resolveIdResult === "string" ? resolveIdResult : resolveIdResult.id; + if (typeof resolveIdResult === "string" ? false : resolveIdResult.external === true) externalModules.add(resolved); + let isVirtual = true; + try { + (compiler.inputFileSystem?.statSync ?? node_fs.default.statSync)(resolved); + isVirtual = false; + } catch { + isVirtual = !require_utils.isVirtualModuleId(resolved, plugin); + } + if (isVirtual) { + const encodedVirtualPath = require_utils.encodeVirtualModuleId(resolved, plugin); + if (!vfsModules.has(resolved)) { + const fsPromise = Promise.resolve(vfs.writeModule(encodedVirtualPath, "")); + vfsModules.set(resolved, fsPromise); + await fsPromise; + } else await vfsModules.get(resolved); + resolved = encodedVirtualPath; + } + resolveData.request = resolved; + }); + }); + } + if (plugin.load) compiler.options.module.rules.unshift({ + enforce: plugin.enforce, + include(id) { + if (require_utils.isVirtualModuleId(id, plugin)) id = require_utils.decodeVirtualModuleId(id, plugin); + if (plugin.loadInclude && !plugin.loadInclude(id)) return false; + const { filter } = require_context.normalizeObjectHook("load", plugin.load); + if (!filter(id)) return false; + return !externalModules.has(id); + }, + use: [{ + loader: LOAD_LOADER$1, + options: { plugin } + }], + type: "javascript/auto" + }); + if (plugin.transform) compiler.options.module.rules.unshift({ + enforce: plugin.enforce, + use(data) { + return require_webpack_like.transformUse(data, plugin, TRANSFORM_LOADER$1); + } + }); + if (plugin.rspack) plugin.rspack(compiler); + if (plugin.watchChange || plugin.buildStart) compiler.hooks.make.tapPromise(plugin.name, async (compilation) => { + const context = require_context$1.createBuildContext(compiler, compilation); + if (plugin.watchChange && (compiler.modifiedFiles || compiler.removedFiles)) { + const promises = []; + if (compiler.modifiedFiles) compiler.modifiedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "update" })))); + if (compiler.removedFiles) compiler.removedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "delete" })))); + await Promise.all(promises); + } + if (plugin.buildStart) return await plugin.buildStart.call(context); + }); + if (plugin.buildEnd) compiler.hooks.emit.tapPromise(plugin.name, async (compilation) => { + await plugin.buildEnd.call(require_context$1.createBuildContext(compiler, compilation)); + }); + if (plugin.writeBundle) compiler.hooks.afterEmit.tapPromise(plugin.name, async () => { + await plugin.writeBundle(); + }); + } + } }; + }; +} + +//#endregion +//#region src/unloader/index.ts +function getUnloaderPlugin(factory) { + return ((userOptions) => { + const plugins = require_context.toArray(factory(userOptions, { framework: "unloader" })).map((rawPlugin) => { + return toRollupPlugin(rawPlugin, "unloader"); + }); + return plugins.length === 1 ? plugins[0] : plugins; + }); +} + +//#endregion +//#region src/vite/index.ts +function getVitePlugin(factory) { + return ((userOptions) => { + const plugins = require_context.toArray(factory(userOptions, { framework: "vite" })).map((rawPlugin) => { + return toRollupPlugin(rawPlugin, "vite"); + }); + return plugins.length === 1 ? plugins[0] : plugins; + }); +} + +//#endregion +//#region src/webpack/index.ts +const TRANSFORM_LOADER = (0, node_path.resolve)(__dirname, "webpack/loaders/transform"); +const LOAD_LOADER = (0, node_path.resolve)(__dirname, "webpack/loaders/load"); +function getWebpackPlugin(factory) { + return (userOptions) => { + return { apply(compiler) { + const VIRTUAL_MODULE_PREFIX = (0, node_path.resolve)(compiler.options.context ?? node_process.default.cwd(), "_virtual_"); + const meta = { + framework: "webpack", + webpack: { compiler } + }; + const rawPlugins = require_context.toArray(factory(userOptions, meta)); + for (const rawPlugin of rawPlugins) { + const plugin = Object.assign(rawPlugin, { + __unpluginMeta: meta, + __virtualModulePrefix: VIRTUAL_MODULE_PREFIX + }); + const externalModules = /* @__PURE__ */ new Set(); + if (plugin.resolveId) { + let vfs = compiler.options.plugins.find((i) => i instanceof webpack_virtual_modules.default); + if (!vfs) { + vfs = new webpack_virtual_modules.default(); + compiler.options.plugins.push(vfs); + } + const vfsModules = /* @__PURE__ */ new Set(); + plugin.__vfsModules = vfsModules; + plugin.__vfs = vfs; + const resolverPlugin = { apply(resolver) { + const target = resolver.ensureHook("resolve"); + resolver.getHook("resolve").tapAsync(plugin.name, async (request, resolveContext, callback) => { + if (!request.request) return callback(); + if (require_webpack_like.normalizeAbsolutePath(request.request).startsWith(plugin.__virtualModulePrefix)) return callback(); + const id = require_webpack_like.normalizeAbsolutePath(request.request); + const requestContext = request.context; + let importer = requestContext.issuer !== "" ? requestContext.issuer : void 0; + const isEntry = requestContext.issuer === ""; + if (importer?.startsWith(plugin.__virtualModulePrefix)) importer = decodeURIComponent(importer.slice(plugin.__virtualModulePrefix.length)); + const fileDependencies = /* @__PURE__ */ new Set(); + const context = require_context$2.createBuildContext({ + addWatchFile(file) { + fileDependencies.add(file); + resolveContext.fileDependencies?.add(file); + }, + getWatchFiles() { + return Array.from(fileDependencies); + } + }, compiler); + let error; + const pluginContext = { + error(msg) { + if (error == null) error = require_context$2.normalizeMessage(msg); + else console.error(`unplugin/webpack: multiple errors returned from resolveId hook: ${msg}`); + }, + warn(msg) { + console.warn(`unplugin/webpack: warning from resolveId hook: ${msg}`); + } + }; + const { handler, filter } = require_context.normalizeObjectHook("resolveId", plugin.resolveId); + if (!filter(id)) return callback(); + const resolveIdResult = await handler.call({ + ...context, + ...pluginContext + }, id, importer, { isEntry }); + if (error != null) return callback(error); + if (resolveIdResult == null) return callback(); + let resolved = typeof resolveIdResult === "string" ? resolveIdResult : resolveIdResult.id; + if (typeof resolveIdResult === "string" ? false : resolveIdResult.external === true) externalModules.add(resolved); + if (!node_fs.default.existsSync(resolved)) { + resolved = require_webpack_like.normalizeAbsolutePath(plugin.__virtualModulePrefix + encodeURIComponent(resolved)); + if (!vfsModules.has(resolved)) { + plugin.__vfs.writeModule(resolved, ""); + vfsModules.add(resolved); + } + } + const newRequest = { + ...request, + request: resolved + }; + resolver.doResolve(target, newRequest, null, resolveContext, callback); + }); + } }; + compiler.options.resolve.plugins = compiler.options.resolve.plugins || []; + compiler.options.resolve.plugins.push(resolverPlugin); + } + if (plugin.load) compiler.options.module.rules.unshift({ + include(id) { + return shouldLoad(id, plugin, externalModules); + }, + enforce: plugin.enforce, + use: [{ + loader: LOAD_LOADER, + options: { plugin } + }], + type: "javascript/auto" + }); + if (plugin.transform) compiler.options.module.rules.unshift({ + enforce: plugin.enforce, + use(data) { + return require_webpack_like.transformUse(data, plugin, TRANSFORM_LOADER); + } + }); + if (plugin.webpack) plugin.webpack(compiler); + if (plugin.watchChange || plugin.buildStart) compiler.hooks.make.tapPromise(plugin.name, async (compilation) => { + const context = require_context$2.createBuildContext(require_context$2.contextOptionsFromCompilation(compilation), compiler, compilation); + if (plugin.watchChange && (compiler.modifiedFiles || compiler.removedFiles)) { + const promises = []; + if (compiler.modifiedFiles) compiler.modifiedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "update" })))); + if (compiler.removedFiles) compiler.removedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "delete" })))); + await Promise.all(promises); + } + if (plugin.buildStart) return await plugin.buildStart.call(context); + }); + if (plugin.buildEnd) compiler.hooks.emit.tapPromise(plugin.name, async (compilation) => { + await plugin.buildEnd.call(require_context$2.createBuildContext(require_context$2.contextOptionsFromCompilation(compilation), compiler, compilation)); + }); + if (plugin.writeBundle) compiler.hooks.afterEmit.tapPromise(plugin.name, async () => { + await plugin.writeBundle(); + }); + } + } }; + }; +} +function shouldLoad(id, plugin, externalModules) { + if (id.startsWith(plugin.__virtualModulePrefix)) id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length)); + if (plugin.loadInclude && !plugin.loadInclude(id)) return false; + const { filter } = require_context.normalizeObjectHook("load", plugin.load); + if (!filter(id)) return false; + return !externalModules.has(id); +} + +//#endregion +//#region src/define.ts +function createUnplugin(factory) { + return { + get esbuild() { + return getEsbuildPlugin(factory); + }, + get rollup() { + return getRollupPlugin(factory); + }, + get vite() { + return getVitePlugin(factory); + }, + get rolldown() { + return getRolldownPlugin(factory); + }, + get webpack() { + return getWebpackPlugin(factory); + }, + get rspack() { + return getRspackPlugin(factory); + }, + get farm() { + return getFarmPlugin(factory); + }, + get unloader() { + return getUnloaderPlugin(factory); + }, + get raw() { + return factory; + } + }; +} +function createEsbuildPlugin(factory) { + return getEsbuildPlugin(factory); +} +function createRollupPlugin(factory) { + return getRollupPlugin(factory); +} +function createVitePlugin(factory) { + return getVitePlugin(factory); +} +function createRolldownPlugin(factory) { + return getRolldownPlugin(factory); +} +function createWebpackPlugin(factory) { + return getWebpackPlugin(factory); +} +function createRspackPlugin(factory) { + return getRspackPlugin(factory); +} +function createFarmPlugin(factory) { + return getFarmPlugin(factory); +} +function createUnloaderPlugin(factory) { + return getUnloaderPlugin(factory); +} + +//#endregion +exports.createEsbuildPlugin = createEsbuildPlugin; +exports.createFarmPlugin = createFarmPlugin; +exports.createRolldownPlugin = createRolldownPlugin; +exports.createRollupPlugin = createRollupPlugin; +exports.createRspackPlugin = createRspackPlugin; +exports.createUnloaderPlugin = createUnloaderPlugin; +exports.createUnplugin = createUnplugin; +exports.createVitePlugin = createVitePlugin; +exports.createWebpackPlugin = createWebpackPlugin; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/index.d.cts b/tools/ui/node_modules/unplugin/dist/index.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..0787cb45b4dcdda5a47c5f35c26e230e25aa3910 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/index.d.cts @@ -0,0 +1,198 @@ +import { CompilationContext, JsPlugin } from "@farmfe/core"; +import { Compilation, Compiler as RspackCompiler, LoaderContext, RspackPluginInstance } from "@rspack/core"; +import { BuildOptions, Loader, Plugin as EsbuildPlugin, PluginBuild } from "esbuild"; +import { Plugin as RolldownPlugin } from "rolldown"; +import { AstNode, EmittedAsset, Plugin as RollupPlugin, PluginContextMeta, SourceMapInput } from "rollup"; +import { Plugin as UnloaderPlugin } from "unloader"; +import { Plugin as VitePlugin } from "vite"; +import { Compilation as Compilation$1, Compiler as WebpackCompiler, LoaderContext as LoaderContext$1, WebpackPluginInstance } from "webpack"; +import VirtualModulesPlugin from "webpack-virtual-modules"; + +//#region src/types.d.ts +type Thenable = T | Promise; +/** +* Null or whatever +*/ +type Nullable = T | null | undefined; +/** +* Array, or not yet +*/ +type Arrayable = T | Array; +interface SourceMapCompact { + file?: string | undefined; + mappings: string; + names: string[]; + sourceRoot?: string | undefined; + sources: string[]; + sourcesContent?: (string | null)[] | undefined; + version: number; +} +type TransformResult = string | { + code: string; + map?: SourceMapInput | SourceMapCompact | null | undefined; +} | null | undefined | void; +interface ExternalIdResult { + id: string; + external?: boolean | undefined; +} +type NativeBuildContext = { + framework: "webpack"; + compiler: WebpackCompiler; + compilation?: Compilation$1 | undefined; + loaderContext?: LoaderContext$1<{ + unpluginName: string; + }> | undefined; + inputSourceMap?: any; +} | { + framework: "esbuild"; + build: PluginBuild; +} | { + framework: "rspack"; + compiler: RspackCompiler; + compilation: Compilation; + loaderContext?: LoaderContext | undefined; + inputSourceMap?: any; +} | { + framework: "farm"; + context: CompilationContext; +}; +interface UnpluginBuildContext { + addWatchFile: (id: string) => void; + emitFile: (emittedFile: EmittedAsset) => void; + getWatchFiles: () => string[]; + parse: (input: string, options?: any) => AstNode; + getNativeBuildContext?: (() => NativeBuildContext) | undefined; +} +type StringOrRegExp = string | RegExp; +type FilterPattern = Arrayable; +type StringFilter = FilterPattern | { + include?: FilterPattern | undefined; + exclude?: FilterPattern | undefined; +}; +interface HookFilter { + id?: StringFilter | undefined; + code?: StringFilter | undefined; +} +interface ObjectHook { + filter?: Pick | undefined; + handler: T; +} +type Hook = T | ObjectHook; +interface HookFnMap { + buildStart: (this: UnpluginBuildContext) => Thenable; + buildEnd: (this: UnpluginBuildContext) => Thenable; + transform: (this: UnpluginBuildContext & UnpluginContext, code: string, id: string) => Thenable; + load: (this: UnpluginBuildContext & UnpluginContext, id: string) => Thenable; + resolveId: (this: UnpluginBuildContext & UnpluginContext, id: string, importer: string | undefined, options: { + isEntry: boolean; + }) => Thenable; + writeBundle: (this: void) => Thenable; +} +interface UnpluginOptions { + name: string; + enforce?: "post" | "pre" | undefined; + buildStart?: HookFnMap["buildStart"] | undefined; + buildEnd?: HookFnMap["buildEnd"] | undefined; + transform?: Hook | undefined; + load?: Hook | undefined; + resolveId?: Hook | undefined; + writeBundle?: HookFnMap["writeBundle"] | undefined; + watchChange?: ((this: UnpluginBuildContext, id: string, change: { + event: "create" | "update" | "delete"; + }) => void) | undefined; + /** + * Custom predicate function to filter modules to be loaded. + * When omitted, all modules will be included (might have potential perf impact on Webpack). + * + * @deprecated Use `load.filter` instead. + */ + loadInclude?: ((id: string) => boolean | null | undefined) | undefined; + /** + * Custom predicate function to filter modules to be transformed. + * When omitted, all modules will be included (might have potential perf impact on Webpack). + * + * @deprecated Use `transform.filter` instead. + */ + transformInclude?: ((id: string) => boolean | null | undefined) | undefined; + rollup?: Partial | undefined; + webpack?: ((compiler: WebpackCompiler) => void) | undefined; + rspack?: ((compiler: RspackCompiler) => void) | undefined; + vite?: Partial | undefined; + unloader?: Partial | undefined; + rolldown?: Partial | undefined; + esbuild?: { + onResolveFilter?: RegExp | undefined; + onLoadFilter?: RegExp | undefined; + loader?: Loader | ((code: string, id: string) => Loader) | undefined; + setup?: ((build: PluginBuild) => void | Promise) | undefined; + config?: ((options: BuildOptions) => void) | undefined; + } | undefined; + farm?: Partial | undefined; +} +interface ResolvedUnpluginOptions extends UnpluginOptions { + __vfs?: VirtualModulesPlugin | undefined; + __vfsModules?: Map> | Set | undefined; + __virtualModulePrefix: string; +} +type UnpluginFactory = (options: UserOptions, meta: UnpluginContextMeta) => Nested extends true ? Array : UnpluginOptions; +type UnpluginFactoryOutput = undefined extends UserOptions ? (options?: UserOptions | undefined) => Return : (options: UserOptions) => Return; +interface UnpluginInstance { + rollup: UnpluginFactoryOutput : RollupPlugin>; + vite: UnpluginFactoryOutput : VitePlugin>; + rolldown: UnpluginFactoryOutput : RolldownPlugin>; + webpack: UnpluginFactoryOutput; + rspack: UnpluginFactoryOutput; + esbuild: UnpluginFactoryOutput; + unloader: UnpluginFactoryOutput : UnloaderPlugin>; + farm: UnpluginFactoryOutput; + raw: UnpluginFactory; +} +type UnpluginContextMeta = Partial & ({ + framework: "rollup" | "vite" | "rolldown" | "farm" | "unloader"; +} | { + framework: "webpack"; + webpack: { + compiler: WebpackCompiler; + }; +} | { + framework: "esbuild"; + /** Set the host plugin name of esbuild when returning multiple plugins */ + esbuildHostName?: string | undefined; +} | { + framework: "rspack"; + rspack: { + compiler: RspackCompiler; + }; +}); +interface UnpluginMessage { + name?: string | undefined; + id?: string | undefined; + message: string; + stack?: string | undefined; + code?: string | undefined; + plugin?: string | undefined; + pluginCode?: unknown | undefined; + loc?: { + column: number; + file?: string | undefined; + line: number; + } | undefined; + meta?: any; +} +interface UnpluginContext { + error: (message: string | UnpluginMessage) => void; + warn: (message: string | UnpluginMessage) => void; +} +//#endregion +//#region src/define.d.ts +declare function createUnplugin(factory: UnpluginFactory): UnpluginInstance; +declare function createEsbuildPlugin(factory: UnpluginFactory): UnpluginInstance["esbuild"]; +declare function createRollupPlugin(factory: UnpluginFactory): UnpluginInstance["rollup"]; +declare function createVitePlugin(factory: UnpluginFactory): UnpluginInstance["vite"]; +declare function createRolldownPlugin(factory: UnpluginFactory): UnpluginInstance["rolldown"]; +declare function createWebpackPlugin(factory: UnpluginFactory): UnpluginInstance["webpack"]; +declare function createRspackPlugin(factory: UnpluginFactory): UnpluginInstance["rspack"]; +declare function createFarmPlugin(factory: UnpluginFactory): UnpluginInstance["farm"]; +declare function createUnloaderPlugin(factory: UnpluginFactory): UnpluginInstance["unloader"]; +//#endregion +export { Arrayable, type EsbuildPlugin, ExternalIdResult, FilterPattern, Hook, HookFilter, HookFnMap, NativeBuildContext, Nullable, ObjectHook, ResolvedUnpluginOptions, type RolldownPlugin, type RollupPlugin, type RspackCompiler, type RspackPluginInstance, SourceMapCompact, StringFilter, StringOrRegExp, Thenable, TransformResult, type UnloaderPlugin, UnpluginBuildContext, UnpluginContext, UnpluginContextMeta, UnpluginFactory, UnpluginFactoryOutput, UnpluginInstance, UnpluginMessage, UnpluginOptions, type VitePlugin, type WebpackCompiler, type WebpackPluginInstance, createEsbuildPlugin, createFarmPlugin, createRolldownPlugin, createRollupPlugin, createRspackPlugin, createUnloaderPlugin, createUnplugin, createVitePlugin, createWebpackPlugin }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/index.d.ts b/tools/ui/node_modules/unplugin/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..64166a0984c57a32184eece0e395e17441ca6aa3 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/index.d.ts @@ -0,0 +1,198 @@ +import VirtualModulesPlugin from "webpack-virtual-modules"; +import { CompilationContext, JsPlugin } from "@farmfe/core"; +import { Compilation, Compiler as RspackCompiler, LoaderContext, RspackPluginInstance } from "@rspack/core"; +import { BuildOptions, Loader, Plugin as EsbuildPlugin, PluginBuild } from "esbuild"; +import { Plugin as RolldownPlugin } from "rolldown"; +import { AstNode, EmittedAsset, Plugin as RollupPlugin, PluginContextMeta, SourceMapInput } from "rollup"; +import { Plugin as UnloaderPlugin } from "unloader"; +import { Plugin as VitePlugin } from "vite"; +import { Compilation as Compilation$1, Compiler as WebpackCompiler, LoaderContext as LoaderContext$1, WebpackPluginInstance } from "webpack"; + +//#region src/types.d.ts +type Thenable = T | Promise; +/** +* Null or whatever +*/ +type Nullable = T | null | undefined; +/** +* Array, or not yet +*/ +type Arrayable = T | Array; +interface SourceMapCompact { + file?: string | undefined; + mappings: string; + names: string[]; + sourceRoot?: string | undefined; + sources: string[]; + sourcesContent?: (string | null)[] | undefined; + version: number; +} +type TransformResult = string | { + code: string; + map?: SourceMapInput | SourceMapCompact | null | undefined; +} | null | undefined | void; +interface ExternalIdResult { + id: string; + external?: boolean | undefined; +} +type NativeBuildContext = { + framework: "webpack"; + compiler: WebpackCompiler; + compilation?: Compilation$1 | undefined; + loaderContext?: LoaderContext$1<{ + unpluginName: string; + }> | undefined; + inputSourceMap?: any; +} | { + framework: "esbuild"; + build: PluginBuild; +} | { + framework: "rspack"; + compiler: RspackCompiler; + compilation: Compilation; + loaderContext?: LoaderContext | undefined; + inputSourceMap?: any; +} | { + framework: "farm"; + context: CompilationContext; +}; +interface UnpluginBuildContext { + addWatchFile: (id: string) => void; + emitFile: (emittedFile: EmittedAsset) => void; + getWatchFiles: () => string[]; + parse: (input: string, options?: any) => AstNode; + getNativeBuildContext?: (() => NativeBuildContext) | undefined; +} +type StringOrRegExp = string | RegExp; +type FilterPattern = Arrayable; +type StringFilter = FilterPattern | { + include?: FilterPattern | undefined; + exclude?: FilterPattern | undefined; +}; +interface HookFilter { + id?: StringFilter | undefined; + code?: StringFilter | undefined; +} +interface ObjectHook { + filter?: Pick | undefined; + handler: T; +} +type Hook = T | ObjectHook; +interface HookFnMap { + buildStart: (this: UnpluginBuildContext) => Thenable; + buildEnd: (this: UnpluginBuildContext) => Thenable; + transform: (this: UnpluginBuildContext & UnpluginContext, code: string, id: string) => Thenable; + load: (this: UnpluginBuildContext & UnpluginContext, id: string) => Thenable; + resolveId: (this: UnpluginBuildContext & UnpluginContext, id: string, importer: string | undefined, options: { + isEntry: boolean; + }) => Thenable; + writeBundle: (this: void) => Thenable; +} +interface UnpluginOptions { + name: string; + enforce?: "post" | "pre" | undefined; + buildStart?: HookFnMap["buildStart"] | undefined; + buildEnd?: HookFnMap["buildEnd"] | undefined; + transform?: Hook | undefined; + load?: Hook | undefined; + resolveId?: Hook | undefined; + writeBundle?: HookFnMap["writeBundle"] | undefined; + watchChange?: ((this: UnpluginBuildContext, id: string, change: { + event: "create" | "update" | "delete"; + }) => void) | undefined; + /** + * Custom predicate function to filter modules to be loaded. + * When omitted, all modules will be included (might have potential perf impact on Webpack). + * + * @deprecated Use `load.filter` instead. + */ + loadInclude?: ((id: string) => boolean | null | undefined) | undefined; + /** + * Custom predicate function to filter modules to be transformed. + * When omitted, all modules will be included (might have potential perf impact on Webpack). + * + * @deprecated Use `transform.filter` instead. + */ + transformInclude?: ((id: string) => boolean | null | undefined) | undefined; + rollup?: Partial | undefined; + webpack?: ((compiler: WebpackCompiler) => void) | undefined; + rspack?: ((compiler: RspackCompiler) => void) | undefined; + vite?: Partial | undefined; + unloader?: Partial | undefined; + rolldown?: Partial | undefined; + esbuild?: { + onResolveFilter?: RegExp | undefined; + onLoadFilter?: RegExp | undefined; + loader?: Loader | ((code: string, id: string) => Loader) | undefined; + setup?: ((build: PluginBuild) => void | Promise) | undefined; + config?: ((options: BuildOptions) => void) | undefined; + } | undefined; + farm?: Partial | undefined; +} +interface ResolvedUnpluginOptions extends UnpluginOptions { + __vfs?: VirtualModulesPlugin | undefined; + __vfsModules?: Map> | Set | undefined; + __virtualModulePrefix: string; +} +type UnpluginFactory = (options: UserOptions, meta: UnpluginContextMeta) => Nested extends true ? Array : UnpluginOptions; +type UnpluginFactoryOutput = undefined extends UserOptions ? (options?: UserOptions | undefined) => Return : (options: UserOptions) => Return; +interface UnpluginInstance { + rollup: UnpluginFactoryOutput : RollupPlugin>; + vite: UnpluginFactoryOutput : VitePlugin>; + rolldown: UnpluginFactoryOutput : RolldownPlugin>; + webpack: UnpluginFactoryOutput; + rspack: UnpluginFactoryOutput; + esbuild: UnpluginFactoryOutput; + unloader: UnpluginFactoryOutput : UnloaderPlugin>; + farm: UnpluginFactoryOutput; + raw: UnpluginFactory; +} +type UnpluginContextMeta = Partial & ({ + framework: "rollup" | "vite" | "rolldown" | "farm" | "unloader"; +} | { + framework: "webpack"; + webpack: { + compiler: WebpackCompiler; + }; +} | { + framework: "esbuild"; + /** Set the host plugin name of esbuild when returning multiple plugins */ + esbuildHostName?: string | undefined; +} | { + framework: "rspack"; + rspack: { + compiler: RspackCompiler; + }; +}); +interface UnpluginMessage { + name?: string | undefined; + id?: string | undefined; + message: string; + stack?: string | undefined; + code?: string | undefined; + plugin?: string | undefined; + pluginCode?: unknown | undefined; + loc?: { + column: number; + file?: string | undefined; + line: number; + } | undefined; + meta?: any; +} +interface UnpluginContext { + error: (message: string | UnpluginMessage) => void; + warn: (message: string | UnpluginMessage) => void; +} +//#endregion +//#region src/define.d.ts +declare function createUnplugin(factory: UnpluginFactory): UnpluginInstance; +declare function createEsbuildPlugin(factory: UnpluginFactory): UnpluginInstance["esbuild"]; +declare function createRollupPlugin(factory: UnpluginFactory): UnpluginInstance["rollup"]; +declare function createVitePlugin(factory: UnpluginFactory): UnpluginInstance["vite"]; +declare function createRolldownPlugin(factory: UnpluginFactory): UnpluginInstance["rolldown"]; +declare function createWebpackPlugin(factory: UnpluginFactory): UnpluginInstance["webpack"]; +declare function createRspackPlugin(factory: UnpluginFactory): UnpluginInstance["rspack"]; +declare function createFarmPlugin(factory: UnpluginFactory): UnpluginInstance["farm"]; +declare function createUnloaderPlugin(factory: UnpluginFactory): UnpluginInstance["unloader"]; +//#endregion +export { Arrayable, type EsbuildPlugin, ExternalIdResult, FilterPattern, Hook, HookFilter, HookFnMap, NativeBuildContext, Nullable, ObjectHook, ResolvedUnpluginOptions, type RolldownPlugin, type RollupPlugin, type RspackCompiler, type RspackPluginInstance, SourceMapCompact, StringFilter, StringOrRegExp, Thenable, TransformResult, type UnloaderPlugin, UnpluginBuildContext, UnpluginContext, UnpluginContextMeta, UnpluginFactory, UnpluginFactoryOutput, UnpluginInstance, UnpluginMessage, UnpluginOptions, type VitePlugin, type WebpackCompiler, type WebpackPluginInstance, createEsbuildPlugin, createFarmPlugin, createRolldownPlugin, createRollupPlugin, createRspackPlugin, createUnloaderPlugin, createUnplugin, createVitePlugin, createWebpackPlugin }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/index.js b/tools/ui/node_modules/unplugin/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8ace91a08f343a611a372841b558a7d4736acc97 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/index.js @@ -0,0 +1,1005 @@ +import { n as normalizeObjectHook, r as toArray, t as parse } from "./context-Csj9j3eN.js"; +import { n as transformUse, t as normalizeAbsolutePath } from "./webpack-like-DFGTNSuV.js"; +import { r as normalizeMessage$1, t as createBuildContext$1 } from "./context-DkYlx1xL.js"; +import { i as isVirtualModuleId, n as decodeVirtualModuleId, r as encodeVirtualModuleId, t as FakeVirtualModulesPlugin } from "./utils-BosfZ0pB.js"; +import { i as normalizeMessage, n as createBuildContext, t as contextOptionsFromCompilation } from "./context-OCFO8EW1.js"; +import fs from "node:fs"; +import path, { extname, resolve } from "node:path"; +import { Buffer } from "node:buffer"; +import remapping from "@jridgewell/remapping"; +import * as querystring from "node:querystring"; +import { fileURLToPath } from "node:url"; +import process$1 from "node:process"; +import VirtualModulesPlugin from "webpack-virtual-modules"; + +//#region src/esbuild/utils.ts +const ExtToLoader = { + ".js": "js", + ".mjs": "js", + ".cjs": "js", + ".jsx": "jsx", + ".ts": "ts", + ".cts": "ts", + ".mts": "ts", + ".tsx": "tsx", + ".css": "css", + ".less": "css", + ".stylus": "css", + ".scss": "css", + ".sass": "css", + ".json": "json", + ".txt": "text" +}; +function guessLoader(code, id) { + return ExtToLoader[path.extname(id).toLowerCase()] || "js"; +} +function unwrapLoader(loader, code, id) { + if (typeof loader === "function") return loader(code, id); + return loader; +} +function fixSourceMap(map) { + if (!Object.prototype.hasOwnProperty.call(map, "toString")) Object.defineProperty(map, "toString", { + enumerable: false, + value: function toString() { + return JSON.stringify(this); + } + }); + if (!Object.prototype.hasOwnProperty.call(map, "toUrl")) Object.defineProperty(map, "toUrl", { + enumerable: false, + value: function toUrl() { + return `data:application/json;charset=utf-8;base64,${Buffer.from(this.toString()).toString("base64")}`; + } + }); + return map; +} +const nullSourceMap = { + names: [], + sources: [], + mappings: "", + version: 3 +}; +function combineSourcemaps(filename, sourcemapList) { + sourcemapList = sourcemapList.filter((m) => m.sources); + if (sourcemapList.length === 0 || sourcemapList.every((m) => m.sources.length === 0)) return { ...nullSourceMap }; + let map; + let mapIndex = 1; + if (sourcemapList.slice(0, -1).find((m) => m.sources.length !== 1) === void 0) map = remapping(sourcemapList, () => null, true); + else map = remapping(sourcemapList[0], (sourcefile) => { + if (sourcefile === filename && sourcemapList[mapIndex]) return sourcemapList[mapIndex++]; + else return { ...nullSourceMap }; + }, true); + if (!map.file) delete map.file; + return map; +} +function createBuildContext$2(build) { + const watchFiles = []; + const { initialOptions } = build; + return { + parse, + addWatchFile() { + throw new Error("unplugin/esbuild: addWatchFile outside supported hooks (resolveId, load, transform)"); + }, + emitFile(emittedFile) { + const outFileName = emittedFile.fileName || emittedFile.name; + if (initialOptions.outdir && emittedFile.source && outFileName) { + const outPath = path.resolve(initialOptions.outdir, outFileName); + const outDir = path.dirname(outPath); + if (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true }); + fs.writeFileSync(outPath, emittedFile.source); + } + }, + getWatchFiles() { + return watchFiles; + }, + getNativeBuildContext() { + return { + framework: "esbuild", + build + }; + } + }; +} +function createPluginContext(context) { + const errors = []; + const warnings = []; + const pluginContext = { + error(message) { + errors.push(normalizeMessage$2(message)); + }, + warn(message) { + warnings.push(normalizeMessage$2(message)); + } + }; + return { + errors, + warnings, + mixedContext: { + ...context, + ...pluginContext, + addWatchFile(id) { + context.getWatchFiles().push(id); + } + } + }; +} +function normalizeMessage$2(message) { + if (typeof message === "string") message = { message }; + return { + id: message.id, + pluginName: message.plugin, + text: message.message, + location: message.loc ? { + file: message.loc.file, + line: message.loc.line, + column: message.loc.column + } : null, + detail: message.meta, + notes: [] + }; +} +function processCodeWithSourceMap(map, code) { + if (map) { + if (!map.sourcesContent || map.sourcesContent.length === 0) map.sourcesContent = [code]; + map = fixSourceMap(map); + code += `\n//# sourceMappingURL=${map.toUrl()}`; + } + return code; +} + +//#endregion +//#region src/esbuild/index.ts +function getEsbuildPlugin(factory) { + return (userOptions) => { + const meta = { framework: "esbuild" }; + const plugins = toArray(factory(userOptions, meta)); + const setupPlugins = async (build) => { + const setup = buildSetup(); + const loaders = []; + for (const plugin of plugins) { + const loader = {}; + await setup(plugin)({ + ...build, + onLoad(_options, callback) { + loader.options = _options; + loader.onLoadCb = callback; + }, + onTransform(_options, callback) { + loader.options ||= _options; + loader.onTransformCb = callback; + } + }, build); + if (loader.onLoadCb || loader.onTransformCb) loaders.push(loader); + } + if (loaders.length) build.onLoad(loaders.length === 1 ? loaders[0].options : { filter: /.*/ }, async (args) => { + function checkFilter(options) { + return loaders.length === 1 || !options?.filter || options.filter.test(args.path); + } + let result; + for (const { options, onLoadCb } of loaders) { + if (!checkFilter(options)) continue; + if (onLoadCb) result = await onLoadCb(args); + if (result?.contents) break; + } + let fsContentsCache; + for (const { options, onTransformCb } of loaders) { + if (!checkFilter(options)) continue; + if (onTransformCb) { + const _result = await onTransformCb({ + ...result, + ...args, + async getContents() { + if (result?.contents) return result.contents; + if (fsContentsCache) return fsContentsCache; + return fsContentsCache = await fs.promises.readFile(args.path, "utf8"); + } + }); + if (_result?.contents) result = _result; + } + } + if (result?.contents) return result; + }); + }; + return { + name: (plugins.length === 1 ? plugins[0].name : meta.esbuildHostName) ?? `unplugin-host:${plugins.map((p) => p.name).join(":")}`, + setup: setupPlugins + }; + }; +} +function buildSetup() { + return (plugin) => { + return (build, rawBuild) => { + const context = createBuildContext$2(rawBuild); + const { onStart, onEnd, onResolve, onLoad, onTransform, initialOptions } = build; + const onResolveFilter = plugin.esbuild?.onResolveFilter ?? /.*/; + const onLoadFilter = plugin.esbuild?.onLoadFilter ?? /.*/; + const loader = plugin.esbuild?.loader ?? guessLoader; + plugin.esbuild?.config?.call(context, initialOptions); + if (plugin.buildStart) onStart(() => plugin.buildStart.call(context)); + if (plugin.buildEnd || plugin.writeBundle) onEnd(async () => { + if (plugin.buildEnd) await plugin.buildEnd.call(context); + if (plugin.writeBundle) await plugin.writeBundle(); + }); + if (plugin.resolveId) onResolve({ filter: onResolveFilter }, async (args) => { + const id = args.path; + if (initialOptions.external?.includes(id)) return; + const { handler, filter } = normalizeObjectHook("resolveId", plugin.resolveId); + if (!filter(id)) return; + const { errors, warnings, mixedContext } = createPluginContext(context); + const isEntry = args.kind === "entry-point"; + const result = await handler.call(mixedContext, id, isEntry ? void 0 : args.importer, { isEntry }); + if (typeof result === "string") return { + path: result, + namespace: plugin.name, + errors, + warnings, + watchFiles: mixedContext.getWatchFiles() + }; + else if (typeof result === "object" && result !== null) return { + path: result.id, + external: result.external, + namespace: plugin.name, + errors, + warnings, + watchFiles: mixedContext.getWatchFiles() + }; + }); + if (plugin.load) onLoad({ filter: onLoadFilter }, async (args) => { + const { handler, filter } = normalizeObjectHook("load", plugin.load); + const id = args.path + (args.suffix || ""); + if (plugin.loadInclude && !plugin.loadInclude(id)) return; + if (!filter(id)) return; + const { errors, warnings, mixedContext } = createPluginContext(context); + let code; + let map; + const result = await handler.call(mixedContext, id); + if (typeof result === "string") code = result; + else if (typeof result === "object" && result !== null) { + code = result.code; + map = result.map; + } + if (code === void 0) return null; + if (map) code = processCodeWithSourceMap(map, code); + const resolveDir = path.dirname(args.path); + return { + contents: code, + errors, + warnings, + watchFiles: mixedContext.getWatchFiles(), + loader: unwrapLoader(loader, code, args.path), + resolveDir + }; + }); + if (plugin.transform) onTransform({ filter: onLoadFilter }, async (args) => { + const { handler, filter } = normalizeObjectHook("transform", plugin.transform); + const id = args.path + (args.suffix || ""); + if (plugin.transformInclude && !plugin.transformInclude(id)) return; + let code = await args.getContents(); + if (!filter(id, code)) return; + const { mixedContext, errors, warnings } = createPluginContext(context); + const resolveDir = path.dirname(args.path); + let map; + const result = await handler.call(mixedContext, code, id); + if (typeof result === "string") code = result; + else if (typeof result === "object" && result !== null) { + code = result.code; + if (map && result.map) map = combineSourcemaps(args.path, [result.map === "string" ? JSON.parse(result.map) : result.map, map]); + else if (typeof result.map === "string") map = JSON.parse(result.map); + else map = result.map; + } + if (code) { + if (map) code = processCodeWithSourceMap(map, code); + return { + contents: code, + errors, + warnings, + watchFiles: mixedContext.getWatchFiles(), + loader: unwrapLoader(loader, code, args.path), + resolveDir + }; + } + }); + if (plugin.esbuild?.setup) return plugin.esbuild.setup(rawBuild); + }; + }; +} + +//#endregion +//#region src/farm/context.ts +function createFarmContext(context, currentResolveId) { + return { + parse, + addWatchFile(id) { + context.addWatchFile(id, currentResolveId || id); + }, + emitFile(emittedFile) { + const outFileName = emittedFile.fileName || emittedFile.name; + if (emittedFile.source && outFileName) context.emitFile({ + resolvedPath: outFileName, + name: outFileName, + content: [...Buffer.from(emittedFile.source)], + resourceType: extname(outFileName) + }); + }, + getWatchFiles() { + return context.getWatchFiles(); + }, + getNativeBuildContext() { + return { + framework: "farm", + context + }; + } + }; +} +function unpluginContext(context) { + return { + error: (error) => context.error(typeof error === "string" ? new Error(error) : error), + warn: (error) => context.warn(typeof error === "string" ? new Error(error) : error) + }; +} + +//#endregion +//#region src/farm/utils.ts +function convertEnforceToPriority(value) { + const defaultPriority = 100; + const enforceToPriority = { + pre: 102, + post: 98 + }; + return enforceToPriority[value] !== void 0 ? enforceToPriority[value] : defaultPriority; +} +function convertWatchEventChange(value) { + return { + Added: "create", + Updated: "update", + Removed: "delete" + }[value]; +} +function isString(variable) { + return typeof variable === "string"; +} +function isObject(variable) { + return typeof variable === "object" && variable !== null; +} +function customParseQueryString(url) { + if (!url) return []; + const queryString = url.split("?")[1]; + const parsedParams = querystring.parse(queryString); + const paramsArray = []; + for (const key in parsedParams) paramsArray.push([key, parsedParams[key]]); + return paramsArray; +} +function encodeStr(str) { + const len = str.length; + if (len === 0) return str; + const firstNullIndex = str.indexOf("\0"); + if (firstNullIndex === -1) return str; + const result = Array.from({ length: len + countNulls(str, firstNullIndex) }); + let pos = 0; + for (let i = 0; i < firstNullIndex; i++) result[pos++] = str[i]; + for (let i = firstNullIndex; i < len; i++) { + const char = str[i]; + if (char === "\0") { + result[pos++] = "\\"; + result[pos++] = "0"; + } else result[pos++] = char; + } + return path.posix.normalize(result.join("")); +} +function decodeStr(str) { + const len = str.length; + if (len === 0) return str; + const firstIndex = str.indexOf("\\0"); + if (firstIndex === -1) return str; + const result = Array.from({ length: len - countBackslashZeros(str, firstIndex) }); + let pos = 0; + for (let i$1 = 0; i$1 < firstIndex; i$1++) result[pos++] = str[i$1]; + let i = firstIndex; + while (i < len) if (str[i] === "\\" && str[i + 1] === "0") { + result[pos++] = "\0"; + i += 2; + } else result[pos++] = str[i++]; + return path.posix.normalize(result.join("")); +} +function getContentValue(content) { + if (content === null || content === void 0) throw new Error("Content cannot be null or undefined"); + return encodeStr(typeof content === "string" ? content : content.code || ""); +} +function countNulls(str, startIndex) { + let count = 0; + const len = str.length; + for (let i = startIndex; i < len; i++) if (str[i] === "\0") count++; + return count; +} +function countBackslashZeros(str, startIndex) { + let count = 0; + const len = str.length; + for (let i = startIndex; i < len - 1; i++) if (str[i] === "\\" && str[i + 1] === "0") { + count++; + i++; + } + return count; +} +function removeQuery(pathe) { + const queryIndex = pathe.indexOf("?"); + if (queryIndex !== -1) return path.posix.normalize(pathe.slice(0, queryIndex)); + return path.posix.normalize(pathe); +} +function isStartsWithSlash(str) { + return str?.startsWith("/"); +} +function appendQuery(id, query) { + if (!query.length) return id; + return `${id}?${stringifyQuery(query)}`; +} +function stringifyQuery(query) { + if (!query.length) return ""; + let queryStr = ""; + for (const [key, value] of query) queryStr += `${key}${value ? `=${value}` : ""}&`; + return `${queryStr.slice(0, -1)}`; +} +const CSS_LANGS_RES = [ + [/\.(less)(?:$|\?)/, "less"], + [/\.(scss|sass)(?:$|\?)/, "sass"], + [/\.(styl|stylus)(?:$|\?)/, "stylus"], + [/\.(css)(?:$|\?)/, "css"] +]; +const JS_LANGS_RES = [ + [/\.(js|mjs|cjs)(?:$|\?)/, "js"], + [/\.(jsx)(?:$|\?)/, "jsx"], + [/\.(ts|cts|mts)(?:$|\?)/, "ts"], + [/\.(tsx)(?:$|\?)/, "tsx"] +]; +function getCssModuleType(id) { + for (const [reg, lang] of CSS_LANGS_RES) if (reg.test(id)) return lang; + return null; +} +function getJsModuleType(id) { + for (const [reg, lang] of JS_LANGS_RES) if (reg.test(id)) return lang; + return null; +} +function formatLoadModuleType(id) { + const cssModuleType = getCssModuleType(id); + if (cssModuleType) return cssModuleType; + const jsModuleType = getJsModuleType(id); + if (jsModuleType) return jsModuleType; + return "js"; +} +function formatTransformModuleType(id) { + return formatLoadModuleType(id); +} + +//#endregion +//#region src/farm/index.ts +function getFarmPlugin(factory) { + return ((userOptions) => { + const plugins = toArray(factory(userOptions, { framework: "farm" })).map((rawPlugin) => { + const plugin = toFarmPlugin(rawPlugin, userOptions); + if (rawPlugin.farm) Object.assign(plugin, rawPlugin.farm); + return plugin; + }); + return plugins.length === 1 ? plugins[0] : plugins; + }); +} +function toFarmPlugin(plugin, options) { + const farmPlugin = { + name: plugin.name, + priority: convertEnforceToPriority(plugin.enforce) + }; + if (plugin.farm) Object.keys(plugin.farm).forEach((key) => { + const value = plugin.farm[key]; + if (value) Reflect.set(farmPlugin, key, value); + }); + if (plugin.buildStart) { + const _buildStart = plugin.buildStart; + farmPlugin.buildStart = { async executor(_, context) { + await _buildStart.call(createFarmContext(context)); + } }; + } + if (plugin.resolveId) { + const _resolveId = plugin.resolveId; + let filters = []; + if (options) filters = options?.filters ?? []; + farmPlugin.resolve = { + filters: { + sources: filters.length ? filters : [".*"], + importers: [".*"] + }, + async executor(params, context) { + const resolvedIdPath = path.resolve(params.importer ?? ""); + const id = decodeStr(params.source); + const { handler, filter } = normalizeObjectHook("resolveId", _resolveId); + if (!filter(id)) return null; + let isEntry = false; + if (isObject(params.kind) && "entry" in params.kind) isEntry = params.kind.entry === "index"; + const farmContext = createFarmContext(context, resolvedIdPath); + const resolveIdResult = await handler.call(Object.assign(unpluginContext(context), farmContext), id, resolvedIdPath ?? null, { isEntry }); + if (isString(resolveIdResult)) return { + resolvedPath: removeQuery(encodeStr(resolveIdResult)), + query: customParseQueryString(resolveIdResult), + sideEffects: true, + external: false, + meta: {} + }; + if (isObject(resolveIdResult)) return { + resolvedPath: removeQuery(encodeStr(resolveIdResult?.id)), + query: customParseQueryString(resolveIdResult?.id), + sideEffects: false, + external: Boolean(resolveIdResult?.external), + meta: {} + }; + if (!isStartsWithSlash(params.source)) return null; + } + }; + } + if (plugin.load) { + const _load = plugin.load; + farmPlugin.load = { + filters: { resolvedPaths: [".*"] }, + async executor(params, context) { + const id = appendQuery(decodeStr(params.resolvedPath), params.query); + const loader = formatTransformModuleType(id); + if (plugin.loadInclude && !plugin.loadInclude?.(id)) return null; + const { handler, filter } = normalizeObjectHook("load", _load); + if (!filter(id)) return null; + const farmContext = createFarmContext(context, id); + return { + content: getContentValue(await handler.call(Object.assign(unpluginContext(context), farmContext), id)), + moduleType: loader + }; + } + }; + } + if (plugin.transform) { + const _transform = plugin.transform; + farmPlugin.transform = { + filters: { + resolvedPaths: [".*"], + moduleTypes: [".*"] + }, + async executor(params, context) { + const id = appendQuery(decodeStr(params.resolvedPath), params.query); + const loader = formatTransformModuleType(id); + if (plugin.transformInclude && !plugin.transformInclude(id)) return null; + const { handler, filter } = normalizeObjectHook("transform", _transform); + if (!filter(id, params.content)) return null; + const farmContext = createFarmContext(context, id); + const resource = await handler.call(Object.assign(unpluginContext(context), farmContext), params.content, id); + if (resource && typeof resource !== "string") return { + content: getContentValue(resource), + moduleType: loader, + sourceMap: typeof resource.map === "object" && resource.map !== null ? JSON.stringify(resource.map) : void 0 + }; + } + }; + } + if (plugin.watchChange) { + const _watchChange = plugin.watchChange; + farmPlugin.updateModules = { async executor(param, context) { + const updatePathContent = param.paths[0]; + const ModifiedPath = updatePathContent[0]; + const eventChange = convertWatchEventChange(updatePathContent[1]); + await _watchChange.call(createFarmContext(context), ModifiedPath, { event: eventChange }); + } }; + } + if (plugin.buildEnd) { + const _buildEnd = plugin.buildEnd; + farmPlugin.buildEnd = { async executor(_, context) { + await _buildEnd.call(createFarmContext(context)); + } }; + } + if (plugin.writeBundle) { + const _writeBundle = plugin.writeBundle; + farmPlugin.finish = { async executor() { + await _writeBundle(); + } }; + } + return farmPlugin; +} + +//#endregion +//#region src/rollup/index.ts +function getRollupPlugin(factory) { + return ((userOptions) => { + const plugins = toArray(factory(userOptions, { framework: "rollup" })).map((plugin) => toRollupPlugin(plugin, "rollup")); + return plugins.length === 1 ? plugins[0] : plugins; + }); +} +function toRollupPlugin(plugin, key) { + const nativeFilter = key === "rolldown"; + if (plugin.resolveId && !nativeFilter && typeof plugin.resolveId === "object" && plugin.resolveId.filter) { + const resolveIdHook = plugin.resolveId; + const { handler, filter } = normalizeObjectHook("load", resolveIdHook); + replaceHookHandler("resolveId", resolveIdHook, function(...args) { + const [id] = args; + if (!supportNativeFilter(this, key) && !filter(id)) return; + return handler.apply(this, args); + }); + } + if (plugin.load && (plugin.loadInclude || !nativeFilter && typeof plugin.load === "object" && plugin.load.filter)) { + const loadHook = plugin.load; + const { handler, filter } = normalizeObjectHook("load", loadHook); + replaceHookHandler("load", loadHook, function(...args) { + const [id] = args; + if (plugin.loadInclude && !plugin.loadInclude(id)) return; + if (!supportNativeFilter(this, key) && !filter(id)) return; + return handler.apply(this, args); + }); + } + if (plugin.transform && (plugin.transformInclude || !nativeFilter && typeof plugin.transform === "object" && plugin.transform.filter)) { + const transformHook = plugin.transform; + const { handler, filter } = normalizeObjectHook("transform", transformHook); + replaceHookHandler("transform", transformHook, function(...args) { + const [code, id] = args; + if (plugin.transformInclude && !plugin.transformInclude(id)) return; + if (!supportNativeFilter(this, key) && !filter(id, code)) return; + return handler.apply(this, args); + }); + } + if (plugin[key]) Object.assign(plugin, plugin[key]); + return plugin; + function replaceHookHandler(name, hook, handler) { + if (typeof hook === "function") plugin[name] = handler; + else hook.handler = handler; + } +} +function supportNativeFilter(context, framework) { + if (framework === "unloader") return false; + if (framework === "vite") return !!context?.meta?.viteVersion; + if (framework === "rolldown") return true; + const rollupVersion = context?.meta?.rollupVersion; + if (!rollupVersion) return false; + const [major, minor] = rollupVersion.split("."); + return Number(major) > 4 || Number(major) === 4 && Number(minor) >= 40; +} + +//#endregion +//#region src/rolldown/index.ts +function getRolldownPlugin(factory) { + return ((userOptions) => { + const plugins = toArray(factory(userOptions, { framework: "rolldown" })).map((rawPlugin) => { + return toRollupPlugin(rawPlugin, "rolldown"); + }); + return plugins.length === 1 ? plugins[0] : plugins; + }); +} + +//#endregion +//#region node_modules/.pnpm/tsdown@0.15.12_publint@0.3.5_typescript@5.9.3_unplugin-unused@0.5.5_vue-tsc@3.1.3_typescript@5.9.3_/node_modules/tsdown/esm-shims.js +const getFilename = () => fileURLToPath(import.meta.url); +const getDirname = () => path.dirname(getFilename()); +const __dirname = /* @__PURE__ */ getDirname(); + +//#endregion +//#region src/rspack/index.ts +const TRANSFORM_LOADER$1 = resolve(__dirname, "rspack/loaders/transform"); +const LOAD_LOADER$1 = resolve(__dirname, "rspack/loaders/load"); +function getRspackPlugin(factory) { + return (userOptions) => { + return { apply(compiler) { + const VIRTUAL_MODULE_PREFIX = resolve(compiler.options.context ?? process.cwd(), "node_modules/.virtual", compiler.rspack.experiments.VirtualModulesPlugin ? "" : process.pid.toString()); + const meta = { + framework: "rspack", + rspack: { compiler } + }; + const rawPlugins = toArray(factory(userOptions, meta)); + for (const rawPlugin of rawPlugins) { + const plugin = Object.assign(rawPlugin, { + __unpluginMeta: meta, + __virtualModulePrefix: VIRTUAL_MODULE_PREFIX + }); + const externalModules = /* @__PURE__ */ new Set(); + if (plugin.resolveId) { + const createPlugin = (plugin$1) => { + if (compiler.rspack.experiments.VirtualModulesPlugin) return new compiler.rspack.experiments.VirtualModulesPlugin(); + return new FakeVirtualModulesPlugin(plugin$1); + }; + const vfs = createPlugin(plugin); + vfs.apply(compiler); + const vfsModules = /* @__PURE__ */ new Map(); + plugin.__vfsModules = vfsModules; + plugin.__vfs = vfs; + compiler.hooks.compilation.tap(plugin.name, (compilation, { normalModuleFactory }) => { + normalModuleFactory.hooks.resolve.tapPromise(plugin.name, async (resolveData) => { + const id = normalizeAbsolutePath(resolveData.request); + const requestContext = resolveData.contextInfo; + let importer = requestContext.issuer !== "" ? requestContext.issuer : void 0; + const isEntry = requestContext.issuer === ""; + if (importer?.startsWith(plugin.__virtualModulePrefix)) importer = decodeURIComponent(importer.slice(plugin.__virtualModulePrefix.length)); + const context = createBuildContext$1(compiler, compilation); + let error; + const pluginContext = { + error(msg) { + if (error == null) error = normalizeMessage$1(msg); + else console.error(`unplugin/rspack: multiple errors returned from resolveId hook: ${msg}`); + }, + warn(msg) { + console.warn(`unplugin/rspack: warning from resolveId hook: ${msg}`); + } + }; + const { handler, filter } = normalizeObjectHook("resolveId", plugin.resolveId); + if (!filter(id)) return; + const resolveIdResult = await handler.call({ + ...context, + ...pluginContext + }, id, importer, { isEntry }); + if (error != null) throw error; + if (resolveIdResult == null) return; + let resolved = typeof resolveIdResult === "string" ? resolveIdResult : resolveIdResult.id; + if (typeof resolveIdResult === "string" ? false : resolveIdResult.external === true) externalModules.add(resolved); + let isVirtual = true; + try { + (compiler.inputFileSystem?.statSync ?? fs.statSync)(resolved); + isVirtual = false; + } catch { + isVirtual = !isVirtualModuleId(resolved, plugin); + } + if (isVirtual) { + const encodedVirtualPath = encodeVirtualModuleId(resolved, plugin); + if (!vfsModules.has(resolved)) { + const fsPromise = Promise.resolve(vfs.writeModule(encodedVirtualPath, "")); + vfsModules.set(resolved, fsPromise); + await fsPromise; + } else await vfsModules.get(resolved); + resolved = encodedVirtualPath; + } + resolveData.request = resolved; + }); + }); + } + if (plugin.load) compiler.options.module.rules.unshift({ + enforce: plugin.enforce, + include(id) { + if (isVirtualModuleId(id, plugin)) id = decodeVirtualModuleId(id, plugin); + if (plugin.loadInclude && !plugin.loadInclude(id)) return false; + const { filter } = normalizeObjectHook("load", plugin.load); + if (!filter(id)) return false; + return !externalModules.has(id); + }, + use: [{ + loader: LOAD_LOADER$1, + options: { plugin } + }], + type: "javascript/auto" + }); + if (plugin.transform) compiler.options.module.rules.unshift({ + enforce: plugin.enforce, + use(data) { + return transformUse(data, plugin, TRANSFORM_LOADER$1); + } + }); + if (plugin.rspack) plugin.rspack(compiler); + if (plugin.watchChange || plugin.buildStart) compiler.hooks.make.tapPromise(plugin.name, async (compilation) => { + const context = createBuildContext$1(compiler, compilation); + if (plugin.watchChange && (compiler.modifiedFiles || compiler.removedFiles)) { + const promises = []; + if (compiler.modifiedFiles) compiler.modifiedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "update" })))); + if (compiler.removedFiles) compiler.removedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "delete" })))); + await Promise.all(promises); + } + if (plugin.buildStart) return await plugin.buildStart.call(context); + }); + if (plugin.buildEnd) compiler.hooks.emit.tapPromise(plugin.name, async (compilation) => { + await plugin.buildEnd.call(createBuildContext$1(compiler, compilation)); + }); + if (plugin.writeBundle) compiler.hooks.afterEmit.tapPromise(plugin.name, async () => { + await plugin.writeBundle(); + }); + } + } }; + }; +} + +//#endregion +//#region src/unloader/index.ts +function getUnloaderPlugin(factory) { + return ((userOptions) => { + const plugins = toArray(factory(userOptions, { framework: "unloader" })).map((rawPlugin) => { + return toRollupPlugin(rawPlugin, "unloader"); + }); + return plugins.length === 1 ? plugins[0] : plugins; + }); +} + +//#endregion +//#region src/vite/index.ts +function getVitePlugin(factory) { + return ((userOptions) => { + const plugins = toArray(factory(userOptions, { framework: "vite" })).map((rawPlugin) => { + return toRollupPlugin(rawPlugin, "vite"); + }); + return plugins.length === 1 ? plugins[0] : plugins; + }); +} + +//#endregion +//#region src/webpack/index.ts +const TRANSFORM_LOADER = resolve(__dirname, "webpack/loaders/transform"); +const LOAD_LOADER = resolve(__dirname, "webpack/loaders/load"); +function getWebpackPlugin(factory) { + return (userOptions) => { + return { apply(compiler) { + const VIRTUAL_MODULE_PREFIX = resolve(compiler.options.context ?? process$1.cwd(), "_virtual_"); + const meta = { + framework: "webpack", + webpack: { compiler } + }; + const rawPlugins = toArray(factory(userOptions, meta)); + for (const rawPlugin of rawPlugins) { + const plugin = Object.assign(rawPlugin, { + __unpluginMeta: meta, + __virtualModulePrefix: VIRTUAL_MODULE_PREFIX + }); + const externalModules = /* @__PURE__ */ new Set(); + if (plugin.resolveId) { + let vfs = compiler.options.plugins.find((i) => i instanceof VirtualModulesPlugin); + if (!vfs) { + vfs = new VirtualModulesPlugin(); + compiler.options.plugins.push(vfs); + } + const vfsModules = /* @__PURE__ */ new Set(); + plugin.__vfsModules = vfsModules; + plugin.__vfs = vfs; + const resolverPlugin = { apply(resolver) { + const target = resolver.ensureHook("resolve"); + resolver.getHook("resolve").tapAsync(plugin.name, async (request, resolveContext, callback) => { + if (!request.request) return callback(); + if (normalizeAbsolutePath(request.request).startsWith(plugin.__virtualModulePrefix)) return callback(); + const id = normalizeAbsolutePath(request.request); + const requestContext = request.context; + let importer = requestContext.issuer !== "" ? requestContext.issuer : void 0; + const isEntry = requestContext.issuer === ""; + if (importer?.startsWith(plugin.__virtualModulePrefix)) importer = decodeURIComponent(importer.slice(plugin.__virtualModulePrefix.length)); + const fileDependencies = /* @__PURE__ */ new Set(); + const context = createBuildContext({ + addWatchFile(file) { + fileDependencies.add(file); + resolveContext.fileDependencies?.add(file); + }, + getWatchFiles() { + return Array.from(fileDependencies); + } + }, compiler); + let error; + const pluginContext = { + error(msg) { + if (error == null) error = normalizeMessage(msg); + else console.error(`unplugin/webpack: multiple errors returned from resolveId hook: ${msg}`); + }, + warn(msg) { + console.warn(`unplugin/webpack: warning from resolveId hook: ${msg}`); + } + }; + const { handler, filter } = normalizeObjectHook("resolveId", plugin.resolveId); + if (!filter(id)) return callback(); + const resolveIdResult = await handler.call({ + ...context, + ...pluginContext + }, id, importer, { isEntry }); + if (error != null) return callback(error); + if (resolveIdResult == null) return callback(); + let resolved = typeof resolveIdResult === "string" ? resolveIdResult : resolveIdResult.id; + if (typeof resolveIdResult === "string" ? false : resolveIdResult.external === true) externalModules.add(resolved); + if (!fs.existsSync(resolved)) { + resolved = normalizeAbsolutePath(plugin.__virtualModulePrefix + encodeURIComponent(resolved)); + if (!vfsModules.has(resolved)) { + plugin.__vfs.writeModule(resolved, ""); + vfsModules.add(resolved); + } + } + const newRequest = { + ...request, + request: resolved + }; + resolver.doResolve(target, newRequest, null, resolveContext, callback); + }); + } }; + compiler.options.resolve.plugins = compiler.options.resolve.plugins || []; + compiler.options.resolve.plugins.push(resolverPlugin); + } + if (plugin.load) compiler.options.module.rules.unshift({ + include(id) { + return shouldLoad(id, plugin, externalModules); + }, + enforce: plugin.enforce, + use: [{ + loader: LOAD_LOADER, + options: { plugin } + }], + type: "javascript/auto" + }); + if (plugin.transform) compiler.options.module.rules.unshift({ + enforce: plugin.enforce, + use(data) { + return transformUse(data, plugin, TRANSFORM_LOADER); + } + }); + if (plugin.webpack) plugin.webpack(compiler); + if (plugin.watchChange || plugin.buildStart) compiler.hooks.make.tapPromise(plugin.name, async (compilation) => { + const context = createBuildContext(contextOptionsFromCompilation(compilation), compiler, compilation); + if (plugin.watchChange && (compiler.modifiedFiles || compiler.removedFiles)) { + const promises = []; + if (compiler.modifiedFiles) compiler.modifiedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "update" })))); + if (compiler.removedFiles) compiler.removedFiles.forEach((file) => promises.push(Promise.resolve(plugin.watchChange.call(context, file, { event: "delete" })))); + await Promise.all(promises); + } + if (plugin.buildStart) return await plugin.buildStart.call(context); + }); + if (plugin.buildEnd) compiler.hooks.emit.tapPromise(plugin.name, async (compilation) => { + await plugin.buildEnd.call(createBuildContext(contextOptionsFromCompilation(compilation), compiler, compilation)); + }); + if (plugin.writeBundle) compiler.hooks.afterEmit.tapPromise(plugin.name, async () => { + await plugin.writeBundle(); + }); + } + } }; + }; +} +function shouldLoad(id, plugin, externalModules) { + if (id.startsWith(plugin.__virtualModulePrefix)) id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length)); + if (plugin.loadInclude && !plugin.loadInclude(id)) return false; + const { filter } = normalizeObjectHook("load", plugin.load); + if (!filter(id)) return false; + return !externalModules.has(id); +} + +//#endregion +//#region src/define.ts +function createUnplugin(factory) { + return { + get esbuild() { + return getEsbuildPlugin(factory); + }, + get rollup() { + return getRollupPlugin(factory); + }, + get vite() { + return getVitePlugin(factory); + }, + get rolldown() { + return getRolldownPlugin(factory); + }, + get webpack() { + return getWebpackPlugin(factory); + }, + get rspack() { + return getRspackPlugin(factory); + }, + get farm() { + return getFarmPlugin(factory); + }, + get unloader() { + return getUnloaderPlugin(factory); + }, + get raw() { + return factory; + } + }; +} +function createEsbuildPlugin(factory) { + return getEsbuildPlugin(factory); +} +function createRollupPlugin(factory) { + return getRollupPlugin(factory); +} +function createVitePlugin(factory) { + return getVitePlugin(factory); +} +function createRolldownPlugin(factory) { + return getRolldownPlugin(factory); +} +function createWebpackPlugin(factory) { + return getWebpackPlugin(factory); +} +function createRspackPlugin(factory) { + return getRspackPlugin(factory); +} +function createFarmPlugin(factory) { + return getFarmPlugin(factory); +} +function createUnloaderPlugin(factory) { + return getUnloaderPlugin(factory); +} + +//#endregion +export { createEsbuildPlugin, createFarmPlugin, createRolldownPlugin, createRollupPlugin, createRspackPlugin, createUnloaderPlugin, createUnplugin, createVitePlugin, createWebpackPlugin }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/rspack/loaders/load.cjs b/tools/ui/node_modules/unplugin/dist/rspack/loaders/load.cjs new file mode 100644 index 0000000000000000000000000000000000000000..538236912997efe95845be02402be68c2d3a2a12 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/rspack/loaders/load.cjs @@ -0,0 +1,27 @@ +const require_context = require('../../context-CQfDPcdE.cjs'); +const require_webpack_like = require('../../webpack-like-DDVwPJ4e.cjs'); +const require_context$1 = require('../../context-CrbHoDid.cjs'); +const require_utils = require('../../utils-CJMEEaD7.cjs'); + +//#region src/rspack/loaders/load.ts +async function load(source, map) { + const callback = this.async(); + const { plugin } = this.query; + let id = this.resource; + if (!plugin?.load || !id) return callback(null, source, map); + if (require_utils.isVirtualModuleId(id, plugin)) id = require_utils.decodeVirtualModuleId(id, plugin); + const context = require_context$1.createContext(this); + const { handler } = require_context.normalizeObjectHook("load", plugin.load); + try { + const res = await handler.call(Object.assign({}, this._compilation && require_context$1.createBuildContext(this._compiler, this._compilation, this), context), require_webpack_like.normalizeAbsolutePath(id)); + if (res == null) callback(null, source, map); + else if (typeof res !== "string") callback(null, res.code, res.map ?? map); + else callback(null, res, map); + } catch (error) { + if (error instanceof Error) callback(error); + else callback(new Error(String(error))); + } +} + +//#endregion +module.exports = load; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/rspack/loaders/load.d.cts b/tools/ui/node_modules/unplugin/dist/rspack/loaders/load.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..43defb9e40f72dd9753658b6ccf05c36666e0a6f --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/rspack/loaders/load.d.cts @@ -0,0 +1,5 @@ +import { LoaderContext } from "@rspack/core"; + +//#region src/rspack/loaders/load.d.ts +declare function load(this: LoaderContext, source: string, map: any): Promise; +export = load; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/rspack/loaders/load.d.ts b/tools/ui/node_modules/unplugin/dist/rspack/loaders/load.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a868e600a3ac66b873c29f0daba71b3fa3200eaf --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/rspack/loaders/load.d.ts @@ -0,0 +1,6 @@ +import { LoaderContext } from "@rspack/core"; + +//#region src/rspack/loaders/load.d.ts +declare function load(this: LoaderContext, source: string, map: any): Promise; +//#endregion +export { load as default }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/rspack/loaders/load.js b/tools/ui/node_modules/unplugin/dist/rspack/loaders/load.js new file mode 100644 index 0000000000000000000000000000000000000000..250f8dd4c83dfd47506d2a4a0b8c4a750eec03c5 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/rspack/loaders/load.js @@ -0,0 +1,27 @@ +import { n as normalizeObjectHook } from "../../context-Csj9j3eN.js"; +import { t as normalizeAbsolutePath } from "../../webpack-like-DFGTNSuV.js"; +import { n as createContext, t as createBuildContext } from "../../context-DkYlx1xL.js"; +import { i as isVirtualModuleId, n as decodeVirtualModuleId } from "../../utils-BosfZ0pB.js"; + +//#region src/rspack/loaders/load.ts +async function load(source, map) { + const callback = this.async(); + const { plugin } = this.query; + let id = this.resource; + if (!plugin?.load || !id) return callback(null, source, map); + if (isVirtualModuleId(id, plugin)) id = decodeVirtualModuleId(id, plugin); + const context = createContext(this); + const { handler } = normalizeObjectHook("load", plugin.load); + try { + const res = await handler.call(Object.assign({}, this._compilation && createBuildContext(this._compiler, this._compilation, this), context), normalizeAbsolutePath(id)); + if (res == null) callback(null, source, map); + else if (typeof res !== "string") callback(null, res.code, res.map ?? map); + else callback(null, res, map); + } catch (error) { + if (error instanceof Error) callback(error); + else callback(new Error(String(error))); + } +} + +//#endregion +export { load as default }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/rspack/loaders/transform.cjs b/tools/ui/node_modules/unplugin/dist/rspack/loaders/transform.cjs new file mode 100644 index 0000000000000000000000000000000000000000..2fa3b29053149ba4898d72172bd1ecc6bf6f6b98 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/rspack/loaders/transform.cjs @@ -0,0 +1,25 @@ +const require_context = require('../../context-CQfDPcdE.cjs'); +const require_context$1 = require('../../context-CrbHoDid.cjs'); + +//#region src/rspack/loaders/transform.ts +async function transform(source, map) { + const callback = this.async(); + const { plugin } = this.query; + if (!plugin?.transform) return callback(null, source, map); + const id = this.resource; + const context = require_context$1.createContext(this); + const { handler, filter } = require_context.normalizeObjectHook("transform", plugin.transform); + if (!filter(this.resource, source)) return callback(null, source, map); + try { + const res = await handler.call(Object.assign({}, this._compilation && require_context$1.createBuildContext(this._compiler, this._compilation, this, map), context), source, id); + if (res == null) callback(null, source, map); + else if (typeof res !== "string") callback(null, res.code, map == null ? map : res.map || map); + else callback(null, res, map); + } catch (error) { + if (error instanceof Error) callback(error); + else callback(new Error(String(error))); + } +} + +//#endregion +module.exports = transform; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/rspack/loaders/transform.d.cts b/tools/ui/node_modules/unplugin/dist/rspack/loaders/transform.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..3cb3cd712ec434c636c107d6c0a8bea8bcfc0da2 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/rspack/loaders/transform.d.cts @@ -0,0 +1,5 @@ +import { LoaderContext } from "@rspack/core"; + +//#region src/rspack/loaders/transform.d.ts +declare function transform(this: LoaderContext, source: string, map: any): Promise; +export = transform; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/rspack/loaders/transform.d.ts b/tools/ui/node_modules/unplugin/dist/rspack/loaders/transform.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0abd665085e6cd7767da98fe53433a91007b897c --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/rspack/loaders/transform.d.ts @@ -0,0 +1,6 @@ +import { LoaderContext } from "@rspack/core"; + +//#region src/rspack/loaders/transform.d.ts +declare function transform(this: LoaderContext, source: string, map: any): Promise; +//#endregion +export { transform as default }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/rspack/loaders/transform.js b/tools/ui/node_modules/unplugin/dist/rspack/loaders/transform.js new file mode 100644 index 0000000000000000000000000000000000000000..b3bc905c8478e95bc2ad3ff4050be2ec68864790 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/rspack/loaders/transform.js @@ -0,0 +1,25 @@ +import { n as normalizeObjectHook } from "../../context-Csj9j3eN.js"; +import { n as createContext, t as createBuildContext } from "../../context-DkYlx1xL.js"; + +//#region src/rspack/loaders/transform.ts +async function transform(source, map) { + const callback = this.async(); + const { plugin } = this.query; + if (!plugin?.transform) return callback(null, source, map); + const id = this.resource; + const context = createContext(this); + const { handler, filter } = normalizeObjectHook("transform", plugin.transform); + if (!filter(this.resource, source)) return callback(null, source, map); + try { + const res = await handler.call(Object.assign({}, this._compilation && createBuildContext(this._compiler, this._compilation, this, map), context), source, id); + if (res == null) callback(null, source, map); + else if (typeof res !== "string") callback(null, res.code, map == null ? map : res.map || map); + else callback(null, res, map); + } catch (error) { + if (error instanceof Error) callback(error); + else callback(new Error(String(error))); + } +} + +//#endregion +export { transform as default }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/utils-BosfZ0pB.js b/tools/ui/node_modules/unplugin/dist/utils-BosfZ0pB.js new file mode 100644 index 0000000000000000000000000000000000000000..9e261e3460679e444b5b70a33fae2124593d4452 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/utils-BosfZ0pB.js @@ -0,0 +1,54 @@ +import fs from "node:fs"; +import { basename, dirname, resolve } from "node:path"; + +//#region src/rspack/utils.ts +function encodeVirtualModuleId(id, plugin) { + return resolve(plugin.__virtualModulePrefix, encodeURIComponent(id)); +} +function decodeVirtualModuleId(encoded, _plugin) { + return decodeURIComponent(basename(encoded)); +} +function isVirtualModuleId(encoded, plugin) { + return dirname(encoded) === plugin.__virtualModulePrefix; +} +var FakeVirtualModulesPlugin = class FakeVirtualModulesPlugin { + name = "FakeVirtualModulesPlugin"; + static counters = /* @__PURE__ */ new Map(); + static initCleanup = false; + constructor(plugin) { + this.plugin = plugin; + if (!FakeVirtualModulesPlugin.initCleanup) { + FakeVirtualModulesPlugin.initCleanup = true; + process.once("exit", () => { + FakeVirtualModulesPlugin.counters.forEach((_, dir) => { + fs.rmSync(dir, { + recursive: true, + force: true + }); + }); + }); + } + } + apply(compiler) { + const dir = this.plugin.__virtualModulePrefix; + if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true }); + const counter = FakeVirtualModulesPlugin.counters.get(dir) ?? 0; + FakeVirtualModulesPlugin.counters.set(dir, counter + 1); + compiler.hooks.shutdown.tap(this.name, () => { + const counter$1 = (FakeVirtualModulesPlugin.counters.get(dir) ?? 1) - 1; + if (counter$1 === 0) { + FakeVirtualModulesPlugin.counters.delete(dir); + fs.rmSync(dir, { + recursive: true, + force: true + }); + } else FakeVirtualModulesPlugin.counters.set(dir, counter$1); + }); + } + async writeModule(file) { + return fs.promises.writeFile(file, ""); + } +}; + +//#endregion +export { isVirtualModuleId as i, decodeVirtualModuleId as n, encodeVirtualModuleId as r, FakeVirtualModulesPlugin as t }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/utils-CJMEEaD7.cjs b/tools/ui/node_modules/unplugin/dist/utils-CJMEEaD7.cjs new file mode 100644 index 0000000000000000000000000000000000000000..a4824fc7d544a7962c2fe05034d7997768aff05c --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/utils-CJMEEaD7.cjs @@ -0,0 +1,80 @@ +const require_context = require('./context-CQfDPcdE.cjs'); +let node_fs = require("node:fs"); +node_fs = require_context.__toESM(node_fs); +let node_path = require("node:path"); +node_path = require_context.__toESM(node_path); + +//#region src/rspack/utils.ts +function encodeVirtualModuleId(id, plugin) { + return (0, node_path.resolve)(plugin.__virtualModulePrefix, encodeURIComponent(id)); +} +function decodeVirtualModuleId(encoded, _plugin) { + return decodeURIComponent((0, node_path.basename)(encoded)); +} +function isVirtualModuleId(encoded, plugin) { + return (0, node_path.dirname)(encoded) === plugin.__virtualModulePrefix; +} +var FakeVirtualModulesPlugin = class FakeVirtualModulesPlugin { + name = "FakeVirtualModulesPlugin"; + static counters = /* @__PURE__ */ new Map(); + static initCleanup = false; + constructor(plugin) { + this.plugin = plugin; + if (!FakeVirtualModulesPlugin.initCleanup) { + FakeVirtualModulesPlugin.initCleanup = true; + process.once("exit", () => { + FakeVirtualModulesPlugin.counters.forEach((_, dir) => { + node_fs.default.rmSync(dir, { + recursive: true, + force: true + }); + }); + }); + } + } + apply(compiler) { + const dir = this.plugin.__virtualModulePrefix; + if (!node_fs.default.existsSync(dir)) node_fs.default.mkdirSync(dir, { recursive: true }); + const counter = FakeVirtualModulesPlugin.counters.get(dir) ?? 0; + FakeVirtualModulesPlugin.counters.set(dir, counter + 1); + compiler.hooks.shutdown.tap(this.name, () => { + const counter$1 = (FakeVirtualModulesPlugin.counters.get(dir) ?? 1) - 1; + if (counter$1 === 0) { + FakeVirtualModulesPlugin.counters.delete(dir); + node_fs.default.rmSync(dir, { + recursive: true, + force: true + }); + } else FakeVirtualModulesPlugin.counters.set(dir, counter$1); + }); + } + async writeModule(file) { + return node_fs.default.promises.writeFile(file, ""); + } +}; + +//#endregion +Object.defineProperty(exports, 'FakeVirtualModulesPlugin', { + enumerable: true, + get: function () { + return FakeVirtualModulesPlugin; + } +}); +Object.defineProperty(exports, 'decodeVirtualModuleId', { + enumerable: true, + get: function () { + return decodeVirtualModuleId; + } +}); +Object.defineProperty(exports, 'encodeVirtualModuleId', { + enumerable: true, + get: function () { + return encodeVirtualModuleId; + } +}); +Object.defineProperty(exports, 'isVirtualModuleId', { + enumerable: true, + get: function () { + return isVirtualModuleId; + } +}); \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/webpack-like-DDVwPJ4e.cjs b/tools/ui/node_modules/unplugin/dist/webpack-like-DDVwPJ4e.cjs new file mode 100644 index 0000000000000000000000000000000000000000..27e29ae98c177a09c32528e38d072c49e1396fd7 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/webpack-like-DDVwPJ4e.cjs @@ -0,0 +1,45 @@ +const require_context = require('./context-CQfDPcdE.cjs'); +let node_path = require("node:path"); +node_path = require_context.__toESM(node_path); + +//#region src/utils/webpack-like.ts +function transformUse(data, plugin, transformLoader) { + if (data.resource == null) return []; + const id = normalizeAbsolutePath(data.resource + (data.resourceQuery || "")); + if (plugin.transformInclude && !plugin.transformInclude(id)) return []; + const { filter } = require_context.normalizeObjectHook("load", plugin.transform); + if (!filter(id)) return []; + return [{ + loader: transformLoader, + options: { plugin }, + ident: plugin.name + }]; +} +/** +* Normalizes a given path when it's absolute. Normalizing means returning a new path by converting +* the input path to the native os format. This is useful in cases where we want to normalize +* the `id` argument of a hook. Any absolute ids should be in the default format +* of the operating system. Any relative imports or node_module imports should remain +* untouched. +* +* @param path - Path to normalize. +* @returns a new normalized path. +*/ +function normalizeAbsolutePath(path) { + if ((0, node_path.isAbsolute)(path)) return (0, node_path.normalize)(path); + else return path; +} + +//#endregion +Object.defineProperty(exports, 'normalizeAbsolutePath', { + enumerable: true, + get: function () { + return normalizeAbsolutePath; + } +}); +Object.defineProperty(exports, 'transformUse', { + enumerable: true, + get: function () { + return transformUse; + } +}); \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/webpack-like-DFGTNSuV.js b/tools/ui/node_modules/unplugin/dist/webpack-like-DFGTNSuV.js new file mode 100644 index 0000000000000000000000000000000000000000..716bc80bf02f8138f9af787605e933b0f9fba6dd --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/webpack-like-DFGTNSuV.js @@ -0,0 +1,33 @@ +import { n as normalizeObjectHook } from "./context-Csj9j3eN.js"; +import { isAbsolute, normalize } from "node:path"; + +//#region src/utils/webpack-like.ts +function transformUse(data, plugin, transformLoader) { + if (data.resource == null) return []; + const id = normalizeAbsolutePath(data.resource + (data.resourceQuery || "")); + if (plugin.transformInclude && !plugin.transformInclude(id)) return []; + const { filter } = normalizeObjectHook("load", plugin.transform); + if (!filter(id)) return []; + return [{ + loader: transformLoader, + options: { plugin }, + ident: plugin.name + }]; +} +/** +* Normalizes a given path when it's absolute. Normalizing means returning a new path by converting +* the input path to the native os format. This is useful in cases where we want to normalize +* the `id` argument of a hook. Any absolute ids should be in the default format +* of the operating system. Any relative imports or node_module imports should remain +* untouched. +* +* @param path - Path to normalize. +* @returns a new normalized path. +*/ +function normalizeAbsolutePath(path$1) { + if (isAbsolute(path$1)) return normalize(path$1); + else return path$1; +} + +//#endregion +export { transformUse as n, normalizeAbsolutePath as t }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/webpack/loaders/load.cjs b/tools/ui/node_modules/unplugin/dist/webpack/loaders/load.cjs new file mode 100644 index 0000000000000000000000000000000000000000..8a6bf783ad85f961c95bcff5edc91994152ac1d6 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/webpack/loaders/load.cjs @@ -0,0 +1,28 @@ +const require_context = require('../../context-CQfDPcdE.cjs'); +const require_webpack_like = require('../../webpack-like-DDVwPJ4e.cjs'); +const require_context$1 = require('../../context-D7WFmOmt.cjs'); + +//#region src/webpack/loaders/load.ts +async function load(source, map) { + const callback = this.async(); + const { plugin } = this.query; + let id = this.resource; + if (!plugin?.load || !id) return callback(null, source, map); + if (id.startsWith(plugin.__virtualModulePrefix)) id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length)); + const context = require_context$1.createContext(this); + const { handler } = require_context.normalizeObjectHook("load", plugin.load); + const res = await handler.call(Object.assign({}, require_context$1.createBuildContext({ + addWatchFile: (file) => { + this.addDependency(file); + }, + getWatchFiles: () => { + return this.getDependencies(); + } + }, this._compiler, this._compilation, this), context), require_webpack_like.normalizeAbsolutePath(id)); + if (res == null) callback(null, source, map); + else if (typeof res !== "string") callback(null, res.code, res.map ?? map); + else callback(null, res, map); +} + +//#endregion +module.exports = load; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/webpack/loaders/load.d.cts b/tools/ui/node_modules/unplugin/dist/webpack/loaders/load.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..52cdffdf1ff27eefa1e0b6001befd0a7f05ffd92 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/webpack/loaders/load.d.cts @@ -0,0 +1,5 @@ +import { LoaderContext } from "webpack"; + +//#region src/webpack/loaders/load.d.ts +declare function load(this: LoaderContext, source: string, map: any): Promise; +export = load; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/webpack/loaders/load.d.ts b/tools/ui/node_modules/unplugin/dist/webpack/loaders/load.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b432090f4121a7a52e3f3f746ebf26d7636d33d5 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/webpack/loaders/load.d.ts @@ -0,0 +1,6 @@ +import { LoaderContext } from "webpack"; + +//#region src/webpack/loaders/load.d.ts +declare function load(this: LoaderContext, source: string, map: any): Promise; +//#endregion +export { load as default }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/webpack/loaders/load.js b/tools/ui/node_modules/unplugin/dist/webpack/loaders/load.js new file mode 100644 index 0000000000000000000000000000000000000000..b7580d2afdb374179390ecd41d0e71798caee2e0 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/webpack/loaders/load.js @@ -0,0 +1,28 @@ +import { n as normalizeObjectHook } from "../../context-Csj9j3eN.js"; +import { t as normalizeAbsolutePath } from "../../webpack-like-DFGTNSuV.js"; +import { n as createBuildContext, r as createContext } from "../../context-OCFO8EW1.js"; + +//#region src/webpack/loaders/load.ts +async function load(source, map) { + const callback = this.async(); + const { plugin } = this.query; + let id = this.resource; + if (!plugin?.load || !id) return callback(null, source, map); + if (id.startsWith(plugin.__virtualModulePrefix)) id = decodeURIComponent(id.slice(plugin.__virtualModulePrefix.length)); + const context = createContext(this); + const { handler } = normalizeObjectHook("load", plugin.load); + const res = await handler.call(Object.assign({}, createBuildContext({ + addWatchFile: (file) => { + this.addDependency(file); + }, + getWatchFiles: () => { + return this.getDependencies(); + } + }, this._compiler, this._compilation, this), context), normalizeAbsolutePath(id)); + if (res == null) callback(null, source, map); + else if (typeof res !== "string") callback(null, res.code, res.map ?? map); + else callback(null, res, map); +} + +//#endregion +export { load as default }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/webpack/loaders/transform.cjs b/tools/ui/node_modules/unplugin/dist/webpack/loaders/transform.cjs new file mode 100644 index 0000000000000000000000000000000000000000..7d1ab8d8983c61caae496ab6241caad77fd748df --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/webpack/loaders/transform.cjs @@ -0,0 +1,31 @@ +const require_context = require('../../context-CQfDPcdE.cjs'); +const require_context$1 = require('../../context-D7WFmOmt.cjs'); + +//#region src/webpack/loaders/transform.ts +async function transform(source, map) { + const callback = this.async(); + const { plugin } = this.query; + if (!plugin?.transform) return callback(null, source, map); + const context = require_context$1.createContext(this); + const { handler, filter } = require_context.normalizeObjectHook("transform", plugin.transform); + if (!filter(this.resource, source)) return callback(null, source, map); + try { + const res = await handler.call(Object.assign({}, require_context$1.createBuildContext({ + addWatchFile: (file) => { + this.addDependency(file); + }, + getWatchFiles: () => { + return this.getDependencies(); + } + }, this._compiler, this._compilation, this, map), context), source, this.resource); + if (res == null) callback(null, source, map); + else if (typeof res !== "string") callback(null, res.code, map == null ? map : res.map || map); + else callback(null, res, map); + } catch (error) { + if (error instanceof Error) callback(error); + else callback(new Error(String(error))); + } +} + +//#endregion +module.exports = transform; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/webpack/loaders/transform.d.cts b/tools/ui/node_modules/unplugin/dist/webpack/loaders/transform.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..b1fb637501da60176fa99e7b915e31aeb0d65e0d --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/webpack/loaders/transform.d.cts @@ -0,0 +1,5 @@ +import { LoaderContext } from "webpack"; + +//#region src/webpack/loaders/transform.d.ts +declare function transform(this: LoaderContext, source: string, map: any): Promise; +export = transform; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/webpack/loaders/transform.d.ts b/tools/ui/node_modules/unplugin/dist/webpack/loaders/transform.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2f6aa8dae8b87a462979e08f3fdb53b342bc08c2 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/webpack/loaders/transform.d.ts @@ -0,0 +1,6 @@ +import { LoaderContext } from "webpack"; + +//#region src/webpack/loaders/transform.d.ts +declare function transform(this: LoaderContext, source: string, map: any): Promise; +//#endregion +export { transform as default }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/dist/webpack/loaders/transform.js b/tools/ui/node_modules/unplugin/dist/webpack/loaders/transform.js new file mode 100644 index 0000000000000000000000000000000000000000..2d153a3fa557b9fd910effc8fbd547cae6e8a157 --- /dev/null +++ b/tools/ui/node_modules/unplugin/dist/webpack/loaders/transform.js @@ -0,0 +1,31 @@ +import { n as normalizeObjectHook } from "../../context-Csj9j3eN.js"; +import { n as createBuildContext, r as createContext } from "../../context-OCFO8EW1.js"; + +//#region src/webpack/loaders/transform.ts +async function transform(source, map) { + const callback = this.async(); + const { plugin } = this.query; + if (!plugin?.transform) return callback(null, source, map); + const context = createContext(this); + const { handler, filter } = normalizeObjectHook("transform", plugin.transform); + if (!filter(this.resource, source)) return callback(null, source, map); + try { + const res = await handler.call(Object.assign({}, createBuildContext({ + addWatchFile: (file) => { + this.addDependency(file); + }, + getWatchFiles: () => { + return this.getDependencies(); + } + }, this._compiler, this._compilation, this, map), context), source, this.resource); + if (res == null) callback(null, source, map); + else if (typeof res !== "string") callback(null, res.code, map == null ? map : res.map || map); + else callback(null, res, map); + } catch (error) { + if (error instanceof Error) callback(error); + else callback(new Error(String(error))); + } +} + +//#endregion +export { transform as default }; \ No newline at end of file diff --git a/tools/ui/node_modules/unplugin/package.json b/tools/ui/node_modules/unplugin/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a9bb41e690e35cf9e8c5ef2830f05f56d2e92106 --- /dev/null +++ b/tools/ui/node_modules/unplugin/package.json @@ -0,0 +1,92 @@ +{ + "name": "unplugin", + "type": "module", + "version": "2.3.11", + "description": "Unified plugin system for build tools", + "license": "MIT", + "homepage": "https://unplugin.unjs.io", + "repository": { + "type": "git", + "url": "git+https://github.com/unjs/unplugin.git" + }, + "sideEffects": false, + "exports": { + ".": { + "import": "./dist/index.js", + "require": "./dist/index.cjs" + }, + "./dist/webpack/loaders/*": "./dist/webpack/loaders/*.cjs", + "./dist/rspack/loaders/*": "./dist/rspack/loaders/*.cjs" + }, + "main": "dist/index.js", + "module": "dist/index.js", + "types": "dist/index.d.ts", + "files": [ + "dist" + ], + "engines": { + "node": ">=18.12.0" + }, + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "acorn": "^8.15.0", + "picomatch": "^4.0.3", + "webpack-virtual-modules": "^0.6.2" + }, + "devDependencies": { + "@antfu/eslint-config": "^6.2.0", + "@antfu/ni": "^27.0.1", + "@farmfe/cli": "^1.0.5", + "@farmfe/core": "^1.7.11", + "@rspack/cli": "^1.6.0", + "@rspack/core": "^1.6.0", + "@types/fs-extra": "^11.0.4", + "@types/node": "^24.10.0", + "@types/picomatch": "^4.0.2", + "ansis": "^4.2.0", + "bumpp": "^10.3.1", + "esbuild": "^0.25.12", + "esbuild-plugin-copy": "^2.1.1", + "eslint": "^9.39.0", + "eslint-plugin-format": "^1.0.2", + "fast-glob": "^3.3.3", + "fs-extra": "^11.3.2", + "jiti": "^2.6.1", + "lint-staged": "^16.2.6", + "magic-string": "^0.30.21", + "rolldown": "^1.0.0-beta.46", + "rollup": "^4.52.5", + "simple-git-hooks": "^2.13.1", + "tsdown": "^0.15.12", + "typescript": "~5.9.3", + "unloader": "^0.5.0", + "unplugin-unused": "^0.5.5", + "vite": "^7.1.12", + "vitest": "^4.0.6", + "webpack": "^5.102.1", + "webpack-cli": "^6.0.1", + "unplugin": "2.3.11" + }, + "resolutions": { + "esbuild": "catalog:" + }, + "simple-git-hooks": { + "pre-commit": "pnpm i --frozen-lockfile --ignore-scripts --offline && npx lint-staged" + }, + "lint-staged": { + "*": "eslint --fix" + }, + "scripts": { + "build": "tsdown", + "dev": "tsdown --watch src", + "lint": "eslint --cache .", + "lint:fix": "nr lint --fix", + "typecheck": "tsc --noEmit", + "docs:dev": "pnpm -C docs run dev", + "docs:build": "pnpm -C docs run build", + "docs:gen-files": "pnpm -C docs run gen-files", + "release": "bumpp", + "test": "nr test:build && vitest run --pool=forks", + "test:build": "jiti scripts/buildFixtures.ts" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/upath/LICENSE b/tools/ui/node_modules/upath/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..77fab240221f04f7b0af379c4a0bca96734f16a8 --- /dev/null +++ b/tools/ui/node_modules/upath/LICENSE @@ -0,0 +1,22 @@ +Copyright(c) 2014-2019 Angelos Pikoulas (agelos.pikoulas@gmail.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/upath/build/code/upath.js b/tools/ui/node_modules/upath/build/code/upath.js new file mode 100644 index 0000000000000000000000000000000000000000..f0949e139e782631953f506b2f65878efd63082e --- /dev/null +++ b/tools/ui/node_modules/upath/build/code/upath.js @@ -0,0 +1,171 @@ +/** +* upath http://github.com/anodynos/upath/ +* +* A proxy to `path`, replacing `\` with `/` for all results & new methods to normalize & join keeping leading `./` and add, change, default, trim file extensions. +* Version 1.2.0 - Compiled on 2019-09-02 23:33:57 +* Repository git://github.com/anodynos/upath +* Copyright(c) 2019 Angelos Pikoulas +* License MIT +*/ + +// Generated by uRequire v0.7.0-beta.33 target: 'lib' template: 'nodejs' + + +var VERSION = '1.2.0'; // injected by urequire-rc-inject-version + +var extraFn, extraFunctions, isFunction, isString, isValidExt, name, path, propName, propValue, toUnix, upath, slice = [].slice, indexOf = [].indexOf || function (item) { + for (var i = 0, l = this.length; i < l; i++) { + if (i in this && this[i] === item) + return i; + } + return -1; + }, hasProp = {}.hasOwnProperty; +path = require("path"); +isFunction = function (val) { + return val instanceof Function; +}; +isString = function (val) { + return typeof val === "string" || !!val && typeof val === "object" && Object.prototype.toString.call(val) === "[object String]"; +}; +upath = exports; +upath.VERSION = typeof VERSION !== "undefined" && VERSION !== null ? VERSION : "NO-VERSION"; +toUnix = function (p) { + var double; + p = p.replace(/\\/g, "/"); + double = /\/\//; + while (p.match(double)) { + p = p.replace(double, "/"); + } + return p; +}; +for (propName in path) { + propValue = path[propName]; + if (isFunction(propValue)) { + upath[propName] = function (propName) { + return function () { + var args, result; + args = 1 <= arguments.length ? slice.call(arguments, 0) : []; + args = args.map(function (p) { + if (isString(p)) { + return toUnix(p); + } else { + return p; + } + }); + result = path[propName].apply(path, args); + if (isString(result)) { + return toUnix(result); + } else { + return result; + } + }; + }(propName); + } else { + upath[propName] = propValue; + } +} +upath.sep = "/"; +extraFunctions = { + toUnix: toUnix, + normalizeSafe: function (p) { + p = toUnix(p); + if (p.startsWith("./")) { + if (p.startsWith("./..") || p === "./") { + return upath.normalize(p); + } else { + return "./" + upath.normalize(p); + } + } else { + return upath.normalize(p); + } + }, + normalizeTrim: function (p) { + p = upath.normalizeSafe(p); + if (p.endsWith("/")) { + return p.slice(0, +(p.length - 2) + 1 || 9000000000); + } else { + return p; + } + }, + joinSafe: function () { + var p, result; + p = 1 <= arguments.length ? slice.call(arguments, 0) : []; + result = upath.join.apply(null, p); + if (p[0].startsWith("./") && !result.startsWith("./")) { + result = "./" + result; + } + return result; + }, + addExt: function (file, ext) { + if (!ext) { + return file; + } else { + if (ext[0] !== ".") { + ext = "." + ext; + } + return file + (file.endsWith(ext) ? "" : ext); + } + }, + trimExt: function (filename, ignoreExts, maxSize) { + var oldExt; + if (maxSize == null) { + maxSize = 7; + } + oldExt = upath.extname(filename); + if (isValidExt(oldExt, ignoreExts, maxSize)) { + return filename.slice(0, +(filename.length - oldExt.length - 1) + 1 || 9000000000); + } else { + return filename; + } + }, + removeExt: function (filename, ext) { + if (!ext) { + return filename; + } else { + ext = ext[0] === "." ? ext : "." + ext; + if (upath.extname(filename) === ext) { + return upath.trimExt(filename); + } else { + return filename; + } + } + }, + changeExt: function (filename, ext, ignoreExts, maxSize) { + if (maxSize == null) { + maxSize = 7; + } + return upath.trimExt(filename, ignoreExts, maxSize) + (!ext ? "" : ext[0] === "." ? ext : "." + ext); + }, + defaultExt: function (filename, ext, ignoreExts, maxSize) { + var oldExt; + if (maxSize == null) { + maxSize = 7; + } + oldExt = upath.extname(filename); + if (isValidExt(oldExt, ignoreExts, maxSize)) { + return filename; + } else { + return upath.addExt(filename, ext); + } + } +}; +isValidExt = function (ext, ignoreExts, maxSize) { + if (ignoreExts == null) { + ignoreExts = []; + } + return ext && ext.length <= maxSize && indexOf.call(ignoreExts.map(function (e) { + return (e && e[0] !== "." ? "." : "") + e; + }), ext) < 0; +}; +for (name in extraFunctions) { + if (!hasProp.call(extraFunctions, name)) + continue; + extraFn = extraFunctions[name]; + if (upath[name] !== void 0) { + throw new Error("path." + name + " already exists."); + } else { + upath[name] = extraFn; + } +} + +; \ No newline at end of file diff --git a/tools/ui/node_modules/upath/package.json b/tools/ui/node_modules/upath/package.json new file mode 100644 index 0000000000000000000000000000000000000000..38f605b51d8df9559c0977043622337b757a1d58 --- /dev/null +++ b/tools/ui/node_modules/upath/package.json @@ -0,0 +1,60 @@ +{ + "name": "upath", + "description": "A proxy to `path`, replacing `\\` with `/` for all results & new methods to normalize & join keeping leading `./` and add, change, default, trim file extensions.", + "version": "1.2.0", + "homepage": "http://github.com/anodynos/upath/", + "author": { + "name": "Angelos Pikoulas", + "email": "agelos.pikoulas@gmail.com" + }, + "license": "MIT", + "keywords": [ + "path", + "unix", + "windows", + "extension", + "file extension", + "replace extension", + "change extension", + "trim extension", + "add extension", + "default extension" + ], + "repository": { + "type": "git", + "url": "git://github.com/anodynos/upath" + }, + "bugs": { + "url": "http://github.com/anodynos/upath/issues", + "email": "agelos.pikoulas@gmail.com" + }, + "main": "./build/code/upath.js", + "types": "./upath.d.ts", + "preferGlobal": false, + "scripts": { + "test": "grunt", + "build": "grunt lib" + }, + "directories": { + "doc": "./doc", + "dist": "./build" + }, + "engines": { + "node": ">=4", + "yarn": "*" + }, + "devDependencies": { + "chai": "~4.0.2", + "coffee-script": "1.12.6", + "grunt": "0.4.5", + "grunt-contrib-watch": "^1.1.0", + "grunt-urequire": "0.7.x", + "lodash": "^4.17.15", + "mocha": "~3.4.2", + "uberscore": "0.0.19", + "underscore.string": "^3.3.5", + "urequire": "0.7.0-beta.33", + "urequire-ab-specrunner": "^0.2.5", + "urequire-rc-inject-version": "^0.1.6" + } +} diff --git a/tools/ui/node_modules/upath/readme.md b/tools/ui/node_modules/upath/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..21bd958f45af2c067206f748c9227fc4e09192af --- /dev/null +++ b/tools/ui/node_modules/upath/readme.md @@ -0,0 +1,342 @@ +# upath v1.2.0 + +[![Build Status](https://travis-ci.org/anodynos/upath.svg?branch=master)](https://travis-ci.org/anodynos/upath) +[![Up to date Status](https://david-dm.org/anodynos/upath.png)](https://david-dm.org/anodynos/upath) + +A drop-in replacement / proxy to nodejs's `path` that: + + * Replaces the windows `\` with the unix `/` in all string params & results. This has significant positives - see below. + + * Adds **filename extensions** functions `addExt`, `trimExt`, `removeExt`, `changeExt`, and `defaultExt`. + + * Add a `normalizeSafe` function to preserve any meaningful leading `./` & a `normalizeTrim` which additionally trims any useless ending `/`. + + * Plus a helper `toUnix` that simply converts `\` to `/` and consolidates duplicates. + +**Useful note: these docs are actually auto generated from [specs](https://github.com/anodynos/upath/blob/master/source/spec/upath-spec.coffee), running on Linux.** + +Notes: + + * `upath.sep` is set to `'/'` for seamless replacement (as of 1.0.3). + + * upath has no runtime dependencies, except built-in `path` (as of 1.0.4) + + * travis-ci tested in node versions 4 to 12 + + +## Why ? + +Normal `path` doesn't convert paths to a unified format (ie `/`) before calculating paths (`normalize`, `join`), which can lead to numerous problems. +Also path joining, normalization etc on the two formats is not consistent, depending on where it runs. Running `path` on Windows yields different results than when it runs on Linux / Mac. + +In general, if you code your paths logic while developing on Unix/Mac and it runs on Windows, you may run into problems when using `path`. + +Note that using **Unix `/` on Windows** works perfectly inside nodejs (and other languages), so there's no reason to stick to the Windows legacy at all. + +##### Examples / specs + + +Check out the different (improved) behavior to vanilla `path`: + + `upath.normalize(path)` --returns--> + + ✓ `'c:/windows/nodejs/path'` ---> `'c:/windows/nodejs/path'` // equal to `path.normalize()` + ✓ `'c:/windows/../nodejs/path'` ---> `'c:/nodejs/path'` // equal to `path.normalize()` + ✓ `'c:\\windows\\nodejs\\path'` ---> `'c:/windows/nodejs/path'` // `path.normalize()` gives `'c:\windows\nodejs\path'` + ✓ `'c:\\windows\\..\\nodejs\\path'` ---> `'c:/nodejs/path'` // `path.normalize()` gives `'c:\windows\..\nodejs\path'` + ✓ `'//windows\\unix/mixed'` ---> `'/windows/unix/mixed'` // `path.normalize()` gives `'/windows\unix/mixed'` + ✓ `'\\windows//unix/mixed'` ---> `'/windows/unix/mixed'` // `path.normalize()` gives `'\windows/unix/mixed'` + ✓ `'////\\windows\\..\\unix/mixed/'` ---> `'/unix/mixed/'` // `path.normalize()` gives `'/\windows\..\unix/mixed/'` + + +Joining paths can also be a problem: + + `upath.join(paths...)` --returns--> + + ✓ `'some/nodejs/deep', '../path'` ---> `'some/nodejs/path'` // equal to `path.join()` + ✓ `'some/nodejs\\windows', '../path'` ---> `'some/nodejs/path'` // `path.join()` gives `'some/path'` + ✓ `'some\\windows\\only', '..\\path'` ---> `'some/windows/path'` // `path.join()` gives `'some\windows\only/..\path'` + + +Parsing with `path.parse()` should also be consistent across OSes: + + `upath.parse(path)` --returns--> + + ✓ `'c:\Windows\Directory\somefile.ext'` ---> `{ root: '', dir: 'c:/Windows/Directory', base: 'somefile.ext', ext: '.ext', name: 'somefile' }` + // `path.parse()` gives `'{ root: '', dir: '', base: 'c:\\Windows\\Directory\\somefile.ext', ext: '.ext', name: 'c:\\Windows\\Directory\\somefile' }'` + ✓ `'/root/of/unix/somefile.ext'` ---> `{ root: '/', dir: '/root/of/unix', base: 'somefile.ext', ext: '.ext', name: 'somefile' }` // equal to `path.parse()` + + +## Added functions + + +#### `upath.toUnix(path)` + +Just converts all `` to `/` and consolidates duplicates, without performing any normalization. + +##### Examples / specs + + `upath.toUnix(path)` --returns--> + + ✓ `'.//windows\//unix//mixed////'` ---> `'./windows/unix/mixed/'` + ✓ `'..///windows\..\\unix/mixed'` ---> `'../windows/../unix/mixed'` + + +#### `upath.normalizeSafe(path)` + +Exactly like `path.normalize(path)`, but it keeps the first meaningful `./`. + +Note that the unix `/` is returned everywhere, so windows `\` is always converted to unix `/`. + +##### Examples / specs & how it differs from vanilla `path` + + `upath.normalizeSafe(path)` --returns--> + + ✓ `''` ---> `'.'` // equal to `path.normalize()` + ✓ `'.'` ---> `'.'` // equal to `path.normalize()` + ✓ `'./'` ---> `'./'` // equal to `path.normalize()` + ✓ `'.//'` ---> `'./'` // equal to `path.normalize()` + ✓ `'.\\'` ---> `'./'` // `path.normalize()` gives `'.\'` + ✓ `'.\\//'` ---> `'./'` // `path.normalize()` gives `'.\/'` + ✓ `'./..'` ---> `'..'` // equal to `path.normalize()` + ✓ `'.//..'` ---> `'..'` // equal to `path.normalize()` + ✓ `'./../'` ---> `'../'` // equal to `path.normalize()` + ✓ `'.\\..\\'` ---> `'../'` // `path.normalize()` gives `'.\..\'` + ✓ `'./../dep'` ---> `'../dep'` // equal to `path.normalize()` + ✓ `'../dep'` ---> `'../dep'` // equal to `path.normalize()` + ✓ `'../path/dep'` ---> `'../path/dep'` // equal to `path.normalize()` + ✓ `'../path/../dep'` ---> `'../dep'` // equal to `path.normalize()` + ✓ `'dep'` ---> `'dep'` // equal to `path.normalize()` + ✓ `'path//dep'` ---> `'path/dep'` // equal to `path.normalize()` + ✓ `'./dep'` ---> `'./dep'` // `path.normalize()` gives `'dep'` + ✓ `'./path/dep'` ---> `'./path/dep'` // `path.normalize()` gives `'path/dep'` + ✓ `'./path/../dep'` ---> `'./dep'` // `path.normalize()` gives `'dep'` + ✓ `'.//windows\\unix/mixed/'` ---> `'./windows/unix/mixed/'` // `path.normalize()` gives `'windows\unix/mixed/'` + ✓ `'..//windows\\unix/mixed'` ---> `'../windows/unix/mixed'` // `path.normalize()` gives `'../windows\unix/mixed'` + ✓ `'windows\\unix/mixed/'` ---> `'windows/unix/mixed/'` // `path.normalize()` gives `'windows\unix/mixed/'` + ✓ `'..//windows\\..\\unix/mixed'` ---> `'../unix/mixed'` // `path.normalize()` gives `'../windows\..\unix/mixed'` + + +#### `upath.normalizeTrim(path)` + +Exactly like `path.normalizeSafe(path)`, but it trims any useless ending `/`. + +##### Examples / specs + + `upath.normalizeTrim(path)` --returns--> + + ✓ `'./'` ---> `'.'` // `upath.normalizeSafe()` gives `'./'` + ✓ `'./../'` ---> `'..'` // `upath.normalizeSafe()` gives `'../'` + ✓ `'./../dep/'` ---> `'../dep'` // `upath.normalizeSafe()` gives `'../dep/'` + ✓ `'path//dep\\'` ---> `'path/dep'` // `upath.normalizeSafe()` gives `'path/dep/'` + ✓ `'.//windows\\unix/mixed/'` ---> `'./windows/unix/mixed'` // `upath.normalizeSafe()` gives `'./windows/unix/mixed/'` + + +#### `upath.joinSafe([path1][, path2][, ...])` + +Exactly like `path.join()`, but it keeps the first meaningful `./`. + +Note that the unix `/` is returned everywhere, so windows `\` is always converted to unix `/`. + +##### Examples / specs & how it differs from vanilla `path` + + `upath.joinSafe(path)` --returns--> + + ✓ `'some/nodejs/deep', '../path'` ---> `'some/nodejs/path'` // equal to `path.join()` + ✓ `'./some/local/unix/', '../path'` ---> `'./some/local/path'` // `path.join()` gives `'some/local/path'` + ✓ `'./some\\current\\mixed', '..\\path'` ---> `'./some/current/path'` // `path.join()` gives `'some\current\mixed/..\path'` + ✓ `'../some/relative/destination', '..\\path'` ---> `'../some/relative/path'` // `path.join()` gives `'../some/relative/destination/..\path'` + + +## Added functions for *filename extension* manipulation. + +**Happy notes:** + + In all functions you can: + + * use both `.ext` & `ext` - the dot `.` on the extension is always adjusted correctly. + + * omit the `ext` param (pass null/undefined/empty string) and the common sense thing will happen. + + * ignore specific extensions from being considered as valid ones (eg `.min`, `.dev` `.aLongExtIsNotAnExt` etc), hence no trimming or replacement takes place on them. + + + +#### `upath.addExt(filename, [ext])` + +Adds `.ext` to `filename`, but only if it doesn't already have the exact extension. + +##### Examples / specs + + `upath.addExt(filename, 'js')` --returns--> + + ✓ `'myfile/addExt'` ---> `'myfile/addExt.js'` + ✓ `'myfile/addExt.txt'` ---> `'myfile/addExt.txt.js'` + ✓ `'myfile/addExt.js'` ---> `'myfile/addExt.js'` + ✓ `'myfile/addExt.min.'` ---> `'myfile/addExt.min..js'` + + +It adds nothing if no `ext` param is passed. + + `upath.addExt(filename)` --returns--> + + ✓ `'myfile/addExt'` ---> `'myfile/addExt'` + ✓ `'myfile/addExt.txt'` ---> `'myfile/addExt.txt'` + ✓ `'myfile/addExt.js'` ---> `'myfile/addExt.js'` + ✓ `'myfile/addExt.min.'` ---> `'myfile/addExt.min.'` + + +#### `upath.trimExt(filename, [ignoreExts], [maxSize=7])` + +Trims a filename's extension. + + * Extensions are considered to be up to `maxSize` chars long, counting the dot (defaults to 7). + + * An `Array` of `ignoreExts` (eg `['.min']`) prevents these from being considered as extension, thus are not trimmed. + +##### Examples / specs + + `upath.trimExt(filename)` --returns--> + + ✓ `'my/trimedExt.txt'` ---> `'my/trimedExt'` + ✓ `'my/trimedExt'` ---> `'my/trimedExt'` + ✓ `'my/trimedExt.min'` ---> `'my/trimedExt'` + ✓ `'my/trimedExt.min.js'` ---> `'my/trimedExt.min'` + ✓ `'../my/trimedExt.longExt'` ---> `'../my/trimedExt.longExt'` + + +It is ignoring `.min` & `.dev` as extensions, and considers exts with up to 8 chars. + + `upath.trimExt(filename, ['min', '.dev'], 8)` --returns--> + + ✓ `'my/trimedExt.txt'` ---> `'my/trimedExt'` + ✓ `'my/trimedExt.min'` ---> `'my/trimedExt.min'` + ✓ `'my/trimedExt.dev'` ---> `'my/trimedExt.dev'` + ✓ `'../my/trimedExt.longExt'` ---> `'../my/trimedExt'` + ✓ `'../my/trimedExt.longRExt'` ---> `'../my/trimedExt.longRExt'` + + +#### `upath.removeExt(filename, ext)` + +Removes the specific `ext` extension from filename, if it has it. Otherwise it leaves it as is. +As in all upath functions, it be `.ext` or `ext`. + +##### Examples / specs + + `upath.removeExt(filename, '.js')` --returns--> + + ✓ `'removedExt.js'` ---> `'removedExt'` + ✓ `'removedExt.txt.js'` ---> `'removedExt.txt'` + ✓ `'notRemoved.txt'` ---> `'notRemoved.txt'` + +It does not care about the length of exts. + + `upath.removeExt(filename, '.longExt')` --returns--> + + ✓ `'removedExt.longExt'` ---> `'removedExt'` + ✓ `'removedExt.txt.longExt'` ---> `'removedExt.txt'` + ✓ `'notRemoved.txt'` ---> `'notRemoved.txt'` + + +#### `upath.changeExt(filename, [ext], [ignoreExts], [maxSize=7])` + +Changes a filename's extension to `ext`. If it has no (valid) extension, it adds it. + + * Valid extensions are considered to be up to `maxSize` chars long, counting the dot (defaults to 7). + + * An `Array` of `ignoreExts` (eg `['.min']`) prevents these from being considered as extension, thus are not changed - the new extension is added instead. + +##### Examples / specs + + `upath.changeExt(filename, '.js')` --returns--> + + ✓ `'my/module.min'` ---> `'my/module.js'` + ✓ `'my/module.coffee'` ---> `'my/module.js'` + ✓ `'my/module'` ---> `'my/module.js'` + ✓ `'file/withDot.'` ---> `'file/withDot.js'` + ✓ `'file/change.longExt'` ---> `'file/change.longExt.js'` + + +If no `ext` param is given, it trims the current extension (if any). + + `upath.changeExt(filename)` --returns--> + + ✓ `'my/module.min'` ---> `'my/module'` + ✓ `'my/module.coffee'` ---> `'my/module'` + ✓ `'my/module'` ---> `'my/module'` + ✓ `'file/withDot.'` ---> `'file/withDot'` + ✓ `'file/change.longExt'` ---> `'file/change.longExt'` + + +It is ignoring `.min` & `.dev` as extensions, and considers exts with up to 8 chars. + + `upath.changeExt(filename, 'js', ['min', '.dev'], 8)` --returns--> + + ✓ `'my/module.coffee'` ---> `'my/module.js'` + ✓ `'file/notValidExt.min'` ---> `'file/notValidExt.min.js'` + ✓ `'file/notValidExt.dev'` ---> `'file/notValidExt.dev.js'` + ✓ `'file/change.longExt'` ---> `'file/change.js'` + ✓ `'file/change.longRExt'` ---> `'file/change.longRExt.js'` + + +#### `upath.defaultExt(filename, [ext], [ignoreExts], [maxSize=7])` + +Adds `.ext` to `filename`, only if it doesn't already have _any_ *old* extension. + + * (Old) extensions are considered to be up to `maxSize` chars long, counting the dot (defaults to 7). + + * An `Array` of `ignoreExts` (eg `['.min']`) will force adding default `.ext` even if one of these is present. + +##### Examples / specs + + `upath.defaultExt(filename, 'js')` --returns--> + + ✓ `'fileWith/defaultExt'` ---> `'fileWith/defaultExt.js'` + ✓ `'fileWith/defaultExt.js'` ---> `'fileWith/defaultExt.js'` + ✓ `'fileWith/defaultExt.min'` ---> `'fileWith/defaultExt.min'` + ✓ `'fileWith/defaultExt.longExt'` ---> `'fileWith/defaultExt.longExt.js'` + + +If no `ext` param is passed, it leaves filename intact. + + `upath.defaultExt(filename)` --returns--> + + ✓ `'fileWith/defaultExt'` ---> `'fileWith/defaultExt'` + ✓ `'fileWith/defaultExt.js'` ---> `'fileWith/defaultExt.js'` + ✓ `'fileWith/defaultExt.min'` ---> `'fileWith/defaultExt.min'` + ✓ `'fileWith/defaultExt.longExt'` ---> `'fileWith/defaultExt.longExt'` + + +It is ignoring `.min` & `.dev` as extensions, and considers exts with up to 8 chars. + + `upath.defaultExt(filename, 'js', ['min', '.dev'], 8)` --returns--> + + ✓ `'fileWith/defaultExt'` ---> `'fileWith/defaultExt.js'` + ✓ `'fileWith/defaultExt.min'` ---> `'fileWith/defaultExt.min.js'` + ✓ `'fileWith/defaultExt.dev'` ---> `'fileWith/defaultExt.dev.js'` + ✓ `'fileWith/defaultExt.longExt'` ---> `'fileWith/defaultExt.longExt'` + ✓ `'fileWith/defaultExt.longRext'` ---> `'fileWith/defaultExt.longRext.js'` + + +Copyright(c) 2014-2019 Angelos Pikoulas (agelos.pikoulas@gmail.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/upath/upath.d.ts b/tools/ui/node_modules/upath/upath.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..778d70a8d0a4805e812a4746e31c845c8c99b87d --- /dev/null +++ b/tools/ui/node_modules/upath/upath.d.ts @@ -0,0 +1,239 @@ +declare module "upath" { + + /** + * A parsed path object generated by path.parse() or consumed by path.format(). + */ + export interface ParsedPath { + /** + * The root of the path such as '/' or 'c:\' + */ + root: string; + /** + * The full directory path such as '/home/user/dir' or 'c:\path\dir' + */ + dir: string; + /** + * The file name including extension (if any) such as 'index.html' + */ + base: string; + /** + * The file extension (if any) such as '.html' + */ + ext: string; + /** + * The file name without extension (if any) such as 'index' + */ + name: string; + } + + /** + * Version of the library + */ + export var VERSION: string; + + /** + * Just converts all `to/` and consolidates duplicates, without performing any normalization. + * + * @param p string path to convert to unix. + */ + export function toUnix(p: string): string; + + /** + * Exactly like path.normalize(path), but it keeps the first meaningful ./. + * + * Note that the unix / is returned everywhere, so windows \ is always converted to unix /. + * + * @param p string path to normalize. + */ + export function normalizeSafe(p: string): string; + + /** + * Exactly like path.normalizeSafe(path), but it trims any useless ending /. + * + * @param p string path to normalize + */ + export function normalizeTrim(p: string): string; + + /** + * Exactly like path.join(), but it keeps the first meaningful ./. + * + * Note that the unix / is returned everywhere, so windows \ is always converted to unix /. + * + * @param paths string paths to join + */ + export function joinSafe(...p: any[]): string; + + /** + * Adds .ext to filename, but only if it doesn't already have the exact extension. + * + * @param file string filename to add extension to + * @param ext string extension to add + */ + export function addExt(file: string, ext: string): string; + + /** + * Trims a filename's extension. + * + * Extensions are considered to be up to maxSize chars long, counting the dot (defaults to 7). + * + * An Array of ignoreExts (eg ['.min']) prevents these from being considered as extension, thus are not trimmed. + * + * @param filename string filename to trim it's extension + * @param ignoreExts array extensions to ignore + * @param maxSize number max length of the extension + */ + export function trimExt(filename: string, ignoreExts?: string[], maxSize?: number): string; + + /** + * Removes the specific ext extension from filename, if it has it. Otherwise it leaves it as is. As in all upath functions, it be .ext or ext. + * + * @param file string filename to remove extension to + * @param ext string extension to remove + */ + export function removeExt(filename: string, ext: string): string; + + /** + * Changes a filename's extension to ext. If it has no (valid) extension, it adds it. + * + * Valid extensions are considered to be up to maxSize chars long, counting the dot (defaults to 7). + * + * An Array of ignoreExts (eg ['.min']) prevents these from being considered as extension, thus are not changed - the new extension is added instead. + * + * @param filename string filename to change it's extension + * @param ext string extension to change to + * @param ignoreExts array extensions to ignore + * @param maxSize number max length of the extension + */ + export function changeExt(filename: string, ext: string, ignoreExts?: string[], maxSize?: number): string; + + /** + * Adds .ext to filename, only if it doesn't already have any old extension. + * + * (Old) extensions are considered to be up to maxSize chars long, counting the dot (defaults to 7). + * + * An Array of ignoreExts (eg ['.min']) will force adding default .ext even if one of these is present. + * + * @param filename string filename to default to it's extension + * @param ext string extension to default to + * @param ignoreExts array extensions to ignore + * @param maxSize number max length of the extension + */ + export function defaultExt(filename: string, ext: string, ignoreExts?: string[], maxSize?: number): string; + + /** + * Normalize a string path, reducing '..' and '.' parts. + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used. + * + * @param p string path to normalize. + */ + export function normalize(p: string): string; + /** + * Join all arguments together and normalize the resulting path. + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. + * + * @param paths string paths to join. + */ + export function join(...paths: any[]): string; + /** + * Join all arguments together and normalize the resulting path. + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown. + * + * @param paths string paths to join. + */ + export function join(...paths: string[]): string; + /** + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}. + * + * Starting from leftmost {from} parameter, resolves {to} to an absolute path. + * + * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory. + * + * @param pathSegments string paths to join. Non-string arguments are ignored. + */ + export function resolve(...pathSegments: any[]): string; + /** + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory. + * + * @param path path to test. + */ + export function isAbsolute(path: string): boolean; + /** + * Solve the relative path from {from} to {to}. + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve. + * + * @param from + * @param to + */ + export function relative(from: string, to: string): string; + /** + * Return the directory name of a path. Similar to the Unix dirname command. + * + * @param p the path to evaluate. + */ + export function dirname(p: string): string; + /** + * Return the last portion of a path. Similar to the Unix basename command. + * Often used to extract the file name from a fully qualified path. + * + * @param p the path to evaluate. + * @param ext optionally, an extension to remove from the result. + */ + export function basename(p: string, ext?: string): string; + /** + * Return the extension of the path, from the last '.' to end of string in the last portion of the path. + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string + * + * @param p the path to evaluate. + */ + export function extname(p: string): string; + /** + * The platform-specific file separator. '\\' or '/'. + */ + export var sep: string; + /** + * The platform-specific file delimiter. ';' or ':'. + */ + export var delimiter: string; + /** + * Returns an object from a path string - the opposite of format(). + * + * @param pathString path to evaluate. + */ + export function parse(pathString: string): ParsedPath; + /** + * Returns a path string from an object - the opposite of parse(). + * + * @param pathString path to evaluate. + */ + export function format(pathObject: ParsedPath): string; + + export module posix { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; + } + + export module win32 { + export function normalize(p: string): string; + export function join(...paths: any[]): string; + export function resolve(...pathSegments: any[]): string; + export function isAbsolute(p: string): boolean; + export function relative(from: string, to: string): string; + export function dirname(p: string): string; + export function basename(p: string, ext?: string): string; + export function extname(p: string): string; + export var sep: string; + export var delimiter: string; + export function parse(p: string): ParsedPath; + export function format(pP: ParsedPath): string; + } +} diff --git a/tools/ui/node_modules/update-browserslist-db/LICENSE b/tools/ui/node_modules/update-browserslist-db/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..377ae1bee969f65948f68eaeecee947e04760073 --- /dev/null +++ b/tools/ui/node_modules/update-browserslist-db/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright 2022 Andrey Sitnik and other contributors + +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/update-browserslist-db/README.md b/tools/ui/node_modules/update-browserslist-db/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6a4770bd3540378a86d6181d6bad8a959b3809e3 --- /dev/null +++ b/tools/ui/node_modules/update-browserslist-db/README.md @@ -0,0 +1,30 @@ +# Update Browserslist DB + +Browserslist logo by Anton Popov + +CLI tool to update `caniuse-lite` with browsers DB +from [Browserslist](https://github.com/browserslist/browserslist/) config. + +Some queries like `last 2 versions` or `>1%` depend on actual data +from `caniuse-lite`. + +```sh +npx update-browserslist-db@latest +``` +Or if using `pnpm`: +```sh +pnpm exec update-browserslist-db latest +``` +Or if using `yarn`: +```sh +yarn dlx update-browserslist-db@latest +``` + + + Sponsored by Evil Martians + + +## Docs +Read full docs **[here](https://github.com/browserslist/update-db#readme)**. diff --git a/tools/ui/node_modules/update-browserslist-db/check-npm-version.js b/tools/ui/node_modules/update-browserslist-db/check-npm-version.js new file mode 100644 index 0000000000000000000000000000000000000000..b06811a52239173c970529c41c8e5630b0fee50e --- /dev/null +++ b/tools/ui/node_modules/update-browserslist-db/check-npm-version.js @@ -0,0 +1,17 @@ +let { execSync } = require('child_process') +let pico = require('picocolors') + +try { + let version = parseInt(execSync('npm -v')) + if (version <= 6) { + process.stderr.write( + pico.red( + 'Update npm or call ' + + pico.yellow('npx browserslist@latest --update-db') + + '\n' + ) + ) + process.exit(1) + } + // eslint-disable-next-line no-unused-vars +} catch (e) {} diff --git a/tools/ui/node_modules/update-browserslist-db/cli.js b/tools/ui/node_modules/update-browserslist-db/cli.js new file mode 100644 index 0000000000000000000000000000000000000000..1388e94d08ce1c949cd65ef98172fa64c16c096a --- /dev/null +++ b/tools/ui/node_modules/update-browserslist-db/cli.js @@ -0,0 +1,42 @@ +#!/usr/bin/env node + +let { readFileSync } = require('fs') +let { join } = require('path') + +require('./check-npm-version') +let updateDb = require('./') + +const ROOT = __dirname + +function getPackage() { + return JSON.parse(readFileSync(join(ROOT, 'package.json'))) +} + +let args = process.argv.slice(2) + +let USAGE = 'Usage:\n npx update-browserslist-db\n' + +function isArg(arg) { + return args.some(i => i === arg) +} + +function error(msg) { + process.stderr.write('update-browserslist-db: ' + msg + '\n') + process.exit(1) +} + +if (isArg('--help') || isArg('-h')) { + process.stdout.write(getPackage().description + '.\n\n' + USAGE + '\n') +} else if (isArg('--version') || isArg('-v')) { + process.stdout.write('browserslist-lint ' + getPackage().version + '\n') +} else { + try { + updateDb() + } catch (e) { + if (e.name === 'BrowserslistUpdateError') { + error(e.message) + } else { + throw e + } + } +} diff --git a/tools/ui/node_modules/update-browserslist-db/index.d.ts b/tools/ui/node_modules/update-browserslist-db/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7ae5acd345325ea0a8708f5ee01ab6054e45a62d --- /dev/null +++ b/tools/ui/node_modules/update-browserslist-db/index.d.ts @@ -0,0 +1,6 @@ +/** + * Run update and print output to terminal. + */ +declare function updateDb(print?: (str: string) => void): void + +export = updateDb diff --git a/tools/ui/node_modules/update-browserslist-db/index.js b/tools/ui/node_modules/update-browserslist-db/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8909e39901d524e3a4d8de88f0090b430e704c4f --- /dev/null +++ b/tools/ui/node_modules/update-browserslist-db/index.js @@ -0,0 +1,347 @@ +let { execSync } = require('child_process') +let escalade = require('escalade/sync') +let { existsSync, readFileSync, writeFileSync } = require('fs') +let { join } = require('path') +let pico = require('picocolors') + +const { detectEOL, detectIndent } = require('./utils') + +function BrowserslistUpdateError(message) { + this.name = 'BrowserslistUpdateError' + this.message = message + this.browserslist = true + if (Error.captureStackTrace) { + Error.captureStackTrace(this, BrowserslistUpdateError) + } +} + +BrowserslistUpdateError.prototype = Error.prototype + +// Check if HADOOP_HOME is set to determine if this is running in a Hadoop environment +const IsHadoopExists = !!process.env.HADOOP_HOME +const yarnCommand = IsHadoopExists ? 'yarnpkg' : 'yarn' + +/* c8 ignore next 3 */ +function defaultPrint(str) { + process.stdout.write(str) +} + +function detectLockfile() { + let packageDir = escalade('.', (dir, names) => { + return names.indexOf('package.json') !== -1 ? dir : '' + }) + + if (!packageDir) { + throw new BrowserslistUpdateError( + 'Cannot find package.json. ' + + 'Is this the right directory to run `npx update-browserslist-db` in?' + ) + } + + let lockfileNpm = join(packageDir, 'package-lock.json') + let lockfileShrinkwrap = join(packageDir, 'npm-shrinkwrap.json') + let lockfileYarn = join(packageDir, 'yarn.lock') + let lockfilePnpm = join(packageDir, 'pnpm-lock.yaml') + let lockfileBun = join(packageDir, 'bun.lock') + let lockfileBunBinary = join(packageDir, 'bun.lockb') + + if (existsSync(lockfilePnpm)) { + return { file: lockfilePnpm, mode: 'pnpm' } + } else if (existsSync(lockfileBun) || existsSync(lockfileBunBinary)) { + return { file: lockfileBun, mode: 'bun' } + } else if (existsSync(lockfileNpm)) { + return { file: lockfileNpm, mode: 'npm' } + } else if (existsSync(lockfileYarn)) { + let lock = { file: lockfileYarn, mode: 'yarn' } + lock.content = readFileSync(lock.file).toString() + lock.version = /# yarn lockfile v1/.test(lock.content) ? 1 : 2 + return lock + } else if (existsSync(lockfileShrinkwrap)) { + return { file: lockfileShrinkwrap, mode: 'npm' } + } + throw new BrowserslistUpdateError( + 'No lockfile found. Run "npm install", "yarn install" or "pnpm install"' + ) +} + +function getLatestInfo(lock) { + if (lock.mode === 'yarn') { + if (lock.version === 1) { + return JSON.parse( + execSync(yarnCommand + ' info caniuse-lite --json').toString() + ).data + } else { + return JSON.parse( + execSync(yarnCommand + ' npm info caniuse-lite --json').toString() + ) + } + } + if (lock.mode === 'pnpm') { + return JSON.parse(execSync('pnpm info caniuse-lite --json').toString()) + } + if (lock.mode === 'bun') { + return JSON.parse(execSync(' bun info caniuse-lite --json').toString()) + } + + return JSON.parse(execSync('npm show caniuse-lite --json').toString()) +} + +function getBrowsers() { + let browserslist = require('browserslist') + return browserslist().reduce((result, entry) => { + if (!result[entry[0]]) { + result[entry[0]] = [] + } + result[entry[0]].push(entry[1]) + return result + }, {}) +} + +function diffBrowsers(old, current) { + let browsers = Object.keys(old).concat( + Object.keys(current).filter(browser => old[browser] === undefined) + ) + return browsers + .map(browser => { + let oldVersions = old[browser] || [] + let currentVersions = current[browser] || [] + let common = oldVersions.filter(v => currentVersions.includes(v)) + let added = currentVersions.filter(v => !common.includes(v)) + let removed = oldVersions.filter(v => !common.includes(v)) + return removed + .map(v => pico.red('- ' + browser + ' ' + v)) + .concat(added.map(v => pico.green('+ ' + browser + ' ' + v))) + }) + .reduce((result, array) => result.concat(array), []) + .join('\n') +} + +function updateNpmLockfile(lock, latest) { + let metadata = { latest, versions: [] } + let content = deletePackage(JSON.parse(lock.content), metadata) + metadata.content = JSON.stringify(content, null, detectIndent(lock.content)) + return metadata +} + +function deletePackage(node, metadata) { + if (node.dependencies) { + if (node.dependencies['caniuse-lite']) { + let version = node.dependencies['caniuse-lite'].version + metadata.versions[version] = true + delete node.dependencies['caniuse-lite'] + } + for (let i in node.dependencies) { + node.dependencies[i] = deletePackage(node.dependencies[i], metadata) + } + } + if (node.packages) { + for (let path in node.packages) { + if (path.endsWith('/caniuse-lite')) { + metadata.versions[node.packages[path].version] = true + delete node.packages[path] + } + } + } + return node +} + +let yarnVersionRe = /version "(.*?)"/ + +function updateYarnLockfile(lock, latest) { + let blocks = lock.content.split(/(\n{2,})/).map(block => { + return block.split('\n') + }) + let versions = {} + blocks.forEach(lines => { + if (lines[0].indexOf('caniuse-lite@') !== -1) { + let match = yarnVersionRe.exec(lines[1]) + versions[match[1]] = true + if (match[1] !== latest.version) { + lines[1] = lines[1].replace( + /version "[^"]+"/, + 'version "' + latest.version + '"' + ) + lines[2] = lines[2].replace( + /resolved "[^"]+"/, + 'resolved "' + latest.dist.tarball + '"' + ) + if (lines.length === 4) { + lines[3] = latest.dist.integrity + ? lines[3].replace( + /integrity .+/, + 'integrity ' + latest.dist.integrity + ) + : '' + } + } + } + }) + let content = blocks.map(lines => lines.join('\n')).join('') + return { content, versions } +} + +function updateLockfile(lock, latest) { + if (!lock.content) lock.content = readFileSync(lock.file).toString() + + let updatedLockFile + if (lock.mode === 'yarn') { + updatedLockFile = updateYarnLockfile(lock, latest) + } else { + updatedLockFile = updateNpmLockfile(lock, latest) + } + updatedLockFile.content = updatedLockFile.content.replace( + /\n/g, + detectEOL(lock.content) + ) + return updatedLockFile +} + +function updatePackageManually(print, lock, latest) { + let lockfileData = updateLockfile(lock, latest) + let caniuseVersions = Object.keys(lockfileData.versions).sort() + if (caniuseVersions.length === 1 && caniuseVersions[0] === latest.version) { + print( + 'Installed version: ' + + pico.bold(pico.green(caniuseVersions[0])) + + '\n' + + pico.bold(pico.green('caniuse-lite is up to date')) + + '\n' + ) + return + } + + if (caniuseVersions.length === 0) { + caniuseVersions[0] = 'none' + } + print( + 'Installed version' + + (caniuseVersions.length === 1 ? ': ' : 's: ') + + pico.bold(pico.red(caniuseVersions.join(', '))) + + '\n' + + 'Removing old caniuse-lite from lock file\n' + ) + writeFileSync(lock.file, lockfileData.content) + + let install = + lock.mode === 'yarn' ? yarnCommand + ' add -W' : lock.mode + ' install' + print( + 'Installing new caniuse-lite version\n' + + pico.yellow('$ ' + install + ' caniuse-lite baseline-browser-mapping') + + '\n' + ) + try { + execSync(install + ' caniuse-lite baseline-browser-mapping') + } catch (e) /* c8 ignore start */ { + print( + pico.red( + '\n' + + e.stack + + '\n\n' + + 'Problem with `' + + install + + ' caniuse-lite` call. ' + + 'Run it manually.\n' + ) + ) + process.exit(1) + } /* c8 ignore end */ + + let del = + lock.mode === 'yarn' ? yarnCommand + ' remove -W' : lock.mode + ' uninstall' + print( + 'Cleaning package.json dependencies from caniuse-lite\n' + + pico.yellow('$ ' + del + ' caniuse-lite baseline-browser-mapping') + + '\n' + ) + execSync(del + ' caniuse-lite baseline-browser-mapping') +} + +function updateWith(print, cmd) { + print('Updating caniuse-lite version\n' + pico.yellow('$ ' + cmd) + '\n') + try { + execSync(cmd) + } catch (e) /* c8 ignore start */ { + print(pico.red(e.stdout.toString())) + print( + pico.red( + '\n' + + e.stack + + '\n\n' + + 'Problem with `' + + cmd + + '` call. ' + + 'Run it manually.\n' + ) + ) + process.exit(1) + } /* c8 ignore end */ +} + +module.exports = function updateDB(print = defaultPrint) { + let lock = detectLockfile() + let latest = getLatestInfo(lock) + + let listError + let oldList + try { + oldList = getBrowsers() + } catch (e) { + listError = e + } + + print('Latest version: ' + pico.bold(pico.green(latest.version)) + '\n') + + if (lock.mode === 'yarn' && lock.version !== 1) { + updateWith( + print, + yarnCommand + ' up -R caniuse-lite baseline-browser-mapping' + ) + } else if (lock.mode === 'pnpm') { + let lockContent = readFileSync(lock.file).toString() + let packages = lockContent.includes('baseline-browser-mapping') + ? 'caniuse-lite baseline-browser-mapping' + : 'caniuse-lite' + updateWith(print, 'pnpm up --depth=Infinity --no-save ' + packages) + } else if (lock.mode === 'bun') { + updateWith(print, 'bun update caniuse-lite baseline-browser-mapping') + } else { + updatePackageManually(print, lock, latest) + } + + print('caniuse-lite has been successfully updated\n') + + let newList + if (!listError) { + try { + newList = getBrowsers() + } catch (e) /* c8 ignore start */ { + listError = e + } /* c8 ignore end */ + } + + if (listError) { + if (listError.message.includes("Cannot find module 'browserslist'")) { + print( + pico.gray( + 'Install `browserslist` to your direct dependencies ' + + 'to see target browser changes\n' + ) + ) + } else { + print( + pico.gray( + 'Problem with browser list retrieval.\n' + + 'Target browser changes won’t be shown.\n' + ) + ) + } + } else { + let changes = diffBrowsers(oldList, newList) + if (changes) { + print('\nTarget browser changes:\n') + print(changes + '\n') + } else { + print('\n' + pico.green('No target browser changes') + '\n') + } + } +} diff --git a/tools/ui/node_modules/update-browserslist-db/package.json b/tools/ui/node_modules/update-browserslist-db/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1ed5daf0df8f821441173eb6ba5bdf0e7467c97b --- /dev/null +++ b/tools/ui/node_modules/update-browserslist-db/package.json @@ -0,0 +1,40 @@ +{ + "name": "update-browserslist-db", + "version": "1.2.3", + "description": "CLI tool to update caniuse-lite to refresh target browsers from Browserslist config", + "keywords": [ + "caniuse", + "browsers", + "target" + ], + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/browserslist" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "author": "Andrey Sitnik ", + "license": "MIT", + "repository": "browserslist/update-db", + "types": "./index.d.ts", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "dependencies": { + "escalade": "^3.2.0", + "picocolors": "^1.1.1" + }, + "peerDependencies": { + "browserslist": ">= 4.21.0" + }, + "bin": "cli.js" +} diff --git a/tools/ui/node_modules/update-browserslist-db/utils.js b/tools/ui/node_modules/update-browserslist-db/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..c63b278c01079f60115dfa3d23276bf052613c74 --- /dev/null +++ b/tools/ui/node_modules/update-browserslist-db/utils.js @@ -0,0 +1,25 @@ +const { EOL } = require('os') + +const getFirstRegexpMatchOrDefault = (text, regexp, defaultValue) => { + regexp.lastIndex = 0 // https://stackoverflow.com/a/11477448/4536543 + let match = regexp.exec(text) + if (match !== null) { + return match[1] + } else { + return defaultValue + } +} + +const DEFAULT_INDENT = ' ' +const INDENT_REGEXP = /^([ \t]+)[^\s]/m + +module.exports.detectIndent = text => + getFirstRegexpMatchOrDefault(text, INDENT_REGEXP, DEFAULT_INDENT) +module.exports.DEFAULT_INDENT = DEFAULT_INDENT + +const DEFAULT_EOL = EOL +const EOL_REGEXP = /(\r\n|\n|\r)/g + +module.exports.detectEOL = text => + getFirstRegexpMatchOrDefault(text, EOL_REGEXP, DEFAULT_EOL) +module.exports.DEFAULT_EOL = DEFAULT_EOL diff --git a/tools/ui/node_modules/uri-js/LICENSE b/tools/ui/node_modules/uri-js/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9338bde8eb43b24ce18b60c5628836f143c8eefb --- /dev/null +++ b/tools/ui/node_modules/uri-js/LICENSE @@ -0,0 +1,11 @@ +Copyright 2011 Gary Court. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. 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. + +THIS SOFTWARE IS PROVIDED BY GARY COURT "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 GARY COURT 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. + +The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Gary Court. diff --git a/tools/ui/node_modules/uri-js/README.md b/tools/ui/node_modules/uri-js/README.md new file mode 100644 index 0000000000000000000000000000000000000000..43e648bbad5c85d5346c88e82e39b9ecd5f70970 --- /dev/null +++ b/tools/ui/node_modules/uri-js/README.md @@ -0,0 +1,203 @@ +# URI.js + +URI.js is an [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt) compliant, scheme extendable URI parsing/validating/resolving library for all JavaScript environments (browsers, Node.js, etc). +It is also compliant with the IRI ([RFC 3987](http://www.ietf.org/rfc/rfc3987.txt)), IDNA ([RFC 5890](http://www.ietf.org/rfc/rfc5890.txt)), IPv6 Address ([RFC 5952](http://www.ietf.org/rfc/rfc5952.txt)), IPv6 Zone Identifier ([RFC 6874](http://www.ietf.org/rfc/rfc6874.txt)) specifications. + +URI.js has an extensive test suite, and works in all (Node.js, web) environments. It weighs in at 6.4kb (gzipped, 17kb deflated). + +## API + +### Parsing + + URI.parse("uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body"); + //returns: + //{ + // scheme : "uri", + // userinfo : "user:pass", + // host : "example.com", + // port : 123, + // path : "/one/two.three", + // query : "q1=a1&q2=a2", + // fragment : "body" + //} + +### Serializing + + URI.serialize({scheme : "http", host : "example.com", fragment : "footer"}) === "http://example.com/#footer" + +### Resolving + + URI.resolve("uri://a/b/c/d?q", "../../g") === "uri://a/g" + +### Normalizing + + URI.normalize("HTTP://ABC.com:80/%7Esmith/home.html") === "http://abc.com/~smith/home.html" + +### Comparison + + URI.equal("example://a/b/c/%7Bfoo%7D", "eXAMPLE://a/./b/../b/%63/%7bfoo%7d") === true + +### IP Support + + //IPv4 normalization + URI.normalize("//192.068.001.000") === "//192.68.1.0" + + //IPv6 normalization + URI.normalize("//[2001:0:0DB8::0:0001]") === "//[2001:0:db8::1]" + + //IPv6 zone identifier support + URI.parse("//[2001:db8::7%25en1]"); + //returns: + //{ + // host : "2001:db8::7%en1" + //} + +### IRI Support + + //convert IRI to URI + URI.serialize(URI.parse("http://examplé.org/rosé")) === "http://xn--exampl-gva.org/ros%C3%A9" + //convert URI to IRI + URI.serialize(URI.parse("http://xn--exampl-gva.org/ros%C3%A9"), {iri:true}) === "http://examplé.org/rosé" + +### Options + +All of the above functions can accept an additional options argument that is an object that can contain one or more of the following properties: + +* `scheme` (string) + + Indicates the scheme that the URI should be treated as, overriding the URI's normal scheme parsing behavior. + +* `reference` (string) + + If set to `"suffix"`, it indicates that the URI is in the suffix format, and the validator will use the option's `scheme` property to determine the URI's scheme. + +* `tolerant` (boolean, false) + + If set to `true`, the parser will relax URI resolving rules. + +* `absolutePath` (boolean, false) + + If set to `true`, the serializer will not resolve a relative `path` component. + +* `iri` (boolean, false) + + If set to `true`, the serializer will unescape non-ASCII characters as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). + +* `unicodeSupport` (boolean, false) + + If set to `true`, the parser will unescape non-ASCII characters in the parsed output as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt). + +* `domainHost` (boolean, false) + + If set to `true`, the library will treat the `host` component as a domain name, and convert IDNs (International Domain Names) as per [RFC 5891](http://www.ietf.org/rfc/rfc5891.txt). + +## Scheme Extendable + +URI.js supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_scheme) dependent processing rules. Currently, URI.js has built in support for the following schemes: + +* http \[[RFC 2616](http://www.ietf.org/rfc/rfc2616.txt)\] +* https \[[RFC 2818](http://www.ietf.org/rfc/rfc2818.txt)\] +* ws \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\] +* wss \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\] +* mailto \[[RFC 6068](http://www.ietf.org/rfc/rfc6068.txt)\] +* urn \[[RFC 2141](http://www.ietf.org/rfc/rfc2141.txt)\] +* urn:uuid \[[RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)\] + +### HTTP/HTTPS Support + + URI.equal("HTTP://ABC.COM:80", "http://abc.com/") === true + URI.equal("https://abc.com", "HTTPS://ABC.COM:443/") === true + +### WS/WSS Support + + URI.parse("wss://example.com/foo?bar=baz"); + //returns: + //{ + // scheme : "wss", + // host: "example.com", + // resourceName: "/foo?bar=baz", + // secure: true, + //} + + URI.equal("WS://ABC.COM:80/chat#one", "ws://abc.com/chat") === true + +### Mailto Support + + URI.parse("mailto:alpha@example.com,bravo@example.com?subject=SUBSCRIBE&body=Sign%20me%20up!"); + //returns: + //{ + // scheme : "mailto", + // to : ["alpha@example.com", "bravo@example.com"], + // subject : "SUBSCRIBE", + // body : "Sign me up!" + //} + + URI.serialize({ + scheme : "mailto", + to : ["alpha@example.com"], + subject : "REMOVE", + body : "Please remove me", + headers : { + cc : "charlie@example.com" + } + }) === "mailto:alpha@example.com?cc=charlie@example.com&subject=REMOVE&body=Please%20remove%20me" + +### URN Support + + URI.parse("urn:example:foo"); + //returns: + //{ + // scheme : "urn", + // nid : "example", + // nss : "foo", + //} + +#### URN UUID Support + + URI.parse("urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"); + //returns: + //{ + // scheme : "urn", + // nid : "uuid", + // uuid : "f81d4fae-7dec-11d0-a765-00a0c91e6bf6", + //} + +## Usage + +To load in a browser, use the following tag: + + + +To load in a CommonJS/Module environment, first install with npm/yarn by running on the command line: + + npm install uri-js + # OR + yarn add uri-js + +Then, in your code, load it using: + + const URI = require("uri-js"); + +If you are writing your code in ES6+ (ESNEXT) or TypeScript, you would load it using: + + import * as URI from "uri-js"; + +Or you can load just what you need using named exports: + + import { parse, serialize, resolve, resolveComponents, normalize, equal, removeDotSegments, pctEncChar, pctDecChars, escapeComponent, unescapeComponent } from "uri-js"; + +## Breaking changes + +### Breaking changes from 3.x + +URN parsing has been completely changed to better align with the specification. Scheme is now always `urn`, but has two new properties: `nid` which contains the Namspace Identifier, and `nss` which contains the Namespace Specific String. The `nss` property will be removed by higher order scheme handlers, such as the UUID URN scheme handler. + +The UUID of a URN can now be found in the `uuid` property. + +### Breaking changes from 2.x + +URI validation has been removed as it was slow, exposed a vulnerabilty, and was generally not useful. + +### Breaking changes from 1.x + +The `errors` array on parsed components is now an `error` string. diff --git a/tools/ui/node_modules/uri-js/dist/es5/uri.all.d.ts b/tools/ui/node_modules/uri-js/dist/es5/uri.all.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..da51e23527705f85a4d8c513d9931ae2d3eec7a0 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/es5/uri.all.d.ts @@ -0,0 +1,59 @@ +export interface URIComponents { + scheme?: string; + userinfo?: string; + host?: string; + port?: number | string; + path?: string; + query?: string; + fragment?: string; + reference?: string; + error?: string; +} +export interface URIOptions { + scheme?: string; + reference?: string; + tolerant?: boolean; + absolutePath?: boolean; + iri?: boolean; + unicodeSupport?: boolean; + domainHost?: boolean; +} +export interface URISchemeHandler { + scheme: string; + parse(components: ParentComponents, options: Options): Components; + serialize(components: Components, options: Options): ParentComponents; + unicodeSupport?: boolean; + domainHost?: boolean; + absolutePath?: boolean; +} +export interface URIRegExps { + NOT_SCHEME: RegExp; + NOT_USERINFO: RegExp; + NOT_HOST: RegExp; + NOT_PATH: RegExp; + NOT_PATH_NOSCHEME: RegExp; + NOT_QUERY: RegExp; + NOT_FRAGMENT: RegExp; + ESCAPE: RegExp; + UNRESERVED: RegExp; + OTHER_CHARS: RegExp; + PCT_ENCODED: RegExp; + IPV4ADDRESS: RegExp; + IPV6ADDRESS: RegExp; +} +export declare const SCHEMES: { + [scheme: string]: URISchemeHandler; +}; +export declare function pctEncChar(chr: string): string; +export declare function pctDecChars(str: string): string; +export declare function parse(uriString: string, options?: URIOptions): URIComponents; +export declare function removeDotSegments(input: string): string; +export declare function serialize(components: URIComponents, options?: URIOptions): string; +export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; +export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; +export declare function normalize(uri: string, options?: URIOptions): string; +export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; +export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; +export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; +export declare function escapeComponent(str: string, options?: URIOptions): string; +export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/tools/ui/node_modules/uri-js/dist/es5/uri.all.js b/tools/ui/node_modules/uri-js/dist/es5/uri.all.js new file mode 100644 index 0000000000000000000000000000000000000000..0706116fef7e309ea15e868343e2d4a673a7b9dd --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/es5/uri.all.js @@ -0,0 +1,1443 @@ +/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.URI = global.URI || {}))); +}(this, (function (exports) { 'use strict'; + +function merge() { + for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) { + sets[_key] = arguments[_key]; + } + + if (sets.length > 1) { + sets[0] = sets[0].slice(0, -1); + var xl = sets.length - 1; + for (var x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } else { + return sets[0]; + } +} +function subexp(str) { + return "(?:" + str + ")"; +} +function typeOf(o) { + return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase(); +} +function toUpperCase(str) { + return str.toUpperCase(); +} +function toArray(obj) { + return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : []; +} +function assign(target, source) { + var obj = target; + if (source) { + for (var key in source) { + obj[key] = source[key]; + } + } + return obj; +} + +function buildExps(isIRI) { + var ALPHA$$ = "[A-Za-z]", + CR$ = "[\\x0D]", + DIGIT$$ = "[0-9]", + DQUOTE$$ = "[\\x22]", + HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), + //case-insensitive + LF$$ = "[\\x0A]", + SP$$ = "[\\x20]", + PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), + //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", + SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", + RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), + UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", + //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", + //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), + SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), + USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), + DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), + DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), + //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), + H16$ = subexp(HEXDIG$$ + "{1,4}"), + LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), + IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), + // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), + // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), + //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), + //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), + //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), + //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), + //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), + //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), + //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), + ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), + //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), + //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), + //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), + IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), + //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), + HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), + PORT$ = subexp(DIGIT$$ + "*"), + AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), + PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), + SEGMENT$ = subexp(PCHAR$ + "*"), + SEGMENT_NZ$ = subexp(PCHAR$ + "+"), + SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), + PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), + PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), + //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), + //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), + //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", + PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), + FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), + HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), + URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), + RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), + URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), + ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), + GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", + SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", + AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +var URI_PROTOCOL = buildExps(false); + +var IRI_PROTOCOL = buildExps(true); + +var slicedToArray = function () { + function sliceIterator(arr, i) { + var _arr = []; + var _n = true; + var _d = false; + var _e = undefined; + + try { + for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { + _arr.push(_s.value); + + if (i && _arr.length === i) break; + } + } catch (err) { + _d = true; + _e = err; + } finally { + try { + if (!_n && _i["return"]) _i["return"](); + } finally { + if (_d) throw _e; + } + } + + return _arr; + } + + return function (arr, i) { + if (Array.isArray(arr)) { + return arr; + } else if (Symbol.iterator in Object(arr)) { + return sliceIterator(arr, i); + } else { + throw new TypeError("Invalid attempt to destructure non-iterable instance"); + } + }; +}(); + + + + + + + + + + + + + +var toConsumableArray = function (arr) { + if (Array.isArray(arr)) { + for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; + + return arr2; + } else { + return Array.from(arr); + } +}; + +/** Highest positive signed 32-bit float value */ + +var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1 + +/** Bootstring parameters */ +var base = 36; +var tMin = 1; +var tMax = 26; +var skew = 38; +var damp = 700; +var initialBias = 72; +var initialN = 128; // 0x80 +var delimiter = '-'; // '\x2D' + +/** Regular expressions */ +var regexPunycode = /^xn--/; +var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars +var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators + +/** Error messages */ +var errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' +}; + +/** Convenience shortcuts */ +var baseMinusTMin = base - tMin; +var floor = Math.floor; +var stringFromCharCode = String.fromCharCode; + +/*--------------------------------------------------------------------------*/ + +/** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ +function error$1(type) { + throw new RangeError(errors[type]); +} + +/** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ +function map(array, fn) { + var result = []; + var length = array.length; + while (length--) { + result[length] = fn(array[length]); + } + return result; +} + +/** + * A simple `Array#map`-like wrapper to work with domain name strings or email + * addresses. + * @private + * @param {String} domain The domain name or email address. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ +function mapDomain(string, fn) { + var parts = string.split('@'); + var result = ''; + if (parts.length > 1) { + // In email addresses, only the domain name should be punycoded. Leave + // the local part (i.e. everything up to `@`) intact. + result = parts[0] + '@'; + string = parts[1]; + } + // Avoid `split(regex)` for IE8 compatibility. See #17. + string = string.replace(regexSeparators, '\x2E'); + var labels = string.split('.'); + var encoded = map(labels, fn).join('.'); + return result + encoded; +} + +/** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ +function ucs2decode(string) { + var output = []; + var counter = 0; + var length = string.length; + while (counter < length) { + var value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // It's a high surrogate, and there is a next character. + var extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { + // Low surrogate. + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // It's an unmatched surrogate; only append this code unit, in case the + // next code unit is the high surrogate of a surrogate pair. + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; +} + +/** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ +var ucs2encode = function ucs2encode(array) { + return String.fromCodePoint.apply(String, toConsumableArray(array)); +}; + +/** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ +var basicToDigit = function basicToDigit(codePoint) { + if (codePoint - 0x30 < 0x0A) { + return codePoint - 0x16; + } + if (codePoint - 0x41 < 0x1A) { + return codePoint - 0x41; + } + if (codePoint - 0x61 < 0x1A) { + return codePoint - 0x61; + } + return base; +}; + +/** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ +var digitToBasic = function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); +}; + +/** + * Bias adaptation function as per section 3.4 of RFC 3492. + * https://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ +var adapt = function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); +}; + +/** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ +var decode = function decode(input) { + // Don't use UCS-2. + var output = []; + var inputLength = input.length; + var i = 0; + var n = initialN; + var bias = initialBias; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + var basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (var j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error$1('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{ + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + var oldi = i; + for (var w = 1, k = base;; /* no condition */k += base) { + + if (index >= inputLength) { + error$1('invalid-input'); + } + + var digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error$1('overflow'); + } + + i += digit * w; + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + + if (digit < t) { + break; + } + + var baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error$1('overflow'); + } + + w *= baseMinusT; + } + + var out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error$1('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output. + output.splice(i++, 0, n); + } + + return String.fromCodePoint.apply(String, output); +}; + +/** + * Converts a string of Unicode symbols (e.g. a domain name label) to a + * Punycode string of ASCII-only symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ +var encode = function encode(input) { + var output = []; + + // Convert the input in UCS-2 to an array of Unicode code points. + input = ucs2decode(input); + + // Cache the length. + var inputLength = input.length; + + // Initialize the state. + var n = initialN; + var delta = 0; + var bias = initialBias; + + // Handle the basic code points. + var _iteratorNormalCompletion = true; + var _didIteratorError = false; + var _iteratorError = undefined; + + try { + for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) { + var _currentValue2 = _step.value; + + if (_currentValue2 < 0x80) { + output.push(stringFromCharCode(_currentValue2)); + } + } + } catch (err) { + _didIteratorError = true; + _iteratorError = err; + } finally { + try { + if (!_iteratorNormalCompletion && _iterator.return) { + _iterator.return(); + } + } finally { + if (_didIteratorError) { + throw _iteratorError; + } + } + } + + var basicLength = output.length; + var handledCPCount = basicLength; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string with a delimiter unless it's empty. + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + var m = maxInt; + var _iteratorNormalCompletion2 = true; + var _didIteratorError2 = false; + var _iteratorError2 = undefined; + + try { + for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) { + var currentValue = _step2.value; + + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow. + } catch (err) { + _didIteratorError2 = true; + _iteratorError2 = err; + } finally { + try { + if (!_iteratorNormalCompletion2 && _iterator2.return) { + _iterator2.return(); + } + } finally { + if (_didIteratorError2) { + throw _iteratorError2; + } + } + } + + var handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error$1('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + var _iteratorNormalCompletion3 = true; + var _didIteratorError3 = false; + var _iteratorError3 = undefined; + + try { + for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) { + var _currentValue = _step3.value; + + if (_currentValue < n && ++delta > maxInt) { + error$1('overflow'); + } + if (_currentValue == n) { + // Represent delta as a generalized variable-length integer. + var q = delta; + for (var k = base;; /* no condition */k += base) { + var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias; + if (q < t) { + break; + } + var qMinusT = q - t; + var baseMinusT = base - t; + output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + } catch (err) { + _didIteratorError3 = true; + _iteratorError3 = err; + } finally { + try { + if (!_iteratorNormalCompletion3 && _iterator3.return) { + _iterator3.return(); + } + } finally { + if (_didIteratorError3) { + throw _iteratorError3; + } + } + } + + ++delta; + ++n; + } + return output.join(''); +}; + +/** + * Converts a Punycode string representing a domain name or an email address + * to Unicode. Only the Punycoded parts of the input will be converted, i.e. + * it doesn't matter if you call it on a string that has already been + * converted to Unicode. + * @memberOf punycode + * @param {String} input The Punycoded domain name or email address to + * convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ +var toUnicode = function toUnicode(input) { + return mapDomain(input, function (string) { + return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string; + }); +}; + +/** + * Converts a Unicode string representing a domain name or an email address to + * Punycode. Only the non-ASCII parts of the domain name will be converted, + * i.e. it doesn't matter if you call it with a domain that's already in + * ASCII. + * @memberOf punycode + * @param {String} input The domain name or email address to convert, as a + * Unicode string. + * @returns {String} The Punycode representation of the given domain name or + * email address. + */ +var toASCII = function toASCII(input) { + return mapDomain(input, function (string) { + return regexNonASCII.test(string) ? 'xn--' + encode(string) : string; + }); +}; + +/*--------------------------------------------------------------------------*/ + +/** Define the public API */ +var punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '2.1.0', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode +}; + +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``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 GARY COURT 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. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +var SCHEMES = {}; +function pctEncChar(chr) { + var c = chr.charCodeAt(0); + var e = void 0; + if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase(); + return e; +} +function pctDecChars(str) { + var newStr = ""; + var i = 0; + var il = str.length; + while (i < il) { + var c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } else if (c >= 194 && c < 224) { + if (il - i >= 6) { + var c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode((c & 31) << 6 | c2 & 63); + } else { + newStr += str.substr(i, 6); + } + i += 6; + } else if (c >= 224) { + if (il - i >= 9) { + var _c = parseInt(str.substr(i + 4, 2), 16); + var c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63); + } else { + newStr += str.substr(i, 9); + } + i += 9; + } else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; +} +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(protocol.UNRESERVED) ? str : decStr; + } + if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; +} + +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; +} +function _normalizeIPv4(host, protocol) { + var matches = host.match(protocol.IPV4ADDRESS) || []; + + var _matches = slicedToArray(matches, 2), + address = _matches[1]; + + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } else { + return host; + } +} +function _normalizeIPv6(host, protocol) { + var matches = host.match(protocol.IPV6ADDRESS) || []; + + var _matches2 = slicedToArray(matches, 3), + address = _matches2[1], + zone = _matches2[2]; + + if (address) { + var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(), + _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2), + last = _address$toLowerCase$2[0], + first = _address$toLowerCase$2[1]; + + var firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + var lastFields = last.split(":").map(_stripLeadingZeros); + var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + var fieldCount = isLastFieldIPv4Address ? 7 : 8; + var lastFieldsStart = lastFields.length - fieldCount; + var fields = Array(fieldCount); + for (var x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + var allZeroFields = fields.reduce(function (acc, field, index) { + if (!field || field === "0") { + var lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } else { + acc.push({ index: index, length: 1 }); + } + } + return acc; + }, []); + var longestZeroFields = allZeroFields.sort(function (a, b) { + return b.length - a.length; + })[0]; + var newHost = void 0; + if (longestZeroFields && longestZeroFields.length > 1) { + var newFirst = fields.slice(0, longestZeroFields.index); + var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } else { + return host; + } +} +var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined; +function parse(uriString) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var components = {}; + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + var matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } else { + //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined; + components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined; + components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined; + //fix port number + if (isNaN(components.port)) { + components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined; + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } else if (components.scheme === undefined) { + components.reference = "relative"; + } else if (components.fragment === undefined) { + components.reference = "absolute"; + } else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } else { + components.error = components.error || "URI can not be parsed."; + } + return components; +} + +function _recomposeAuthority(components, options) { + var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) { + return "[" + $1 + ($2 ? "%25" + $2 : "") + "]"; + })); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} + +var RDS1 = /^\.\.?\//; +var RDS2 = /^\/\.(\/|$)/; +var RDS3 = /^\/\.\.(\/|$)/; +var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +function removeDotSegments(input) { + var output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } else if (input === "." || input === "..") { + input = ""; + } else { + var im = input.match(RDS5); + if (im) { + var s = im[0]; + input = input.slice(s.length); + output.push(s); + } else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} + +function serialize(components) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL; + var uriTokens = []; + //find scheme handler + var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) {} + //TODO: normalize IPv6 address as per RFC 5952 + + //if host component is a domain name + else if (options.domainHost || schemeHandler && schemeHandler.domainHost) { + //convert IDN via punycode + try { + components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host); + } catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } + } + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + var authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + var s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} + +function resolveComponents(base, relative) { + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var skipNormalization = arguments[3]; + + var target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } else { + target.query = base.query; + } + } else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } else if (!base.path) { + target.path = relative.path; + } else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative.fragment; + return target; +} + +function resolve(baseURI, relativeURI, options) { + var schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); +} + +function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); + } + return uri; +} + +function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} + +function escapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar); +} + +function unescapeComponent(str, options) { + return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars); +} + +var handler = { + scheme: "http", + domainHost: true, + parse: function parse(components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function serialize(components, options) { + var secure = String(components.scheme).toLowerCase() === "https"; + //normalize the default port + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; + +var handler$1 = { + scheme: "https", + domainHost: handler.domainHost, + parse: handler.parse, + serialize: handler.serialize +}; + +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +var handler$2 = { + scheme: "ws", + domainHost: true, + parse: function parse(components, options) { + var wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function serialize(wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws'; + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + var _wsComponents$resourc = wsComponents.resourceName.split('?'), + _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2), + path = _wsComponents$resourc2[0], + query = _wsComponents$resourc2[1]; + + wsComponents.path = path && path !== '/' ? path : undefined; + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; + +var handler$3 = { + scheme: "wss", + domainHost: handler$2.domainHost, + parse: handler$2.parse, + serialize: handler$2.serialize +}; + +var O = {}; +var isIRI = true; +//RFC 3986 +var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +var UNRESERVED = new RegExp(UNRESERVED$$, "g"); +var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +var NOT_HFVALUE = NOT_HFNAME; +function decodeUnreserved(str) { + var decStr = pctDecChars(str); + return !decStr.match(UNRESERVED) ? str : decStr; +} +var handler$4 = { + scheme: "mailto", + parse: function parse$$1(components, options) { + var mailtoComponents = components; + var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : []; + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + var unknownHeaders = false; + var headers = {}; + var hfields = mailtoComponents.query.split("&"); + for (var x = 0, xl = hfields.length; x < xl; ++x) { + var hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + var toAddrs = hfield[1].split(","); + for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) { + to.push(toAddrs[_x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) { + var addr = to[_x2].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[_x2] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function serialize$$1(mailtoComponents, options) { + var components = mailtoComponents; + var to = toArray(mailtoComponents.to); + if (to) { + for (var x = 0, xl = to.length; x < xl; ++x) { + var toAddr = String(to[x]); + var atIdx = toAddr.lastIndexOf("@"); + var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + var domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain); + } catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + var headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) headers["body"] = mailtoComponents.body; + var fields = []; + for (var name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } +}; + +var URN_PARSE = /^([^\:]+)\:(.*)/; +//RFC 2141 +var handler$5 = { + scheme: "urn", + parse: function parse$$1(components, options) { + var matches = components.path && components.path.match(URN_PARSE); + var urnComponents = components; + if (matches) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = matches[1].toLowerCase(); + var nss = matches[2]; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function serialize$$1(urnComponents, options) { + var scheme = options.scheme || urnComponents.scheme || "urn"; + var nid = urnComponents.nid; + var urnScheme = scheme + ":" + (options.nid || nid); + var schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + var uriComponents = urnComponents; + var nss = urnComponents.nss; + uriComponents.path = (nid || options.nid) + ":" + nss; + return uriComponents; + } +}; + +var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +//RFC 4122 +var handler$6 = { + scheme: "urn:uuid", + parse: function parse(urnComponents, options) { + var uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function serialize(uuidComponents, options) { + var urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + } +}; + +SCHEMES[handler.scheme] = handler; +SCHEMES[handler$1.scheme] = handler$1; +SCHEMES[handler$2.scheme] = handler$2; +SCHEMES[handler$3.scheme] = handler$3; +SCHEMES[handler$4.scheme] = handler$4; +SCHEMES[handler$5.scheme] = handler$5; +SCHEMES[handler$6.scheme] = handler$6; + +exports.SCHEMES = SCHEMES; +exports.pctEncChar = pctEncChar; +exports.pctDecChars = pctDecChars; +exports.parse = parse; +exports.removeDotSegments = removeDotSegments; +exports.serialize = serialize; +exports.resolveComponents = resolveComponents; +exports.resolve = resolve; +exports.normalize = normalize; +exports.equal = equal; +exports.escapeComponent = escapeComponent; +exports.unescapeComponent = unescapeComponent; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=uri.all.js.map diff --git a/tools/ui/node_modules/uri-js/dist/es5/uri.all.js.map b/tools/ui/node_modules/uri-js/dist/es5/uri.all.js.map new file mode 100644 index 0000000000000000000000000000000000000000..5b30c4e2202e13e69c61ab7d8bbeaf249e0c85bf --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/es5/uri.all.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uri.all.js","sources":["../../src/index.ts","../../src/schemes/urn-uuid.ts","../../src/schemes/urn.ts","../../src/schemes/mailto.ts","../../src/schemes/wss.ts","../../src/schemes/ws.ts","../../src/schemes/https.ts","../../src/schemes/http.ts","../../src/uri.ts","../../node_modules/punycode/punycode.es6.js","../../src/regexps-iri.ts","../../src/regexps-uri.ts","../../src/util.ts"],"sourcesContent":["import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","export function merge(...sets:Array):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}"],"names":["SCHEMES","uuid","scheme","urn","mailto","wss","ws","https","http","urnComponents","nss","uuidComponents","toLowerCase","options","error","tolerant","match","UUID","undefined","handler","uriComponents","path","nid","schemeHandler","serialize","urnScheme","parse","matches","components","URN_PARSE","query","fields","join","length","push","name","replace","PCT_ENCODED","decodeUnreserved","toUpperCase","NOT_HFNAME","pctEncChar","headers","NOT_HFVALUE","O","mailtoComponents","body","subject","to","x","localPart","domain","iri","e","punycode","toASCII","unescapeComponent","toUnicode","toAddr","slice","atIdx","NOT_LOCAL_PART","lastIndexOf","String","xl","toArray","addr","unicodeSupport","split","unknownHeaders","hfield","toAddrs","hfields","decStr","UNRESERVED","str","pctDecChars","RegExp","merge","UNRESERVED$$","SOME_DELIMS$$","ATEXT$$","VCHAR$$","PCT_ENCODED$","QTEXT$$","subexp","HEXDIG$$","isIRI","domainHost","wsComponents","fragment","resourceName","secure","port","isSecure","host","toString","URI_PROTOCOL","IRI_PROTOCOL","ESCAPE","escapeComponent","uriA","uriB","typeOf","equal","uri","normalize","resolveComponents","baseURI","schemelessOptions","relativeURI","assign","resolve","target","relative","base","userinfo","removeDotSegments","charAt","skipNormalization","uriTokens","s","authority","absolutePath","reference","_recomposeAuthority","protocol","IPV6ADDRESS","test","output","Error","input","im","RDS5","pop","RDS3","RDS2","RDS1","$1","$2","_normalizeIPv6","_normalizeIPv4","_","uriString","isNaN","indexOf","parseInt","NO_MATCH_IS_UNDEFINED","URI_PARSE","newHost","zone","newFirst","newLast","longestZeroFields","index","b","a","allZeroFields","sort","acc","lastLongest","field","reduce","fieldCount","isLastFieldIPv4Address","firstFields","lastFields","lastFieldsStart","Array","IPV4ADDRESS","last","map","_stripLeadingZeros","first","address","reverse","NOT_FRAGMENT","NOT_QUERY","NOT_PATH","NOT_PATH_NOSCHEME","NOT_HOST","NOT_USERINFO","NOT_SCHEME","_normalizeComponentEncoding","newStr","substr","i","fromCharCode","c","c2","c3","il","chr","charCodeAt","encode","decode","ucs2encode","ucs2decode","regexNonASCII","string","mapDomain","regexPunycode","n","delta","handledCPCount","adapt","handledCPCountPlusOne","basicLength","stringFromCharCode","digitToBasic","q","floor","qMinusT","baseMinusT","t","k","bias","tMin","tMax","currentValue","maxInt","m","inputLength","delimiter","initialBias","initialN","fromCodePoint","splice","out","oldi","w","digit","basicToDigit","basic","j","baseMinusTMin","skew","numPoints","firstTime","damp","flag","codePoint","array","value","extra","counter","result","encoded","labels","fn","regexSeparators","parts","RangeError","errors","type","Math","buildExps","IPV6ADDRESS$","ZONEID$","IPV4ADDRESS$","RESERVED$$","SUB_DELIMS$$","IPRIVATE$$","ALPHA$$","DIGIT$$","AUTHORITY_REF$","USERINFO$","HOST$","PORT$","SAMEDOC_REF$","FRAGMENT$","ABSOLUTE_REF$","SCHEME$","PATH_ABEMPTY$","PATH_ABSOLUTE$","PATH_ROOTLESS$","PATH_EMPTY$","QUERY$","RELATIVE_REF$","PATH_NOSCHEME$","GENERIC_REF$","ABSOLUTE_URI$","HIER_PART$","URI_REFERENCE$","URI$","RELATIVE$","RELATIVE_PART$","AUTHORITY$","PCHAR$","PATH$","SEGMENT_NZ$","SEGMENT_NZ_NC$","SEGMENT$","IP_LITERAL$","REG_NAME$","IPV6ADDRZ_RELAXED$","IPVFUTURE$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","H16$","LS32$","DEC_OCTET_RELAXED$","DEC_OCTET$","UCSCHAR$$","GEN_DELIMS$$","SP$$","DQUOTE$$","CR$","obj","key","source","setInterval","call","prototype","o","Object","shift","sets"],"mappings":";;;;;;;AYAA,SAAA8E,KAAA,GAAA;sCAAyBsP,IAAzB;YAAA;;;QACKA,KAAKnS,MAAL,GAAc,CAAlB,EAAqB;aACf,CAAL,IAAUmS,KAAK,CAAL,EAAQzQ,KAAR,CAAc,CAAd,EAAiB,CAAC,CAAlB,CAAV;YACMK,KAAKoQ,KAAKnS,MAAL,GAAc,CAAzB;aACK,IAAIgB,IAAI,CAAb,EAAgBA,IAAIe,EAApB,EAAwB,EAAEf,CAA1B,EAA6B;iBACvBA,CAAL,IAAUmR,KAAKnR,CAAL,EAAQU,KAAR,CAAc,CAAd,EAAiB,CAAC,CAAlB,CAAV;;aAEIK,EAAL,IAAWoQ,KAAKpQ,EAAL,EAASL,KAAT,CAAe,CAAf,CAAX;eACOyQ,KAAKpS,IAAL,CAAU,EAAV,CAAP;KAPD,MAQO;eACCoS,KAAK,CAAL,CAAP;;;AAIF,AAAA,SAAA/O,MAAA,CAAuBV,GAAvB,EAAA;WACQ,QAAQA,GAAR,GAAc,GAArB;;AAGD,AAAA,SAAA4B,MAAA,CAAuB0N,CAAvB,EAAA;WACQA,MAAM/S,SAAN,GAAkB,WAAlB,GAAiC+S,MAAM,IAAN,GAAa,MAAb,GAAsBC,OAAOF,SAAP,CAAiBhO,QAAjB,CAA0B+N,IAA1B,CAA+BE,CAA/B,EAAkC7P,KAAlC,CAAwC,GAAxC,EAA6CkE,GAA7C,GAAmDlE,KAAnD,CAAyD,GAAzD,EAA8D+P,KAA9D,GAAsEvT,WAAtE,EAA9D;;AAGD,AAAA,SAAA2B,WAAA,CAA4BoC,GAA5B,EAAA;WACQA,IAAIpC,WAAJ,EAAP;;AAGD,AAAA,SAAA0B,OAAA,CAAwB0P,GAAxB,EAAA;WACQA,QAAQzS,SAAR,IAAqByS,QAAQ,IAA7B,GAAqCA,eAAenJ,KAAf,GAAuBmJ,GAAvB,GAA8B,OAAOA,IAAI1R,MAAX,KAAsB,QAAtB,IAAkC0R,IAAIvP,KAAtC,IAA+CuP,IAAIG,WAAnD,IAAkEH,IAAII,IAAtE,GAA6E,CAACJ,GAAD,CAA7E,GAAqFnJ,MAAMwJ,SAAN,CAAgBrQ,KAAhB,CAAsBoQ,IAAtB,CAA2BJ,GAA3B,CAAxJ,GAA4L,EAAnM;;AAID,AAAA,SAAA5M,MAAA,CAAuBE,MAAvB,EAAuC4M,MAAvC,EAAA;QACOF,MAAM1M,MAAZ;QACI4M,MAAJ,EAAY;aACN,IAAMD,GAAX,IAAkBC,MAAlB,EAA0B;gBACrBD,GAAJ,IAAWC,OAAOD,GAAP,CAAX;;;WAGKD,GAAP;;;ADnCD,SAAA3D,SAAA,CAA0BzK,KAA1B,EAAA;QAEEgL,UAAU,UADX;QAECmD,MAAM,SAFP;QAGClD,UAAU,OAHX;QAICiD,WAAW,SAJZ;QAKCnO,WAAWR,MAAM0L,OAAN,EAAe,UAAf,CALZ;;WAMQ,SANR;QAOCgD,OAAO,SAPR;QAQCrO,eAAeE,OAAOA,OAAO,YAAYC,QAAZ,GAAuB,GAAvB,GAA6BA,QAA7B,GAAwCA,QAAxC,GAAmD,GAAnD,GAAyDA,QAAzD,GAAoEA,QAA3E,IAAuF,GAAvF,GAA6FD,OAAO,gBAAgBC,QAAhB,GAA2B,GAA3B,GAAiCA,QAAjC,GAA4CA,QAAnD,CAA7F,GAA4J,GAA5J,GAAkKD,OAAO,MAAMC,QAAN,GAAiBA,QAAxB,CAAzK,CARhB;;mBASgB,yBAThB;QAUC+K,eAAe,qCAVhB;QAWCD,aAAatL,MAAMyO,YAAN,EAAoBlD,YAApB,CAXd;QAYCiD,YAAY/N,QAAQ,6EAAR,GAAwF,IAZrG;;iBAacA,QAAQ,mBAAR,GAA8B,IAb5C;;mBAcgBT,MAAMyL,OAAN,EAAeC,OAAf,EAAwB,gBAAxB,EAA0C8C,SAA1C,CAdhB;QAeCtC,UAAU3L,OAAOkL,UAAUzL,MAAMyL,OAAN,EAAeC,OAAf,EAAwB,aAAxB,CAAV,GAAmD,GAA1D,CAfX;QAgBCE,YAAYrL,OAAOA,OAAOF,eAAe,GAAf,GAAqBL,MAAMC,YAAN,EAAoBsL,YAApB,EAAkC,OAAlC,CAA5B,IAA0E,GAAjF,CAhBb;QAiBCgD,aAAahO,OAAOA,OAAO,SAAP,IAAoB,GAApB,GAA0BA,OAAO,WAAWmL,OAAlB,CAA1B,GAAuD,GAAvD,GAA6DnL,OAAO,MAAMmL,OAAN,GAAgBA,OAAvB,CAA7D,GAA+F,GAA/F,GAAqGnL,OAAO,UAAUmL,OAAjB,CAArG,GAAiI,GAAjI,GAAuIA,OAA9I,CAjBd;QAkBC4C,qBAAqB/N,OAAOA,OAAO,SAAP,IAAoB,GAApB,GAA0BA,OAAO,WAAWmL,OAAlB,CAA1B,GAAuD,GAAvD,GAA6DnL,OAAO,MAAMmL,OAAN,GAAgBA,OAAvB,CAA7D,GAA+F,GAA/F,GAAqGnL,OAAO,YAAYmL,OAAnB,CAArG,GAAmI,OAAnI,GAA6IA,OAApJ,CAlBtB;;mBAmBgBnL,OAAO+N,qBAAqB,KAArB,GAA6BA,kBAA7B,GAAkD,KAAlD,GAA0DA,kBAA1D,GAA+E,KAA/E,GAAuFA,kBAA9F,CAnBhB;QAoBCF,OAAO7N,OAAOC,WAAW,OAAlB,CApBR;QAqBC6N,QAAQ9N,OAAOA,OAAO6N,OAAO,KAAP,GAAeA,IAAtB,IAA8B,GAA9B,GAAoC/C,YAA3C,CArBT;QAsBCsC,gBAAgBpN,OAAmEA,OAAO6N,OAAO,KAAd,IAAuB,KAAvB,GAA+BC,KAAlG,CAtBjB;;oBAuBiB9N,OAAwD,WAAWA,OAAO6N,OAAO,KAAd,CAAX,GAAkC,KAAlC,GAA0CC,KAAlG,CAvBjB;;oBAwBiB9N,OAAOA,OAAwC6N,IAAxC,IAAgD,SAAhD,GAA4D7N,OAAO6N,OAAO,KAAd,CAA5D,GAAmF,KAAnF,GAA2FC,KAAlG,CAxBjB;;oBAyBiB9N,OAAOA,OAAOA,OAAO6N,OAAO,KAAd,IAAuB,OAAvB,GAAiCA,IAAxC,IAAgD,SAAhD,GAA4D7N,OAAO6N,OAAO,KAAd,CAA5D,GAAmF,KAAnF,GAA2FC,KAAlG,CAzBjB;;oBA0BiB9N,OAAOA,OAAOA,OAAO6N,OAAO,KAAd,IAAuB,OAAvB,GAAiCA,IAAxC,IAAgD,SAAhD,GAA4D7N,OAAO6N,OAAO,KAAd,CAA5D,GAAmF,KAAnF,GAA2FC,KAAlG,CA1BjB;;oBA2BiB9N,OAAOA,OAAOA,OAAO6N,OAAO,KAAd,IAAuB,OAAvB,GAAiCA,IAAxC,IAAgD,SAAhD,GAAmEA,IAAnE,GAA0E,KAA1E,GAA2FC,KAAlG,CA3BjB;;oBA4BiB9N,OAAOA,OAAOA,OAAO6N,OAAO,KAAd,IAAuB,OAAvB,GAAiCA,IAAxC,IAAgD,SAAhD,GAA2FC,KAAlG,CA5BjB;;oBA6BiB9N,OAAOA,OAAOA,OAAO6N,OAAO,KAAd,IAAuB,OAAvB,GAAiCA,IAAxC,IAAgD,SAAhD,GAA2FA,IAAlG,CA7BjB;;oBA8BiB7N,OAAOA,OAAOA,OAAO6N,OAAO,KAAd,IAAuB,OAAvB,GAAiCA,IAAxC,IAAgD,SAAvD,CA9BjB;;mBA+BgB7N,OAAO,CAACoN,aAAD,EAAgBC,aAAhB,EAA+BC,aAA/B,EAA8CC,aAA9C,EAA6DC,aAA7D,EAA4EC,aAA5E,EAA2FC,aAA3F,EAA0GC,aAA1G,EAAyHC,aAAzH,EAAwIjR,IAAxI,CAA6I,GAA7I,CAAP,CA/BhB;QAgCCkO,UAAU7K,OAAOA,OAAON,eAAe,GAAf,GAAqBI,YAA5B,IAA4C,GAAnD,CAhCX;;iBAiCcE,OAAO4K,eAAe,OAAf,GAAyBC,OAAhC,CAjCd;;yBAkCsB7K,OAAO4K,eAAe5K,OAAO,iBAAiBC,QAAjB,GAA4B,MAAnC,CAAf,GAA4D4K,OAAnE,CAlCtB;;iBAmCc7K,OAAO,SAASC,QAAT,GAAoB,MAApB,GAA6BR,MAAMC,YAAN,EAAoBsL,YAApB,EAAkC,OAAlC,CAA7B,GAA0E,GAAjF,CAnCd;QAoCCgC,cAAchN,OAAO,QAAQA,OAAOkN,qBAAqB,GAArB,GAA2BtC,YAA3B,GAA0C,GAA1C,GAAgDuC,UAAvD,CAAR,GAA6E,KAApF,CApCf;;gBAqCanN,OAAOA,OAAOF,eAAe,GAAf,GAAqBL,MAAMC,YAAN,EAAoBsL,YAApB,CAA5B,IAAiE,GAAxE,CArCb;QAsCCM,QAAQtL,OAAOgN,cAAc,GAAd,GAAoBlC,YAApB,GAAmC,KAAnC,GAA2CmC,SAA3C,GAAuD,GAAvD,GAA6D,GAA7D,GAAmEA,SAA1E,CAtCT;QAuCC1B,QAAQvL,OAAOmL,UAAU,GAAjB,CAvCT;QAwCCuB,aAAa1M,OAAOA,OAAOqL,YAAY,GAAnB,IAA0B,GAA1B,GAAgCC,KAAhC,GAAwCtL,OAAO,QAAQuL,KAAf,CAAxC,GAAgE,GAAvE,CAxCd;QAyCCoB,SAAS3M,OAAOF,eAAe,GAAf,GAAqBL,MAAMC,YAAN,EAAoBsL,YAApB,EAAkC,UAAlC,CAA5B,CAzCV;QA0CC+B,WAAW/M,OAAO2M,SAAS,GAAhB,CA1CZ;QA2CCE,cAAc7M,OAAO2M,SAAS,GAAhB,CA3Cf;QA4CCG,iBAAiB9M,OAAOA,OAAOF,eAAe,GAAf,GAAqBL,MAAMC,YAAN,EAAoBsL,YAApB,EAAkC,OAAlC,CAA5B,IAA0E,GAAjF,CA5ClB;QA6CCY,gBAAgB5L,OAAOA,OAAO,QAAQ+M,QAAf,IAA2B,GAAlC,CA7CjB;QA8CClB,iBAAiB7L,OAAO,QAAQA,OAAO6M,cAAcjB,aAArB,CAAR,GAA8C,GAArD,CA9ClB;;qBA+CkB5L,OAAO8M,iBAAiBlB,aAAxB,CA/ClB;;qBAgDkB5L,OAAO6M,cAAcjB,aAArB,CAhDlB;;kBAiDe,QAAQe,MAAR,GAAiB,GAjDhC;QAkDCC,QAAQ5M,OAAO4L,gBAAgB,GAAhB,GAAsBC,cAAtB,GAAuC,GAAvC,GAA6CK,cAA7C,GAA8D,GAA9D,GAAoEJ,cAApE,GAAqF,GAArF,GAA2FC,WAAlG,CAlDT;QAmDCC,SAAShM,OAAOA,OAAO2M,SAAS,GAAT,GAAelN,MAAM,UAAN,EAAkBwL,UAAlB,CAAtB,IAAuD,GAA9D,CAnDV;QAoDCQ,YAAYzL,OAAOA,OAAO2M,SAAS,WAAhB,IAA+B,GAAtC,CApDb;QAqDCN,aAAarM,OAAOA,OAAO,WAAW0M,UAAX,GAAwBd,aAA/B,IAAgD,GAAhD,GAAsDC,cAAtD,GAAuE,GAAvE,GAA6EC,cAA7E,GAA8F,GAA9F,GAAoGC,WAA3G,CArDd;QAsDCQ,OAAOvM,OAAO2L,UAAU,KAAV,GAAkBU,UAAlB,GAA+BrM,OAAO,QAAQgM,MAAf,CAA/B,GAAwD,GAAxD,GAA8DhM,OAAO,QAAQyL,SAAf,CAA9D,GAA0F,GAAjG,CAtDR;QAuDCgB,iBAAiBzM,OAAOA,OAAO,WAAW0M,UAAX,GAAwBd,aAA/B,IAAgD,GAAhD,GAAsDC,cAAtD,GAAuE,GAAvE,GAA6EK,cAA7E,GAA8F,GAA9F,GAAoGH,WAA3G,CAvDlB;QAwDCS,YAAYxM,OAAOyM,iBAAiBzM,OAAO,QAAQgM,MAAf,CAAjB,GAA0C,GAA1C,GAAgDhM,OAAO,QAAQyL,SAAf,CAAhD,GAA4E,GAAnF,CAxDb;QAyDCa,iBAAiBtM,OAAOuM,OAAO,GAAP,GAAaC,SAApB,CAzDlB;QA0DCJ,gBAAgBpM,OAAO2L,UAAU,KAAV,GAAkBU,UAAlB,GAA+BrM,OAAO,QAAQgM,MAAf,CAA/B,GAAwD,GAA/D,CA1DjB;QA4DCG,eAAe,OAAOR,OAAP,GAAiB,MAAjB,GAA0B3L,OAAOA,OAAO,YAAYA,OAAO,MAAMqL,SAAN,GAAkB,IAAzB,CAAZ,GAA6C,IAA7C,GAAoDC,KAApD,GAA4D,GAA5D,GAAkEtL,OAAO,SAASuL,KAAT,GAAiB,GAAxB,CAAlE,GAAiG,IAAxG,IAAgH,IAAhH,GAAuHK,aAAvH,GAAuI,GAAvI,GAA6IC,cAA7I,GAA8J,GAA9J,GAAoKC,cAApK,GAAqL,GAArL,GAA2LC,WAA3L,GAAyM,GAAhN,CAA1B,GAAiP/L,OAAO,SAASgM,MAAT,GAAkB,GAAzB,CAAjP,GAAiR,GAAjR,GAAuRhM,OAAO,SAASyL,SAAT,GAAqB,GAA5B,CAAvR,GAA0T,IA5D1U;QA6DCQ,gBAAgB,WAAWjM,OAAOA,OAAO,YAAYA,OAAO,MAAMqL,SAAN,GAAkB,IAAzB,CAAZ,GAA6C,IAA7C,GAAoDC,KAApD,GAA4D,GAA5D,GAAkEtL,OAAO,SAASuL,KAAT,GAAiB,GAAxB,CAAlE,GAAiG,IAAxG,IAAgH,IAAhH,GAAuHK,aAAvH,GAAuI,GAAvI,GAA6IC,cAA7I,GAA8J,GAA9J,GAAoKK,cAApK,GAAqL,GAArL,GAA2LH,WAA3L,GAAyM,GAAhN,CAAX,GAAkO/L,OAAO,SAASgM,MAAT,GAAkB,GAAzB,CAAlO,GAAkQ,GAAlQ,GAAwQhM,OAAO,SAASyL,SAAT,GAAqB,GAA5B,CAAxQ,GAA2S,IA7D5T;QA8DCC,gBAAgB,OAAOC,OAAP,GAAiB,MAAjB,GAA0B3L,OAAOA,OAAO,YAAYA,OAAO,MAAMqL,SAAN,GAAkB,IAAzB,CAAZ,GAA6C,IAA7C,GAAoDC,KAApD,GAA4D,GAA5D,GAAkEtL,OAAO,SAASuL,KAAT,GAAiB,GAAxB,CAAlE,GAAiG,IAAxG,IAAgH,IAAhH,GAAuHK,aAAvH,GAAuI,GAAvI,GAA6IC,cAA7I,GAA8J,GAA9J,GAAoKC,cAApK,GAAqL,GAArL,GAA2LC,WAA3L,GAAyM,GAAhN,CAA1B,GAAiP/L,OAAO,SAASgM,MAAT,GAAkB,GAAzB,CAAjP,GAAiR,IA9DlS;QA+DCR,eAAe,MAAMxL,OAAO,SAASyL,SAAT,GAAqB,GAA5B,CAAN,GAAyC,IA/DzD;QAgECL,iBAAiB,MAAMpL,OAAO,MAAMqL,SAAN,GAAkB,IAAzB,CAAN,GAAuC,IAAvC,GAA8CC,KAA9C,GAAsD,GAAtD,GAA4DtL,OAAO,SAASuL,KAAT,GAAiB,GAAxB,CAA5D,GAA2F,IAhE7G;WAmEO;oBACO,IAAI/L,MAAJ,CAAWC,MAAM,KAAN,EAAayL,OAAb,EAAsBC,OAAtB,EAA+B,aAA/B,CAAX,EAA0D,GAA1D,CADP;sBAES,IAAI3L,MAAJ,CAAWC,MAAM,WAAN,EAAmBC,YAAnB,EAAiCsL,YAAjC,CAAX,EAA2D,GAA3D,CAFT;kBAGK,IAAIxL,MAAJ,CAAWC,MAAM,iBAAN,EAAyBC,YAAzB,EAAuCsL,YAAvC,CAAX,EAAiE,GAAjE,CAHL;kBAIK,IAAIxL,MAAJ,CAAWC,MAAM,iBAAN,EAAyBC,YAAzB,EAAuCsL,YAAvC,CAAX,EAAiE,GAAjE,CAJL;2BAKc,IAAIxL,MAAJ,CAAWC,MAAM,cAAN,EAAsBC,YAAtB,EAAoCsL,YAApC,CAAX,EAA8D,GAA9D,CALd;mBAMM,IAAIxL,MAAJ,CAAWC,MAAM,QAAN,EAAgBC,YAAhB,EAA8BsL,YAA9B,EAA4C,gBAA5C,EAA8DC,UAA9D,CAAX,EAAsF,GAAtF,CANN;sBAOS,IAAIzL,MAAJ,CAAWC,MAAM,QAAN,EAAgBC,YAAhB,EAA8BsL,YAA9B,EAA4C,gBAA5C,CAAX,EAA0E,GAA1E,CAPT;gBAQG,IAAIxL,MAAJ,CAAWC,MAAM,KAAN,EAAaC,YAAb,EAA2BsL,YAA3B,CAAX,EAAqD,GAArD,CARH;oBASO,IAAIxL,MAAJ,CAAWE,YAAX,EAAyB,GAAzB,CATP;qBAUQ,IAAIF,MAAJ,CAAWC,MAAM,QAAN,EAAgBC,YAAhB,EAA8BqL,UAA9B,CAAX,EAAsD,GAAtD,CAVR;qBAWQ,IAAIvL,MAAJ,CAAWM,YAAX,EAAyB,GAAzB,CAXR;qBAYQ,IAAIN,MAAJ,CAAW,OAAOsL,YAAP,GAAsB,IAAjC,CAZR;qBAaQ,IAAItL,MAAJ,CAAW,WAAWoL,YAAX,GAA0B,GAA1B,GAAgC5K,OAAOA,OAAO,iBAAiBC,QAAjB,GAA4B,MAAnC,IAA6C,GAA7C,GAAmD4K,OAAnD,GAA6D,GAApE,CAAhC,GAA2G,QAAtH,CAbR;KAAP;;AAiBD,mBAAeF,UAAU,KAAV,CAAf;;ADrFA,mBAAeA,UAAU,IAAV,CAAf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ADDA;;AACA,IAAMpC,SAAS,UAAf;;;AAGA,IAAMzG,OAAO,EAAb;AACA,IAAMsG,OAAO,CAAb;AACA,IAAMC,OAAO,EAAb;AACA,IAAMkB,OAAO,EAAb;AACA,IAAMG,OAAO,GAAb;AACA,IAAMf,cAAc,EAApB;AACA,IAAMC,WAAW,GAAjB;AACA,IAAMF,YAAY,GAAlB;;;AAGA,IAAMtB,gBAAgB,OAAtB;AACA,IAAMH,gBAAgB,YAAtB;AACA,IAAMoD,kBAAkB,2BAAxB;;;AAGA,IAAMG,SAAS;aACF,iDADE;cAED,gDAFC;kBAGG;CAHlB;;;AAOA,IAAMlB,gBAAgBxH,OAAOsG,IAA7B;AACA,IAAMN,QAAQ4C,KAAK5C,KAAnB;AACA,IAAMH,qBAAqBjJ,OAAO4H,YAAlC;;;;;;;;;;AAUA,SAAS7K,OAAT,CAAegP,IAAf,EAAqB;OACd,IAAIF,UAAJ,CAAeC,OAAOC,IAAP,CAAf,CAAN;;;;;;;;;;;AAWD,SAASnF,GAAT,CAAauE,KAAb,EAAoBO,EAApB,EAAwB;KACjBH,SAAS,EAAf;KACIrN,SAASiN,MAAMjN,MAAnB;QACOA,QAAP,EAAiB;SACTA,MAAP,IAAiBwN,GAAGP,MAAMjN,MAAN,CAAH,CAAjB;;QAEMqN,MAAP;;;;;;;;;;;;;AAaD,SAAS9C,SAAT,CAAmBD,MAAnB,EAA2BkD,EAA3B,EAA+B;KACxBE,QAAQpD,OAAOnI,KAAP,CAAa,GAAb,CAAd;KACIkL,SAAS,EAAb;KACIK,MAAM1N,MAAN,GAAe,CAAnB,EAAsB;;;WAGZ0N,MAAM,CAAN,IAAW,GAApB;WACSA,MAAM,CAAN,CAAT;;;UAGQpD,OAAOnK,OAAP,CAAesN,eAAf,EAAgC,MAAhC,CAAT;KACMF,SAASjD,OAAOnI,KAAP,CAAa,GAAb,CAAf;KACMmL,UAAU5E,IAAI6E,MAAJ,EAAYC,EAAZ,EAAgBzN,IAAhB,CAAqB,GAArB,CAAhB;QACOsN,SAASC,OAAhB;;;;;;;;;;;;;;;;AAgBD,SAASlD,UAAT,CAAoBE,MAApB,EAA4B;KACrBtE,SAAS,EAAf;KACIoH,UAAU,CAAd;KACMpN,SAASsK,OAAOtK,MAAtB;QACOoN,UAAUpN,MAAjB,EAAyB;MAClBkN,QAAQ5C,OAAON,UAAP,CAAkBoD,SAAlB,CAAd;MACIF,SAAS,MAAT,IAAmBA,SAAS,MAA5B,IAAsCE,UAAUpN,MAApD,EAA4D;;OAErDmN,QAAQ7C,OAAON,UAAP,CAAkBoD,SAAlB,CAAd;OACI,CAACD,QAAQ,MAAT,KAAoB,MAAxB,EAAgC;;WACxBlN,IAAP,CAAY,CAAC,CAACiN,QAAQ,KAAT,KAAmB,EAApB,KAA2BC,QAAQ,KAAnC,IAA4C,OAAxD;IADD,MAEO;;;WAGClN,IAAP,CAAYiN,KAAZ;;;GARF,MAWO;UACCjN,IAAP,CAAYiN,KAAZ;;;QAGKlH,MAAP;;;;;;;;;;;AAWD,IAAMmE,aAAa,SAAbA,UAAa;QAASrI,OAAOmK,aAAP,iCAAwBgB,KAAxB,EAAT;CAAnB;;;;;;;;;;;AAWA,IAAMV,eAAe,SAAfA,YAAe,CAASS,SAAT,EAAoB;KACpCA,YAAY,IAAZ,GAAmB,IAAvB,EAA6B;SACrBA,YAAY,IAAnB;;KAEGA,YAAY,IAAZ,GAAmB,IAAvB,EAA6B;SACrBA,YAAY,IAAnB;;KAEGA,YAAY,IAAZ,GAAmB,IAAvB,EAA6B;SACrBA,YAAY,IAAnB;;QAEM9H,IAAP;CAVD;;;;;;;;;;;;;AAwBA,IAAM8F,eAAe,SAAfA,YAAe,CAASsB,KAAT,EAAgBS,IAAhB,EAAsB;;;QAGnCT,QAAQ,EAAR,GAAa,MAAMA,QAAQ,EAAd,CAAb,IAAkC,CAACS,QAAQ,CAAT,KAAe,CAAjD,CAAP;CAHD;;;;;;;AAWA,IAAMnC,QAAQ,SAARA,KAAQ,CAASF,KAAT,EAAgBkC,SAAhB,EAA2BC,SAA3B,EAAsC;KAC/CvB,IAAI,CAAR;SACQuB,YAAY3B,MAAMR,QAAQoC,IAAd,CAAZ,GAAkCpC,SAAS,CAAnD;UACSQ,MAAMR,QAAQkC,SAAd,CAAT;+BAC8BlC,QAAQgC,gBAAgBjB,IAAhB,IAAwB,CAA9D,EAAiEH,KAAKpG,IAAtE,EAA4E;UACnEgG,MAAMR,QAAQgC,aAAd,CAAR;;QAEMxB,MAAMI,IAAI,CAACoB,gBAAgB,CAAjB,IAAsBhC,KAAtB,IAA+BA,QAAQiC,IAAvC,CAAV,CAAP;CAPD;;;;;;;;;AAiBA,IAAMzC,SAAS,SAATA,MAAS,CAAShE,KAAT,EAAgB;;KAExBF,SAAS,EAAf;KACM6F,cAAc3F,MAAMlG,MAA1B;KACIyJ,IAAI,CAAR;KACIgB,IAAIuB,QAAR;KACIT,OAAOQ,WAAX;;;;;;KAMIS,QAAQtG,MAAMrE,WAAN,CAAkBiK,SAAlB,CAAZ;KACIU,QAAQ,CAAZ,EAAe;UACN,CAAR;;;MAGI,IAAIC,IAAI,CAAb,EAAgBA,IAAID,KAApB,EAA2B,EAAEC,CAA7B,EAAgC;;MAE3BvG,MAAM8D,UAAN,CAAiByC,CAAjB,KAAuB,IAA3B,EAAiC;WAC1B,WAAN;;SAEMxM,IAAP,CAAYiG,MAAM8D,UAAN,CAAiByC,CAAjB,CAAZ;;;;;;MAMI,IAAIhF,QAAQ+E,QAAQ,CAAR,GAAYA,QAAQ,CAApB,GAAwB,CAAzC,EAA4C/E,QAAQoE,WAApD,4BAA4F;;;;;;;MAOvFO,OAAO3C,CAAX;OACK,IAAI4C,IAAI,CAAR,EAAWf,IAAIpG,IAApB,qBAA8CoG,KAAKpG,IAAnD,EAAyD;;OAEpDuC,SAASoE,WAAb,EAA0B;YACnB,eAAN;;;OAGKS,QAAQC,aAAarG,MAAM8D,UAAN,CAAiBvC,OAAjB,CAAb,CAAd;;OAEI6E,SAASpH,IAAT,IAAiBoH,QAAQpB,MAAM,CAACS,SAASlC,CAAV,IAAe4C,CAArB,CAA7B,EAAsD;YAC/C,UAAN;;;QAGIC,QAAQD,CAAb;OACMhB,IAAIC,KAAKC,IAAL,GAAYC,IAAZ,GAAoBF,KAAKC,OAAOE,IAAZ,GAAmBA,IAAnB,GAA0BH,IAAIC,IAA5D;;OAEIe,QAAQjB,CAAZ,EAAe;;;;OAITD,aAAalG,OAAOmG,CAA1B;OACIgB,IAAInB,MAAMS,SAASP,UAAf,CAAR,EAAoC;YAC7B,UAAN;;;QAGIA,UAAL;;;MAIKe,MAAMnG,OAAOhG,MAAP,GAAgB,CAA5B;SACO4K,MAAMnB,IAAI2C,IAAV,EAAgBD,GAAhB,EAAqBC,QAAQ,CAA7B,CAAP;;;;MAIIlB,MAAMzB,IAAI0C,GAAV,IAAiBR,SAASlB,CAA9B,EAAiC;WAC1B,UAAN;;;OAGIS,MAAMzB,IAAI0C,GAAV,CAAL;OACKA,GAAL;;;SAGOD,MAAP,CAAczC,GAAd,EAAmB,CAAnB,EAAsBgB,CAAtB;;;QAIM3I,OAAOmK,aAAP,eAAwBjG,MAAxB,CAAP;CAjFD;;;;;;;;;AA2FA,IAAMiE,SAAS,SAATA,MAAS,CAAS/D,KAAT,EAAgB;KACxBF,SAAS,EAAf;;;SAGQoE,WAAWlE,KAAX,CAAR;;;KAGI2F,cAAc3F,MAAMlG,MAAxB;;;KAGIyK,IAAIuB,QAAR;KACItB,QAAQ,CAAZ;KACIa,OAAOQ,WAAX;;;;;;;;uBAG2B7F,KAA3B,8HAAkC;OAAvBwF,cAAuB;;OAC7BA,iBAAe,IAAnB,EAAyB;WACjBzL,IAAP,CAAY8K,mBAAmBW,cAAnB,CAAZ;;;;;;;;;;;;;;;;;;KAIEZ,cAAc9E,OAAOhG,MAAzB;KACI2K,iBAAiBG,WAArB;;;;;;KAMIA,WAAJ,EAAiB;SACT7K,IAAP,CAAY6L,SAAZ;;;;QAIMnB,iBAAiBkB,WAAxB,EAAqC;;;;MAIhCD,IAAID,MAAR;;;;;;yBAC2BzF,KAA3B,mIAAkC;QAAvBwF,YAAuB;;QAC7BA,gBAAgBjB,CAAhB,IAAqBiB,eAAeE,CAAxC,EAA2C;SACtCF,YAAJ;;;;;;;;;;;;;;;;;;;;;MAMIb,wBAAwBF,iBAAiB,CAA/C;MACIiB,IAAInB,CAAJ,GAAQS,MAAM,CAACS,SAASjB,KAAV,IAAmBG,qBAAzB,CAAZ,EAA6D;WACtD,UAAN;;;WAGQ,CAACe,IAAInB,CAAL,IAAUI,qBAAnB;MACIe,CAAJ;;;;;;;yBAE2B1F,KAA3B,mIAAkC;QAAvBwF,aAAuB;;QAC7BA,gBAAejB,CAAf,IAAoB,EAAEC,KAAF,GAAUiB,MAAlC,EAA0C;aACnC,UAAN;;QAEGD,iBAAgBjB,CAApB,EAAuB;;SAElBQ,IAAIP,KAAR;UACK,IAAIY,IAAIpG,IAAb,qBAAuCoG,KAAKpG,IAA5C,EAAkD;UAC3CmG,IAAIC,KAAKC,IAAL,GAAYC,IAAZ,GAAoBF,KAAKC,OAAOE,IAAZ,GAAmBA,IAAnB,GAA0BH,IAAIC,IAA5D;UACIN,IAAII,CAAR,EAAW;;;UAGLF,UAAUF,IAAII,CAApB;UACMD,aAAalG,OAAOmG,CAA1B;aACOpL,IAAP,CACC8K,mBAAmBC,aAAaK,IAAIF,UAAUC,UAA3B,EAAuC,CAAvC,CAAnB,CADD;UAGIF,MAAMC,UAAUC,UAAhB,CAAJ;;;YAGMnL,IAAP,CAAY8K,mBAAmBC,aAAaC,CAAb,EAAgB,CAAhB,CAAnB,CAAZ;YACOL,MAAMF,KAAN,EAAaG,qBAAb,EAAoCF,kBAAkBG,WAAtD,CAAP;aACQ,CAAR;OACEH,cAAF;;;;;;;;;;;;;;;;;;IAIAD,KAAF;IACED,CAAF;;QAGMzE,OAAOjG,IAAP,CAAY,EAAZ,CAAP;CArFD;;;;;;;;;;;;;AAmGA,IAAMyB,YAAY,SAAZA,SAAY,CAAS0E,KAAT,EAAgB;QAC1BqE,UAAUrE,KAAV,EAAiB,UAASoE,MAAT,EAAiB;SACjCE,cAAczE,IAAd,CAAmBuE,MAAnB,IACJJ,OAAOI,OAAO5I,KAAP,CAAa,CAAb,EAAgB/C,WAAhB,EAAP,CADI,GAEJ2L,MAFH;EADM,CAAP;CADD;;;;;;;;;;;;;AAmBA,IAAMhJ,UAAU,SAAVA,OAAU,CAAS4E,KAAT,EAAgB;QACxBqE,UAAUrE,KAAV,EAAiB,UAASoE,MAAT,EAAiB;SACjCD,cAActE,IAAd,CAAmBuE,MAAnB,IACJ,SAASL,OAAOK,MAAP,CADL,GAEJA,MAFH;EADM,CAAP;CADD;;;;;AAWA,IAAMjJ,WAAW;;;;;;YAML,OANK;;;;;;;;SAcR;YACG+I,UADH;YAEGD;EAhBK;WAkBND,MAlBM;WAmBND,MAnBM;YAoBL3I,OApBK;cAqBHE;CArBd,CAwBA;;ADvbA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,AACA,AACA,AACA,AAiDA,AAAO,IAAMzD,UAA6C,EAAnD;AAEP,AAAA,SAAAyC,UAAA,CAA2BuJ,GAA3B,EAAA;QACOJ,IAAII,IAAIC,UAAJ,CAAe,CAAf,CAAV;QACI5I,UAAJ;QAEIuI,IAAI,EAAR,EAAYvI,IAAI,OAAOuI,EAAE5F,QAAF,CAAW,EAAX,EAAezD,WAAf,EAAX,CAAZ,KACK,IAAIqJ,IAAI,GAAR,EAAavI,IAAI,MAAMuI,EAAE5F,QAAF,CAAW,EAAX,EAAezD,WAAf,EAAV,CAAb,KACA,IAAIqJ,IAAI,IAAR,EAAcvI,IAAI,MAAM,CAAEuI,KAAK,CAAN,GAAW,GAAZ,EAAiB5F,QAAjB,CAA0B,EAA1B,EAA8BzD,WAA9B,EAAN,GAAoD,GAApD,GAA0D,CAAEqJ,IAAI,EAAL,GAAW,GAAZ,EAAiB5F,QAAjB,CAA0B,EAA1B,EAA8BzD,WAA9B,EAA9D,CAAd,KACAc,IAAI,MAAM,CAAEuI,KAAK,EAAN,GAAY,GAAb,EAAkB5F,QAAlB,CAA2B,EAA3B,EAA+BzD,WAA/B,EAAN,GAAqD,GAArD,GAA2D,CAAGqJ,KAAK,CAAN,GAAW,EAAZ,GAAkB,GAAnB,EAAwB5F,QAAxB,CAAiC,EAAjC,EAAqCzD,WAArC,EAA3D,GAAgH,GAAhH,GAAsH,CAAEqJ,IAAI,EAAL,GAAW,GAAZ,EAAiB5F,QAAjB,CAA0B,EAA1B,EAA8BzD,WAA9B,EAA1H;WAEEc,CAAP;;AAGD,AAAA,SAAAuB,WAAA,CAA4BD,GAA5B,EAAA;QACK6G,SAAS,EAAb;QACIE,IAAI,CAAR;QACMK,KAAKpH,IAAI1C,MAAf;WAEOyJ,IAAIK,EAAX,EAAe;YACRH,IAAI1C,SAASvE,IAAI8G,MAAJ,CAAWC,IAAI,CAAf,EAAkB,CAAlB,CAAT,EAA+B,EAA/B,CAAV;YAEIE,IAAI,GAAR,EAAa;sBACF7H,OAAO4H,YAAP,CAAoBC,CAApB,CAAV;iBACK,CAAL;SAFD,MAIK,IAAIA,KAAK,GAAL,IAAYA,IAAI,GAApB,EAAyB;gBACxBG,KAAKL,CAAN,IAAY,CAAhB,EAAmB;oBACZG,KAAK3C,SAASvE,IAAI8G,MAAJ,CAAWC,IAAI,CAAf,EAAkB,CAAlB,CAAT,EAA+B,EAA/B,CAAX;0BACU3H,OAAO4H,YAAP,CAAqB,CAACC,IAAI,EAAL,KAAY,CAAb,GAAmBC,KAAK,EAA5C,CAAV;aAFD,MAGO;0BACIlH,IAAI8G,MAAJ,CAAWC,CAAX,EAAc,CAAd,CAAV;;iBAEI,CAAL;SAPI,MASA,IAAIE,KAAK,GAAT,EAAc;gBACbG,KAAKL,CAAN,IAAY,CAAhB,EAAmB;oBACZG,KAAK3C,SAASvE,IAAI8G,MAAJ,CAAWC,IAAI,CAAf,EAAkB,CAAlB,CAAT,EAA+B,EAA/B,CAAX;oBACMI,KAAK5C,SAASvE,IAAI8G,MAAJ,CAAWC,IAAI,CAAf,EAAkB,CAAlB,CAAT,EAA+B,EAA/B,CAAX;0BACU3H,OAAO4H,YAAP,CAAqB,CAACC,IAAI,EAAL,KAAY,EAAb,GAAoB,CAACC,KAAK,EAAN,KAAa,CAAjC,GAAuCC,KAAK,EAAhE,CAAV;aAHD,MAIO;0BACInH,IAAI8G,MAAJ,CAAWC,CAAX,EAAc,CAAd,CAAV;;iBAEI,CAAL;SARI,MAUA;sBACM/G,IAAI8G,MAAJ,CAAWC,CAAX,EAAc,CAAd,CAAV;iBACK,CAAL;;;WAIKF,MAAP;;AAGD,SAAAD,2BAAA,CAAqC3J,UAArC,EAA+DkG,QAA/D,EAAA;aACAxF,gBAAC,CAA0BqC,GAA1B,EAAD;YACQF,SAASG,YAAYD,GAAZ,CAAf;eACQ,CAACF,OAAOzD,KAAP,CAAa8G,SAASpD,UAAtB,CAAD,GAAqCC,GAArC,GAA2CF,MAAnD;;QAGG7C,WAAW1B,MAAf,EAAuB0B,WAAW1B,MAAX,GAAoB6D,OAAOnC,WAAW1B,MAAlB,EAA0BkC,OAA1B,CAAkC0F,SAASzF,WAA3C,EAAwDC,gBAAxD,EAA0E1B,WAA1E,GAAwFwB,OAAxF,CAAgG0F,SAASwD,UAAzG,EAAqH,EAArH,CAApB;QACnB1J,WAAWwF,QAAX,KAAwBlG,SAA5B,EAAuCU,WAAWwF,QAAX,GAAsBrD,OAAOnC,WAAWwF,QAAlB,EAA4BhF,OAA5B,CAAoC0F,SAASzF,WAA7C,EAA0DC,gBAA1D,EAA4EF,OAA5E,CAAoF0F,SAASuD,YAA7F,EAA2G5I,UAA3G,EAAuHL,OAAvH,CAA+H0F,SAASzF,WAAxI,EAAqJE,WAArJ,CAAtB;QACnCX,WAAWmE,IAAX,KAAoB7E,SAAxB,EAAmCU,WAAWmE,IAAX,GAAkBhC,OAAOnC,WAAWmE,IAAlB,EAAwB3D,OAAxB,CAAgC0F,SAASzF,WAAzC,EAAsDC,gBAAtD,EAAwE1B,WAAxE,GAAsFwB,OAAtF,CAA8F0F,SAASsD,QAAvG,EAAiH3I,UAAjH,EAA6HL,OAA7H,CAAqI0F,SAASzF,WAA9I,EAA2JE,WAA3J,CAAlB;QAC/BX,WAAWP,IAAX,KAAoBH,SAAxB,EAAmCU,WAAWP,IAAX,GAAkB0C,OAAOnC,WAAWP,IAAlB,EAAwBe,OAAxB,CAAgC0F,SAASzF,WAAzC,EAAsDC,gBAAtD,EAAwEF,OAAxE,CAAiFR,WAAW1B,MAAX,GAAoB4H,SAASoD,QAA7B,GAAwCpD,SAASqD,iBAAlI,EAAsJ1I,UAAtJ,EAAkKL,OAAlK,CAA0K0F,SAASzF,WAAnL,EAAgME,WAAhM,CAAlB;QAC/BX,WAAWE,KAAX,KAAqBZ,SAAzB,EAAoCU,WAAWE,KAAX,GAAmBiC,OAAOnC,WAAWE,KAAlB,EAAyBM,OAAzB,CAAiC0F,SAASzF,WAA1C,EAAuDC,gBAAvD,EAAyEF,OAAzE,CAAiF0F,SAASmD,SAA1F,EAAqGxI,UAArG,EAAiHL,OAAjH,CAAyH0F,SAASzF,WAAlI,EAA+IE,WAA/I,CAAnB;QAChCX,WAAW8D,QAAX,KAAwBxE,SAA5B,EAAuCU,WAAW8D,QAAX,GAAsB3B,OAAOnC,WAAW8D,QAAlB,EAA4BtD,OAA5B,CAAoC0F,SAASzF,WAA7C,EAA0DC,gBAA1D,EAA4EF,OAA5E,CAAoF0F,SAASkD,YAA7F,EAA2GvI,UAA3G,EAAuHL,OAAvH,CAA+H0F,SAASzF,WAAxI,EAAqJE,WAArJ,CAAtB;WAEhCX,UAAP;;AACA;AAED,SAAAgJ,kBAAA,CAA4BjG,GAA5B,EAAA;WACQA,IAAIvC,OAAJ,CAAY,SAAZ,EAAuB,IAAvB,KAAgC,GAAvC;;AAGD,SAAAyG,cAAA,CAAwB9C,IAAxB,EAAqC+B,QAArC,EAAA;QACOnG,UAAUoE,KAAK/E,KAAL,CAAW8G,SAAS2C,WAApB,KAAoC,EAApD;;iCACoB9I,OAFrB;QAEUmJ,OAFV;;QAIKA,OAAJ,EAAa;eACLA,QAAQ1G,KAAR,CAAc,GAAd,EAAmBuG,GAAnB,CAAuBC,kBAAvB,EAA2C5I,IAA3C,CAAgD,GAAhD,CAAP;KADD,MAEO;eACC+D,IAAP;;;AAIF,SAAA6C,cAAA,CAAwB7C,IAAxB,EAAqC+B,QAArC,EAAA;QACOnG,UAAUoE,KAAK/E,KAAL,CAAW8G,SAASC,WAApB,KAAoC,EAApD;;kCAC0BpG,OAF3B;QAEUmJ,OAFV;QAEmBxB,IAFnB;;QAIKwB,OAAJ,EAAa;oCACUA,QAAQlK,WAAR,GAAsBwD,KAAtB,CAA4B,IAA5B,EAAkC2G,OAAlC,EADV;;YACLL,IADK;YACCG,KADD;;YAENR,cAAcQ,QAAQA,MAAMzG,KAAN,CAAY,GAAZ,EAAiBuG,GAAjB,CAAqBC,kBAArB,CAAR,GAAmD,EAAvE;YACMN,aAAaI,KAAKtG,KAAL,CAAW,GAAX,EAAgBuG,GAAhB,CAAoBC,kBAApB,CAAnB;YACMR,yBAAyBtC,SAAS2C,WAAT,CAAqBzC,IAArB,CAA0BsC,WAAWA,WAAWrI,MAAX,GAAoB,CAA/B,CAA1B,CAA/B;YACMkI,aAAaC,yBAAyB,CAAzB,GAA6B,CAAhD;YACMG,kBAAkBD,WAAWrI,MAAX,GAAoBkI,UAA5C;YACMpI,SAASyI,MAAcL,UAAd,CAAf;aAEK,IAAIlH,IAAI,CAAb,EAAgBA,IAAIkH,UAApB,EAAgC,EAAElH,CAAlC,EAAqC;mBAC7BA,CAAP,IAAYoH,YAAYpH,CAAZ,KAAkBqH,WAAWC,kBAAkBtH,CAA7B,CAAlB,IAAqD,EAAjE;;YAGGmH,sBAAJ,EAA4B;mBACpBD,aAAa,CAApB,IAAyBtB,eAAe9G,OAAOoI,aAAa,CAApB,CAAf,EAAuCrC,QAAvC,CAAzB;;YAGK+B,gBAAgB9H,OAAOmI,MAAP,CAAmD,UAACH,GAAD,EAAME,KAAN,EAAaP,KAAb,EAA3E;gBACO,CAACO,KAAD,IAAUA,UAAU,GAAxB,EAA6B;oBACtBD,cAAcD,IAAIA,IAAI9H,MAAJ,GAAa,CAAjB,CAApB;oBACI+H,eAAeA,YAAYN,KAAZ,GAAoBM,YAAY/H,MAAhC,KAA2CyH,KAA9D,EAAqE;gCACxDzH,MAAZ;iBADD,MAEO;wBACFC,IAAJ,CAAS,EAAEwH,YAAF,EAASzH,QAAS,CAAlB,EAAT;;;mBAGK8H,GAAP;SATqB,EAUnB,EAVmB,CAAtB;YAYMN,oBAAoBI,cAAcC,IAAd,CAAmB,UAACF,CAAD,EAAID,CAAJ;mBAAUA,EAAE1H,MAAF,GAAW2H,EAAE3H,MAAvB;SAAnB,EAAkD,CAAlD,CAA1B;YAEIoH,gBAAJ;YACII,qBAAqBA,kBAAkBxH,MAAlB,GAA2B,CAApD,EAAuD;gBAChDsH,WAAWxH,OAAO4B,KAAP,CAAa,CAAb,EAAgB8F,kBAAkBC,KAAlC,CAAjB;gBACMF,UAAUzH,OAAO4B,KAAP,CAAa8F,kBAAkBC,KAAlB,GAA0BD,kBAAkBxH,MAAzD,CAAhB;sBACUsH,SAASvH,IAAT,CAAc,GAAd,IAAqB,IAArB,GAA4BwH,QAAQxH,IAAR,CAAa,GAAb,CAAtC;SAHD,MAIO;sBACID,OAAOC,IAAP,CAAY,GAAZ,CAAV;;YAGGsH,IAAJ,EAAU;uBACE,MAAMA,IAAjB;;eAGMD,OAAP;KA5CD,MA6CO;eACCtD,IAAP;;;AAIF,IAAMqD,YAAY,iIAAlB;AACA,IAAMD,wBAA4C,EAAD,CAAKnI,KAAL,CAAW,OAAX,EAAqB,CAArB,MAA4BE,SAA7E;AAEA,AAAA,SAAAQ,KAAA,CAAsBqH,SAAtB,EAAA;QAAwClI,OAAxC,uEAA6D,EAA7D;;QACOe,aAA2B,EAAjC;QACMkG,WAAYjH,QAAQuC,GAAR,KAAgB,KAAhB,GAAwB8C,YAAxB,GAAuCD,YAAzD;QAEIpF,QAAQ+G,SAAR,KAAsB,QAA1B,EAAoCmB,YAAY,CAAClI,QAAQX,MAAR,GAAiBW,QAAQX,MAAR,GAAiB,GAAlC,GAAwC,EAAzC,IAA+C,IAA/C,GAAsD6I,SAAlE;QAE9BpH,UAAUoH,UAAU/H,KAAV,CAAgBoI,SAAhB,CAAhB;QAEIzH,OAAJ,EAAa;YACRwH,qBAAJ,EAA2B;;uBAEfjJ,MAAX,GAAoByB,QAAQ,CAAR,CAApB;uBACWyF,QAAX,GAAsBzF,QAAQ,CAAR,CAAtB;uBACWoE,IAAX,GAAkBpE,QAAQ,CAAR,CAAlB;uBACWkE,IAAX,GAAkBqD,SAASvH,QAAQ,CAAR,CAAT,EAAqB,EAArB,CAAlB;uBACWN,IAAX,GAAkBM,QAAQ,CAAR,KAAc,EAAhC;uBACWG,KAAX,GAAmBH,QAAQ,CAAR,CAAnB;uBACW+D,QAAX,GAAsB/D,QAAQ,CAAR,CAAtB;;gBAGIqH,MAAMpH,WAAWiE,IAAjB,CAAJ,EAA4B;2BAChBA,IAAX,GAAkBlE,QAAQ,CAAR,CAAlB;;SAZF,MAcO;;;uBAEKzB,MAAX,GAAoByB,QAAQ,CAAR,KAAcT,SAAlC;uBACWkG,QAAX,GAAuB2B,UAAUE,OAAV,CAAkB,GAAlB,MAA2B,CAAC,CAA5B,GAAgCtH,QAAQ,CAAR,CAAhC,GAA6CT,SAApE;uBACW6E,IAAX,GAAmBgD,UAAUE,OAAV,CAAkB,IAAlB,MAA4B,CAAC,CAA7B,GAAiCtH,QAAQ,CAAR,CAAjC,GAA8CT,SAAjE;uBACW2E,IAAX,GAAkBqD,SAASvH,QAAQ,CAAR,CAAT,EAAqB,EAArB,CAAlB;uBACWN,IAAX,GAAkBM,QAAQ,CAAR,KAAc,EAAhC;uBACWG,KAAX,GAAoBiH,UAAUE,OAAV,CAAkB,GAAlB,MAA2B,CAAC,CAA5B,GAAgCtH,QAAQ,CAAR,CAAhC,GAA6CT,SAAjE;uBACWwE,QAAX,GAAuBqD,UAAUE,OAAV,CAAkB,GAAlB,MAA2B,CAAC,CAA5B,GAAgCtH,QAAQ,CAAR,CAAhC,GAA6CT,SAApE;;gBAGI8H,MAAMpH,WAAWiE,IAAjB,CAAJ,EAA4B;2BAChBA,IAAX,GAAmBkD,UAAU/H,KAAV,CAAgB,+BAAhB,IAAmDW,QAAQ,CAAR,CAAnD,GAAgET,SAAnF;;;YAIEU,WAAWmE,IAAf,EAAqB;;uBAETA,IAAX,GAAkB6C,eAAeC,eAAejH,WAAWmE,IAA1B,EAAgC+B,QAAhC,CAAf,EAA0DA,QAA1D,CAAlB;;;YAIGlG,WAAW1B,MAAX,KAAsBgB,SAAtB,IAAmCU,WAAWwF,QAAX,KAAwBlG,SAA3D,IAAwEU,WAAWmE,IAAX,KAAoB7E,SAA5F,IAAyGU,WAAWiE,IAAX,KAAoB3E,SAA7H,IAA0I,CAACU,WAAWP,IAAtJ,IAA8JO,WAAWE,KAAX,KAAqBZ,SAAvL,EAAkM;uBACtL0G,SAAX,GAAuB,eAAvB;SADD,MAEO,IAAIhG,WAAW1B,MAAX,KAAsBgB,SAA1B,EAAqC;uBAChC0G,SAAX,GAAuB,UAAvB;SADM,MAEA,IAAIhG,WAAW8D,QAAX,KAAwBxE,SAA5B,EAAuC;uBAClC0G,SAAX,GAAuB,UAAvB;SADM,MAEA;uBACKA,SAAX,GAAuB,KAAvB;;;YAIG/G,QAAQ+G,SAAR,IAAqB/G,QAAQ+G,SAAR,KAAsB,QAA3C,IAAuD/G,QAAQ+G,SAAR,KAAsBhG,WAAWgG,SAA5F,EAAuG;uBAC3F9G,KAAX,GAAmBc,WAAWd,KAAX,IAAoB,kBAAkBD,QAAQ+G,SAA1B,GAAsC,aAA7E;;;YAIKrG,gBAAgBvB,QAAQ,CAACa,QAAQX,MAAR,IAAkB0B,WAAW1B,MAA7B,IAAuC,EAAxC,EAA4CU,WAA5C,EAAR,CAAtB;;YAGI,CAACC,QAAQsD,cAAT,KAA4B,CAAC5C,aAAD,IAAkB,CAACA,cAAc4C,cAA7D,CAAJ,EAAkF;;gBAE7EvC,WAAWmE,IAAX,KAAoBlF,QAAQ2E,UAAR,IAAuBjE,iBAAiBA,cAAciE,UAA1E,CAAJ,EAA4F;;oBAEvF;+BACQO,IAAX,GAAkBzC,SAASC,OAAT,CAAiB3B,WAAWmE,IAAX,CAAgB3D,OAAhB,CAAwB0F,SAASzF,WAAjC,EAA8CuC,WAA9C,EAA2DhE,WAA3D,EAAjB,CAAlB;iBADD,CAEE,OAAOyC,CAAP,EAAU;+BACAvC,KAAX,GAAmBc,WAAWd,KAAX,IAAoB,oEAAoEuC,CAA3G;;;;wCAI0BzB,UAA5B,EAAwCqE,YAAxC;SAXD,MAYO;;wCAEsBrE,UAA5B,EAAwCkG,QAAxC;;;YAIGvG,iBAAiBA,cAAcG,KAAnC,EAA0C;0BAC3BA,KAAd,CAAoBE,UAApB,EAAgCf,OAAhC;;KA3EF,MA6EO;mBACKC,KAAX,GAAmBc,WAAWd,KAAX,IAAoB,wBAAvC;;WAGMc,UAAP;;AACA;AAED,SAAAiG,mBAAA,CAA6BjG,UAA7B,EAAuDf,OAAvD,EAAA;QACOiH,WAAYjH,QAAQuC,GAAR,KAAgB,KAAhB,GAAwB8C,YAAxB,GAAuCD,YAAzD;QACMuB,YAA0B,EAAhC;QAEI5F,WAAWwF,QAAX,KAAwBlG,SAA5B,EAAuC;kBAC5BgB,IAAV,CAAeN,WAAWwF,QAA1B;kBACUlF,IAAV,CAAe,GAAf;;QAGGN,WAAWmE,IAAX,KAAoB7E,SAAxB,EAAmC;;kBAExBgB,IAAV,CAAe0G,eAAeC,eAAe9E,OAAOnC,WAAWmE,IAAlB,CAAf,EAAwC+B,QAAxC,CAAf,EAAkEA,QAAlE,EAA4E1F,OAA5E,CAAoF0F,SAASC,WAA7F,EAA0G,UAACe,CAAD,EAAIJ,EAAJ,EAAQC,EAAR;mBAAe,MAAMD,EAAN,IAAYC,KAAK,QAAQA,EAAb,GAAkB,EAA9B,IAAoC,GAAnD;SAA1G,CAAf;;QAGG,OAAO/G,WAAWiE,IAAlB,KAA2B,QAA3B,IAAuC,OAAOjE,WAAWiE,IAAlB,KAA2B,QAAtE,EAAgF;kBACrE3D,IAAV,CAAe,GAAf;kBACUA,IAAV,CAAe6B,OAAOnC,WAAWiE,IAAlB,CAAf;;WAGM2B,UAAUvF,MAAV,GAAmBuF,UAAUxF,IAAV,CAAe,EAAf,CAAnB,GAAwCd,SAA/C;;AACA;AAED,IAAMuH,OAAO,UAAb;AACA,IAAMD,OAAO,aAAb;AACA,IAAMD,OAAO,eAAb;AACA,AACA,IAAMF,OAAO,wBAAb;AAEA,AAAA,SAAAhB,iBAAA,CAAkCc,KAAlC,EAAA;QACOF,SAAuB,EAA7B;WAEOE,MAAMlG,MAAb,EAAqB;YAChBkG,MAAMnH,KAAN,CAAYyH,IAAZ,CAAJ,EAAuB;oBACdN,MAAM/F,OAAN,CAAcqG,IAAd,EAAoB,EAApB,CAAR;SADD,MAEO,IAAIN,MAAMnH,KAAN,CAAYwH,IAAZ,CAAJ,EAAuB;oBACrBL,MAAM/F,OAAN,CAAcoG,IAAd,EAAoB,GAApB,CAAR;SADM,MAEA,IAAIL,MAAMnH,KAAN,CAAYuH,IAAZ,CAAJ,EAAuB;oBACrBJ,MAAM/F,OAAN,CAAcmG,IAAd,EAAoB,GAApB,CAAR;mBACOD,GAAP;SAFM,MAGA,IAAIH,UAAU,GAAV,IAAiBA,UAAU,IAA/B,EAAqC;oBACnC,EAAR;SADM,MAEA;gBACAC,KAAKD,MAAMnH,KAAN,CAAYqH,IAAZ,CAAX;gBACID,EAAJ,EAAQ;oBACDX,IAAIW,GAAG,CAAH,CAAV;wBACQD,MAAMxE,KAAN,CAAY8D,EAAExF,MAAd,CAAR;uBACOC,IAAP,CAAYuF,CAAZ;aAHD,MAIO;sBACA,IAAIS,KAAJ,CAAU,kCAAV,CAAN;;;;WAKID,OAAOjG,IAAP,CAAY,EAAZ,CAAP;;AACA;AAED,AAAA,SAAAR,SAAA,CAA0BI,UAA1B,EAAA;QAAoDf,OAApD,uEAAyE,EAAzE;;QACOiH,WAAYjH,QAAQuC,GAAR,GAAc8C,YAAd,GAA6BD,YAA/C;QACMuB,YAA0B,EAAhC;;QAGMjG,gBAAgBvB,QAAQ,CAACa,QAAQX,MAAR,IAAkB0B,WAAW1B,MAA7B,IAAuC,EAAxC,EAA4CU,WAA5C,EAAR,CAAtB;;QAGIW,iBAAiBA,cAAcC,SAAnC,EAA8CD,cAAcC,SAAd,CAAwBI,UAAxB,EAAoCf,OAApC;QAE1Ce,WAAWmE,IAAf,EAAqB;;YAEhB+B,SAASC,WAAT,CAAqBC,IAArB,CAA0BpG,WAAWmE,IAArC,CAAJ,EAAgD;;;;aAK3C,IAAIlF,QAAQ2E,UAAR,IAAuBjE,iBAAiBA,cAAciE,UAA1D,EAAuE;;oBAEvE;+BACQO,IAAX,GAAmB,CAAClF,QAAQuC,GAAT,GAAeE,SAASC,OAAT,CAAiB3B,WAAWmE,IAAX,CAAgB3D,OAAhB,CAAwB0F,SAASzF,WAAjC,EAA8CuC,WAA9C,EAA2DhE,WAA3D,EAAjB,CAAf,GAA4G0C,SAASG,SAAT,CAAmB7B,WAAWmE,IAA9B,CAA/H;iBADD,CAEE,OAAO1C,CAAP,EAAU;+BACAvC,KAAX,GAAmBc,WAAWd,KAAX,IAAoB,iDAAiD,CAACD,QAAQuC,GAAT,GAAe,OAAf,GAAyB,SAA1E,IAAuF,iBAAvF,GAA2GC,CAAlJ;;;;;gCAMyBzB,UAA5B,EAAwCkG,QAAxC;QAEIjH,QAAQ+G,SAAR,KAAsB,QAAtB,IAAkChG,WAAW1B,MAAjD,EAAyD;kBAC9CgC,IAAV,CAAeN,WAAW1B,MAA1B;kBACUgC,IAAV,CAAe,GAAf;;QAGKwF,YAAYG,oBAAoBjG,UAApB,EAAgCf,OAAhC,CAAlB;QACI6G,cAAcxG,SAAlB,EAA6B;YACxBL,QAAQ+G,SAAR,KAAsB,QAA1B,EAAoC;sBACzB1F,IAAV,CAAe,IAAf;;kBAGSA,IAAV,CAAewF,SAAf;YAEI9F,WAAWP,IAAX,IAAmBO,WAAWP,IAAX,CAAgBiG,MAAhB,CAAuB,CAAvB,MAA8B,GAArD,EAA0D;sBAC/CpF,IAAV,CAAe,GAAf;;;QAIEN,WAAWP,IAAX,KAAoBH,SAAxB,EAAmC;YAC9BuG,IAAI7F,WAAWP,IAAnB;YAEI,CAACR,QAAQ8G,YAAT,KAA0B,CAACpG,aAAD,IAAkB,CAACA,cAAcoG,YAA3D,CAAJ,EAA8E;gBACzEN,kBAAkBI,CAAlB,CAAJ;;YAGGC,cAAcxG,SAAlB,EAA6B;gBACxBuG,EAAErF,OAAF,CAAU,OAAV,EAAmB,MAAnB,CAAJ,CAD4B;;kBAInBF,IAAV,CAAeuF,CAAf;;QAGG7F,WAAWE,KAAX,KAAqBZ,SAAzB,EAAoC;kBACzBgB,IAAV,CAAe,GAAf;kBACUA,IAAV,CAAeN,WAAWE,KAA1B;;QAGGF,WAAW8D,QAAX,KAAwBxE,SAA5B,EAAuC;kBAC5BgB,IAAV,CAAe,GAAf;kBACUA,IAAV,CAAeN,WAAW8D,QAA1B;;WAGM8B,UAAUxF,IAAV,CAAe,EAAf,CAAP,CAxED;;AAyEC;AAED,AAAA,SAAA2E,iBAAA,CAAkCQ,IAAlC,EAAsDD,QAAtD,EAAA;QAA8ErG,OAA9E,uEAAmG,EAAnG;QAAuG0G,iBAAvG;;QACON,SAAuB,EAA7B;QAEI,CAACM,iBAAL,EAAwB;eAChB7F,MAAMF,UAAU2F,IAAV,EAAgBtG,OAAhB,CAAN,EAAgCA,OAAhC,CAAP,CADuB;mBAEZa,MAAMF,UAAU0F,QAAV,EAAoBrG,OAApB,CAAN,EAAoCA,OAApC,CAAX,CAFuB;;cAIdA,WAAW,EAArB;QAEI,CAACA,QAAQE,QAAT,IAAqBmG,SAAShH,MAAlC,EAA0C;eAClCA,MAAP,GAAgBgH,SAAShH,MAAzB;;eAEOkH,QAAP,GAAkBF,SAASE,QAA3B;eACOrB,IAAP,GAAcmB,SAASnB,IAAvB;eACOF,IAAP,GAAcqB,SAASrB,IAAvB;eACOxE,IAAP,GAAcgG,kBAAkBH,SAAS7F,IAAT,IAAiB,EAAnC,CAAd;eACOS,KAAP,GAAeoF,SAASpF,KAAxB;KAPD,MAQO;YACFoF,SAASE,QAAT,KAAsBlG,SAAtB,IAAmCgG,SAASnB,IAAT,KAAkB7E,SAArD,IAAkEgG,SAASrB,IAAT,KAAkB3E,SAAxF,EAAmG;;mBAE3FkG,QAAP,GAAkBF,SAASE,QAA3B;mBACOrB,IAAP,GAAcmB,SAASnB,IAAvB;mBACOF,IAAP,GAAcqB,SAASrB,IAAvB;mBACOxE,IAAP,GAAcgG,kBAAkBH,SAAS7F,IAAT,IAAiB,EAAnC,CAAd;mBACOS,KAAP,GAAeoF,SAASpF,KAAxB;SAND,MAOO;gBACF,CAACoF,SAAS7F,IAAd,EAAoB;uBACZA,IAAP,GAAc8F,KAAK9F,IAAnB;oBACI6F,SAASpF,KAAT,KAAmBZ,SAAvB,EAAkC;2BAC1BY,KAAP,GAAeoF,SAASpF,KAAxB;iBADD,MAEO;2BACCA,KAAP,GAAeqF,KAAKrF,KAApB;;aALF,MAOO;oBACFoF,SAAS7F,IAAT,CAAciG,MAAd,CAAqB,CAArB,MAA4B,GAAhC,EAAqC;2BAC7BjG,IAAP,GAAcgG,kBAAkBH,SAAS7F,IAA3B,CAAd;iBADD,MAEO;wBACF,CAAC8F,KAAKC,QAAL,KAAkBlG,SAAlB,IAA+BiG,KAAKpB,IAAL,KAAc7E,SAA7C,IAA0DiG,KAAKtB,IAAL,KAAc3E,SAAzE,KAAuF,CAACiG,KAAK9F,IAAjG,EAAuG;+BAC/FA,IAAP,GAAc,MAAM6F,SAAS7F,IAA7B;qBADD,MAEO,IAAI,CAAC8F,KAAK9F,IAAV,EAAgB;+BACfA,IAAP,GAAc6F,SAAS7F,IAAvB;qBADM,MAEA;+BACCA,IAAP,GAAc8F,KAAK9F,IAAL,CAAUsC,KAAV,CAAgB,CAAhB,EAAmBwD,KAAK9F,IAAL,CAAUyC,WAAV,CAAsB,GAAtB,IAA6B,CAAhD,IAAqDoD,SAAS7F,IAA5E;;2BAEMA,IAAP,GAAcgG,kBAAkBJ,OAAO5F,IAAzB,CAAd;;uBAEMS,KAAP,GAAeoF,SAASpF,KAAxB;;;mBAGMsF,QAAP,GAAkBD,KAAKC,QAAvB;mBACOrB,IAAP,GAAcoB,KAAKpB,IAAnB;mBACOF,IAAP,GAAcsB,KAAKtB,IAAnB;;eAEM3F,MAAP,GAAgBiH,KAAKjH,MAArB;;WAGMwF,QAAP,GAAkBwB,SAASxB,QAA3B;WAEOuB,MAAP;;AACA;AAED,AAAA,SAAAD,OAAA,CAAwBJ,OAAxB,EAAwCE,WAAxC,EAA4DjG,OAA5D,EAAA;QACOgG,oBAAoBE,OAAO,EAAE7G,QAAS,MAAX,EAAP,EAA4BW,OAA5B,CAA1B;WACOW,UAAUmF,kBAAkBjF,MAAMkF,OAAN,EAAeC,iBAAf,CAAlB,EAAqDnF,MAAMoF,WAAN,EAAmBD,iBAAnB,CAArD,EAA4FA,iBAA5F,EAA+G,IAA/G,CAAV,EAAgIA,iBAAhI,CAAP;;AACA;AAID,AAAA,SAAAH,SAAA,CAA0BD,GAA1B,EAAmC5F,OAAnC,EAAA;QACK,OAAO4F,GAAP,KAAe,QAAnB,EAA6B;cACtBjF,UAAUE,MAAM+E,GAAN,EAAW5F,OAAX,CAAV,EAA+BA,OAA/B,CAAN;KADD,MAEO,IAAI0F,OAAOE,GAAP,MAAgB,QAApB,EAA8B;cAC9B/E,MAAMF,UAAyBiF,GAAzB,EAA8B5F,OAA9B,CAAN,EAA8CA,OAA9C,CAAN;;WAGM4F,GAAP;;AACA;AAID,AAAA,SAAAD,KAAA,CAAsBH,IAAtB,EAAgCC,IAAhC,EAA0CzF,OAA1C,EAAA;QACK,OAAOwF,IAAP,KAAgB,QAApB,EAA8B;eACtB7E,UAAUE,MAAM2E,IAAN,EAAYxF,OAAZ,CAAV,EAAgCA,OAAhC,CAAP;KADD,MAEO,IAAI0F,OAAOF,IAAP,MAAiB,QAArB,EAA+B;eAC9B7E,UAAyB6E,IAAzB,EAA+BxF,OAA/B,CAAP;;QAGG,OAAOyF,IAAP,KAAgB,QAApB,EAA8B;eACtB9E,UAAUE,MAAM4E,IAAN,EAAYzF,OAAZ,CAAV,EAAgCA,OAAhC,CAAP;KADD,MAEO,IAAI0F,OAAOD,IAAP,MAAiB,QAArB,EAA+B;eAC9B9E,UAAyB8E,IAAzB,EAA+BzF,OAA/B,CAAP;;WAGMwF,SAASC,IAAhB;;AACA;AAED,AAAA,SAAAF,eAAA,CAAgCzB,GAAhC,EAA4C9D,OAA5C,EAAA;WACQ8D,OAAOA,IAAIqB,QAAJ,GAAe5D,OAAf,CAAwB,CAACvB,OAAD,IAAY,CAACA,QAAQuC,GAArB,GAA2B6C,aAAaE,MAAxC,GAAiDD,aAAaC,MAAtF,EAA+F1D,UAA/F,CAAd;;AACA;AAED,AAAA,SAAAe,iBAAA,CAAkCmB,GAAlC,EAA8C9D,OAA9C,EAAA;WACQ8D,OAAOA,IAAIqB,QAAJ,GAAe5D,OAAf,CAAwB,CAACvB,OAAD,IAAY,CAACA,QAAQuC,GAArB,GAA2B6C,aAAa5D,WAAxC,GAAsD6D,aAAa7D,WAA3F,EAAyGuC,WAAzG,CAAd;CACA;;ADziBD,IAAMzD,UAA2B;YACvB,MADuB;gBAGnB,IAHmB;WAKxB,eAAUS,UAAV,EAAoCf,OAApC,EAAT;;YAEM,CAACe,WAAWmE,IAAhB,EAAsB;uBACVjF,KAAX,GAAmBc,WAAWd,KAAX,IAAoB,6BAAvC;;eAGMc,UAAP;KAX+B;eAcpB,mBAAUA,UAAV,EAAoCf,OAApC,EAAb;YACQ+E,SAAS7B,OAAOnC,WAAW1B,MAAlB,EAA0BU,WAA1B,OAA4C,OAA3D;;YAGIgB,WAAWiE,IAAX,MAAqBD,SAAS,GAAT,GAAe,EAApC,KAA2ChE,WAAWiE,IAAX,KAAoB,EAAnE,EAAuE;uBAC3DA,IAAX,GAAkB3E,SAAlB;;;YAIG,CAACU,WAAWP,IAAhB,EAAsB;uBACVA,IAAX,GAAkB,GAAlB;;;;;eAOMO,UAAP;;CA/BF,CAmCA;;ADlCA,IAAMT,YAA2B;YACvB,OADuB;gBAEnBX,QAAKgF,UAFc;WAGxBhF,QAAKkB,KAHmB;eAIpBlB,QAAKgB;CAJlB,CAOA;;ADHA,SAAAsE,QAAA,CAAkBL,YAAlB,EAAA;WACQ,OAAOA,aAAaG,MAApB,KAA+B,SAA/B,GAA2CH,aAAaG,MAAxD,GAAiE7B,OAAO0B,aAAavF,MAApB,EAA4BU,WAA5B,OAA8C,KAAtH;;;AAID,IAAMO,YAA2B;YACvB,IADuB;gBAGnB,IAHmB;WAKxB,eAAUS,UAAV,EAAoCf,OAApC,EAAT;YACQ4E,eAAe7D,UAArB;;qBAGagE,MAAb,GAAsBE,SAASL,YAAT,CAAtB;;qBAGaE,YAAb,GAA4B,CAACF,aAAapE,IAAb,IAAqB,GAAtB,KAA8BoE,aAAa3D,KAAb,GAAqB,MAAM2D,aAAa3D,KAAxC,GAAgD,EAA9E,CAA5B;qBACaT,IAAb,GAAoBH,SAApB;qBACaY,KAAb,GAAqBZ,SAArB;eAEOuE,YAAP;KAhB+B;eAmBpB,mBAAUA,YAAV,EAAqC5E,OAArC,EAAb;;YAEM4E,aAAaI,IAAb,MAAuBC,SAASL,YAAT,IAAyB,GAAzB,GAA+B,EAAtD,KAA6DA,aAAaI,IAAb,KAAsB,EAAvF,EAA2F;yBAC7EA,IAAb,GAAoB3E,SAApB;;;YAIG,OAAOuE,aAAaG,MAApB,KAA+B,SAAnC,EAA8C;yBAChC1F,MAAb,GAAuBuF,aAAaG,MAAb,GAAsB,KAAtB,GAA8B,IAArD;yBACaA,MAAb,GAAsB1E,SAAtB;;;YAIGuE,aAAaE,YAAjB,EAA+B;wCACRF,aAAaE,YAAb,CAA0BvB,KAA1B,CAAgC,GAAhC,CADQ;;gBACvB/C,IADuB;gBACjBS,KADiB;;yBAEjBT,IAAb,GAAqBA,QAAQA,SAAS,GAAjB,GAAuBA,IAAvB,GAA8BH,SAAnD;yBACaY,KAAb,GAAqBA,KAArB;yBACa6D,YAAb,GAA4BzE,SAA5B;;;qBAIYwE,QAAb,GAAwBxE,SAAxB;eAEOuE,YAAP;;CA1CF,CA8CA;;ADvDA,IAAMtE,YAA2B;YACvB,KADuB;gBAEnBb,UAAGkF,UAFgB;WAGxBlF,UAAGoB,KAHqB;eAIpBpB,UAAGkB;CAJhB,CAOA;;ADMA,IAAMoB,IAAkB,EAAxB;AACA,IAAM2C,QAAQ,IAAd;;AAGA,IAAMR,eAAe,4BAA4BQ,QAAQ,2EAAR,GAAsF,EAAlH,IAAwH,GAA7I;AACA,IAAMD,WAAW,aAAjB;AACA,IAAMH,eAAeE,OAAOA,OAAO,YAAYC,QAAZ,GAAuB,GAAvB,GAA6BA,QAA7B,GAAwCA,QAAxC,GAAmD,GAAnD,GAAyDA,QAAzD,GAAoEA,QAA3E,IAAuF,GAAvF,GAA6FD,OAAO,gBAAgBC,QAAhB,GAA2B,GAA3B,GAAiCA,QAAjC,GAA4CA,QAAnD,CAA7F,GAA4J,GAA5J,GAAkKD,OAAO,MAAMC,QAAN,GAAiBA,QAAxB,CAAzK,CAArB;;;;;;;;;;;;AAaA,IAAML,UAAU,uDAAhB;AACA,IAAMG,UAAU,4DAAhB;AACA,IAAMF,UAAUJ,MAAMM,OAAN,EAAe,YAAf,CAAhB;AACA,AACA,AACA,AACA,AAEA,AAEA,IAAMJ,gBAAgB,qCAAtB;AACA,AACA,AACA,AACA,AACA,AACA,AACA,AACA,AACA,AACA,AACA,AAEA,IAAMN,aAAa,IAAIG,MAAJ,CAAWE,YAAX,EAAyB,GAAzB,CAAnB;AACA,IAAM1C,cAAc,IAAIwC,MAAJ,CAAWM,YAAX,EAAyB,GAAzB,CAApB;AACA,IAAMtB,iBAAiB,IAAIgB,MAAJ,CAAWC,MAAM,KAAN,EAAaG,OAAb,EAAsB,OAAtB,EAA+B,OAA/B,EAAwCC,OAAxC,CAAX,EAA6D,GAA7D,CAAvB;AACA,AACA,IAAM1C,aAAa,IAAIqC,MAAJ,CAAWC,MAAM,KAAN,EAAaC,YAAb,EAA2BC,aAA3B,CAAX,EAAsD,GAAtD,CAAnB;AACA,IAAMrC,cAAcH,UAApB;AACA,AACA,AAEA,SAAAF,gBAAA,CAA0BqC,GAA1B,EAAA;QACOF,SAASG,YAAYD,GAAZ,CAAf;WACQ,CAACF,OAAOzD,KAAP,CAAa0D,UAAb,CAAD,GAA4BC,GAA5B,GAAkCF,MAA1C;;AAGD,IAAMtD,YAA8C;YAC1C,QAD0C;WAG3C,kBAAUS,UAAV,EAAoCf,OAApC,EAAT;YACQgC,mBAAmBjB,UAAzB;YACMoB,KAAKH,iBAAiBG,EAAjB,GAAuBH,iBAAiBxB,IAAjB,GAAwBwB,iBAAiBxB,IAAjB,CAAsB+C,KAAtB,CAA4B,GAA5B,CAAxB,GAA2D,EAA7F;yBACiB/C,IAAjB,GAAwBH,SAAxB;YAEI2B,iBAAiBf,KAArB,EAA4B;gBACvBuC,iBAAiB,KAArB;gBACM3B,UAAwB,EAA9B;gBACM8B,UAAU3B,iBAAiBf,KAAjB,CAAuBsC,KAAvB,CAA6B,GAA7B,CAAhB;iBAEK,IAAInB,IAAI,CAAR,EAAWe,KAAKQ,QAAQvC,MAA7B,EAAqCgB,IAAIe,EAAzC,EAA6C,EAAEf,CAA/C,EAAkD;oBAC3CqB,SAASE,QAAQvB,CAAR,EAAWmB,KAAX,CAAiB,GAAjB,CAAf;wBAEQE,OAAO,CAAP,CAAR;yBACM,IAAL;4BACOC,UAAUD,OAAO,CAAP,EAAUF,KAAV,CAAgB,GAAhB,CAAhB;6BACK,IAAInB,KAAI,CAAR,EAAWe,MAAKO,QAAQtC,MAA7B,EAAqCgB,KAAIe,GAAzC,EAA6C,EAAEf,EAA/C,EAAkD;+BAC9Cf,IAAH,CAAQqC,QAAQtB,EAAR,CAAR;;;yBAGG,SAAL;yCACkBF,OAAjB,GAA2BS,kBAAkBc,OAAO,CAAP,CAAlB,EAA6BzD,OAA7B,CAA3B;;yBAEI,MAAL;yCACkBiC,IAAjB,GAAwBU,kBAAkBc,OAAO,CAAP,CAAlB,EAA6BzD,OAA7B,CAAxB;;;yCAGiB,IAAjB;gCACQ2C,kBAAkBc,OAAO,CAAP,CAAlB,EAA6BzD,OAA7B,CAAR,IAAiD2C,kBAAkBc,OAAO,CAAP,CAAlB,EAA6BzD,OAA7B,CAAjD;;;;gBAKCwD,cAAJ,EAAoBxB,iBAAiBH,OAAjB,GAA2BA,OAA3B;;yBAGJZ,KAAjB,GAAyBZ,SAAzB;aAEK,IAAI+B,MAAI,CAAR,EAAWe,OAAKhB,GAAGf,MAAxB,EAAgCgB,MAAIe,IAApC,EAAwC,EAAEf,GAA1C,EAA6C;gBACtCiB,OAAOlB,GAAGC,GAAH,EAAMmB,KAAN,CAAY,GAAZ,CAAb;iBAEK,CAAL,IAAUZ,kBAAkBU,KAAK,CAAL,CAAlB,CAAV;gBAEI,CAACrD,QAAQsD,cAAb,EAA6B;;oBAExB;yBACE,CAAL,IAAUb,SAASC,OAAT,CAAiBC,kBAAkBU,KAAK,CAAL,CAAlB,EAA2BrD,OAA3B,EAAoCD,WAApC,EAAjB,CAAV;iBADD,CAEE,OAAOyC,CAAP,EAAU;qCACMvC,KAAjB,GAAyB+B,iBAAiB/B,KAAjB,IAA0B,6EAA6EuC,CAAhI;;aALF,MAOO;qBACD,CAAL,IAAUG,kBAAkBU,KAAK,CAAL,CAAlB,EAA2BrD,OAA3B,EAAoCD,WAApC,EAAV;;eAGEqC,GAAH,IAAQiB,KAAKlC,IAAL,CAAU,GAAV,CAAR;;eAGMa,gBAAP;KA5DkD;eA+DvC,sBAAUA,gBAAV,EAA6ChC,OAA7C,EAAb;YACQe,aAAaiB,gBAAnB;YACMG,KAAKiB,QAAQpB,iBAAiBG,EAAzB,CAAX;YACIA,EAAJ,EAAQ;iBACF,IAAIC,IAAI,CAAR,EAAWe,KAAKhB,GAAGf,MAAxB,EAAgCgB,IAAIe,EAApC,EAAwC,EAAEf,CAA1C,EAA6C;oBACtCS,SAASK,OAAOf,GAAGC,CAAH,CAAP,CAAf;oBACMW,QAAQF,OAAOI,WAAP,CAAmB,GAAnB,CAAd;oBACMZ,YAAaQ,OAAOC,KAAP,CAAa,CAAb,EAAgBC,KAAhB,CAAD,CAAyBxB,OAAzB,CAAiCC,WAAjC,EAA8CC,gBAA9C,EAAgEF,OAAhE,CAAwEC,WAAxE,EAAqFE,WAArF,EAAkGH,OAAlG,CAA0GyB,cAA1G,EAA0HpB,UAA1H,CAAlB;oBACIU,SAASO,OAAOC,KAAP,CAAaC,QAAQ,CAArB,CAAb;;oBAGI;6BACO,CAAC/C,QAAQuC,GAAT,GAAeE,SAASC,OAAT,CAAiBC,kBAAkBL,MAAlB,EAA0BtC,OAA1B,EAAmCD,WAAnC,EAAjB,CAAf,GAAoF0C,SAASG,SAAT,CAAmBN,MAAnB,CAA9F;iBADD,CAEE,OAAOE,CAAP,EAAU;+BACAvC,KAAX,GAAmBc,WAAWd,KAAX,IAAoB,0DAA0D,CAACD,QAAQuC,GAAT,GAAe,OAAf,GAAyB,SAAnF,IAAgG,iBAAhG,GAAoHC,CAA3J;;mBAGEJ,CAAH,IAAQC,YAAY,GAAZ,GAAkBC,MAA1B;;uBAGU9B,IAAX,GAAkB2B,GAAGhB,IAAH,CAAQ,GAAR,CAAlB;;YAGKU,UAAUG,iBAAiBH,OAAjB,GAA2BG,iBAAiBH,OAAjB,IAA4B,EAAvE;YAEIG,iBAAiBE,OAArB,EAA8BL,QAAQ,SAAR,IAAqBG,iBAAiBE,OAAtC;YAC1BF,iBAAiBC,IAArB,EAA2BJ,QAAQ,MAAR,IAAkBG,iBAAiBC,IAAnC;YAErBf,SAAS,EAAf;aACK,IAAMI,IAAX,IAAmBO,OAAnB,EAA4B;gBACvBA,QAAQP,IAAR,MAAkBS,EAAET,IAAF,CAAtB,EAA+B;uBACvBD,IAAP,CACCC,KAAKC,OAAL,CAAaC,WAAb,EAA0BC,gBAA1B,EAA4CF,OAA5C,CAAoDC,WAApD,EAAiEE,WAAjE,EAA8EH,OAA9E,CAAsFI,UAAtF,EAAkGC,UAAlG,IACA,GADA,GAEAC,QAAQP,IAAR,EAAcC,OAAd,CAAsBC,WAAtB,EAAmCC,gBAAnC,EAAqDF,OAArD,CAA6DC,WAA7D,EAA0EE,WAA1E,EAAuFH,OAAvF,CAA+FO,WAA/F,EAA4GF,UAA5G,CAHD;;;YAOEV,OAAOE,MAAX,EAAmB;uBACPH,KAAX,GAAmBC,OAAOC,IAAP,CAAY,GAAZ,CAAnB;;eAGMJ,UAAP;;CAzGF,CA6GA;;ADnKA,IAAMC,YAAY,iBAAlB;AACA,AAEA;AACA,IAAMV,YAAqD;YACjD,KADiD;WAGlD,kBAAUS,UAAV,EAAoCf,OAApC,EAAT;YACQc,UAAUC,WAAWP,IAAX,IAAmBO,WAAWP,IAAX,CAAgBL,KAAhB,CAAsBa,SAAtB,CAAnC;YACIpB,gBAAgBmB,UAApB;YAEID,OAAJ,EAAa;gBACNzB,SAASW,QAAQX,MAAR,IAAkBO,cAAcP,MAAhC,IAA0C,KAAzD;gBACMoB,MAAMK,QAAQ,CAAR,EAAWf,WAAX,EAAZ;gBACMF,MAAMiB,QAAQ,CAAR,CAAZ;gBACMF,YAAevB,MAAf,UAAyBW,QAAQS,GAAR,IAAeA,GAAxC,CAAN;gBACMC,gBAAgBvB,QAAQyB,SAAR,CAAtB;0BAEcH,GAAd,GAAoBA,GAApB;0BACcZ,GAAd,GAAoBA,GAApB;0BACcW,IAAd,GAAqBH,SAArB;gBAEIK,aAAJ,EAAmB;gCACFA,cAAcG,KAAd,CAAoBjB,aAApB,EAAmCI,OAAnC,CAAhB;;SAZF,MAcO;0BACQC,KAAd,GAAsBL,cAAcK,KAAd,IAAuB,wBAA7C;;eAGML,aAAP;KAzByD;eA4B9C,sBAAUA,aAAV,EAAuCI,OAAvC,EAAb;YACQX,SAASW,QAAQX,MAAR,IAAkBO,cAAcP,MAAhC,IAA0C,KAAzD;YACMoB,MAAMb,cAAca,GAA1B;YACMG,YAAevB,MAAf,UAAyBW,QAAQS,GAAR,IAAeA,GAAxC,CAAN;YACMC,gBAAgBvB,QAAQyB,SAAR,CAAtB;YAEIF,aAAJ,EAAmB;4BACFA,cAAcC,SAAd,CAAwBf,aAAxB,EAAuCI,OAAvC,CAAhB;;YAGKO,gBAAgBX,aAAtB;YACMC,MAAMD,cAAcC,GAA1B;sBACcW,IAAd,IAAwBC,OAAOT,QAAQS,GAAvC,UAA8CZ,GAA9C;eAEOU,aAAP;;CA1CF,CA8CA;;AD5DA,IAAMH,OAAO,0DAAb;AACA,AAEA;AACA,IAAME,YAAsE;YAClE,UADkE;WAGnE,eAAUV,aAAV,EAAuCI,OAAvC,EAAT;YACQF,iBAAiBF,aAAvB;uBACeR,IAAf,GAAsBU,eAAeD,GAArC;uBACeA,GAAf,GAAqBQ,SAArB;YAEI,CAACL,QAAQE,QAAT,KAAsB,CAACJ,eAAeV,IAAhB,IAAwB,CAACU,eAAeV,IAAf,CAAoBe,KAApB,CAA0BC,IAA1B,CAA/C,CAAJ,EAAqF;2BACrEH,KAAf,GAAuBH,eAAeG,KAAf,IAAwB,oBAA/C;;eAGMH,cAAP;KAZ0E;eAe/D,mBAAUA,cAAV,EAAyCE,OAAzC,EAAb;YACQJ,gBAAgBE,cAAtB;;sBAEcD,GAAd,GAAoB,CAACC,eAAeV,IAAf,IAAuB,EAAxB,EAA4BW,WAA5B,EAApB;eACOH,aAAP;;CAnBF,CAuBA;;ADhCAT,QAAQQ,QAAKN,MAAb,IAAuBM,OAAvB;AAEA,AACAR,QAAQO,UAAML,MAAd,IAAwBK,SAAxB;AAEA,AACAP,QAAQM,UAAGJ,MAAX,IAAqBI,SAArB;AAEA,AACAN,QAAQK,UAAIH,MAAZ,IAAsBG,SAAtB;AAEA,AACAL,QAAQI,UAAOF,MAAf,IAAyBE,SAAzB;AAEA,AACAJ,QAAQG,UAAID,MAAZ,IAAsBC,SAAtB;AAEA,AACAH,QAAQC,UAAKC,MAAb,IAAuBD,SAAvB,CAEA;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/es5/uri.all.min.d.ts b/tools/ui/node_modules/uri-js/dist/es5/uri.all.min.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..da51e23527705f85a4d8c513d9931ae2d3eec7a0 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/es5/uri.all.min.d.ts @@ -0,0 +1,59 @@ +export interface URIComponents { + scheme?: string; + userinfo?: string; + host?: string; + port?: number | string; + path?: string; + query?: string; + fragment?: string; + reference?: string; + error?: string; +} +export interface URIOptions { + scheme?: string; + reference?: string; + tolerant?: boolean; + absolutePath?: boolean; + iri?: boolean; + unicodeSupport?: boolean; + domainHost?: boolean; +} +export interface URISchemeHandler { + scheme: string; + parse(components: ParentComponents, options: Options): Components; + serialize(components: Components, options: Options): ParentComponents; + unicodeSupport?: boolean; + domainHost?: boolean; + absolutePath?: boolean; +} +export interface URIRegExps { + NOT_SCHEME: RegExp; + NOT_USERINFO: RegExp; + NOT_HOST: RegExp; + NOT_PATH: RegExp; + NOT_PATH_NOSCHEME: RegExp; + NOT_QUERY: RegExp; + NOT_FRAGMENT: RegExp; + ESCAPE: RegExp; + UNRESERVED: RegExp; + OTHER_CHARS: RegExp; + PCT_ENCODED: RegExp; + IPV4ADDRESS: RegExp; + IPV6ADDRESS: RegExp; +} +export declare const SCHEMES: { + [scheme: string]: URISchemeHandler; +}; +export declare function pctEncChar(chr: string): string; +export declare function pctDecChars(str: string): string; +export declare function parse(uriString: string, options?: URIOptions): URIComponents; +export declare function removeDotSegments(input: string): string; +export declare function serialize(components: URIComponents, options?: URIOptions): string; +export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; +export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; +export declare function normalize(uri: string, options?: URIOptions): string; +export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; +export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; +export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; +export declare function escapeComponent(str: string, options?: URIOptions): string; +export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/tools/ui/node_modules/uri-js/dist/es5/uri.all.min.js b/tools/ui/node_modules/uri-js/dist/es5/uri.all.min.js new file mode 100644 index 0000000000000000000000000000000000000000..fcd845862d917f9aa5cc142908814e901c7b95e8 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/es5/uri.all.min.js @@ -0,0 +1,3 @@ +/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */ +!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.URI=e.URI||{})}(this,function(e){"use strict";function r(){for(var e=arguments.length,r=Array(e),n=0;n1){r[0]=r[0].slice(0,-1);for(var t=r.length-1,o=1;o1&&(t=n[0]+"@",e=n[1]),e=e.replace(j,"."),t+f(e.split("."),r).join(".")}function p(e){for(var r=[],n=0,t=e.length;n=55296&&o<=56319&&n>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function d(e){for(var r="",n=0,t=e.length;n=194&&o<224){if(t-n>=6){var a=parseInt(e.substr(n+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(n,6);n+=6}else if(o>=224){if(t-n>=9){var i=parseInt(e.substr(n+4,2),16),u=parseInt(e.substr(n+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&u)}else r+=e.substr(n,9);n+=9}else r+=e.substr(n,3),n+=3}return r}function l(e,r){function n(e){var n=d(e);return n.match(r.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_SCHEME,"")),e.userinfo!==undefined&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,n).replace(r.NOT_USERINFO,h).replace(r.PCT_ENCODED,o)),e.host!==undefined&&(e.host=String(e.host).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_HOST,h).replace(r.PCT_ENCODED,o)),e.path!==undefined&&(e.path=String(e.path).replace(r.PCT_ENCODED,n).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,h).replace(r.PCT_ENCODED,o)),e.query!==undefined&&(e.query=String(e.query).replace(r.PCT_ENCODED,n).replace(r.NOT_QUERY,h).replace(r.PCT_ENCODED,o)),e.fragment!==undefined&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,n).replace(r.NOT_FRAGMENT,h).replace(r.PCT_ENCODED,o)),e}function m(e){return e.replace(/^0*(.*)/,"$1")||"0"}function g(e,r){var n=e.match(r.IPV4ADDRESS)||[],t=T(n,2),o=t[1];return o?o.split(".").map(m).join("."):e}function v(e,r){var n=e.match(r.IPV6ADDRESS)||[],t=T(n,3),o=t[1],a=t[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),u=T(i,2),s=u[0],f=u[1],c=f?f.split(":").map(m):[],p=s.split(":").map(m),h=r.IPV4ADDRESS.test(p[p.length-1]),d=h?7:8,l=p.length-d,v=Array(d),E=0;E1){var A=v.slice(0,y.index),D=v.slice(y.index+y.length);S=A.join(":")+"::"+D.join(":")}else S=v.join(":");return a&&(S+="%"+a),S}return e}function E(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n={},t=!1!==r.iri?R:F;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(K);if(o){W?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||undefined,n.userinfo=-1!==e.indexOf("@")?o[3]:undefined,n.host=-1!==e.indexOf("//")?o[4]:undefined,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:undefined,n.fragment=-1!==e.indexOf("#")?o[8]:undefined,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined)),n.host&&(n.host=v(g(n.host,t),t)),n.scheme!==undefined||n.userinfo!==undefined||n.host!==undefined||n.port!==undefined||n.path||n.query!==undefined?n.scheme===undefined?n.reference="relative":n.fragment===undefined?n.reference="absolute":n.reference="uri":n.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");var a=J[(r.scheme||n.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)l(n,t);else{if(n.host&&(r.domainHost||a&&a.domainHost))try{n.host=B.toASCII(n.host.replace(t.PCT_ENCODED,d).toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+i}l(n,F)}a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}function C(e,r){var n=!1!==r.iri?R:F,t=[];return e.userinfo!==undefined&&(t.push(e.userinfo),t.push("@")),e.host!==undefined&&t.push(v(g(String(e.host),n),n).replace(n.IPV6ADDRESS,function(e,r,n){return"["+r+(n?"%25"+n:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):undefined}function y(e){for(var r=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(ee))e=e.replace(ee,"/");else if(e.match(re))e=e.replace(re,"/"),r.pop();else if("."===e||".."===e)e="";else{var n=e.match(ne);if(!n)throw new Error("Unexpected dot segment condition");var t=n[0];e=e.slice(t.length),r.push(t)}return r.join("")}function S(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.iri?R:F,t=[],o=J[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(n.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?B.toUnicode(e.host):B.toASCII(e.host.replace(n.PCT_ENCODED,d).toLowerCase())}catch(u){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+u}l(e,n),"suffix"!==r.reference&&e.scheme&&(t.push(e.scheme),t.push(":"));var a=C(e,r);if(a!==undefined&&("suffix"!==r.reference&&t.push("//"),t.push(a),e.path&&"/"!==e.path.charAt(0)&&t.push("/")),e.path!==undefined){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=y(i)),a===undefined&&(i=i.replace(/^\/\//,"/%2F")),t.push(i)}return e.query!==undefined&&(t.push("?"),t.push(e.query)),e.fragment!==undefined&&(t.push("#"),t.push(e.fragment)),t.join("")}function A(e,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},t=arguments[3],o={};return t||(e=E(S(e,n),n),r=E(S(r,n),n)),n=n||{},!n.tolerant&&r.scheme?(o.scheme=r.scheme,o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined?(o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.path?("/"===r.path.charAt(0)?o.path=y(r.path):(e.userinfo===undefined&&e.host===undefined&&e.port===undefined||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:o.path=r.path:o.path="/"+r.path,o.path=y(o.path)),o.query=r.query):(o.path=e.path,r.query!==undefined?o.query=r.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=r.fragment,o}function D(e,r,n){var t=i({scheme:"null"},n);return S(A(E(e,t),E(r,t),t,!0),t)}function w(e,r){return"string"==typeof e?e=S(E(e,r),r):"object"===t(e)&&(e=E(S(e,r),r)),e}function b(e,r,n){return"string"==typeof e?e=S(E(e,n),n):"object"===t(e)&&(e=S(e,n)),"string"==typeof r?r=S(E(r,n),n):"object"===t(r)&&(r=S(r,n)),e===r}function x(e,r){return e&&e.toString().replace(r&&r.iri?R.ESCAPE:F.ESCAPE,h)}function O(e,r){return e&&e.toString().replace(r&&r.iri?R.PCT_ENCODED:F.PCT_ENCODED,d)}function N(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function I(e){var r=d(e);return r.match(he)?r:e}var F=u(!1),R=u(!0),T=function(){function e(e,r){var n=[],t=!0,o=!1,a=undefined;try{for(var i,u=e[Symbol.iterator]();!(t=(i=u.next()).done)&&(n.push(i.value),!r||n.length!==r);t=!0);}catch(s){o=!0,a=s}finally{try{!t&&u["return"]&&u["return"]()}finally{if(o)throw a}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(e){if(Array.isArray(e)){for(var r=0,n=Array(e.length);r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,L=String.fromCharCode,$=function(e){return String.fromCodePoint.apply(String,_(e))},M=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36},V=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},k=function(e,r,n){var t=0;for(e=n?z(e/700):e>>1,e+=z(e/r);e>455;t+=36)e=z(e/35);return z(t+36*e/(e+38))},Z=function(e){var r=[],n=e.length,t=0,o=128,a=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var u=0;u=128&&s("not-basic"),r.push(e.charCodeAt(u));for(var f=i>0?i+1:0;f=n&&s("invalid-input");var d=M(e.charCodeAt(f++));(d>=36||d>z((P-t)/p))&&s("overflow"),t+=d*p;var l=h<=a?1:h>=a+26?26:h-a;if(dz(P/m)&&s("overflow"),p*=m}var g=r.length+1;a=k(t-c,g,0==c),z(t/g)>P-o&&s("overflow"),o+=z(t/g),t%=g,r.splice(t++,0,o)}return String.fromCodePoint.apply(String,r)},G=function(e){var r=[];e=p(e);var n=e.length,t=128,o=0,a=72,i=!0,u=!1,f=undefined;try{for(var c,h=e[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;d<128&&r.push(L(d))}}catch(U){u=!0,f=U}finally{try{!i&&h["return"]&&h["return"]()}finally{if(u)throw f}}var l=r.length,m=l;for(l&&r.push("-");m=t&&Az((P-o)/D)&&s("overflow"),o+=(g-t)*D,t=g;var w=!0,b=!1,x=undefined;try{for(var O,N=e[Symbol.iterator]();!(w=(O=N.next()).done);w=!0){var I=O.value;if(IP&&s("overflow"),I==t){for(var F=o,R=36;;R+=36){var T=R<=a?1:R>=a+26?26:R-a;if(FA-Z\\x5E-\\x7E]",'[\\"\\\\]'),he=new RegExp(se,"g"),de=new RegExp(ce,"g"),le=new RegExp(r("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',pe),"g"),me=new RegExp(r("[^]",se,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ge=me,ve={scheme:"mailto",parse:function(e,r){var n=e,t=n.to=n.path?n.path.split(","):[];if(n.path=undefined,n.query){for(var o=!1,a={},i=n.query.split("&"),u=0,s=i.length;u):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"), //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)), //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\", //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\", //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$), //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp( subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), // 6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp( \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), // \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp( H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[ h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" + H16$ + \"\\\\:\" + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\" h16 \":\" ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\" + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\" ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\" + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\" h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\" ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"), //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$), //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$), //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"), //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"), //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\") //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t// 0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see \n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author Gary Court\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n * 1. Redistributions of source code must retain the above copyright notice, this list of\n * conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright notice, this list\n * of conditions and the following disclaimer in the documentation and/or other materials\n * provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = ((\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else { //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\"); //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\"); //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options); //normalize base components\n\t\trelative = parse(serialize(relative, options), options); //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\"; //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)); //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\"; //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\"; //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler = {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n"]} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/index.d.ts b/tools/ui/node_modules/uri-js/dist/esnext/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f6be760343fbdf683bff1a7aa6590c43e3e9a0a7 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/index.d.ts @@ -0,0 +1 @@ +export * from "./uri"; diff --git a/tools/ui/node_modules/uri-js/dist/esnext/index.js b/tools/ui/node_modules/uri-js/dist/esnext/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e3531b5b61bb28ab48f0a55722eb63e97b7b83f8 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/index.js @@ -0,0 +1,17 @@ +import { SCHEMES } from "./uri"; +import http from "./schemes/http"; +SCHEMES[http.scheme] = http; +import https from "./schemes/https"; +SCHEMES[https.scheme] = https; +import ws from "./schemes/ws"; +SCHEMES[ws.scheme] = ws; +import wss from "./schemes/wss"; +SCHEMES[wss.scheme] = wss; +import mailto from "./schemes/mailto"; +SCHEMES[mailto.scheme] = mailto; +import urn from "./schemes/urn"; +SCHEMES[urn.scheme] = urn; +import uuid from "./schemes/urn-uuid"; +SCHEMES[uuid.scheme] = uuid; +export * from "./uri"; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/index.js.map b/tools/ui/node_modules/uri-js/dist/esnext/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..0971f6ebcadb791627f0a100919d31e679d3df38 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AAE9B,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9B,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AAExB,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAEhC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,cAAc,OAAO,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/regexps-iri.d.ts b/tools/ui/node_modules/uri-js/dist/esnext/regexps-iri.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c91cdacbce6f744f7d95fffff2f1dd9e345e2eda --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/regexps-iri.d.ts @@ -0,0 +1,3 @@ +import { URIRegExps } from "./uri"; +declare const _default: URIRegExps; +export default _default; diff --git a/tools/ui/node_modules/uri-js/dist/esnext/regexps-iri.js b/tools/ui/node_modules/uri-js/dist/esnext/regexps-iri.js new file mode 100644 index 0000000000000000000000000000000000000000..34e7de989e3b474cccad6e4f94910f9a55accc69 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/regexps-iri.js @@ -0,0 +1,3 @@ +import { buildExps } from "./regexps-uri"; +export default buildExps(true); +//# sourceMappingURL=regexps-iri.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/regexps-iri.js.map b/tools/ui/node_modules/uri-js/dist/esnext/regexps-iri.js.map new file mode 100644 index 0000000000000000000000000000000000000000..2269c580c7449d79e7a39870df637e3c23ab3692 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/regexps-iri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regexps-iri.js","sourceRoot":"","sources":["../../src/regexps-iri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAe,SAAS,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/regexps-uri.d.ts b/tools/ui/node_modules/uri-js/dist/esnext/regexps-uri.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6096bda5cd515b52bb83998b000909f0ce8b3020 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/regexps-uri.d.ts @@ -0,0 +1,4 @@ +import { URIRegExps } from "./uri"; +export declare function buildExps(isIRI: boolean): URIRegExps; +declare const _default: URIRegExps; +export default _default; diff --git a/tools/ui/node_modules/uri-js/dist/esnext/regexps-uri.js b/tools/ui/node_modules/uri-js/dist/esnext/regexps-uri.js new file mode 100644 index 0000000000000000000000000000000000000000..1cc659f133da37fbecff94099d04d4e0caa7a5ba --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/regexps-uri.js @@ -0,0 +1,42 @@ +import { merge, subexp } from "./util"; +export function buildExps(isIRI) { + const ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive + LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded + GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters + IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset + UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), //relaxed parsing rules + IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), // 6( h16 ":" ) ls32 + IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), // "::" 5( h16 ":" ) ls32 + IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[ h16 ] "::" 4( h16 ":" ) ls32 + IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 + IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 + IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 + IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::" ls32 + IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::" h16 + IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::" + IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874 + IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874 + IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules + IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874 + REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified + PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified + PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified + PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$"; + return { + NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"), + NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"), + NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"), + NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"), + ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"), + UNRESERVED: new RegExp(UNRESERVED$$, "g"), + OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"), + PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"), + IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"), + IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules + }; +} +export default buildExps(false); +//# sourceMappingURL=regexps-uri.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/regexps-uri.js.map b/tools/ui/node_modules/uri-js/dist/esnext/regexps-uri.js.map new file mode 100644 index 0000000000000000000000000000000000000000..cb028b804e3d5e4913a902a13a9108f3636e2d8b --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/regexps-uri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"regexps-uri.js","sourceRoot":"","sources":["../../src/regexps-uri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,oBAAoB,KAAa;IACtC,MACC,OAAO,GAAG,UAAU,EACpB,GAAG,GAAG,SAAS,EACf,OAAO,GAAG,OAAO,EACjB,QAAQ,GAAG,SAAS,EACpB,QAAQ,GAAG,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC,EAAG,kBAAkB;IAC1D,IAAI,GAAG,SAAS,EAChB,IAAI,GAAG,SAAS,EAChB,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,aAAa,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,EAAG,UAAU;IACvO,YAAY,GAAG,yBAAyB,EACxC,YAAY,GAAG,qCAAqC,EACpD,UAAU,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC,EAC9C,SAAS,GAAG,KAAK,CAAC,CAAC,CAAC,6EAA6E,CAAC,CAAC,CAAC,IAAI,EAAG,0CAA0C;IACrJ,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,IAAI,EAAG,QAAQ;IAC1D,YAAY,GAAG,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,CAAC,EACnE,OAAO,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,GAAG,GAAG,CAAC,EACxE,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,EACjG,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,OAAO,GAAG,OAAO,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,OAAO,GAAG,OAAO,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,EACnK,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,OAAO,GAAG,OAAO,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,OAAO,GAAG,OAAO,CAAC,EAAG,uBAAuB;IAC3M,YAAY,GAAG,MAAM,CAAC,kBAAkB,GAAG,KAAK,GAAG,kBAAkB,GAAG,KAAK,GAAG,kBAAkB,GAAG,KAAK,GAAG,kBAAkB,CAAC,EAChI,IAAI,GAAG,MAAM,CAAC,QAAQ,GAAG,OAAO,CAAC,EACjC,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,YAAY,CAAC,EAChE,aAAa,GAAG,MAAM,CAA6D,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAkD,QAAQ,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAkC,IAAI,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,GAAG,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,KAAK,GAAG,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,GAAU,IAAI,GAAG,KAAK,GAAY,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,GAAkC,KAAK,CAAC,EAAE,8CAA8C;IACxK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,GAAkC,IAAI,CAAE,EAAE,6CAA6C;IACvK,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,SAAS,CAAwC,EAAE,4BAA4B;IACtJ,YAAY,GAAG,MAAM,CAAC,CAAC,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,EAAE,aAAa,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EACxK,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,YAAY,CAAC,GAAG,GAAG,CAAC,EAAG,UAAU;IAC9E,UAAU,GAAG,MAAM,CAAC,YAAY,GAAG,OAAO,GAAG,OAAO,CAAC,EAAG,UAAU;IAClE,kBAAkB,GAAG,MAAM,CAAC,YAAY,GAAG,MAAM,CAAC,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC,GAAG,OAAO,CAAC,EAAG,sCAAsC;IACzI,UAAU,GAAG,MAAM,CAAC,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,GAAG,GAAG,CAAC,EAClG,WAAW,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,kBAAkB,GAAG,GAAG,GAAG,YAAY,GAAG,GAAG,GAAG,UAAU,CAAC,GAAG,KAAK,CAAC,EAAG,UAAU;IACrH,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC,GAAG,GAAG,CAAC,EACxF,KAAK,GAAG,MAAM,CAAC,WAAW,GAAG,GAAG,GAAG,YAAY,GAAG,KAAK,GAAG,SAAS,GAAG,GAAG,GAAG,GAAG,GAAG,SAAS,CAAC,EAC5F,KAAK,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG,CAAC,EAC7B,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,KAAK,GAAG,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC,EACxF,MAAM,GAAG,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,EAAE,UAAU,CAAC,CAAC,EACnF,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,EAC/B,WAAW,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,EAClC,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,KAAK,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,EACtG,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,GAAG,GAAG,CAAC,EACtD,cAAc,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,WAAW,GAAG,aAAa,CAAC,GAAG,GAAG,CAAC,EAAG,YAAY;IACzF,cAAc,GAAG,MAAM,CAAC,cAAc,GAAG,aAAa,CAAC,EAAG,YAAY;IACtE,cAAc,GAAG,MAAM,CAAC,WAAW,GAAG,aAAa,CAAC,EAAG,YAAY;IACnE,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,GAAG,EAClC,KAAK,GAAG,MAAM,CAAC,aAAa,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,WAAW,CAAC,EACtH,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,KAAK,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,GAAG,GAAG,CAAC,EAC3E,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,WAAW,CAAC,GAAG,GAAG,CAAC,EACtD,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAC,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,WAAW,CAAC,EACpI,IAAI,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,EAC5G,cAAc,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,GAAG,UAAU,GAAG,aAAa,CAAC,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,WAAW,CAAC,EACxI,SAAS,GAAG,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,EACnG,cAAc,GAAG,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,SAAS,CAAC,EAC/C,aAAa,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,GAAG,UAAU,GAAG,MAAM,CAAC,KAAK,GAAG,MAAM,CAAC,GAAG,GAAG,CAAC,EAEnF,YAAY,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,aAAa,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,WAAW,GAAG,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,SAAS,GAAG,GAAG,CAAC,GAAG,IAAI,EAC7U,aAAa,GAAG,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,aAAa,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,WAAW,GAAG,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,SAAS,GAAG,GAAG,CAAC,GAAG,IAAI,EAC/T,aAAa,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,aAAa,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,cAAc,GAAG,GAAG,GAAG,WAAW,GAAG,GAAG,CAAC,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,EACrS,YAAY,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,SAAS,GAAG,GAAG,CAAC,GAAG,IAAI,EAC5D,cAAc,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,GAAG,IAAI,GAAG,KAAK,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,GAAG,KAAK,GAAG,GAAG,CAAC,GAAG,IAAI,CAChH;IAED,OAAO;QACN,UAAU,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC;QAC3E,YAAY,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC;QAC9E,QAAQ,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC;QAChF,QAAQ,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,iBAAiB,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC;QAChF,iBAAiB,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,cAAc,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC;QACtF,SAAS,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC;QACtG,YAAY,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,CAAC,EAAE,GAAG,CAAC;QAC7F,MAAM,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC;QAClE,UAAU,EAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;QAC1C,WAAW,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC;QACxE,WAAW,EAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;QAC3C,WAAW,EAAG,IAAI,MAAM,CAAC,IAAI,GAAG,YAAY,GAAG,IAAI,CAAC;QACpD,WAAW,EAAG,IAAI,MAAM,CAAC,QAAQ,GAAG,YAAY,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,OAAO,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAE,sCAAsC;KACrL,CAAC;AACH,CAAC;AAED,eAAe,SAAS,CAAC,KAAK,CAAC,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/http.d.ts b/tools/ui/node_modules/uri-js/dist/esnext/schemes/http.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fe5b2f354241bb655c84551cf88b6435525a588f --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/http.d.ts @@ -0,0 +1,3 @@ +import { URISchemeHandler } from "../uri"; +declare const handler: URISchemeHandler; +export default handler; diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/http.js b/tools/ui/node_modules/uri-js/dist/esnext/schemes/http.js new file mode 100644 index 0000000000000000000000000000000000000000..6abf0fe6e3f1f897c2066285f25476e4152712f4 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/http.js @@ -0,0 +1,28 @@ +const handler = { + scheme: "http", + domainHost: true, + parse: function (components, options) { + //report missing host + if (!components.host) { + components.error = components.error || "HTTP URIs must have a host."; + } + return components; + }, + serialize: function (components, options) { + const secure = String(components.scheme).toLowerCase() === "https"; + //normalize the default port + if (components.port === (secure ? 443 : 80) || components.port === "") { + components.port = undefined; + } + //normalize the empty path + if (!components.path) { + components.path = "/"; + } + //NOTE: We do not parse query strings for HTTP URIs + //as WWW Form Url Encoded query strings are part of the HTML4+ spec, + //and not the HTTP spec. + return components; + } +}; +export default handler; +//# sourceMappingURL=http.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/http.js.map b/tools/ui/node_modules/uri-js/dist/esnext/schemes/http.js.map new file mode 100644 index 0000000000000000000000000000000000000000..82118970c54de6c89f87830d6612b6d5c00b06ae --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/http.js.map @@ -0,0 +1 @@ +{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/schemes/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,MAAM;IAEf,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,qBAAqB;QACrB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6BAA6B,CAAC;SACrE;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,SAAS,EAAG,UAAU,UAAwB,EAAE,OAAkB;QACjE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;QAEnE,4BAA4B;QAC5B,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,EAAE,EAAE;YACtE,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC;SAC5B;QAED,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;SACtB;QAED,mDAAmD;QACnD,oEAAoE;QACpE,wBAAwB;QAExB,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/https.d.ts b/tools/ui/node_modules/uri-js/dist/esnext/schemes/https.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fe5b2f354241bb655c84551cf88b6435525a588f --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/https.d.ts @@ -0,0 +1,3 @@ +import { URISchemeHandler } from "../uri"; +declare const handler: URISchemeHandler; +export default handler; diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/https.js b/tools/ui/node_modules/uri-js/dist/esnext/schemes/https.js new file mode 100644 index 0000000000000000000000000000000000000000..ec4b6e76de671bbd1e7cb3a147d52b7229a401bf --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/https.js @@ -0,0 +1,9 @@ +import http from "./http"; +const handler = { + scheme: "https", + domainHost: http.domainHost, + parse: http.parse, + serialize: http.serialize +}; +export default handler; +//# sourceMappingURL=https.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/https.js.map b/tools/ui/node_modules/uri-js/dist/esnext/schemes/https.js.map new file mode 100644 index 0000000000000000000000000000000000000000..385b8efeaa0366e434f4e3c7e504a8a09a9f70bf --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/https.js.map @@ -0,0 +1 @@ +{"version":3,"file":"https.js","sourceRoot":"","sources":["../../../src/schemes/https.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,OAAO;IAChB,UAAU,EAAG,IAAI,CAAC,UAAU;IAC5B,KAAK,EAAG,IAAI,CAAC,KAAK;IAClB,SAAS,EAAG,IAAI,CAAC,SAAS;CAC1B,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts b/tools/ui/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e2aefc2afd16379c841671277fee19096547dfda --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/mailto.d.ts @@ -0,0 +1,12 @@ +import { URISchemeHandler, URIComponents } from "../uri"; +export interface MailtoHeaders { + [hfname: string]: string; +} +export interface MailtoComponents extends URIComponents { + to: Array; + headers?: MailtoHeaders; + subject?: string; + body?: string; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/mailto.js b/tools/ui/node_modules/uri-js/dist/esnext/schemes/mailto.js new file mode 100644 index 0000000000000000000000000000000000000000..2553713cde8c8b21fa0d8d5c746824fc7fcdf9c0 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/mailto.js @@ -0,0 +1,148 @@ +import { pctEncChar, pctDecChars, unescapeComponent } from "../uri"; +import punycode from "punycode"; +import { merge, subexp, toUpperCase, toArray } from "../util"; +const O = {}; +const isIRI = true; +//RFC 3986 +const UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]"; +const HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive +const PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded +//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; = +//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]"; //(%d1-8 / %d11-12 / %d14-31 / %d127) +//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$); //%d33 / %d35-91 / %d93-126 / obs-qtext +//const VCHAR$$ = "[\\x21-\\x7E]"; +//const WSP$$ = "[\\x20\\x09]"; +//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$)); //%d0 / CR / LF / obs-qtext +//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+"); +//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$); +//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"'); +const ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]"; +const QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]"; +const VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]"); +const DOT_ATOM_TEXT$ = subexp(ATEXT$$ + "+" + subexp("\\." + ATEXT$$ + "+") + "*"); +const QUOTED_PAIR$ = subexp("\\\\" + VCHAR$$); +const QCONTENT$ = subexp(QTEXT$$ + "|" + QUOTED_PAIR$); +const QUOTED_STRING$ = subexp('\\"' + QCONTENT$ + "*" + '\\"'); +//RFC 6068 +const DTEXT_NO_OBS$$ = "[\\x21-\\x5A\\x5E-\\x7E]"; //%d33-90 / %d94-126 +const SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"; +const QCHAR$ = subexp(UNRESERVED$$ + "|" + PCT_ENCODED$ + "|" + SOME_DELIMS$$); +const DOMAIN$ = subexp(DOT_ATOM_TEXT$ + "|" + "\\[" + DTEXT_NO_OBS$$ + "*" + "\\]"); +const LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + "|" + QUOTED_STRING$); +const ADDR_SPEC$ = subexp(LOCAL_PART$ + "\\@" + DOMAIN$); +const TO$ = subexp(ADDR_SPEC$ + subexp("\\," + ADDR_SPEC$) + "*"); +const HFNAME$ = subexp(QCHAR$ + "*"); +const HFVALUE$ = HFNAME$; +const HFIELD$ = subexp(HFNAME$ + "\\=" + HFVALUE$); +const HFIELDS2$ = subexp(HFIELD$ + subexp("\\&" + HFIELD$) + "*"); +const HFIELDS$ = subexp("\\?" + HFIELDS2$); +const MAILTO_URI = new RegExp("^mailto\\:" + TO$ + "?" + HFIELDS$ + "?$"); +const UNRESERVED = new RegExp(UNRESERVED$$, "g"); +const PCT_ENCODED = new RegExp(PCT_ENCODED$, "g"); +const NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g"); +const NOT_DOMAIN = new RegExp(merge("[^]", ATEXT$$, "[\\.]", "[\\[]", DTEXT_NO_OBS$$, "[\\]]"), "g"); +const NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g"); +const NOT_HFVALUE = NOT_HFNAME; +const TO = new RegExp("^" + TO$ + "$"); +const HFIELDS = new RegExp("^" + HFIELDS2$ + "$"); +function decodeUnreserved(str) { + const decStr = pctDecChars(str); + return (!decStr.match(UNRESERVED) ? str : decStr); +} +const handler = { + scheme: "mailto", + parse: function (components, options) { + const mailtoComponents = components; + const to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(",") : []); + mailtoComponents.path = undefined; + if (mailtoComponents.query) { + let unknownHeaders = false; + const headers = {}; + const hfields = mailtoComponents.query.split("&"); + for (let x = 0, xl = hfields.length; x < xl; ++x) { + const hfield = hfields[x].split("="); + switch (hfield[0]) { + case "to": + const toAddrs = hfield[1].split(","); + for (let x = 0, xl = toAddrs.length; x < xl; ++x) { + to.push(toAddrs[x]); + } + break; + case "subject": + mailtoComponents.subject = unescapeComponent(hfield[1], options); + break; + case "body": + mailtoComponents.body = unescapeComponent(hfield[1], options); + break; + default: + unknownHeaders = true; + headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options); + break; + } + } + if (unknownHeaders) + mailtoComponents.headers = headers; + } + mailtoComponents.query = undefined; + for (let x = 0, xl = to.length; x < xl; ++x) { + const addr = to[x].split("@"); + addr[0] = unescapeComponent(addr[0]); + if (!options.unicodeSupport) { + //convert Unicode IDN -> ASCII IDN + try { + addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase()); + } + catch (e) { + mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e; + } + } + else { + addr[1] = unescapeComponent(addr[1], options).toLowerCase(); + } + to[x] = addr.join("@"); + } + return mailtoComponents; + }, + serialize: function (mailtoComponents, options) { + const components = mailtoComponents; + const to = toArray(mailtoComponents.to); + if (to) { + for (let x = 0, xl = to.length; x < xl; ++x) { + const toAddr = String(to[x]); + const atIdx = toAddr.lastIndexOf("@"); + const localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar); + let domain = toAddr.slice(atIdx + 1); + //convert IDN via punycode + try { + domain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain)); + } + catch (e) { + components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + to[x] = localPart + "@" + domain; + } + components.path = to.join(","); + } + const headers = mailtoComponents.headers = mailtoComponents.headers || {}; + if (mailtoComponents.subject) + headers["subject"] = mailtoComponents.subject; + if (mailtoComponents.body) + headers["body"] = mailtoComponents.body; + const fields = []; + for (const name in headers) { + if (headers[name] !== O[name]) { + fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + + "=" + + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)); + } + } + if (fields.length) { + components.query = fields.join("&"); + } + return components; + } +}; +export default handler; +//# sourceMappingURL=mailto.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/mailto.js.map b/tools/ui/node_modules/uri-js/dist/esnext/schemes/mailto.js.map new file mode 100644 index 0000000000000000000000000000000000000000..82dba9a1612b097b96147359798050adf5e4a20e --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/mailto.js.map @@ -0,0 +1 @@ +{"version":3,"file":"mailto.js","sourceRoot":"","sources":["../../../src/schemes/mailto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAa9D,MAAM,CAAC,GAAiB,EAAE,CAAC;AAC3B,MAAM,KAAK,GAAG,IAAI,CAAC;AAEnB,UAAU;AACV,MAAM,YAAY,GAAG,wBAAwB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,2EAA2E,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;AACjJ,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAE,kBAAkB;AACnD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,aAAa,GAAG,QAAQ,GAAG,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,GAAG,GAAG,GAAG,MAAM,CAAC,GAAG,GAAG,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAE,UAAU;AAE7O,qEAAqE;AACrE,yFAAyF;AACzF,+BAA+B;AAC/B,uGAAuG;AACvG,+GAA+G;AAC/G,kCAAkC;AAClC,+BAA+B;AAC/B,wGAAwG;AACxG,8EAA8E;AAC9E,8FAA8F;AAC9F,mGAAmG;AACnG,MAAM,OAAO,GAAG,uDAAuD,CAAC;AACxE,MAAM,OAAO,GAAG,4DAA4D,CAAC;AAC7E,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AAC7C,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG,GAAG,MAAM,CAAC,KAAK,GAAG,OAAO,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC;AACnF,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC;AAC9C,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,GAAG,GAAG,GAAG,YAAY,CAAC,CAAC;AACvD,MAAM,cAAc,GAAG,MAAM,CAAC,KAAK,GAAG,SAAS,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC;AAE/D,UAAU;AACV,MAAM,cAAc,GAAG,0BAA0B,CAAC,CAAE,oBAAoB;AACxE,MAAM,aAAa,GAAG,qCAAqC,CAAC;AAC5D,MAAM,MAAM,GAAG,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,YAAY,GAAG,GAAG,GAAG,aAAa,CAAC,CAAC;AAC/E,MAAM,OAAO,GAAG,MAAM,CAAC,cAAc,GAAG,GAAG,GAAG,KAAK,GAAG,cAAc,GAAG,GAAG,GAAG,KAAK,CAAC,CAAC;AACpF,MAAM,WAAW,GAAG,MAAM,CAAC,cAAc,GAAG,GAAG,GAAG,cAAc,CAAC,CAAC;AAClE,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,GAAG,KAAK,GAAG,OAAO,CAAC,CAAC;AACzD,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC;AAClE,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC;AACrC,MAAM,QAAQ,GAAG,OAAO,CAAC;AACzB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC,CAAC;AACnD,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC;AAClE,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,GAAG,SAAS,CAAC,CAAC;AAC3C,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,YAAY,GAAG,GAAG,GAAG,GAAG,GAAG,QAAQ,GAAG,IAAI,CAAC,CAAC;AAE1E,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AACjD,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;AAClD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC;AACzF,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,GAAG,CAAC,CAAC;AACrG,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,aAAa,CAAC,EAAE,GAAG,CAAC,CAAC;AAC9E,MAAM,WAAW,GAAG,UAAU,CAAC;AAC/B,MAAM,EAAE,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AACvC,MAAM,OAAO,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,GAAG,CAAC,CAAC;AAElD,0BAA0B,GAAU;IACnC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAChC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,OAAO,GAAuC;IACnD,MAAM,EAAG,QAAQ;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,gBAAgB,GAAG,UAA8B,CAAC;QACxD,MAAM,EAAE,GAAG,gBAAgB,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QACjG,gBAAgB,CAAC,IAAI,GAAG,SAAS,CAAC;QAElC,IAAI,gBAAgB,CAAC,KAAK,EAAE;YAC3B,IAAI,cAAc,GAAG,KAAK,CAAA;YAC1B,MAAM,OAAO,GAAiB,EAAE,CAAC;YACjC,MAAM,OAAO,GAAG,gBAAgB,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAElD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;gBACjD,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBAErC,QAAQ,MAAM,CAAC,CAAC,CAAC,EAAE;oBAClB,KAAK,IAAI;wBACR,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;wBACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;4BACjD,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;yBACpB;wBACD,MAAM;oBACP,KAAK,SAAS;wBACb,gBAAgB,CAAC,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;wBACjE,MAAM;oBACP,KAAK,MAAM;wBACV,gBAAgB,CAAC,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;wBAC9D,MAAM;oBACP;wBACC,cAAc,GAAG,IAAI,CAAC;wBACtB,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;wBACvF,MAAM;iBACP;aACD;YAED,IAAI,cAAc;gBAAE,gBAAgB,CAAC,OAAO,GAAG,OAAO,CAAC;SACvD;QAED,gBAAgB,CAAC,KAAK,GAAG,SAAS,CAAC;QAEnC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;YAC5C,MAAM,IAAI,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAE9B,IAAI,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;YAErC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;gBAC5B,kCAAkC;gBAClC,IAAI;oBACH,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;iBAC9E;gBAAC,OAAO,CAAC,EAAE;oBACX,gBAAgB,CAAC,KAAK,GAAG,gBAAgB,CAAC,KAAK,IAAI,0EAA0E,GAAG,CAAC,CAAC;iBAClI;aACD;iBAAM;gBACN,IAAI,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC;aAC5D;YAED,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACvB;QAED,OAAO,gBAAgB,CAAC;IACzB,CAAC;IAED,SAAS,EAAG,UAAU,gBAAiC,EAAE,OAAkB;QAC1E,MAAM,UAAU,GAAG,gBAAiC,CAAC;QACrD,MAAM,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;QACxC,IAAI,EAAE,EAAE;YACP,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;gBAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC7B,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;gBACtC,MAAM,SAAS,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;gBACxJ,IAAI,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;gBAErC,0BAA0B;gBAC1B,IAAI;oBACH,MAAM,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;iBAC1H;gBAAC,OAAO,CAAC,EAAE;oBACX,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,sDAAsD,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,iBAAiB,GAAG,CAAC,CAAC;iBAC7J;gBAED,EAAE,CAAC,CAAC,CAAC,GAAG,SAAS,GAAG,GAAG,GAAG,MAAM,CAAC;aACjC;YAED,UAAU,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC/B;QAED,MAAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,GAAG,gBAAgB,CAAC,OAAO,IAAI,EAAE,CAAC;QAE1E,IAAI,gBAAgB,CAAC,OAAO;YAAE,OAAO,CAAC,SAAS,CAAC,GAAG,gBAAgB,CAAC,OAAO,CAAC;QAC5E,IAAI,gBAAgB,CAAC,IAAI;YAAE,OAAO,CAAC,MAAM,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC;QAEnE,MAAM,MAAM,GAAG,EAAE,CAAC;QAClB,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE;YAC3B,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,EAAE;gBAC9B,MAAM,CAAC,IAAI,CACV,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC;oBAC7G,GAAG;oBACH,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,CACvH,CAAC;aACF;SACD;QACD,IAAI,MAAM,CAAC,MAAM,EAAE;YAClB,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACpC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts b/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e75f2e793f929ac64f7476f2555f1a02344f36ce --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn-uuid.d.ts @@ -0,0 +1,7 @@ +import { URISchemeHandler, URIOptions } from "../uri"; +import { URNComponents } from "./urn"; +export interface UUIDComponents extends URNComponents { + uuid?: string; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js b/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js new file mode 100644 index 0000000000000000000000000000000000000000..d1fce495554812d1a667aec719e81bf363518ee5 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js @@ -0,0 +1,23 @@ +const UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/; +const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/; +//RFC 4122 +const handler = { + scheme: "urn:uuid", + parse: function (urnComponents, options) { + const uuidComponents = urnComponents; + uuidComponents.uuid = uuidComponents.nss; + uuidComponents.nss = undefined; + if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) { + uuidComponents.error = uuidComponents.error || "UUID is not valid."; + } + return uuidComponents; + }, + serialize: function (uuidComponents, options) { + const urnComponents = uuidComponents; + //normalize UUID + urnComponents.nss = (uuidComponents.uuid || "").toLowerCase(); + return urnComponents; + }, +}; +export default handler; +//# sourceMappingURL=urn-uuid.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map b/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map new file mode 100644 index 0000000000000000000000000000000000000000..3b7a8b3ae607c8364aac16b082bdd968b4417b2e --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn-uuid.js.map @@ -0,0 +1 @@ +{"version":3,"file":"urn-uuid.js","sourceRoot":"","sources":["../../../src/schemes/urn-uuid.ts"],"names":[],"mappings":"AAQA,MAAM,IAAI,GAAG,0DAA0D,CAAC;AACxE,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,UAAU;AACV,MAAM,OAAO,GAA+D;IAC3E,MAAM,EAAG,UAAU;IAEnB,KAAK,EAAG,UAAU,aAA2B,EAAE,OAAkB;QAChE,MAAM,cAAc,GAAG,aAA+B,CAAC;QACvD,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC;QACzC,cAAc,CAAC,GAAG,GAAG,SAAS,CAAC;QAE/B,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE;YACpF,cAAc,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,IAAI,oBAAoB,CAAC;SACpE;QAED,OAAO,cAAc,CAAC;IACvB,CAAC;IAED,SAAS,EAAG,UAAU,cAA6B,EAAE,OAAkB;QACtE,MAAM,aAAa,GAAG,cAA+B,CAAC;QACtD,gBAAgB;QAChB,aAAa,CAAC,GAAG,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9D,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn.d.ts b/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e0c2fba6c6282bd78072ba3aa6572083fa77567 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn.d.ts @@ -0,0 +1,10 @@ +import { URISchemeHandler, URIComponents, URIOptions } from "../uri"; +export interface URNComponents extends URIComponents { + nid?: string; + nss?: string; +} +export interface URNOptions extends URIOptions { + nid?: string; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn.js b/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn.js new file mode 100644 index 0000000000000000000000000000000000000000..5d3f10aa0f8b137300dfa249bf21c991262e7411 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn.js @@ -0,0 +1,49 @@ +import { SCHEMES } from "../uri"; +const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})"; +const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})"; +const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]"; +const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)"; +const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$"); +const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$"); +const URN_PARSE = /^([^\:]+)\:(.*)/; +const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g; +//RFC 2141 +const handler = { + scheme: "urn", + parse: function (components, options) { + const matches = components.path && components.path.match(URN_PARSE); + let urnComponents = components; + if (matches) { + const scheme = options.scheme || urnComponents.scheme || "urn"; + const nid = matches[1].toLowerCase(); + const nss = matches[2]; + const urnScheme = `${scheme}:${options.nid || nid}`; + const schemeHandler = SCHEMES[urnScheme]; + urnComponents.nid = nid; + urnComponents.nss = nss; + urnComponents.path = undefined; + if (schemeHandler) { + urnComponents = schemeHandler.parse(urnComponents, options); + } + } + else { + urnComponents.error = urnComponents.error || "URN can not be parsed."; + } + return urnComponents; + }, + serialize: function (urnComponents, options) { + const scheme = options.scheme || urnComponents.scheme || "urn"; + const nid = urnComponents.nid; + const urnScheme = `${scheme}:${options.nid || nid}`; + const schemeHandler = SCHEMES[urnScheme]; + if (schemeHandler) { + urnComponents = schemeHandler.serialize(urnComponents, options); + } + const uriComponents = urnComponents; + const nss = urnComponents.nss; + uriComponents.path = `${nid || options.nid}:${nss}`; + return uriComponents; + }, +}; +export default handler; +//# sourceMappingURL=urn.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn.js.map b/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn.js.map new file mode 100644 index 0000000000000000000000000000000000000000..ea43b0bebc3a0b881cc82c7c64a8cc95a78851e6 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/urn.js.map @@ -0,0 +1 @@ +{"version":3,"file":"urn.js","sourceRoot":"","sources":["../../../src/schemes/urn.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,OAAO,EAAE,MAAM,QAAQ,CAAC;AAW7C,MAAM,IAAI,GAAG,qCAAqC,CAAC;AACnD,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAC7C,MAAM,OAAO,GAAG,mEAAmE,CAAC;AACpF,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,GAAG,GAAG,OAAO,GAAG,KAAK,CAAC;AAC7D,MAAM,UAAU,GAAG,IAAI,MAAM,CAAC,UAAU,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACxD,MAAM,QAAQ,GAAG,IAAI,MAAM,CAAC,IAAI,GAAG,IAAI,GAAG,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;AACjE,MAAM,SAAS,GAAG,iBAAiB,CAAC;AACpC,MAAM,YAAY,GAAG,iDAAiD,CAAC;AAEvE,UAAU;AACV,MAAM,OAAO,GAA8C;IAC1D,MAAM,EAAG,KAAK;IAEd,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,OAAO,GAAG,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACpE,IAAI,aAAa,GAAG,UAA2B,CAAC;QAEhD,IAAI,OAAO,EAAE;YACZ,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,IAAI,KAAK,CAAC;YAC/D,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;YACrC,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACvB,MAAM,SAAS,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;YACpD,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;YAEzC,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;YACxB,aAAa,CAAC,GAAG,GAAG,GAAG,CAAC;YACxB,aAAa,CAAC,IAAI,GAAG,SAAS,CAAC;YAE/B,IAAI,aAAa,EAAE;gBAClB,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,aAAa,EAAE,OAAO,CAAkB,CAAC;aAC7E;SACD;aAAM;YACN,aAAa,CAAC,KAAK,GAAG,aAAa,CAAC,KAAK,IAAI,wBAAwB,CAAC;SACtE;QAED,OAAO,aAAa,CAAC;IACtB,CAAC;IAED,SAAS,EAAG,UAAU,aAA2B,EAAE,OAAkB;QACpE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,IAAI,KAAK,CAAC;QAC/D,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC9B,MAAM,SAAS,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QACpD,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QAEzC,IAAI,aAAa,EAAE;YAClB,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,aAAa,EAAE,OAAO,CAAkB,CAAC;SACjF;QAED,MAAM,aAAa,GAAG,aAA8B,CAAC;QACrD,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC9B,aAAa,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QAEpD,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/ws.d.ts b/tools/ui/node_modules/uri-js/dist/esnext/schemes/ws.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..47f4835b24a961f8358f23eb5327cb37c5fcead3 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/ws.d.ts @@ -0,0 +1,7 @@ +import { URISchemeHandler, URIComponents } from "../uri"; +export interface WSComponents extends URIComponents { + resourceName?: string; + secure?: boolean; +} +declare const handler: URISchemeHandler; +export default handler; diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/ws.js b/tools/ui/node_modules/uri-js/dist/esnext/schemes/ws.js new file mode 100644 index 0000000000000000000000000000000000000000..9277f035a0bddd7f03558ef61ac400166e705238 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/ws.js @@ -0,0 +1,41 @@ +function isSecure(wsComponents) { + return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss"; +} +//RFC 6455 +const handler = { + scheme: "ws", + domainHost: true, + parse: function (components, options) { + const wsComponents = components; + //indicate if the secure flag is set + wsComponents.secure = isSecure(wsComponents); + //construct resouce name + wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : ''); + wsComponents.path = undefined; + wsComponents.query = undefined; + return wsComponents; + }, + serialize: function (wsComponents, options) { + //normalize the default port + if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") { + wsComponents.port = undefined; + } + //ensure scheme matches secure flag + if (typeof wsComponents.secure === 'boolean') { + wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws'); + wsComponents.secure = undefined; + } + //reconstruct path from resource name + if (wsComponents.resourceName) { + const [path, query] = wsComponents.resourceName.split('?'); + wsComponents.path = (path && path !== '/' ? path : undefined); + wsComponents.query = query; + wsComponents.resourceName = undefined; + } + //forbid fragment component + wsComponents.fragment = undefined; + return wsComponents; + } +}; +export default handler; +//# sourceMappingURL=ws.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/ws.js.map b/tools/ui/node_modules/uri-js/dist/esnext/schemes/ws.js.map new file mode 100644 index 0000000000000000000000000000000000000000..186818ccd65df166e7cdd6c9b39e794514a15b5c --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/ws.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../../src/schemes/ws.ts"],"names":[],"mappings":"AAOA,kBAAkB,YAAyB;IAC1C,OAAO,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC;AAC7H,CAAC;AAED,UAAU;AACV,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,IAAI;IAEb,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,YAAY,GAAG,UAA0B,CAAC;QAEhD,oCAAoC;QACpC,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;QAE7C,wBAAwB;QACxB,YAAY,CAAC,YAAY,GAAG,CAAC,YAAY,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9G,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;QAC9B,YAAY,CAAC,KAAK,GAAG,SAAS,CAAC;QAE/B,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,SAAS,EAAG,UAAU,YAAyB,EAAE,OAAkB;QAClE,4BAA4B;QAC5B,IAAI,YAAY,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,KAAK,EAAE,EAAE;YAC1F,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;SAC9B;QAED,mCAAmC;QACnC,IAAI,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,EAAE;YAC7C,YAAY,CAAC,MAAM,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC3D,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC;SAChC;QAED,qCAAqC;QACrC,IAAI,YAAY,CAAC,YAAY,EAAE;YAC9B,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3D,YAAY,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC9D,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;YAC3B,YAAY,CAAC,YAAY,GAAG,SAAS,CAAC;SACtC;QAED,2BAA2B;QAC3B,YAAY,CAAC,QAAQ,GAAG,SAAS,CAAC;QAElC,OAAO,YAAY,CAAC;IACrB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/wss.d.ts b/tools/ui/node_modules/uri-js/dist/esnext/schemes/wss.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..fe5b2f354241bb655c84551cf88b6435525a588f --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/wss.d.ts @@ -0,0 +1,3 @@ +import { URISchemeHandler } from "../uri"; +declare const handler: URISchemeHandler; +export default handler; diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/wss.js b/tools/ui/node_modules/uri-js/dist/esnext/schemes/wss.js new file mode 100644 index 0000000000000000000000000000000000000000..d1e22ccd6e0cc58a1f7f91fde05bc8902ef53218 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/wss.js @@ -0,0 +1,9 @@ +import ws from "./ws"; +const handler = { + scheme: "wss", + domainHost: ws.domainHost, + parse: ws.parse, + serialize: ws.serialize +}; +export default handler; +//# sourceMappingURL=wss.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/schemes/wss.js.map b/tools/ui/node_modules/uri-js/dist/esnext/schemes/wss.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e19006d947b35e8e4a7f002fa82c9627648bb711 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/schemes/wss.js.map @@ -0,0 +1 @@ +{"version":3,"file":"wss.js","sourceRoot":"","sources":["../../../src/schemes/wss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,MAAM,CAAC;AAEtB,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,KAAK;IACd,UAAU,EAAG,EAAE,CAAC,UAAU;IAC1B,KAAK,EAAG,EAAE,CAAC,KAAK;IAChB,SAAS,EAAG,EAAE,CAAC,SAAS;CACxB,CAAA;AAED,eAAe,OAAO,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/uri.d.ts b/tools/ui/node_modules/uri-js/dist/esnext/uri.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..da51e23527705f85a4d8c513d9931ae2d3eec7a0 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/uri.d.ts @@ -0,0 +1,59 @@ +export interface URIComponents { + scheme?: string; + userinfo?: string; + host?: string; + port?: number | string; + path?: string; + query?: string; + fragment?: string; + reference?: string; + error?: string; +} +export interface URIOptions { + scheme?: string; + reference?: string; + tolerant?: boolean; + absolutePath?: boolean; + iri?: boolean; + unicodeSupport?: boolean; + domainHost?: boolean; +} +export interface URISchemeHandler { + scheme: string; + parse(components: ParentComponents, options: Options): Components; + serialize(components: Components, options: Options): ParentComponents; + unicodeSupport?: boolean; + domainHost?: boolean; + absolutePath?: boolean; +} +export interface URIRegExps { + NOT_SCHEME: RegExp; + NOT_USERINFO: RegExp; + NOT_HOST: RegExp; + NOT_PATH: RegExp; + NOT_PATH_NOSCHEME: RegExp; + NOT_QUERY: RegExp; + NOT_FRAGMENT: RegExp; + ESCAPE: RegExp; + UNRESERVED: RegExp; + OTHER_CHARS: RegExp; + PCT_ENCODED: RegExp; + IPV4ADDRESS: RegExp; + IPV6ADDRESS: RegExp; +} +export declare const SCHEMES: { + [scheme: string]: URISchemeHandler; +}; +export declare function pctEncChar(chr: string): string; +export declare function pctDecChars(str: string): string; +export declare function parse(uriString: string, options?: URIOptions): URIComponents; +export declare function removeDotSegments(input: string): string; +export declare function serialize(components: URIComponents, options?: URIOptions): string; +export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents; +export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string; +export declare function normalize(uri: string, options?: URIOptions): string; +export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents; +export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean; +export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean; +export declare function escapeComponent(str: string, options?: URIOptions): string; +export declare function unescapeComponent(str: string, options?: URIOptions): string; diff --git a/tools/ui/node_modules/uri-js/dist/esnext/uri.js b/tools/ui/node_modules/uri-js/dist/esnext/uri.js new file mode 100644 index 0000000000000000000000000000000000000000..659ce2651cea1d928546bbc296f5f0cb97c07b85 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/uri.js @@ -0,0 +1,480 @@ +/** + * URI.js + * + * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript. + * @author Gary Court + * @see http://github.com/garycourt/uri-js + */ +/** + * Copyright 2011 Gary Court. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, are + * permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. 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. + * + * THIS SOFTWARE IS PROVIDED BY GARY COURT ``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 GARY COURT 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. + * + * The views and conclusions contained in the software and documentation are those of the + * authors and should not be interpreted as representing official policies, either expressed + * or implied, of Gary Court. + */ +import URI_PROTOCOL from "./regexps-uri"; +import IRI_PROTOCOL from "./regexps-iri"; +import punycode from "punycode"; +import { toUpperCase, typeOf, assign } from "./util"; +export const SCHEMES = {}; +export function pctEncChar(chr) { + const c = chr.charCodeAt(0); + let e; + if (c < 16) + e = "%0" + c.toString(16).toUpperCase(); + else if (c < 128) + e = "%" + c.toString(16).toUpperCase(); + else if (c < 2048) + e = "%" + ((c >> 6) | 192).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); + else + e = "%" + ((c >> 12) | 224).toString(16).toUpperCase() + "%" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase(); + return e; +} +export function pctDecChars(str) { + let newStr = ""; + let i = 0; + const il = str.length; + while (i < il) { + const c = parseInt(str.substr(i + 1, 2), 16); + if (c < 128) { + newStr += String.fromCharCode(c); + i += 3; + } + else if (c >= 194 && c < 224) { + if ((il - i) >= 6) { + const c2 = parseInt(str.substr(i + 4, 2), 16); + newStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); + } + else { + newStr += str.substr(i, 6); + } + i += 6; + } + else if (c >= 224) { + if ((il - i) >= 9) { + const c2 = parseInt(str.substr(i + 4, 2), 16); + const c3 = parseInt(str.substr(i + 7, 2), 16); + newStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + } + else { + newStr += str.substr(i, 9); + } + i += 9; + } + else { + newStr += str.substr(i, 3); + i += 3; + } + } + return newStr; +} +function _normalizeComponentEncoding(components, protocol) { + function decodeUnreserved(str) { + const decStr = pctDecChars(str); + return (!decStr.match(protocol.UNRESERVED) ? str : decStr); + } + if (components.scheme) + components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, ""); + if (components.userinfo !== undefined) + components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.host !== undefined) + components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.path !== undefined) + components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.query !== undefined) + components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + if (components.fragment !== undefined) + components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase); + return components; +} +; +function _stripLeadingZeros(str) { + return str.replace(/^0*(.*)/, "$1") || "0"; +} +function _normalizeIPv4(host, protocol) { + const matches = host.match(protocol.IPV4ADDRESS) || []; + const [, address] = matches; + if (address) { + return address.split(".").map(_stripLeadingZeros).join("."); + } + else { + return host; + } +} +function _normalizeIPv6(host, protocol) { + const matches = host.match(protocol.IPV6ADDRESS) || []; + const [, address, zone] = matches; + if (address) { + const [last, first] = address.toLowerCase().split('::').reverse(); + const firstFields = first ? first.split(":").map(_stripLeadingZeros) : []; + const lastFields = last.split(":").map(_stripLeadingZeros); + const isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]); + const fieldCount = isLastFieldIPv4Address ? 7 : 8; + const lastFieldsStart = lastFields.length - fieldCount; + const fields = Array(fieldCount); + for (let x = 0; x < fieldCount; ++x) { + fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || ''; + } + if (isLastFieldIPv4Address) { + fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol); + } + const allZeroFields = fields.reduce((acc, field, index) => { + if (!field || field === "0") { + const lastLongest = acc[acc.length - 1]; + if (lastLongest && lastLongest.index + lastLongest.length === index) { + lastLongest.length++; + } + else { + acc.push({ index, length: 1 }); + } + } + return acc; + }, []); + const longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0]; + let newHost; + if (longestZeroFields && longestZeroFields.length > 1) { + const newFirst = fields.slice(0, longestZeroFields.index); + const newLast = fields.slice(longestZeroFields.index + longestZeroFields.length); + newHost = newFirst.join(":") + "::" + newLast.join(":"); + } + else { + newHost = fields.join(":"); + } + if (zone) { + newHost += "%" + zone; + } + return newHost; + } + else { + return host; + } +} +const URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i; +const NO_MATCH_IS_UNDEFINED = ("").match(/(){0}/)[1] === undefined; +export function parse(uriString, options = {}) { + const components = {}; + const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); + if (options.reference === "suffix") + uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString; + const matches = uriString.match(URI_PARSE); + if (matches) { + if (NO_MATCH_IS_UNDEFINED) { + //store each component + components.scheme = matches[1]; + components.userinfo = matches[3]; + components.host = matches[4]; + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = matches[7]; + components.fragment = matches[8]; + //fix port number + if (isNaN(components.port)) { + components.port = matches[5]; + } + } + else { //IE FIX for improper RegExp matching + //store each component + components.scheme = matches[1] || undefined; + components.userinfo = (uriString.indexOf("@") !== -1 ? matches[3] : undefined); + components.host = (uriString.indexOf("//") !== -1 ? matches[4] : undefined); + components.port = parseInt(matches[5], 10); + components.path = matches[6] || ""; + components.query = (uriString.indexOf("?") !== -1 ? matches[7] : undefined); + components.fragment = (uriString.indexOf("#") !== -1 ? matches[8] : undefined); + //fix port number + if (isNaN(components.port)) { + components.port = (uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined); + } + } + if (components.host) { + //normalize IP hosts + components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol); + } + //determine reference type + if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) { + components.reference = "same-document"; + } + else if (components.scheme === undefined) { + components.reference = "relative"; + } + else if (components.fragment === undefined) { + components.reference = "absolute"; + } + else { + components.reference = "uri"; + } + //check for reference errors + if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) { + components.error = components.error || "URI is not a " + options.reference + " reference."; + } + //find scheme handler + const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //check if scheme can't handle IRIs + if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) { + //if host component is a domain name + if (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) { + //convert Unicode IDN -> ASCII IDN + try { + components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()); + } + catch (e) { + components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e; + } + } + //convert IRI -> URI + _normalizeComponentEncoding(components, URI_PROTOCOL); + } + else { + //normalize encodings + _normalizeComponentEncoding(components, protocol); + } + //perform scheme specific parsing + if (schemeHandler && schemeHandler.parse) { + schemeHandler.parse(components, options); + } + } + else { + components.error = components.error || "URI can not be parsed."; + } + return components; +} +; +function _recomposeAuthority(components, options) { + const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL); + const uriTokens = []; + if (components.userinfo !== undefined) { + uriTokens.push(components.userinfo); + uriTokens.push("@"); + } + if (components.host !== undefined) { + //normalize IP hosts, add brackets and escape zone separator for IPv6 + uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => "[" + $1 + ($2 ? "%25" + $2 : "") + "]")); + } + if (typeof components.port === "number" || typeof components.port === "string") { + uriTokens.push(":"); + uriTokens.push(String(components.port)); + } + return uriTokens.length ? uriTokens.join("") : undefined; +} +; +const RDS1 = /^\.\.?\//; +const RDS2 = /^\/\.(\/|$)/; +const RDS3 = /^\/\.\.(\/|$)/; +const RDS4 = /^\.\.?$/; +const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/; +export function removeDotSegments(input) { + const output = []; + while (input.length) { + if (input.match(RDS1)) { + input = input.replace(RDS1, ""); + } + else if (input.match(RDS2)) { + input = input.replace(RDS2, "/"); + } + else if (input.match(RDS3)) { + input = input.replace(RDS3, "/"); + output.pop(); + } + else if (input === "." || input === "..") { + input = ""; + } + else { + const im = input.match(RDS5); + if (im) { + const s = im[0]; + input = input.slice(s.length); + output.push(s); + } + else { + throw new Error("Unexpected dot segment condition"); + } + } + } + return output.join(""); +} +; +export function serialize(components, options = {}) { + const protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL); + const uriTokens = []; + //find scheme handler + const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()]; + //perform scheme specific serialization + if (schemeHandler && schemeHandler.serialize) + schemeHandler.serialize(components, options); + if (components.host) { + //if host component is an IPv6 address + if (protocol.IPV6ADDRESS.test(components.host)) { + //TODO: normalize IPv6 address as per RFC 5952 + } + //if host component is a domain name + else if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) { + //convert IDN via punycode + try { + components.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host)); + } + catch (e) { + components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e; + } + } + } + //normalize encoding + _normalizeComponentEncoding(components, protocol); + if (options.reference !== "suffix" && components.scheme) { + uriTokens.push(components.scheme); + uriTokens.push(":"); + } + const authority = _recomposeAuthority(components, options); + if (authority !== undefined) { + if (options.reference !== "suffix") { + uriTokens.push("//"); + } + uriTokens.push(authority); + if (components.path && components.path.charAt(0) !== "/") { + uriTokens.push("/"); + } + } + if (components.path !== undefined) { + let s = components.path; + if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) { + s = removeDotSegments(s); + } + if (authority === undefined) { + s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//" + } + uriTokens.push(s); + } + if (components.query !== undefined) { + uriTokens.push("?"); + uriTokens.push(components.query); + } + if (components.fragment !== undefined) { + uriTokens.push("#"); + uriTokens.push(components.fragment); + } + return uriTokens.join(""); //merge tokens into a string +} +; +export function resolveComponents(base, relative, options = {}, skipNormalization) { + const target = {}; + if (!skipNormalization) { + base = parse(serialize(base, options), options); //normalize base components + relative = parse(serialize(relative, options), options); //normalize relative components + } + options = options || {}; + if (!options.tolerant && relative.scheme) { + target.scheme = relative.scheme; + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } + else { + if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) { + //target.authority = relative.authority; + target.userinfo = relative.userinfo; + target.host = relative.host; + target.port = relative.port; + target.path = removeDotSegments(relative.path || ""); + target.query = relative.query; + } + else { + if (!relative.path) { + target.path = base.path; + if (relative.query !== undefined) { + target.query = relative.query; + } + else { + target.query = base.query; + } + } + else { + if (relative.path.charAt(0) === "/") { + target.path = removeDotSegments(relative.path); + } + else { + if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) { + target.path = "/" + relative.path; + } + else if (!base.path) { + target.path = relative.path; + } + else { + target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path; + } + target.path = removeDotSegments(target.path); + } + target.query = relative.query; + } + //target.authority = base.authority; + target.userinfo = base.userinfo; + target.host = base.host; + target.port = base.port; + } + target.scheme = base.scheme; + } + target.fragment = relative.fragment; + return target; +} +; +export function resolve(baseURI, relativeURI, options) { + const schemelessOptions = assign({ scheme: 'null' }, options); + return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions); +} +; +export function normalize(uri, options) { + if (typeof uri === "string") { + uri = serialize(parse(uri, options), options); + } + else if (typeOf(uri) === "object") { + uri = parse(serialize(uri, options), options); + } + return uri; +} +; +export function equal(uriA, uriB, options) { + if (typeof uriA === "string") { + uriA = serialize(parse(uriA, options), options); + } + else if (typeOf(uriA) === "object") { + uriA = serialize(uriA, options); + } + if (typeof uriB === "string") { + uriB = serialize(parse(uriB, options), options); + } + else if (typeOf(uriB) === "object") { + uriB = serialize(uriB, options); + } + return uriA === uriB; +} +; +export function escapeComponent(str, options) { + return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar); +} +; +export function unescapeComponent(str, options) { + return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars); +} +; +//# sourceMappingURL=uri.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/uri.js.map b/tools/ui/node_modules/uri-js/dist/esnext/uri.js.map new file mode 100644 index 0000000000000000000000000000000000000000..2e72ab18d1192a61d62e03cb474cf5ce9731f5f5 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/uri.js.map @@ -0,0 +1 @@ +{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../src/uri.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAiDrD,MAAM,CAAC,MAAM,OAAO,GAAsC,EAAE,CAAC;AAE7D,MAAM,qBAAqB,GAAU;IACpC,MAAM,CAAC,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC5B,IAAI,CAAQ,CAAC;IAEb,IAAI,CAAC,GAAG,EAAE;QAAE,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;SAC/C,IAAI,CAAC,GAAG,GAAG;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;SACpD,IAAI,CAAC,GAAG,IAAI;QAAE,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;;QACxH,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IAE3K,OAAO,CAAC,CAAC;AACV,CAAC;AAED,MAAM,sBAAsB,GAAU;IACrC,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,CAAC,GAAG,CAAC,CAAC;IACV,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC;IAEtB,OAAO,CAAC,GAAG,EAAE,EAAE;QACd,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAE7C,IAAI,CAAC,GAAG,GAAG,EAAE;YACZ,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;YACjC,CAAC,IAAI,CAAC,CAAC;SACP;aACI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,GAAG,EAAE;YAC7B,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE;gBAClB,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC9C,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;aAC3D;iBAAM;gBACN,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aAC3B;YACD,CAAC,IAAI,CAAC,CAAC;SACP;aACI,IAAI,CAAC,IAAI,GAAG,EAAE;YAClB,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE;gBAClB,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC9C,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;gBAC9C,MAAM,IAAI,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;aAC/E;iBAAM;gBACN,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aAC3B;YACD,CAAC,IAAI,CAAC,CAAC;SACP;aACI;YACJ,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAC3B,CAAC,IAAI,CAAC,CAAC;SACP;KACD;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED,qCAAqC,UAAwB,EAAE,QAAmB;IACjF,0BAA0B,GAAU;QACnC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;QAChC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,UAAU,CAAC,MAAM;QAAE,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IACpK,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS;QAAE,UAAU,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC/N,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS;QAAE,UAAU,CAAC,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC7N,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS;QAAE,UAAU,CAAC,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAClQ,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS;QAAE,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IACnN,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS;QAAE,UAAU,CAAC,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAE/N,OAAO,UAAU,CAAC;AACnB,CAAC;AAAA,CAAC;AAEF,4BAA4B,GAAU;IACrC,OAAO,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC;AAC5C,CAAC;AAED,wBAAwB,IAAW,EAAE,QAAmB;IACvD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IACvD,MAAM,CAAC,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;IAE5B,IAAI,OAAO,EAAE;QACZ,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC5D;SAAM;QACN,OAAO,IAAI,CAAC;KACZ;AACF,CAAC;AAED,wBAAwB,IAAW,EAAE,QAAmB;IACvD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IACvD,MAAM,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC;IAElC,IAAI,OAAO,EAAE;QACZ,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QAClE,MAAM,WAAW,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1E,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC3D,MAAM,sBAAsB,GAAG,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;QAC5F,MAAM,UAAU,GAAG,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAClD,MAAM,eAAe,GAAG,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC;QACvD,MAAM,MAAM,GAAG,KAAK,CAAS,UAAU,CAAC,CAAC;QAEzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,EAAE,EAAE,CAAC,EAAE;YACpC,MAAM,CAAC,CAAC,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,eAAe,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;SACpE;QAED,IAAI,sBAAsB,EAAE;YAC3B,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,GAAG,cAAc,CAAC,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;SAC1E;QAED,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAsC,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YAC9F,IAAI,CAAC,KAAK,IAAI,KAAK,KAAK,GAAG,EAAE;gBAC5B,MAAM,WAAW,GAAG,GAAG,CAAC,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;gBACxC,IAAI,WAAW,IAAI,WAAW,CAAC,KAAK,GAAG,WAAW,CAAC,MAAM,KAAK,KAAK,EAAE;oBACpE,WAAW,CAAC,MAAM,EAAE,CAAC;iBACrB;qBAAM;oBACN,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAG,CAAC,EAAE,CAAC,CAAC;iBAChC;aACD;YACD,OAAO,GAAG,CAAC;QACZ,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,MAAM,iBAAiB,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAE/E,IAAI,OAAc,CAAC;QACnB,IAAI,iBAAiB,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE;YACtD,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAE;YAC3D,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,iBAAiB,CAAC,KAAK,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;YACjF,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACxD;aAAM;YACN,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SAC3B;QAED,IAAI,IAAI,EAAE;YACT,OAAO,IAAI,GAAG,GAAG,IAAI,CAAC;SACtB;QAED,OAAO,OAAO,CAAC;KACf;SAAM;QACN,OAAO,IAAI,CAAC;KACZ;AACF,CAAC;AAED,MAAM,SAAS,GAAG,iIAAiI,CAAC;AACpJ,MAAM,qBAAqB,GAAsB,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAE,CAAC,CAAC,CAAC,KAAK,SAAS,CAAC;AAEvF,MAAM,gBAAgB,SAAgB,EAAE,UAAqB,EAAE;IAC9D,MAAM,UAAU,GAAiB,EAAE,CAAC;IACpC,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IAEvE,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ;QAAE,SAAS,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;IAEhH,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAE3C,IAAI,OAAO,EAAE;QACZ,IAAI,qBAAqB,EAAE;YAC1B,sBAAsB;YACtB,UAAU,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC/B,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YACjC,UAAU,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC7B,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3C,UAAU,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YACnC,UAAU,CAAC,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAC9B,UAAU,CAAC,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;YAEjC,iBAAiB;YACjB,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBAC3B,UAAU,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;aAC7B;SACD;aAAM,EAAG,qCAAqC;YAC9C,sBAAsB;YACtB,UAAU,CAAC,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,SAAS,CAAC;YAC5C,UAAU,CAAC,QAAQ,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC/E,UAAU,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC5E,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3C,UAAU,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;YACnC,UAAU,CAAC,KAAK,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC5E,UAAU,CAAC,QAAQ,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAE/E,iBAAiB;YACjB,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;gBAC3B,UAAU,CAAC,IAAI,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,+BAA+B,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;aAC9F;SACD;QAED,IAAI,UAAU,CAAC,IAAI,EAAE;YACpB,oBAAoB;YACpB,UAAU,CAAC,IAAI,GAAG,cAAc,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC;SACtF;QAED,0BAA0B;QAC1B,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE;YACjM,UAAU,CAAC,SAAS,GAAG,eAAe,CAAC;SACvC;aAAM,IAAI,UAAU,CAAC,MAAM,KAAK,SAAS,EAAE;YAC3C,UAAU,CAAC,SAAS,GAAG,UAAU,CAAC;SAClC;aAAM,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS,EAAE;YAC7C,UAAU,CAAC,SAAS,GAAG,UAAU,CAAC;SAClC;aAAM;YACN,UAAU,CAAC,SAAS,GAAG,KAAK,CAAC;SAC7B;QAED,4BAA4B;QAC5B,IAAI,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,CAAC,SAAS,KAAK,UAAU,CAAC,SAAS,EAAE;YACtG,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,eAAe,GAAG,OAAO,CAAC,SAAS,GAAG,aAAa,CAAC;SAC3F;QAED,qBAAqB;QACrB,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAEzF,mCAAmC;QACnC,IAAI,CAAC,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,EAAE;YACjF,oCAAoC;YACpC,IAAI,UAAU,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,UAAU,CAAC,CAAC,EAAE;gBAC3F,kCAAkC;gBAClC,IAAI;oBACH,UAAU,CAAC,IAAI,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;iBAC7G;gBAAC,OAAO,CAAC,EAAE;oBACX,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,iEAAiE,GAAG,CAAC,CAAC;iBAC7G;aACD;YACD,oBAAoB;YACpB,2BAA2B,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;SACtD;aAAM;YACN,qBAAqB;YACrB,2BAA2B,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;SAClD;QAED,iCAAiC;QACjC,IAAI,aAAa,IAAI,aAAa,CAAC,KAAK,EAAE;YACzC,aAAa,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;SACzC;KACD;SAAM;QACN,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,wBAAwB,CAAC;KAChE;IAED,OAAO,UAAU,CAAC;AACnB,CAAC;AAAA,CAAC;AAEF,6BAA6B,UAAwB,EAAE,OAAkB;IACxE,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IACvE,MAAM,SAAS,GAAiB,EAAE,CAAC;IAEnC,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS,EAAE;QACtC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACpC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACpB;IAED,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;QAClC,qEAAqE;QACrE,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;KAClL;IAED,IAAI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ,EAAE;QAC/E,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;KACxC;IAED,OAAO,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC1D,CAAC;AAAA,CAAC;AAEF,MAAM,IAAI,GAAG,UAAU,CAAC;AACxB,MAAM,IAAI,GAAG,aAAa,CAAC;AAC3B,MAAM,IAAI,GAAG,eAAe,CAAC;AAC7B,MAAM,IAAI,GAAG,SAAS,CAAC;AACvB,MAAM,IAAI,GAAG,wBAAwB,CAAC;AAEtC,MAAM,4BAA4B,KAAY;IAC7C,MAAM,MAAM,GAAiB,EAAE,CAAC;IAEhC,OAAO,KAAK,CAAC,MAAM,EAAE;QACpB,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YACtB,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;SAChC;aAAM,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;SACjC;aAAM,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE;YAC7B,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YACjC,MAAM,CAAC,GAAG,EAAE,CAAC;SACb;aAAM,IAAI,KAAK,KAAK,GAAG,IAAI,KAAK,KAAK,IAAI,EAAE;YAC3C,KAAK,GAAG,EAAE,CAAC;SACX;aAAM;YACN,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAC7B,IAAI,EAAE,EAAE;gBACP,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;gBAChB,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;gBAC9B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACf;iBAAM;gBACN,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;aACpD;SACD;KACD;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC;AAAA,CAAC;AAEF,MAAM,oBAAoB,UAAwB,EAAE,UAAqB,EAAE;IAC1E,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC;IAC7D,MAAM,SAAS,GAAiB,EAAE,CAAC;IAEnC,qBAAqB;IACrB,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,UAAU,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IAEzF,uCAAuC;IACvC,IAAI,aAAa,IAAI,aAAa,CAAC,SAAS;QAAE,aAAa,CAAC,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAE3F,IAAI,UAAU,CAAC,IAAI,EAAE;QACpB,sCAAsC;QACtC,IAAI,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;YAC/C,8CAA8C;SAC9C;QAED,oCAAoC;aAC/B,IAAI,OAAO,CAAC,UAAU,IAAI,CAAC,aAAa,IAAI,aAAa,CAAC,UAAU,CAAC,EAAE;YAC3E,0BAA0B;YAC1B,IAAI;gBACH,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC;aACpK;YAAC,OAAO,CAAC,EAAE;gBACX,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6CAA6C,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,GAAG,iBAAiB,GAAG,CAAC,CAAC;aACpJ;SACD;KACD;IAED,oBAAoB;IACpB,2BAA2B,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAElD,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,IAAI,UAAU,CAAC,MAAM,EAAE;QACxD,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAClC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACpB;IAED,MAAM,SAAS,GAAG,mBAAmB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC3D,IAAI,SAAS,KAAK,SAAS,EAAE;QAC5B,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE;YACnC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SACrB;QAED,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAE1B,IAAI,UAAU,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;YACzD,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACpB;KACD;IAED,IAAI,UAAU,CAAC,IAAI,KAAK,SAAS,EAAE;QAClC,IAAI,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC;QAExB,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,CAAC,aAAa,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,EAAE;YAC7E,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAAC;SACzB;QAED,IAAI,SAAS,KAAK,SAAS,EAAE;YAC5B,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAE,yCAAyC;SAC1E;QAED,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KAClB;IAED,IAAI,UAAU,CAAC,KAAK,KAAK,SAAS,EAAE;QACnC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;KACjC;IAED,IAAI,UAAU,CAAC,QAAQ,KAAK,SAAS,EAAE;QACtC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpB,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;KACpC;IAED,OAAO,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAE,4BAA4B;AACzD,CAAC;AAAA,CAAC;AAEF,MAAM,4BAA4B,IAAkB,EAAE,QAAsB,EAAE,UAAqB,EAAE,EAAE,iBAA0B;IAChI,MAAM,MAAM,GAAiB,EAAE,CAAC;IAEhC,IAAI,CAAC,iBAAiB,EAAE;QACvB,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAE,2BAA2B;QAC7E,QAAQ,GAAG,KAAK,CAAC,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAE,+BAA+B;KACzF;IACD,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;IAExB,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,QAAQ,CAAC,MAAM,EAAE;QACzC,MAAM,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QAChC,wCAAwC;QACxC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;QACpC,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC5B,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC5B,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;QACrD,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;KAC9B;SAAM;QACN,IAAI,QAAQ,CAAC,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE;YAClG,wCAAwC;YACxC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;YACpC,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;YAC5B,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;YAC5B,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;YACrD,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;SAC9B;aAAM;YACN,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE;gBACnB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;gBACxB,IAAI,QAAQ,CAAC,KAAK,KAAK,SAAS,EAAE;oBACjC,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;iBAC9B;qBAAM;oBACN,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;iBAC1B;aACD;iBAAM;gBACN,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;oBACpC,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;iBAC/C;qBAAM;oBACN,IAAI,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;wBACtG,MAAM,CAAC,IAAI,GAAG,GAAG,GAAG,QAAQ,CAAC,IAAI,CAAC;qBAClC;yBAAM,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;wBACtB,MAAM,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;qBAC5B;yBAAM;wBACN,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC;qBACjF;oBACD,MAAM,CAAC,IAAI,GAAG,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;iBAC7C;gBACD,MAAM,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;aAC9B;YACD,oCAAoC;YACpC,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;YAChC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;YACxB,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;SACxB;QACD,MAAM,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;KAC5B;IAED,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC,QAAQ,CAAC;IAEpC,OAAO,MAAM,CAAC;AACf,CAAC;AAAA,CAAC;AAEF,MAAM,kBAAkB,OAAc,EAAE,WAAkB,EAAE,OAAmB;IAC9E,MAAM,iBAAiB,GAAG,MAAM,CAAC,EAAE,MAAM,EAAG,MAAM,EAAE,EAAE,OAAO,CAAC,CAAC;IAC/D,OAAO,SAAS,CAAC,iBAAiB,CAAC,KAAK,CAAC,OAAO,EAAE,iBAAiB,CAAC,EAAE,KAAK,CAAC,WAAW,EAAE,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,IAAI,CAAC,EAAE,iBAAiB,CAAC,CAAC;AAC3J,CAAC;AAAA,CAAC;AAIF,MAAM,oBAAoB,GAAO,EAAE,OAAmB;IACrD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;QAC5B,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;KAC9C;SAAM,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,QAAQ,EAAE;QACpC,GAAG,GAAG,KAAK,CAAC,SAAS,CAAgB,GAAG,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;KAC7D;IAED,OAAO,GAAG,CAAC;AACZ,CAAC;AAAA,CAAC;AAIF,MAAM,gBAAgB,IAAQ,EAAE,IAAQ,EAAE,OAAmB;IAC5D,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC7B,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;KAChD;SAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;QACrC,IAAI,GAAG,SAAS,CAAgB,IAAI,EAAE,OAAO,CAAC,CAAC;KAC/C;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC7B,IAAI,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;KAChD;SAAM,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,QAAQ,EAAE;QACrC,IAAI,GAAG,SAAS,CAAgB,IAAI,EAAE,OAAO,CAAC,CAAC;KAC/C;IAED,OAAO,IAAI,KAAK,IAAI,CAAC;AACtB,CAAC;AAAA,CAAC;AAEF,MAAM,0BAA0B,GAAU,EAAE,OAAmB;IAC9D,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;AAC1H,CAAC;AAAA,CAAC;AAEF,MAAM,4BAA4B,GAAU,EAAE,OAAmB;IAChE,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC;AACrI,CAAC;AAAA,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/util.d.ts b/tools/ui/node_modules/uri-js/dist/esnext/util.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7c12857543a6b0ceab07e4931275186275fff7ec --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/util.d.ts @@ -0,0 +1,6 @@ +export declare function merge(...sets: Array): string; +export declare function subexp(str: string): string; +export declare function typeOf(o: any): string; +export declare function toUpperCase(str: string): string; +export declare function toArray(obj: any): Array; +export declare function assign(target: object, source: any): any; diff --git a/tools/ui/node_modules/uri-js/dist/esnext/util.js b/tools/ui/node_modules/uri-js/dist/esnext/util.js new file mode 100644 index 0000000000000000000000000000000000000000..072711efdbfe37d4305ae6f12331d00d80a2e586 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/util.js @@ -0,0 +1,36 @@ +export function merge(...sets) { + if (sets.length > 1) { + sets[0] = sets[0].slice(0, -1); + const xl = sets.length - 1; + for (let x = 1; x < xl; ++x) { + sets[x] = sets[x].slice(1, -1); + } + sets[xl] = sets[xl].slice(1); + return sets.join(''); + } + else { + return sets[0]; + } +} +export function subexp(str) { + return "(?:" + str + ")"; +} +export function typeOf(o) { + return o === undefined ? "undefined" : (o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase()); +} +export function toUpperCase(str) { + return str.toUpperCase(); +} +export function toArray(obj) { + return obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : []; +} +export function assign(target, source) { + const obj = target; + if (source) { + for (const key in source) { + obj[key] = source[key]; + } + } + return obj; +} +//# sourceMappingURL=util.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/dist/esnext/util.js.map b/tools/ui/node_modules/uri-js/dist/esnext/util.js.map new file mode 100644 index 0000000000000000000000000000000000000000..05d9df021f9d4b94c87e346098dc384b4128f778 --- /dev/null +++ b/tools/ui/node_modules/uri-js/dist/esnext/util.js.map @@ -0,0 +1 @@ +{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,IAAkB;IAC1C,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAC3B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAE;YAC5B,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;SAC/B;QACD,IAAI,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KACrB;SAAM;QACN,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC;KACf;AACF,CAAC;AAED,MAAM,iBAAiB,GAAU;IAChC,OAAO,KAAK,GAAG,GAAG,GAAG,GAAG,CAAC;AAC1B,CAAC;AAED,MAAM,iBAAiB,CAAK;IAC3B,OAAO,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;AACpJ,CAAC;AAED,MAAM,sBAAsB,GAAU;IACrC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC;AAC1B,CAAC;AAED,MAAM,kBAAkB,GAAO;IAC9B,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvM,CAAC;AAGD,MAAM,iBAAiB,MAAc,EAAE,MAAW;IACjD,MAAM,GAAG,GAAG,MAAa,CAAC;IAC1B,IAAI,MAAM,EAAE;QACX,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACzB,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;SACvB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-js/package.json b/tools/ui/node_modules/uri-js/package.json new file mode 100644 index 0000000000000000000000000000000000000000..de95d91aa1a41091d8bc6fca168bf51b289b0f7a --- /dev/null +++ b/tools/ui/node_modules/uri-js/package.json @@ -0,0 +1,77 @@ +{ + "name": "uri-js", + "version": "4.4.1", + "description": "An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.", + "main": "dist/es5/uri.all.js", + "types": "dist/es5/uri.all.d.ts", + "directories": { + "test": "tests" + }, + "files": [ + "dist", + "package.json", + "yarn.lock", + "README.md", + "CHANGELOG", + "LICENSE" + ], + "scripts": { + "build:esnext": "tsc", + "build:es5": "rollup -c && cp dist/esnext/uri.d.ts dist/es5/uri.all.d.ts && npm run build:es5:fix-sourcemap", + "build:es5:fix-sourcemap": "sorcery -i dist/es5/uri.all.js", + "build:es5:min": "uglifyjs dist/es5/uri.all.js --support-ie8 --output dist/es5/uri.all.min.js --in-source-map dist/es5/uri.all.js.map --source-map uri.all.min.js.map --comments --compress --mangle --pure-funcs merge subexp && mv uri.all.min.js.map dist/es5/ && cp dist/es5/uri.all.d.ts dist/es5/uri.all.min.d.ts", + "build": "npm run build:esnext && npm run build:es5 && npm run build:es5:min", + "clean": "rm -rf dist", + "test": "mocha -u mocha-qunit-ui dist/es5/uri.all.js tests/tests.js" + }, + "repository": { + "type": "git", + "url": "http://github.com/garycourt/uri-js" + }, + "keywords": [ + "URI", + "IRI", + "IDN", + "URN", + "UUID", + "HTTP", + "HTTPS", + "WS", + "WSS", + "MAILTO", + "RFC3986", + "RFC3987", + "RFC5891", + "RFC2616", + "RFC2818", + "RFC2141", + "RFC4122", + "RFC4291", + "RFC5952", + "RFC6068", + "RFC6455", + "RFC6874" + ], + "author": "Gary Court ", + "license": "BSD-2-Clause", + "bugs": { + "url": "https://github.com/garycourt/uri-js/issues" + }, + "homepage": "https://github.com/garycourt/uri-js", + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-plugin-external-helpers": "^6.22.0", + "babel-preset-latest": "^6.24.1", + "mocha": "^8.2.1", + "mocha-qunit-ui": "^0.1.3", + "rollup": "^0.41.6", + "rollup-plugin-babel": "^2.7.1", + "rollup-plugin-node-resolve": "^2.0.0", + "sorcery": "^0.10.0", + "typescript": "^2.8.1", + "uglify-js": "^2.8.14" + }, + "dependencies": { + "punycode": "^2.1.0" + } +} diff --git a/tools/ui/node_modules/uri-js/yarn.lock b/tools/ui/node_modules/uri-js/yarn.lock new file mode 100644 index 0000000000000000000000000000000000000000..3c42ded1259efe646a53372a76f8671fd8757fc5 --- /dev/null +++ b/tools/ui/node_modules/uri-js/yarn.lock @@ -0,0 +1,2558 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@ungap/promise-all-settled@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44" + integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q== + +align-text@^0.1.1, align-text@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" + dependencies: + kind-of "^3.0.2" + longest "^1.0.1" + repeat-string "^1.5.2" + +ansi-colors@4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" + integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8= + +ansi-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998" + integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg= + +ansi-regex@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997" + integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4= + +ansi-styles@^3.2.0: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +anymatch@^1.3.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== + dependencies: + micromatch "^2.1.5" + normalize-path "^2.0.0" + +anymatch@~3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142" + integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +arr-diff@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" + integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8= + dependencies: + arr-flatten "^1.0.1" + +arr-diff@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520" + integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA= + +arr-flatten@^1.0.1, arr-flatten@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1" + integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg== + +arr-union@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4" + integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ= + +array-unique@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" + integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM= + +array-unique@^0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428" + integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg= + +assign-symbols@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" + integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= + +async-each@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf" + integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ== + +atob@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" + integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== + +babel-cli@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" + integrity sha1-UCq1SHTX24itALiHoGODzgPQAvE= + dependencies: + babel-core "^6.26.0" + babel-polyfill "^6.26.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + commander "^2.11.0" + convert-source-map "^1.5.0" + fs-readdir-recursive "^1.0.0" + glob "^7.1.2" + lodash "^4.17.4" + output-file-sync "^1.1.2" + path-is-absolute "^1.0.1" + slash "^1.0.0" + source-map "^0.5.6" + v8flags "^2.1.1" + optionalDependencies: + chokidar "^1.6.1" + +babel-code-frame@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" + integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s= + dependencies: + chalk "^1.1.3" + esutils "^2.0.2" + js-tokens "^3.0.2" + +babel-core@6: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8" + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.0" + debug "^2.6.8" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.7" + slash "^1.0.0" + source-map "^0.5.6" + +babel-core@^6.26.0: + version "6.26.3" + resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207" + integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA== + dependencies: + babel-code-frame "^6.26.0" + babel-generator "^6.26.0" + babel-helpers "^6.24.1" + babel-messages "^6.23.0" + babel-register "^6.26.0" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + convert-source-map "^1.5.1" + debug "^2.6.9" + json5 "^0.5.1" + lodash "^4.17.4" + minimatch "^3.0.4" + path-is-absolute "^1.0.1" + private "^0.1.8" + slash "^1.0.0" + source-map "^0.5.7" + +babel-generator@^6.26.0: + version "6.26.1" + resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90" + integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA== + dependencies: + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + detect-indent "^4.0.0" + jsesc "^1.3.0" + lodash "^4.17.4" + source-map "^0.5.7" + trim-right "^1.0.1" + +babel-helper-builder-binary-assignment-operator-visitor@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664" + dependencies: + babel-helper-explode-assignable-expression "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-call-delegate@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-define-map@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-explode-assignable-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa" + dependencies: + babel-runtime "^6.22.0" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9" + dependencies: + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-get-function-arity@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-hoist-variables@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-optimise-call-expression@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-helper-regex@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72" + dependencies: + babel-runtime "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-helper-remap-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helper-replace-supers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a" + dependencies: + babel-helper-optimise-call-expression "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-helpers@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2" + integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI= + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-messages@^6.23.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" + integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4= + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-check-es2015-constants@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-external-helpers@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-syntax-async-functions@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95" + +babel-plugin-syntax-exponentiation-operator@^6.8.0: + version "6.13.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de" + +babel-plugin-syntax-trailing-function-commas@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3" + +babel-plugin-transform-async-to-generator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761" + dependencies: + babel-helper-remap-async-to-generator "^6.24.1" + babel-plugin-syntax-async-functions "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-arrow-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoped-functions@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-block-scoping@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f" + dependencies: + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + lodash "^4.17.4" + +babel-plugin-transform-es2015-classes@^6.24.1, babel-plugin-transform-es2015-classes@^6.9.0: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db" + dependencies: + babel-helper-define-map "^6.24.1" + babel-helper-function-name "^6.24.1" + babel-helper-optimise-call-expression "^6.24.1" + babel-helper-replace-supers "^6.24.1" + babel-messages "^6.23.0" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-computed-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3" + dependencies: + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-destructuring@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-duplicate-keys@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-for-of@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-function-name@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b" + dependencies: + babel-helper-function-name "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-modules-amd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154" + dependencies: + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-commonjs@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a" + dependencies: + babel-plugin-transform-strict-mode "^6.24.1" + babel-runtime "^6.26.0" + babel-template "^6.26.0" + babel-types "^6.26.0" + +babel-plugin-transform-es2015-modules-systemjs@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23" + dependencies: + babel-helper-hoist-variables "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-modules-umd@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468" + dependencies: + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + +babel-plugin-transform-es2015-object-super@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d" + dependencies: + babel-helper-replace-supers "^6.24.1" + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-parameters@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b" + dependencies: + babel-helper-call-delegate "^6.24.1" + babel-helper-get-function-arity "^6.24.1" + babel-runtime "^6.22.0" + babel-template "^6.24.1" + babel-traverse "^6.24.1" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-shorthand-properties@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-spread@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-sticky-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-plugin-transform-es2015-template-literals@^6.22.0: + version "6.22.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-typeof-symbol@^6.22.0: + version "6.23.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372" + dependencies: + babel-runtime "^6.22.0" + +babel-plugin-transform-es2015-unicode-regex@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9" + dependencies: + babel-helper-regex "^6.24.1" + babel-runtime "^6.22.0" + regexpu-core "^2.0.0" + +babel-plugin-transform-exponentiation-operator@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e" + dependencies: + babel-helper-builder-binary-assignment-operator-visitor "^6.24.1" + babel-plugin-syntax-exponentiation-operator "^6.8.0" + babel-runtime "^6.22.0" + +babel-plugin-transform-regenerator@^6.24.1: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f" + dependencies: + regenerator-transform "^0.10.0" + +babel-plugin-transform-strict-mode@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758" + dependencies: + babel-runtime "^6.22.0" + babel-types "^6.24.1" + +babel-polyfill@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= + dependencies: + babel-runtime "^6.26.0" + core-js "^2.5.0" + regenerator-runtime "^0.10.5" + +babel-preset-es2015@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939" + dependencies: + babel-plugin-check-es2015-constants "^6.22.0" + babel-plugin-transform-es2015-arrow-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoped-functions "^6.22.0" + babel-plugin-transform-es2015-block-scoping "^6.24.1" + babel-plugin-transform-es2015-classes "^6.24.1" + babel-plugin-transform-es2015-computed-properties "^6.24.1" + babel-plugin-transform-es2015-destructuring "^6.22.0" + babel-plugin-transform-es2015-duplicate-keys "^6.24.1" + babel-plugin-transform-es2015-for-of "^6.22.0" + babel-plugin-transform-es2015-function-name "^6.24.1" + babel-plugin-transform-es2015-literals "^6.22.0" + babel-plugin-transform-es2015-modules-amd "^6.24.1" + babel-plugin-transform-es2015-modules-commonjs "^6.24.1" + babel-plugin-transform-es2015-modules-systemjs "^6.24.1" + babel-plugin-transform-es2015-modules-umd "^6.24.1" + babel-plugin-transform-es2015-object-super "^6.24.1" + babel-plugin-transform-es2015-parameters "^6.24.1" + babel-plugin-transform-es2015-shorthand-properties "^6.24.1" + babel-plugin-transform-es2015-spread "^6.22.0" + babel-plugin-transform-es2015-sticky-regex "^6.24.1" + babel-plugin-transform-es2015-template-literals "^6.22.0" + babel-plugin-transform-es2015-typeof-symbol "^6.22.0" + babel-plugin-transform-es2015-unicode-regex "^6.24.1" + babel-plugin-transform-regenerator "^6.24.1" + +babel-preset-es2016@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2016/-/babel-preset-es2016-6.24.1.tgz#f900bf93e2ebc0d276df9b8ab59724ebfd959f8b" + dependencies: + babel-plugin-transform-exponentiation-operator "^6.24.1" + +babel-preset-es2017@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-es2017/-/babel-preset-es2017-6.24.1.tgz#597beadfb9f7f208bcfd8a12e9b2b29b8b2f14d1" + dependencies: + babel-plugin-syntax-trailing-function-commas "^6.22.0" + babel-plugin-transform-async-to-generator "^6.24.1" + +babel-preset-latest@^6.24.1: + version "6.24.1" + resolved "https://registry.yarnpkg.com/babel-preset-latest/-/babel-preset-latest-6.24.1.tgz#677de069154a7485c2d25c577c02f624b85b85e8" + dependencies: + babel-preset-es2015 "^6.24.1" + babel-preset-es2016 "^6.24.1" + babel-preset-es2017 "^6.24.1" + +babel-register@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071" + integrity sha1-btAhFz4vy0htestFxgCahW9kcHE= + dependencies: + babel-core "^6.26.0" + babel-runtime "^6.26.0" + core-js "^2.5.0" + home-or-tmp "^2.0.0" + lodash "^4.17.4" + mkdirp "^0.5.1" + source-map-support "^0.4.15" + +babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe" + integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4= + dependencies: + core-js "^2.4.0" + regenerator-runtime "^0.11.0" + +babel-template@^6.24.1, babel-template@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02" + integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI= + dependencies: + babel-runtime "^6.26.0" + babel-traverse "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + lodash "^4.17.4" + +babel-traverse@^6.24.1, babel-traverse@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee" + dependencies: + babel-code-frame "^6.26.0" + babel-messages "^6.23.0" + babel-runtime "^6.26.0" + babel-types "^6.26.0" + babylon "^6.18.0" + debug "^2.6.8" + globals "^9.18.0" + invariant "^2.2.2" + lodash "^4.17.4" + +babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0: + version "6.26.0" + resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497" + dependencies: + babel-runtime "^6.26.0" + esutils "^2.0.2" + lodash "^4.17.4" + to-fast-properties "^1.0.3" + +babylon@^6.18.0: + version "6.18.0" + resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" + integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c= + +base@^0.11.1: + version "0.11.2" + resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" + integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg== + dependencies: + cache-base "^1.0.1" + class-utils "^0.3.5" + component-emitter "^1.2.1" + define-property "^1.0.0" + isobject "^3.0.1" + mixin-deep "^1.2.0" + pascalcase "^0.1.1" + +binary-extensions@^1.0.0: + version "1.13.1" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65" + integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw== + +binary-extensions@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9" + integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ== + +bindings@^1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df" + integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ== + dependencies: + file-uri-to-path "1.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^1.8.2: + version "1.8.5" + resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" + integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc= + dependencies: + expand-range "^1.8.1" + preserve "^0.2.0" + repeat-element "^1.1.2" + +braces@^2.3.1: + version "2.3.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729" + integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w== + dependencies: + arr-flatten "^1.1.0" + array-unique "^0.3.2" + extend-shallow "^2.0.1" + fill-range "^4.0.0" + isobject "^3.0.1" + repeat-element "^1.1.2" + snapdragon "^0.8.1" + snapdragon-node "^2.0.1" + split-string "^3.0.2" + to-regex "^3.0.1" + +braces@~3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +browser-resolve@^1.11.0: + version "1.11.2" + resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce" + dependencies: + resolve "1.1.7" + +browser-stdout@1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" + integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw== + +buffer-crc32@^0.2.5: + version "0.2.13" + resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" + +builtin-modules@^1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" + +cache-base@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2" + integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ== + dependencies: + collection-visit "^1.0.0" + component-emitter "^1.2.1" + get-value "^2.0.6" + has-value "^1.0.0" + isobject "^3.0.1" + set-value "^2.0.0" + to-object-path "^0.3.0" + union-value "^1.0.0" + unset-value "^1.0.0" + +camelcase@^1.0.2: + version "1.2.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" + +camelcase@^5.0.0: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +camelcase@^6.0.0: + version "6.2.0" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809" + integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg== + +center-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" + dependencies: + align-text "^0.1.3" + lazy-cache "^1.0.3" + +chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg= + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chokidar@3.4.3: + version "3.4.3" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b" + integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ== + dependencies: + anymatch "~3.1.1" + braces "~3.0.2" + glob-parent "~5.1.0" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.5.0" + optionalDependencies: + fsevents "~2.1.2" + +chokidar@^1.6.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= + dependencies: + anymatch "^1.3.0" + async-each "^1.0.0" + glob-parent "^2.0.0" + inherits "^2.0.1" + is-binary-path "^1.0.0" + is-glob "^2.0.0" + path-is-absolute "^1.0.0" + readdirp "^2.0.0" + optionalDependencies: + fsevents "^1.0.0" + +class-utils@^0.3.5: + version "0.3.6" + resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" + integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg== + dependencies: + arr-union "^3.1.0" + define-property "^0.2.5" + isobject "^3.0.0" + static-extend "^0.1.1" + +cliui@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" + dependencies: + center-align "^0.1.1" + right-align "^0.1.1" + wordwrap "0.0.2" + +cliui@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5" + integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA== + dependencies: + string-width "^3.1.0" + strip-ansi "^5.2.0" + wrap-ansi "^5.1.0" + +collection-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0" + integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA= + dependencies: + map-visit "^1.0.0" + object-visit "^1.0.0" + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +commander@^2.11.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + +component-emitter@^1.2.1: + version "1.3.0" + resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0" + integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= + +convert-source-map@^1.5.0, convert-source-map@^1.5.1: + version "1.7.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442" + integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA== + dependencies: + safe-buffer "~5.1.1" + +copy-descriptor@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d" + integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40= + +core-js@^2.4.0, core-js@^2.5.0: + version "2.6.12" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec" + integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ== + +core-util-is@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" + integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= + +debug@4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1" + integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== + dependencies: + ms "2.1.2" + +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +decamelize@^1.0.0, decamelize@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" + +decamelize@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837" + integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ== + +decode-uri-component@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" + integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= + +define-property@^0.2.5: + version "0.2.5" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116" + integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY= + dependencies: + is-descriptor "^0.1.0" + +define-property@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6" + integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY= + dependencies: + is-descriptor "^1.0.0" + +define-property@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d" + integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ== + dependencies: + is-descriptor "^1.0.2" + isobject "^3.0.1" + +detect-indent@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" + integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg= + dependencies: + repeating "^2.0.0" + +diff@4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" + integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== + +emoji-regex@^7.0.1: + version "7.0.3" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" + integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA== + +es6-promise@^3.1.2: + version "3.3.1" + resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613" + +escape-string-regexp@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +escape-string-regexp@^1.0.2: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +estree-walker@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e" + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +expand-brackets@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" + integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s= + dependencies: + is-posix-bracket "^0.1.0" + +expand-brackets@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622" + integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI= + dependencies: + debug "^2.3.3" + define-property "^0.2.5" + extend-shallow "^2.0.1" + posix-character-classes "^0.1.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +expand-range@^1.8.1: + version "1.8.2" + resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" + integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc= + dependencies: + fill-range "^2.1.0" + +extend-shallow@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" + integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8= + dependencies: + is-extendable "^0.1.0" + +extend-shallow@^3.0.0, extend-shallow@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8" + integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg= + dependencies: + assign-symbols "^1.0.0" + is-extendable "^1.0.1" + +extglob@^0.3.1: + version "0.3.2" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" + integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE= + dependencies: + is-extglob "^1.0.0" + +extglob@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543" + integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw== + dependencies: + array-unique "^0.3.2" + define-property "^1.0.0" + expand-brackets "^2.1.4" + extend-shallow "^2.0.1" + fragment-cache "^0.2.1" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +file-uri-to-path@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" + integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== + +filename-regex@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" + integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY= + +fill-range@^2.1.0: + version "2.2.4" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565" + integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q== + dependencies: + is-number "^2.1.0" + isobject "^2.0.0" + randomatic "^3.0.0" + repeat-element "^1.1.2" + repeat-string "^1.5.2" + +fill-range@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7" + integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc= + dependencies: + extend-shallow "^2.0.1" + is-number "^3.0.0" + repeat-string "^1.6.1" + to-regex-range "^2.1.0" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +find-up@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" + integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg== + dependencies: + locate-path "^3.0.0" + +flat@^5.0.2: + version "5.0.2" + resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241" + integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ== + +for-in@^1.0.1, for-in@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" + integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= + +for-own@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" + integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= + dependencies: + for-in "^1.0.1" + +fragment-cache@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19" + integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk= + dependencies: + map-cache "^0.2.2" + +fs-readdir-recursive@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27" + integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= + +fsevents@^1.0.0: + version "1.2.13" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38" + integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw== + dependencies: + bindings "^1.5.0" + nan "^2.12.1" + +fsevents@~2.1.2: + version "2.1.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e" + integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ== + +get-caller-file@^2.0.1: + version "2.0.5" + resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" + integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== + +get-value@^2.0.3, get-value@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28" + integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg= + +glob-base@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" + integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q= + dependencies: + glob-parent "^2.0.0" + is-glob "^2.0.0" + +glob-parent@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" + integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg= + dependencies: + is-glob "^2.0.0" + +glob-parent@~5.1.0: + version "5.1.1" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229" + integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ== + dependencies: + is-glob "^4.0.1" + +glob@7.1.6, glob@^7.1.2, glob@^7.1.3: + version "7.1.6" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" + integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^9.18.0: + version "9.18.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" + integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ== + +graceful-fs@^4.1.11, graceful-fs@^4.1.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb" + integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw== + +graceful-fs@^4.1.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423" + +growl@1.10.5: + version "1.10.5" + resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e" + integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA== + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE= + dependencies: + ansi-regex "^2.0.0" + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-value@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f" + integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8= + dependencies: + get-value "^2.0.3" + has-values "^0.1.4" + isobject "^2.0.0" + +has-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177" + integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc= + dependencies: + get-value "^2.0.6" + has-values "^1.0.0" + isobject "^3.0.0" + +has-values@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771" + integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E= + +has-values@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f" + integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8= + dependencies: + is-number "^3.0.0" + kind-of "^4.0.0" + +he@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" + integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw== + +home-or-tmp@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8" + integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg= + dependencies: + os-homedir "^1.0.0" + os-tmpdir "^1.0.1" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.1, inherits@~2.0.3: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +invariant@^2.2.2: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + +is-accessor-descriptor@^0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6" + integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY= + dependencies: + kind-of "^3.0.2" + +is-accessor-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656" + integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ== + dependencies: + kind-of "^6.0.0" + +is-binary-path@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898" + integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg= + dependencies: + binary-extensions "^1.0.0" + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-buffer@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" + integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w== + +is-data-descriptor@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56" + integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y= + dependencies: + kind-of "^3.0.2" + +is-data-descriptor@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7" + integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ== + dependencies: + kind-of "^6.0.0" + +is-descriptor@^0.1.0: + version "0.1.6" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca" + integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg== + dependencies: + is-accessor-descriptor "^0.1.6" + is-data-descriptor "^0.1.4" + kind-of "^5.0.0" + +is-descriptor@^1.0.0, is-descriptor@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec" + integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg== + dependencies: + is-accessor-descriptor "^1.0.0" + is-data-descriptor "^1.0.0" + kind-of "^6.0.2" + +is-dotfile@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" + integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE= + +is-equal-shallow@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" + integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ= + dependencies: + is-primitive "^2.0.0" + +is-extendable@^0.1.0, is-extendable@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" + integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik= + +is-extendable@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4" + integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA== + dependencies: + is-plain-object "^2.0.4" + +is-extglob@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" + integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA= + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI= + +is-finite@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3" + integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w== + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8= + +is-glob@^2.0.0, is-glob@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" + integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM= + dependencies: + is-extglob "^1.0.0" + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + +is-number@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" + integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8= + dependencies: + kind-of "^3.0.2" + +is-number@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" + integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU= + dependencies: + kind-of "^3.0.2" + +is-number@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff" + integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ== + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-plain-obj@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" + integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== + +is-plain-object@^2.0.3, is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + +is-posix-bracket@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" + integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q= + +is-primitive@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" + integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU= + +is-windows@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d" + integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA== + +isarray@1.0.0, isarray@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" + integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE= + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= + +isobject@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" + integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk= + dependencies: + isarray "1.0.0" + +isobject@^3.0.0, isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-tokens@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b" + integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls= + +js-yaml@3.14.0: + version "3.14.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482" + integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +jsesc@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" + integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s= + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + +json5@^0.5.1: + version "0.5.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821" + integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE= + +kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0: + version "3.2.2" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" + integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ= + dependencies: + is-buffer "^1.1.5" + +kind-of@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" + integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc= + dependencies: + is-buffer "^1.1.5" + +kind-of@^5.0.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d" + integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw== + +kind-of@^6.0.0, kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + +lazy-cache@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" + +locate-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e" + integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A== + dependencies: + p-locate "^3.0.0" + path-exists "^3.0.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash@^4.17.4: + version "4.17.20" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" + integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== + +log-symbols@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920" + integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA== + dependencies: + chalk "^4.0.0" + +longest@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" + +loose-envify@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +map-cache@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf" + integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8= + +map-visit@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f" + integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48= + dependencies: + object-visit "^1.0.0" + +math-random@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c" + integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A== + +micromatch@^2.1.5: + version "2.3.11" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" + integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU= + dependencies: + arr-diff "^2.0.0" + array-unique "^0.2.1" + braces "^1.8.2" + expand-brackets "^0.1.4" + extglob "^0.3.1" + filename-regex "^2.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.1" + kind-of "^3.0.2" + normalize-path "^2.0.1" + object.omit "^2.0.0" + parse-glob "^3.0.4" + regex-cache "^0.4.2" + +micromatch@^3.1.10: + version "3.1.10" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" + integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + braces "^2.3.1" + define-property "^2.0.2" + extend-shallow "^3.0.2" + extglob "^2.0.4" + fragment-cache "^0.2.1" + kind-of "^6.0.2" + nanomatch "^1.2.9" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.2" + +minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0, minimist@^1.2.5: + version "1.2.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" + integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== + +mixin-deep@^1.2.0: + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== + dependencies: + for-in "^1.0.2" + is-extendable "^1.0.1" + +mkdirp@^0.5.1: + version "0.5.5" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" + integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== + dependencies: + minimist "^1.2.5" + +mocha-qunit-ui@^0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/mocha-qunit-ui/-/mocha-qunit-ui-0.1.3.tgz#e3e1ff1dac33222b10cef681efd7f82664141ea9" + +mocha@^8.2.1: + version "8.2.1" + resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.2.1.tgz#f2fa68817ed0e53343d989df65ccd358bc3a4b39" + integrity sha512-cuLBVfyFfFqbNR0uUKbDGXKGk+UDFe6aR4os78XIrMQpZl/nv7JYHcvP5MFIAb374b2zFXsdgEGwmzMtP0Xg8w== + dependencies: + "@ungap/promise-all-settled" "1.1.2" + ansi-colors "4.1.1" + browser-stdout "1.3.1" + chokidar "3.4.3" + debug "4.2.0" + diff "4.0.2" + escape-string-regexp "4.0.0" + find-up "5.0.0" + glob "7.1.6" + growl "1.10.5" + he "1.2.0" + js-yaml "3.14.0" + log-symbols "4.0.0" + minimatch "3.0.4" + ms "2.1.2" + nanoid "3.1.12" + serialize-javascript "5.0.1" + strip-json-comments "3.1.1" + supports-color "7.2.0" + which "2.0.2" + wide-align "1.1.3" + workerpool "6.0.2" + yargs "13.3.2" + yargs-parser "13.1.2" + yargs-unparser "2.0.0" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +nan@^2.12.1: + version "2.14.2" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19" + integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ== + +nanoid@3.1.12: + version "3.1.12" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.12.tgz#6f7736c62e8d39421601e4a0c77623a97ea69654" + integrity sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A== + +nanomatch@^1.2.9: + version "1.2.13" + resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119" + integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA== + dependencies: + arr-diff "^4.0.0" + array-unique "^0.3.2" + define-property "^2.0.2" + extend-shallow "^3.0.2" + fragment-cache "^0.2.1" + is-windows "^1.0.2" + kind-of "^6.0.2" + object.pick "^1.3.0" + regex-not "^1.0.0" + snapdragon "^0.8.1" + to-regex "^3.0.1" + +normalize-path@^2.0.0, normalize-path@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" + integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk= + dependencies: + remove-trailing-separator "^1.0.1" + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +object-assign@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= + +object-copy@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c" + integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw= + dependencies: + copy-descriptor "^0.1.0" + define-property "^0.2.5" + kind-of "^3.0.3" + +object-visit@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb" + integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs= + dependencies: + isobject "^3.0.0" + +object.omit@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" + integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= + dependencies: + for-own "^0.1.4" + is-extendable "^0.1.1" + +object.pick@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" + integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c= + dependencies: + isobject "^3.0.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= + dependencies: + wrappy "1" + +os-homedir@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" + integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M= + +os-tmpdir@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= + +output-file-sync@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" + integrity sha1-0KM+7+YaIF+suQCS6CZZjVJFznY= + dependencies: + graceful-fs "^4.1.4" + mkdirp "^0.5.1" + object-assign "^4.1.0" + +p-limit@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4" + integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ== + dependencies: + p-limit "^2.0.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +parse-glob@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" + integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw= + dependencies: + glob-base "^0.3.0" + is-dotfile "^1.0.0" + is-extglob "^1.0.0" + is-glob "^2.0.0" + +pascalcase@^0.1.1: + version "0.1.1" + resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14" + integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ= + +path-exists@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" + integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU= + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0, path-is-absolute@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.2.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad" + integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg== + +posix-character-classes@^0.1.0: + version "0.1.1" + resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" + integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= + +preserve@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" + integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks= + +private@^0.1.6, private@^0.1.7, private@^0.1.8: + version "0.1.8" + resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" + +process-nextick-args@~2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" + integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== + +punycode@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" + +randomatic@^3.0.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed" + integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw== + dependencies: + is-number "^4.0.0" + kind-of "^6.0.0" + math-random "^1.0.1" + +randombytes@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" + integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== + dependencies: + safe-buffer "^5.1.0" + +readable-stream@^2.0.2: + version "2.3.7" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" + integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== + dependencies: + core-util-is "~1.0.0" + inherits "~2.0.3" + isarray "~1.0.0" + process-nextick-args "~2.0.0" + safe-buffer "~5.1.1" + string_decoder "~1.1.1" + util-deprecate "~1.0.1" + +readdirp@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525" + integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ== + dependencies: + graceful-fs "^4.1.11" + micromatch "^3.1.10" + readable-stream "^2.0.2" + +readdirp@~3.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e" + integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ== + dependencies: + picomatch "^2.2.1" + +regenerate@^1.2.1: + version "1.3.3" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f" + +regenerator-runtime@^0.10.5: + version "0.10.5" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= + +regenerator-runtime@^0.11.0: + version "0.11.1" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9" + integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg== + +regenerator-transform@^0.10.0: + version "0.10.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd" + dependencies: + babel-runtime "^6.18.0" + babel-types "^6.19.0" + private "^0.1.6" + +regex-cache@^0.4.2: + version "0.4.4" + resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd" + integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ== + dependencies: + is-equal-shallow "^0.1.3" + +regex-not@^1.0.0, regex-not@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c" + integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A== + dependencies: + extend-shallow "^3.0.2" + safe-regex "^1.1.0" + +regexpu-core@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240" + dependencies: + regenerate "^1.2.1" + regjsgen "^0.2.0" + regjsparser "^0.1.4" + +regjsgen@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7" + +regjsparser@^0.1.4: + version "0.1.5" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c" + dependencies: + jsesc "~0.5.0" + +remove-trailing-separator@^1.0.1: + version "1.1.0" + resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef" + integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8= + +repeat-element@^1.1.2: + version "1.1.3" + resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce" + integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g== + +repeat-string@^1.5.2, repeat-string@^1.6.1: + version "1.6.1" + resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" + integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= + +repeating@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" + integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo= + dependencies: + is-finite "^1.0.0" + +require-directory@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" + integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= + +require-main-filename@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b" + integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg== + +resolve-url@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a" + integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo= + +resolve@1.1.7: + version "1.1.7" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b" + +resolve@^1.1.6: + version "1.6.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.6.0.tgz#0fbd21278b27b4004481c395349e7aba60a9ff5c" + dependencies: + path-parse "^1.0.5" + +ret@~0.1.10: + version "0.1.15" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" + integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg== + +right-align@^0.1.1: + version "0.1.3" + resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" + dependencies: + align-text "^0.1.1" + +rimraf@^2.5.2: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + dependencies: + glob "^7.1.3" + +rollup-plugin-babel@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57" + dependencies: + babel-core "6" + babel-plugin-transform-es2015-classes "^6.9.0" + object-assign "^4.1.0" + rollup-pluginutils "^1.5.0" + +rollup-plugin-node-resolve@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.1.1.tgz#cbb783b0d15b02794d58915350b2f0d902b8ddc8" + dependencies: + browser-resolve "^1.11.0" + builtin-modules "^1.1.0" + resolve "^1.1.6" + +rollup-pluginutils@^1.5.0: + version "1.5.2" + resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408" + dependencies: + estree-walker "^0.2.1" + minimatch "^3.0.2" + +rollup@^0.41.6: + version "0.41.6" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a" + dependencies: + source-map-support "^0.4.0" + +safe-buffer@^5.1.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safe-regex@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e" + integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4= + dependencies: + ret "~0.1.10" + +sander@^0.5.0: + version "0.5.1" + resolved "https://registry.yarnpkg.com/sander/-/sander-0.5.1.tgz#741e245e231f07cafb6fdf0f133adfa216a502ad" + dependencies: + es6-promise "^3.1.2" + graceful-fs "^4.1.3" + mkdirp "^0.5.1" + rimraf "^2.5.2" + +serialize-javascript@5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4" + integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA== + dependencies: + randombytes "^2.1.0" + +set-blocking@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" + +set-value@^2.0.0, set-value@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b" + integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw== + dependencies: + extend-shallow "^2.0.1" + is-extendable "^0.1.1" + is-plain-object "^2.0.3" + split-string "^3.0.1" + +slash@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55" + integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU= + +snapdragon-node@^2.0.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b" + integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw== + dependencies: + define-property "^1.0.0" + isobject "^3.0.0" + snapdragon-util "^3.0.1" + +snapdragon-util@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2" + integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ== + dependencies: + kind-of "^3.2.0" + +snapdragon@^0.8.1: + version "0.8.2" + resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d" + integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg== + dependencies: + base "^0.11.1" + debug "^2.2.0" + define-property "^0.2.5" + extend-shallow "^2.0.1" + map-cache "^0.2.2" + source-map "^0.5.6" + source-map-resolve "^0.5.0" + use "^3.1.0" + +sorcery@^0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/sorcery/-/sorcery-0.10.0.tgz#8ae90ad7d7cb05fc59f1ab0c637845d5c15a52b7" + dependencies: + buffer-crc32 "^0.2.5" + minimist "^1.2.0" + sander "^0.5.0" + sourcemap-codec "^1.3.0" + +source-map-resolve@^0.5.0: + version "0.5.3" + resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" + integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw== + dependencies: + atob "^2.1.2" + decode-uri-component "^0.2.0" + resolve-url "^0.2.1" + source-map-url "^0.4.0" + urix "^0.1.0" + +source-map-support@^0.4.0, source-map-support@^0.4.15: + version "0.4.18" + resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f" + dependencies: + source-map "^0.5.6" + +source-map-url@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3" + integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM= + +source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= + +sourcemap-codec@^1.3.0: + version "1.4.1" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz#c8fd92d91889e902a07aee392bdd2c5863958ba2" + +split-string@^3.0.1, split-string@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2" + integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw== + dependencies: + extend-shallow "^3.0.0" + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= + +static-extend@^0.1.1: + version "0.1.2" + resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" + integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY= + dependencies: + define-property "^0.2.5" + object-copy "^0.1.0" + +"string-width@^1.0.2 || 2": + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +string-width@^3.0.0, string-width@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" + integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w== + dependencies: + emoji-regex "^7.0.1" + is-fullwidth-code-point "^2.0.0" + strip-ansi "^5.1.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8= + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8= + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-json-comments@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@7.2.0, supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc= + +to-fast-properties@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" + integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc= + +to-object-path@^0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af" + integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68= + dependencies: + kind-of "^3.0.2" + +to-regex-range@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38" + integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg= + dependencies: + is-number "^3.0.0" + repeat-string "^1.6.1" + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +to-regex@^3.0.1, to-regex@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce" + integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw== + dependencies: + define-property "^2.0.2" + extend-shallow "^3.0.2" + regex-not "^1.0.2" + safe-regex "^1.1.0" + +trim-right@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" + integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM= + +typescript@^2.8.1: + version "2.8.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.1.tgz#6160e4f8f195d5ba81d4876f9c0cc1fbc0820624" + +uglify-js@^2.8.14: + version "2.8.29" + resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" + dependencies: + source-map "~0.5.1" + yargs "~3.10.0" + optionalDependencies: + uglify-to-browserify "~1.0.0" + +uglify-to-browserify@~1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" + +union-value@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847" + integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg== + dependencies: + arr-union "^3.1.0" + get-value "^2.0.6" + is-extendable "^0.1.1" + set-value "^2.0.1" + +unset-value@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559" + integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk= + dependencies: + has-value "^0.3.1" + isobject "^3.0.0" + +urix@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" + integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI= + +use@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f" + integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ== + +user-home@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" + integrity sha1-K1viOjK2Onyd640PKNSFcko98ZA= + +util-deprecate@~1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" + integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= + +v8flags@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" + integrity sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ= + dependencies: + user-home "^1.1.1" + +which-module@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" + integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho= + +which@2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +wide-align@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457" + integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA== + dependencies: + string-width "^1.0.2 || 2" + +window-size@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" + +wordwrap@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" + +workerpool@6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.0.2.tgz#e241b43d8d033f1beb52c7851069456039d1d438" + integrity sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q== + +wrap-ansi@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09" + integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q== + dependencies: + ansi-styles "^3.2.0" + string-width "^3.0.0" + strip-ansi "^5.0.0" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= + +y18n@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" + integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== + +yargs-parser@13.1.2, yargs-parser@^13.1.2: + version "13.1.2" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38" + integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg== + dependencies: + camelcase "^5.0.0" + decamelize "^1.2.0" + +yargs-unparser@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb" + integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA== + dependencies: + camelcase "^6.0.0" + decamelize "^4.0.0" + flat "^5.0.2" + is-plain-obj "^2.1.0" + +yargs@13.3.2: + version "13.3.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd" + integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw== + dependencies: + cliui "^5.0.0" + find-up "^3.0.0" + get-caller-file "^2.0.1" + require-directory "^2.1.1" + require-main-filename "^2.0.0" + set-blocking "^2.0.0" + string-width "^3.0.0" + which-module "^2.0.0" + y18n "^4.0.0" + yargs-parser "^13.1.2" + +yargs@~3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" + dependencies: + camelcase "^1.0.2" + cliui "^2.1.0" + decamelize "^1.0.0" + window-size "0.1.0" + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== diff --git a/tools/ui/node_modules/uri-template-matcher/LICENSE b/tools/ui/node_modules/uri-template-matcher/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..1e85c344f0ce6621b49293c01b4fab313bdce1c0 --- /dev/null +++ b/tools/ui/node_modules/uri-template-matcher/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Paolo Ricciuti + +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/uri-template-matcher/README.md b/tools/ui/node_modules/uri-template-matcher/README.md new file mode 100644 index 0000000000000000000000000000000000000000..51f516aa5912c4205df51d5eeecc31f37e6f4b62 --- /dev/null +++ b/tools/ui/node_modules/uri-template-matcher/README.md @@ -0,0 +1,459 @@ +# URI Template Matcher + +A lightweight URI template library based on RFC 6570 that supports both matching URIs against templates to extract parameters and expanding templates with variables to generate URIs. + +## Installation + +```bash +npm install uri-template-matcher +``` +```bash +pnpm add uri-template-matcher +``` + +## Usage + +### Basic Usage + +```javascript +import { UriTemplateMatcher } from 'uri-template-matcher'; + +const matcher = new UriTemplateMatcher(); + +// Register URI templates +matcher.add('/users/{id}'); +matcher.add('/posts/{postId}/comments/{commentId}'); + +// Match URIs and extract parameters +const result = matcher.match('/users/123'); +console.log(result); +// Output: { template: '/users/{id}', params: { id: '123' } } + +const result2 = matcher.match('/posts/456/comments/789'); +console.log(result2); +// Output: { +// template: '/posts/{postId}/comments/{commentId}', +// params: { postId: '456', commentId: '789' } +// } +``` + +### Working with Multiple Templates + +```javascript +const matcher = new UriTemplateMatcher(); + +// Add multiple templates +matcher.add('/api/users/{id}'); +matcher.add('/api/posts/{id}'); +matcher.add('/api/health'); + +// The matcher returns the first matching template +const userMatch = matcher.match('/api/users/123'); +console.log(userMatch); +// Output: { template: '/api/users/{id}', params: { id: '123' } } + +const healthMatch = matcher.match('/api/health'); +console.log(healthMatch); +// Output: { template: '/api/health', params: {} } + +// No match returns null +const noMatch = matcher.match('/api/unknown'); +console.log(noMatch); // Output: null +``` + +### URL Encoding Support + +The matcher automatically handles URL encoding and decoding: + +```javascript +const matcher = new UriTemplateMatcher(); +matcher.add('/search/{query}'); + +const result = matcher.match('/search/hello%20world'); +console.log(result); +// Output: { template: '/search/{query}', params: { query: 'hello world' } } +``` + +### RFC 6570 Level 2 - Reserved String Expansion + +```javascript +const matcher = new UriTemplateMatcher(); + +// Reserved expansion with '+' operator +matcher.add('/files/{+path}'); +const result = matcher.match('/files/docs/readme.txt'); +console.log(result); +// Output: { template: '/files/{+path}', params: { path: 'docs/readme.txt' } } + +// Fragment expansion with '#' operator +matcher.add('/page#{section}'); +const fragmentResult = matcher.match('/page#introduction'); +console.log(fragmentResult); +// Output: { template: '/page#{section}', params: { section: 'introduction' } } +``` + +### RFC 6570 Level 3 - Advanced Operators + +```javascript +const matcher = new UriTemplateMatcher(); + +// Dot notation +matcher.add('/files{.format}'); +console.log(matcher.match('/files.json')); +// Output: { template: '/files{.format}', params: { format: 'json' } } + +// Path segments +matcher.add('/api{/version}/users'); +console.log(matcher.match('/api/v1/users')); +// Output: { template: '/api{/version}/users', params: { version: 'v1' } } + +// Query parameters +matcher.add('/search{?q}'); +console.log(matcher.match('/search?q=test')); +// Output: { template: '/search{?q}', params: { q: 'test' } } + +// Multiple query parameters +matcher.add('/search{?q,limit}'); +console.log(matcher.match('/search?q=test&limit=10')); +// Output: { template: '/search{?q,limit}', params: { q: 'test', limit: '10' } } + +// Query continuation +matcher.add('/search?type=user{&q}'); +console.log(matcher.match('/search?type=user&q=john')); +// Output: { template: '/search?type=user{&q}', params: { q: 'john' } } + +// Semicolon parameters +matcher.add('/api{;version}'); +console.log(matcher.match('/api;version=v1')); +// Output: { template: '/api{;version}', params: { version: 'v1' } } +``` + +### RFC 6570 Level 4 - Value Modifiers + +```javascript +const matcher = new UriTemplateMatcher(); + +// Prefix modifiers +matcher.add('/api/{name:3}'); +console.log(matcher.match('/api/toolong')); +// Output: { template: '/api/{name:3}', params: { name: 'too' } } + +// Explode modifiers with lists +matcher.add('/tags{.tags*}'); +console.log(matcher.match('/tags.red.green.blue')); +// Output: { template: '/tags{.tags*}', params: { tags: ['red', 'green', 'blue'] } } + +// Explode modifiers with query parameters +matcher.add('/search{?filters*}'); +console.log(matcher.match('/search?color=red&size=large')); +// Output: { template: '/search{?filters*}', params: { filters: ['color=red', 'size=large'] } } +``` + +### Managing Templates + +```javascript +const matcher = new UriTemplateMatcher(); + +// Add templates +matcher.add('/users/{id}'); +matcher.add('/posts/{id}'); + +// Get all registered templates +console.log(matcher.all()); +// Output: ['/users/{id}', '/posts/{id}'] + +// Clear all templates +matcher.clear(); +console.log(matcher.all()); +// Output: [] +``` + +### Real-World Examples + +#### REST API Routing + +```javascript +const matcher = new UriTemplateMatcher(); + +// Register API endpoints +matcher.add('/api/v1/users/{id}'); +matcher.add('/api/v1/users/{id}/posts'); +matcher.add('/api/v1/posts/{postId}/comments/{commentId}'); + +// Route incoming requests +function routeRequest(path) { + const match = matcher.match(path); + + if (!match) { + return { status: 404, message: 'Not Found' }; + } + + return { + template: match.template, + params: match.params, + status: 200 + }; +} + +console.log(routeRequest('/api/v1/users/123')); +// Output: { template: '/api/v1/users/{id}', params: { id: '123' }, status: 200 } +``` + +#### GitHub-style URLs + +```javascript +const matcher = new UriTemplateMatcher(); +matcher.add('/repos/{owner}/{repo}/issues/{issue_number}'); + +const match = matcher.match('/repos/octocat/Hello-World/issues/1'); +console.log(match); +// Output: { +// template: '/repos/{owner}/{repo}/issues/{issue_number}', +// params: { +// owner: 'octocat', +// repo: 'Hello-World', +// issue_number: '1' +// } +// } +``` + +#### File System Paths + +```javascript +const matcher = new UriTemplateMatcher(); +matcher.add('file:///{+path}'); + +const match = matcher.match('file:///home/user/documents/file.txt'); +console.log(match); +// Output: { +// template: 'file:///{+path}', +// params: { path: 'home/user/documents/file.txt' } +// } +``` + +## URI Template Expansion + +In addition to matching URIs against templates, this library also supports expanding URI templates with variables according to RFC 6570. + +### Basic Expansion + +```javascript +import { UriTemplateExpander } from 'uri-template-matcher'; + +const expander = new UriTemplateExpander('/users/{id}'); +const uri = expander.expand({ id: '123' }); +console.log(uri); +// Output: '/users/123' +``` + +### Expansion with Multiple Variables + +```javascript +const expander = new UriTemplateExpander('/posts/{postId}/comments/{commentId}'); +const uri = expander.expand({ postId: '456', commentId: '789' }); +console.log(uri); +// Output: '/posts/456/comments/789' +``` + +### Reserved String Expansion + +```javascript +const expander = new UriTemplateExpander('/files/{+path}'); +const uri = expander.expand({ path: 'docs/readme.txt' }); +console.log(uri); +// Output: '/files/docs/readme.txt' +``` + +### Fragment Expansion + +```javascript +const expander = new UriTemplateExpander('/page#{section}'); +const uri = expander.expand({ section: 'introduction' }); +console.log(uri); +// Output: '/page#introduction' +``` + +### Query Parameter Expansion + +```javascript +// Single query parameter +const expander1 = new UriTemplateExpander('/search{?q}'); +console.log(expander1.expand({ q: 'test' })); +// Output: '/search?q=test' + +// Multiple query parameters +const expander2 = new UriTemplateExpander('/search{?q,limit}'); +console.log(expander2.expand({ q: 'test', limit: '10' })); +// Output: '/search?q=test&limit=10' + +// Query continuation +const expander3 = new UriTemplateExpander('/search?type=user{&q}'); +console.log(expander3.expand({ q: 'john' })); +// Output: '/search?type=user&q=john' +``` + +### Path and Dot Expansion + +```javascript +// Dot notation +const expander1 = new UriTemplateExpander('/files{.format}'); +console.log(expander1.expand({ format: 'json' })); +// Output: '/files.json' + +// Path segments +const expander2 = new UriTemplateExpander('/api{/version}/users'); +console.log(expander2.expand({ version: 'v1' })); +// Output: '/api/v1/users' +``` + +### Value Modifiers + +```javascript +// Prefix modifiers +const expander1 = new UriTemplateExpander('/api/{name:3}'); +console.log(expander1.expand({ name: 'toolong' })); +// Output: '/api/too' + +// Explode modifiers with arrays +const expander2 = new UriTemplateExpander('/tags{.tags*}'); +console.log(expander2.expand({ tags: ['red', 'green', 'blue'] })); +// Output: '/tags.red.green.blue' + +// Explode modifiers with objects +const expander3 = new UriTemplateExpander('/search{?filters*}'); +console.log(expander3.expand({ filters: { color: 'red', size: 'large' } })); +// Output: '/search?color=red&size=large' +``` + +### Working with Complex Variables + +```javascript +const expander = new UriTemplateExpander('/search{?q,filters*}'); +const uri = expander.expand({ + q: 'uri templates', + filters: { + category: 'technology', + lang: 'en' + } +}); +console.log(uri); +// Output: '/search?q=uri%20templates&category=technology&lang=en' +``` + +### Undefined Variables + +Variables that are undefined, null, or empty arrays/objects are ignored: + +```javascript +const expander = new UriTemplateExpander('/search{?q,limit,offset}'); +const uri = expander.expand({ q: 'test' }); // limit and offset are undefined +console.log(uri); +// Output: '/search?q=test' +``` + +### Using the Expand Function Directly + +You can also use the expand function directly without creating an instance: + +```javascript +import { expand_template } from 'uri-template-matcher'; + +const uri = expand_template('/users/{id}', { id: '123' }); +console.log(uri); +// Output: '/users/123' +``` + +## API Reference + +### Class: UriTemplateMatcher + +#### Constructor + +```javascript +new UriTemplateMatcher() +``` + +Creates a new UriTemplateMatcher instance. + +#### Methods + +##### `add(template: string): void` + +Adds a URI template to the matcher. + +- `template` - The URI template string to add +- Throws `Error` if template is invalid + +##### `match(uri: string): MatchResult | null` + +Matches a URI against all registered templates. + +- `uri` - The URI to match +- Returns `MatchResult` if a match is found, `null` otherwise +- Throws `Error` if URI is invalid + +##### `clear(): void` + +Clears all registered templates. + +##### `all(): string[]` + +Returns an array of all registered template strings. + +### Class: UriTemplateExpander + +#### Constructor + +```javascript +new UriTemplateExpander(template: string) +``` + +Creates a new UriTemplateExpander instance. + +- `template` - The URI template string to use for expansion +- Throws `Error` if template is invalid + +#### Methods + +##### `expand(variables: Record): string` + +Expands the template with the given variables. + +- `variables` - Object containing variable names and values +- Returns the expanded URI string +- Throws `Error` if expansion fails + +### Functions + +##### `expand_template(template: string, variables: Record): string` + +Expands a URI template with given variables. + +- `template` - The URI template string to expand +- `variables` - Object containing variable names and values +- Returns the expanded URI string +- Throws `Error` if template is invalid or expansion fails + +### Types + +#### MatchResult + +```typescript +interface MatchResult { + template: string; // The matched template + params: Record; // Extracted parameters +} +``` + +## RFC 6570 Compliance + +This library implements URI Template matching and expansion based on RFC 6570 with support for: + +- **Level 1**: Simple string expansion +- **Level 2**: Reserved string expansion (`+`) and fragment expansion (`#`) +- **Level 3**: Multiple variable expansion with operators (`.`, `/`, `;`, `?`, `&`) +- **Level 4**: Value modifiers including prefix (`:n`) and explode (`*`) modifiers + +## License + +MIT diff --git a/tools/ui/node_modules/uri-template-matcher/package.json b/tools/ui/node_modules/uri-template-matcher/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1f3066c3aa8ed3678ceaf9392450785e62fc9e52 --- /dev/null +++ b/tools/ui/node_modules/uri-template-matcher/package.json @@ -0,0 +1,56 @@ +{ + "name": "uri-template-matcher", + "version": "1.1.2", + "description": "A lightweight URI template matcher based on RFC 6570", + "repository": { + "type": "git", + "url": "git+https://github.com/paoloricciuti/uri-template-matcher.git" + }, + "type": "module", + "main": "./src/index.js", + "types": "./src/index.d.ts", + "files": [ + "src/*" + ], + "exports": { + ".": { + "types": "./src/index.d.ts", + "import": "./src/index.js", + "default": "./src/index.js" + } + }, + "keywords": [ + "uri", + "template", + "matcher", + "rfc6570", + "routing" + ], + "author": "", + "license": "ISC", + "devDependencies": { + "@changesets/cli": "^2.29.5", + "@eslint/js": "^9.30.1", + "@types/node": "^24.0.12", + "@typescript-eslint/eslint-plugin": "^8.36.0", + "@typescript-eslint/parser": "^8.36.0", + "eslint": "^9.30.1", + "eslint-config-prettier": "^10.1.5", + "eslint-plugin-prettier": "^5.5.1", + "prettier": "^3.6.2", + "publint": "^0.3.12", + "typescript": "^5.8.3", + "vitest": "^3.2.4" + }, + "scripts": { + "test": "vitest", + "test:coverage": "vitest --coverage", + "check": "pnpm typecheck && pnpm lint && pnpm format:check && npx publint", + "typecheck": "tsc --noEmit", + "lint": "eslint src test", + "lint:fix": "eslint src test --fix", + "format": "prettier --write src test", + "format:check": "prettier --check src test", + "release": "changeset publish" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/uri-template-matcher/src/expander.js b/tools/ui/node_modules/uri-template-matcher/src/expander.js new file mode 100644 index 0000000000000000000000000000000000000000..1118b82efdb6ecb77e79f6f319dd66d87e3bbc7f --- /dev/null +++ b/tools/ui/node_modules/uri-template-matcher/src/expander.js @@ -0,0 +1,387 @@ +/** + * @fileoverview URI template expander implementation + */ + +import { parse_template } from './parser.js'; + +/** + * Expand a URI template with given variables + * @param {string} template - The URI template to expand + * @param {Record} variables - Variables to substitute + * @returns {string} Expanded URI + */ +export function expand_template(template, variables) { + try { + const parsed = parse_template(template); + let result = ''; + + for (const part of parsed.parts) { + if (part.type === 'literal') { + result += part.value; + } else if (part.type === 'expression') { + result += expand_expression(part, variables); + } + } + + return result; + } catch (error) { + throw new Error( + `Failed to expand template: ${error instanceof Error ? error.message : error}`, + ); + } +} + +/** + * Expand a template expression + * @param {import('./types.js').ExpressionPart} expression + * @param {Record} variables + * @returns {string} + */ +function expand_expression(expression, variables) { + const { operator, expressions } = expression; + const values = []; + + for (const varSpec of expressions) { + const result = get_variable_value(varSpec, variables); + if (result !== undefined) { + values.push(result); + } + } + + if (values.length === 0) { + return ''; + } + + return format_values(operator || '', values); +} + +/** + * Get the processed value for a variable specification + * @param {import('./types.js').TemplateExpression} varSpec + * @param {Record} variables + * @returns {{name: string, value: any, explode?: boolean} | undefined} + */ +function get_variable_value(varSpec, variables) { + const { name, prefix, explode } = varSpec; + const value = variables[name]; + + if (value === undefined || value === null) { + return undefined; + } + + // Handle empty arrays and objects - they should be treated as undefined + if (Array.isArray(value) && value.length === 0) { + return undefined; + } + if ( + typeof value === 'object' && + value !== null && + Object.keys(value).length === 0 + ) { + return undefined; + } + + let processedValue = value; + + if (typeof value === 'string') { + if (prefix && prefix > 0) { + processedValue = value.substring(0, prefix); + } else { + processedValue = value; + } + } else if (Array.isArray(value)) { + processedValue = value; + } else if (typeof value === 'object') { + processedValue = value; + } else { + processedValue = String(value); + } + + return { name, value: processedValue, explode }; +} + +/** + * Format values according to the operator + * @param {string} operator + * @param {{name: string, value: any, explode?: boolean}[]} values + * @returns {string} + */ +function format_values(operator, values) { + switch (operator) { + case '': + return values + .map((v) => format_value(v.value, '', v.explode)) + .join(','); + case '+': + return values + .map((v) => format_value(v.value, '+', v.explode)) + .join(','); + case '#': + return ( + '#' + + values + .map((v) => format_value(v.value, '#', v.explode)) + .join(',') + ); + case '.': { + const dot_values = values.map((v) => + format_value(v.value, '.', v.explode), + ); + // For dot expansion, empty values still contribute dots + return dot_values.length > 0 ? '.' + dot_values.join('.') : ''; + } + case '/': { + const path_values = values.map((v) => + format_value(v.value, '/', v.explode), + ); + // For path expansion, empty values still contribute slashes + return path_values.length > 0 ? '/' + path_values.join('/') : ''; + } + case ';': + return values + .map( + (v) => + ';' + + format_named_value(v.name, v.value, ';', v.explode), + ) + .join(''); + case '?': + return ( + '?' + + values + .map((v) => + format_named_value(v.name, v.value, '?', v.explode), + ) + .join('&') + ); + case '&': + return values + .map( + (v) => + '&' + + format_named_value(v.name, v.value, '&', v.explode), + ) + .join(''); + default: + return values + .map((v) => format_value(v.value, '', v.explode)) + .join(','); + } +} + +/** + * Format a single value + * @param {any} value + * @param {string} operator + * @param {boolean} [explode] + * @returns {string} + */ +function format_value(value, operator, explode) { + if (typeof value === 'string') { + // For empty strings in certain operators, we need to preserve the separator + if (value === '' && (operator === '.' || operator === '/')) { + return ''; // Empty value, but we'll handle separator in the join logic + } + return encode_value(value, operator); + } + + if (Array.isArray(value)) { + if (value.length === 0) { + // Empty arrays should not disappear entirely for certain operators + return ''; + } + if (explode) { + // For exploded arrays, the separator depends on the operator + if (operator === '.') { + return value + .map((v) => encode_value(String(v), operator)) + .join('.'); + } else if (operator === '/') { + return value + .map((v) => encode_value(String(v), operator)) + .join('/'); + } + } + return value.map((v) => encode_value(String(v), operator)).join(','); + } + + if (typeof value === 'object') { + if (Object.keys(value).length === 0) { + return ''; // Empty objects expand to empty string + } + if (explode) { + // For exploded objects, the format depends on the operator + if (operator === '' || operator === '+' || operator === '#') { + // Simple expansion - key=value pairs separated by commas + return Object.entries(value) + .map( + ([k, v]) => + `${encode_value(k, operator)}=${encode_value(String(v), operator)}`, + ) + .join(','); + } else if (operator === '.') { + // Dot expansion - key=value pairs separated by dots + return Object.entries(value) + .map( + ([k, v]) => + `${encode_value(k, operator)}=${encode_value(String(v), operator)}`, + ) + .join('.'); + } else if (operator === '/') { + // Path expansion - key=value pairs separated by slashes + return Object.entries(value) + .map( + ([k, v]) => + `${encode_value(k, operator)}=${encode_value(String(v), operator)}`, + ) + .join('/'); + } + // For other operators, handled in format_named_value + return Object.entries(value) + .map( + ([k, v]) => + `${encode_value(k, operator)}=${encode_value(String(v), operator)}`, + ) + .join(','); + } + // Non-exploded objects: key,value,key,value... + return Object.entries(value) + .map( + ([k, v]) => + `${encode_value(k, operator)},${encode_value(String(v), operator)}`, + ) + .join(','); + } + + return encode_value(String(value), operator); +} + +/** + * Format a named value (for query parameters) + * @param {string} name + * @param {any} value + * @param {string} operator + * @param {boolean} [explode] + * @returns {string} + */ +function format_named_value(name, value, operator, explode) { + // For query-style operators, use the variable name as-is if it's already encoded + // Otherwise encode it appropriately + let encoded_name = name; + if (operator === '?' || operator === '&') { + // Only encode if it's not already encoded (check for % pattern) + if (!/(%[0-9A-Fa-f]{2})/.test(name)) { + encoded_name = encodeURIComponent(name); + } + } else { + encoded_name = encode_value(name, operator); + } + + if (typeof value === 'string') { + if (value === '') { + return operator === ';' ? encoded_name : `${encoded_name}=`; + } + return `${encoded_name}=${encode_value(value, operator)}`; + } + + if (Array.isArray(value)) { + if (value.length === 0) { + // For empty arrays, some operators produce output, others don't + if (operator === '?' || operator === '&') { + return `${encoded_name}=`; + } else if (operator === ';') { + return encoded_name; + } + return ''; + } + if (explode) { + return value + .map( + (v) => + `${encoded_name}=${encode_value(String(v), operator)}`, + ) + .join(operator === ';' ? ';' : '&'); + } + return `${encoded_name}=${value.map((v) => encode_value(String(v), operator)).join(',')}`; + } + + if (typeof value === 'object') { + if (Object.keys(value).length === 0) { + // For empty objects, some operators produce output, others don't + if (operator === '?' || operator === '&') { + return `${encoded_name}=`; + } else if (operator === ';') { + return encoded_name; + } + return ''; + } + if (explode) { + return Object.entries(value) + .map(([k, v]) => { + let encoded_key = k; + if (operator === '?' || operator === '&') { + // Only encode if it's not already encoded (check for % pattern) + if (!/(%[0-9A-Fa-f]{2})/.test(k)) { + encoded_key = encodeURIComponent(k); + } + } else { + encoded_key = encode_value(k, operator); + } + return `${encoded_key}=${encode_value(String(v), operator)}`; + }) + .join(operator === ';' ? ';' : '&'); + } + return `${encoded_name}=${Object.entries(value) + .map( + ([k, v]) => + `${encode_value(k, operator)},${encode_value(String(v), operator)}`, + ) + .join(',')}`; + } + + return value === '' + ? encoded_name + : `${encoded_name}=${encode_value(String(value), operator)}`; +} + +/** + * Encode a value based on the operator + * @param {string} value + * @param {string} operator + * @returns {string} + */ +function encode_value(value, operator) { + if (operator === '+' || operator === '#') { + // Reserved string expansion - allow reserved characters per RFC 6570 + // Keep: : / ? # [ ] @ ! $ & ' ( ) * + , ; = + // But encode spaces and percent signs that aren't part of percent-encoded sequences + return value + .replace(/ /g, '%20') + .replace(/%(?![0-9A-Fa-f]{2})/g, '%25'); // Encode lone % characters + } + // Default encoding - encode everything except unreserved characters + // Note: encodeURIComponent doesn't encode ! but RFC 6570 requires it for simple expansion + return encodeURIComponent(value).replace(/!/g, '%21'); +} + +/** + * URI Template Expander class + */ +export class UriTemplateExpander { + /** + * Create a new UriTemplateExpander instance + * @param {string} template - The URI template string + */ + constructor(template) { + this.template = template; + } + + /** + * Expand the template with given variables + * @param {Record} variables - Variables to substitute + * @returns {string} Expanded URI + */ + expand(variables) { + return expand_template(this.template, variables); + } +} diff --git a/tools/ui/node_modules/uri-template-matcher/src/index.d.ts b/tools/ui/node_modules/uri-template-matcher/src/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e07f6eebd86c7c11ba39a0f92632474f368e3b94 --- /dev/null +++ b/tools/ui/node_modules/uri-template-matcher/src/index.d.ts @@ -0,0 +1,116 @@ +/** + * Type definitions for URI template matcher library + */ + +/** + * Template expression with variable name and modifiers + */ +export interface TemplateExpression { + /** Variable name */ + name: string; + /** Prefix length modifier (e.g., :3) */ + prefix?: number; + /** Whether to explode arrays/objects */ + explode: boolean; +} + +/** + * Literal part of a template + */ +export interface LiteralPart { + /** Part type */ + type: 'literal'; + /** Literal text value */ + value: string; +} + +/** + * Expression part of a template + */ +export interface ExpressionPart { + /** Part type */ + type: 'expression'; + /** Array of variable expressions */ + expressions: TemplateExpression[]; + /** RFC 6570 operator (+, #, ., /, ;, ?, &) */ + operator?: string; +} + +/** + * Union type for template parts + */ +export type TemplatePart = LiteralPart | ExpressionPart; + +/** + * Parsed template representation + */ +export interface ParsedTemplate { + /** Original template string */ + template: string; + /** Parsed template parts */ + parts: TemplatePart[]; +} + +/** + * Match result containing template and extracted parameters + */ +export interface MatchResult { + /** Matched template string */ + template: string; + /** Extracted parameters */ + params: Record; +} + +/** + * URI Template Matcher class for registering and matching URI templates + */ +export declare class UriTemplateMatcher { + /** + * Create a new UriTemplateMatcher instance + */ + constructor(); + + /** + * Add a URI template to the matcher + * @param template - The URI template string to add + * @throws {Error} If template is invalid + */ + add(template: string): void; + + /** + * Match a URI against all registered templates + * @param uri - The URI to match + * @returns Match result or null if no match found + * @throws {Error} If URI is invalid + */ + match(uri: string): MatchResult | null; + + /** + * Clear all registered templates + */ + clear(): void; + + /** + * Get all registered template strings + * @returns Array of template strings + */ + all(): string[]; +} + +/** + * URI Template Expander class + */ +export class UriTemplateExpander { + /** + * Create a new UriTemplateExpander instance + * @param {string} template - The URI template string + */ + constructor(template: string); + + /** + * Expand the template with given variables + * @param {Record} variables - Variables to substitute + * @returns {string} Expanded URI + */ + expand(variables: Record): string; +} diff --git a/tools/ui/node_modules/uri-template-matcher/src/index.js b/tools/ui/node_modules/uri-template-matcher/src/index.js new file mode 100644 index 0000000000000000000000000000000000000000..ab79281f34644eea050461fada8b4d719a43ca41 --- /dev/null +++ b/tools/ui/node_modules/uri-template-matcher/src/index.js @@ -0,0 +1,13 @@ +/** + * @fileoverview Main entry point for the URI template matcher library + */ + +export { UriTemplateMatcher } from './matcher.js'; +export { UriTemplateExpander } from './expander.js'; + +/** + * @typedef {import('./types.js').MatchResult} MatchResult + * @typedef {import('./types.js').ParsedTemplate} ParsedTemplate + * @typedef {import('./types.js').TemplateExpression} TemplateExpression + * @typedef {import('./types.js').TemplatePart} TemplatePart + */ diff --git a/tools/ui/node_modules/uri-template-matcher/src/matcher.js b/tools/ui/node_modules/uri-template-matcher/src/matcher.js new file mode 100644 index 0000000000000000000000000000000000000000..b1c66565cdb66f43f5f6cac709864e1f10fe4c78 --- /dev/null +++ b/tools/ui/node_modules/uri-template-matcher/src/matcher.js @@ -0,0 +1,88 @@ +/** + * @fileoverview Main UriTemplateMatcher class + */ + +import { match_uri, parse_template } from './parser.js'; + +/** + * @typedef {import('./types.js').MatchResult} MatchResult + * @typedef {import('./types.js').ParsedTemplate} ParsedTemplate + */ + +/** + * URI Template Matcher class for registering and matching URI templates + */ +export class UriTemplateMatcher { + /** + * Create a new UriTemplateMatcher instance + */ + constructor() { + /** @type {ParsedTemplate[]} */ + this.templates = []; + } + + /** + * Add a URI template to the matcher + * @param {string} template - The URI template string to add + * @throws {Error} If template is invalid + */ + add(template) { + if (typeof template !== 'string') { + throw new Error('Template must be a string'); + } + + // Empty template is valid - matches empty string + // But whitespace-only templates are invalid + if (template !== '' && template.trim() === '') { + throw new Error('Template cannot be empty'); + } + + try { + const parsed = parse_template(template); + this.templates.push(parsed); + } catch (error) { + throw new Error( + `Invalid template: ${template} - ${error instanceof Error ? error.message : String(error)}`, + ); + } + } + + /** + * Match a URI against all registered templates + * @param {string} uri - The URI to match + * @returns {MatchResult | null} Match result or null if no match found + * @throws {Error} If URI is invalid + */ + match(uri) { + if (typeof uri !== 'string') { + throw new Error('URI must be a string'); + } + + for (const template of this.templates) { + const params = match_uri(uri, template); + if (params !== null) { + return { + template: template.template, + params, + }; + } + } + + return null; + } + + /** + * Clear all registered templates + */ + clear() { + this.templates = []; + } + + /** + * Get all registered template strings + * @returns {string[]} Array of template strings + */ + all() { + return this.templates.map((t) => t.template); + } +} diff --git a/tools/ui/node_modules/uri-template-matcher/src/parser.js b/tools/ui/node_modules/uri-template-matcher/src/parser.js new file mode 100644 index 0000000000000000000000000000000000000000..a2e15efe5b18a066792a4e73c36cb4615818b6aa --- /dev/null +++ b/tools/ui/node_modules/uri-template-matcher/src/parser.js @@ -0,0 +1,706 @@ +/** + * @fileoverview URI template parser implementation without regex + */ + +/** + * @typedef {import('./types.js').ParsedTemplate} ParsedTemplate + * @typedef {import('./types.js').TemplateExpression} TemplateExpression + * @typedef {import('./types.js').TemplatePart} TemplatePart + * @typedef {import('./types.js').ExpressionPart} ExpressionPart + */ + +/** + * Parse a URI template string into its component parts + * @param {string} template - The URI template to parse + * @returns {ParsedTemplate} Parsed template representation + */ +export function parse_template(template) { + /** @type {TemplatePart[]} */ + const parts = []; + let current_literal = ''; + let i = 0; + + while (i < template.length) { + const char = template[i]; + + if (char === '{') { + // Found start of expression + if (current_literal) { + parts.push({ type: 'literal', value: current_literal }); + current_literal = ''; + } + + // Find the closing brace + const expression_start = i + 1; + let expression_end = expression_start; + let brace_count = 1; + + while (expression_end < template.length && brace_count > 0) { + if (template[expression_end] === '{') { + brace_count++; + } else if (template[expression_end] === '}') { + brace_count--; + } + expression_end++; + } + + if (brace_count > 0) { + throw new Error(`Unclosed expression in template: ${template}`); + } + + const expression_content = template.slice( + expression_start, + expression_end - 1, + ); + const parsed_expression = parse_expression(expression_content); + parts.push(parsed_expression); + + i = expression_end; + } else { + current_literal += char; + i++; + } + } + + if (current_literal) { + parts.push({ type: 'literal', value: current_literal }); + } + + return { template, parts }; +} + +/** + * Parse an expression content (without braces) + * @param {string} content - Expression content + * @returns {TemplatePart} Parsed expression part + */ +function parse_expression(content) { + if (!content.trim()) { + throw new Error('Empty expression'); + } + + // Check for operator prefix + const first_char = content[0]; + const operators = ['+', '#', '.', '/', ';', '?', '&']; + /** @type {string | undefined} */ + let operator = undefined; + let variables_part = content; + + if (operators.includes(first_char)) { + operator = first_char; + variables_part = content.slice(1); + } + + // Parse variable list + const variable_names = split_variables(variables_part); + const expressions = variable_names.map(parse_variable); + + return { + type: 'expression', + expressions, + operator, + }; +} + +/** + * Split variables by comma, handling nested structures + * @param {string} variables - Variables string + * @returns {string[]} Array of variable strings + */ +function split_variables(variables) { + /** @type {string[]} */ + const result = []; + let current = ''; + let i = 0; + + while (i < variables.length) { + const char = variables[i]; + + if (char === ',') { + if (current.trim()) { + result.push(current.trim()); + current = ''; + } + } else { + current += char; + } + i++; + } + + if (current.trim()) { + result.push(current.trim()); + } + + return result; +} + +/** + * Parse a single variable specification + * @param {string} variable - Variable string + * @returns {TemplateExpression} Parsed variable expression + */ +function parse_variable(variable) { + let name = variable; + /** @type {number | undefined} */ + let prefix = undefined; + let explode = false; + + // Check for explode modifier + if (name.endsWith('*')) { + explode = true; + name = name.slice(0, -1); + } + + // Check for prefix modifier + const colon_index = name.indexOf(':'); + if (colon_index !== -1) { + const prefix_str = name.slice(colon_index + 1); + prefix = parseInt(prefix_str, 10); + if (isNaN(prefix) || prefix < 0) { + throw new Error(`Invalid prefix length: ${prefix_str}`); + } + name = name.slice(0, colon_index); + } + + if (!name) { + throw new Error('Empty variable name'); + } + + return { name, prefix, explode }; +} + +/** + * Match a URI against a parsed template + * @param {string} uri - URI to match + * @param {ParsedTemplate} parsed_template - Parsed template + * @returns {Record | null} Extracted parameters or null + */ +export function match_uri(uri, parsed_template) { + /** @type {Record} */ + const params = {}; + + // Handle consecutive variables with backtracking + const result = match_parts(uri, 0, parsed_template.parts, 0, params); + + // Must match exactly - consume entire URI + if (!result || result.uri_index !== uri.length) { + return null; + } + + return params; +} + +/** + * Recursively match template parts with backtracking for consecutive variables + * @param {string} uri - URI to match + * @param {number} uri_index - Current position in URI + * @param {TemplatePart[]} parts - Template parts to match + * @param {number} part_index - Current template part index + * @param {Record} params - Parameters object + * @returns {{ uri_index: number } | null} Match result or null + */ +function match_parts(uri, uri_index, parts, part_index, params) { + // Base case: all parts matched + if (part_index >= parts.length) { + return { uri_index }; + } + + const part = parts[part_index]; + + if (part.type === 'literal') { + // Match literal text exactly + if (!uri.slice(uri_index).startsWith(part.value)) { + return null; + } + + return match_parts( + uri, + uri_index + part.value.length, + parts, + part_index + 1, + params, + ); + } else { + // Expression - try different boundaries + const next_part = parts[part_index + 1]; + + // Find all possible end boundaries for this expression + const boundaries = find_expression_boundaries( + uri, + uri_index, + next_part, + ); + + // Try boundaries in a way that favors the first variable getting more content + const sorted_boundaries = boundaries.sort((a, b) => { + // For consecutive variables, prioritize longer matches for the first variable + if ( + next_part && + next_part.type === 'expression' && + !next_part.operator + ) { + return b - a; // Try longer first + } + return a - b; // Try shorter first for other cases + }); + + for (const boundary of sorted_boundaries) { + const segment = uri.slice(uri_index, boundary); + const temp_params = { ...params }; + + const match_result = match_simple_expression( + segment, + part, + temp_params, + uri, + uri_index, + ); + + if (match_result) { + // Try to match the rest with this boundary + const rest_result = match_parts( + uri, + boundary, + parts, + part_index + 1, + temp_params, + ); + + if (rest_result) { + // Success! Update the original params + Object.assign(params, temp_params); + return rest_result; + } + } + } + + return null; + } +} + +/** + * Find possible boundaries for an expression + * @param {string} uri - URI to search + * @param {number} start_index - Start position + * @param {TemplatePart | undefined} next_part - Next template part + * @returns {number[]} Array of possible boundary positions + */ +function find_expression_boundaries(uri, start_index, next_part) { + /** @type {number[]} */ + const boundaries = []; + + if (next_part && next_part.type === 'literal') { + // Look for all occurrences of the next literal + let search_index = start_index; + while (search_index < uri.length) { + const found_index = uri.indexOf(next_part.value, search_index); + if (found_index === -1) break; + + boundaries.push(found_index); + search_index = found_index + 1; + } + + // If no boundaries found, this means no match is possible + if (boundaries.length === 0) { + return []; + } + } else if (next_part && next_part.type === 'expression') { + // Next part is another expression - need to find natural boundaries + // For consecutive variables, try different split points + const next_expr = /** @type {ExpressionPart} */ (next_part); + if (next_expr.operator === '.') { + // Look for dots as potential boundaries + for (let i = start_index; i < uri.length; i++) { + if (uri[i] === '.') { + boundaries.push(i); + } + } + // Also consider the end of the URI as a boundary for optional dot notation + boundaries.push(uri.length); + } else if (next_expr.operator === '/') { + // Look for slashes as potential boundaries + for (let i = start_index; i < uri.length; i++) { + if (uri[i] === '/') { + boundaries.push(i); + } + } + } else { + // For simple consecutive variables, try all possible split points + // Try shorter matches first for greedy matching + for (let i = start_index; i <= uri.length; i++) { + boundaries.push(i); + } + } + } else { + // No next literal - this is the last part, use the entire rest of the URI + boundaries.push(uri.length); + } + + return boundaries.sort((a, b) => a - b); +} + +/** + * Match a simple expression (no complex operators) + * @param {string} segment - URI segment to match + * @param {TemplatePart} expression - Expression part + * @param {Record} params - Parameters object + * @param {string} uri - Full URI + * @param {number} uri_index - Current URI index + * @returns {boolean} Whether the match was successful + */ +function match_simple_expression(segment, expression, params, uri, uri_index) { + if (expression.type !== 'expression') { + return false; + } + + const operator = expression.operator; + + // Handle different operators + switch (operator) { + case '+': + return handle_reserved_match(segment, expression, params); + case '#': + return handle_fragment_match(segment, expression, params); + case '.': + return handle_dot_match(segment, expression, params); + case '/': + return handle_path_match(segment, expression, params); + case ';': + return handle_semicolon_match(segment, expression, params); + case '?': + case '&': + return handle_query_match(segment, expression, params); + default: + return handle_simple_match( + segment, + expression, + params, + uri, + uri_index, + ); + } +} + +/** + * Handle fragment match (# operator) + * @param {string} segment - URI segment + * @param {TemplatePart} expression - Expression part + * @param {Record} params - Parameters object + * @returns {boolean} Whether the match was successful + */ +function handle_fragment_match(segment, expression, params) { + if (expression.type !== 'expression') { + return false; + } + + // Fragment expansion starts with #, so strip it + if (!segment.startsWith('#')) { + // If no fragment, all variables are undefined + for (const expr of expression.expressions) { + params[expr.name] = ''; + } + return segment === ''; + } + + const fragment_content = segment.slice(1); + + if (expression.expressions.length === 1) { + const expr = expression.expressions[0]; + let value = fragment_content; + + if (expr.prefix && value.length > expr.prefix) { + value = value.slice(0, expr.prefix); + } + + params[expr.name] = decodeURIComponent(value); + return true; + } else { + // Handle multiple variables in a single fragment expression + const values = fragment_content.split(','); + for (let i = 0; i < expression.expressions.length; i++) { + const expr = expression.expressions[i]; + let value = values[i] || ''; + + if (expr.prefix && value.length > expr.prefix) { + value = value.slice(0, expr.prefix); + } + + params[expr.name] = decodeURIComponent(value); + } + return true; + } +} + +/** + * Handle reserved string match (+ operator) + * @param {string} segment - URI segment + * @param {TemplatePart} expression - Expression part + * @param {Record} params - Parameters object + * @returns {boolean} Whether the match was successful + */ +function handle_reserved_match(segment, expression, params) { + if (expression.type !== 'expression') { + return false; + } + + if (expression.expressions.length === 1) { + const expr = expression.expressions[0]; + let value = segment; + + // Reserved expansion allows path separators + if (expr.prefix && value.length > expr.prefix) { + value = value.slice(0, expr.prefix); + } + + params[expr.name] = decodeURIComponent(value); + return true; + } else { + // Handle multiple variables in a single expression + const values = segment.split(','); + for (let i = 0; i < expression.expressions.length; i++) { + const expr = expression.expressions[i]; + let value = values[i] || ''; + + // Reserved expansion allows path separators + if (expr.prefix && value.length > expr.prefix) { + value = value.slice(0, expr.prefix); + } + + params[expr.name] = decodeURIComponent(value); + } + return true; + } +} + +/** + * Handle simple string match + * @param {string} segment - URI segment + * @param {TemplatePart} expression - Expression part + * @param {Record} params - Parameters object + * @param {string} uri - Full URI + * @param {number} uri_index - Current URI index + * @returns {boolean} Whether the match was successful + */ +function handle_simple_match(segment, expression, params, uri, uri_index) { + if (expression.type !== 'expression') { + return false; + } + + if (expression.expressions.length === 1) { + const expr = expression.expressions[0]; + let value = segment; + + // Simple variables should not contain path separators + if (value.includes('/')) { + return false; + } + + // Simple variables should not be empty when at the end of a URI (trailing slash scenario) + if ( + value === '' && + uri_index + segment.length === uri.length && + uri.endsWith('/') + ) { + return false; + } + + if (expr.prefix && value.length > expr.prefix) { + value = value.slice(0, expr.prefix); + } + + params[expr.name] = decodeURIComponent(value); + return true; + } else { + // Handle multiple variables in a single expression + const values = segment.split(','); + for (let i = 0; i < expression.expressions.length; i++) { + const expr = expression.expressions[i]; + let value = values[i] || ''; + + // Simple variables should not contain path separators + if (value.includes('/')) { + return false; + } + + if (expr.prefix && value.length > expr.prefix) { + value = value.slice(0, expr.prefix); + } + + params[expr.name] = decodeURIComponent(value); + } + return true; + } +} + +/** + * Handle dot notation match + * @param {string} segment - URI segment + * @param {TemplatePart} expression - Expression part + * @param {Record} params - Parameters object + * @returns {boolean} Whether the match was successful + */ +function handle_dot_match(segment, expression, params) { + if (expression.type !== 'expression') { + return false; + } + + // Handle empty segment for optional dot notation + if (segment === '') { + // Empty dot segment means all variables are undefined/empty + for (const expr of expression.expressions) { + params[expr.name] = ''; + } + return true; + } + + const clean_segment = segment.startsWith('.') ? segment.slice(1) : segment; + + if (expression.expressions.length === 1) { + const expr = expression.expressions[0]; + + if (expr.explode) { + // Split by dots for explode + const values = clean_segment.split('.'); + params[expr.name] = values.map((v) => decodeURIComponent(v)); + } else { + params[expr.name] = decodeURIComponent(clean_segment); + } + return true; + } else { + // Handle multiple variables in a single dot expression + const values = clean_segment.split('.'); + for (let i = 0; i < expression.expressions.length; i++) { + const expr = expression.expressions[i]; + let value = values[i] || ''; + + if (expr.prefix && value.length > expr.prefix) { + value = value.slice(0, expr.prefix); + } + + params[expr.name] = decodeURIComponent(value); + } + return true; + } +} + +/** + * Handle path match + * @param {string} segment - URI segment + * @param {TemplatePart} expression - Expression part + * @param {Record} params - Parameters object + * @returns {boolean} Whether the match was successful + */ +function handle_path_match(segment, expression, params) { + if (expression.type !== 'expression') { + return false; + } + + const clean_segment = segment.startsWith('/') ? segment.slice(1) : segment; + + if (expression.expressions.length === 1) { + const expr = expression.expressions[0]; + params[expr.name] = decodeURIComponent(clean_segment); + return true; + } else { + // Handle multiple variables in a single path expression + // For path expressions with multiple variables, they're comma-separated + const values = clean_segment.split(','); + for (let i = 0; i < expression.expressions.length; i++) { + const expr = expression.expressions[i]; + let value = values[i] || ''; + + if (expr.prefix && value.length > expr.prefix) { + value = value.slice(0, expr.prefix); + } + + params[expr.name] = decodeURIComponent(value); + } + return true; + } +} + +/** + * Handle semicolon match + * @param {string} segment - URI segment + * @param {TemplatePart} expression - Expression part + * @param {Record} params - Parameters object + * @returns {boolean} Whether the match was successful + */ +function handle_semicolon_match(segment, expression, params) { + if (expression.type !== 'expression') { + return false; + } + + const parts = segment.split(';').filter((p) => p); + + for (const part of parts) { + const eq_index = part.indexOf('='); + if (eq_index !== -1) { + const key = part.slice(0, eq_index); + const value = part.slice(eq_index + 1); + + const expr = expression.expressions.find((e) => e.name === key); + if (expr) { + params[expr.name] = decodeURIComponent(value); + } + } + } + + return true; +} + +/** + * Handle query match + * @param {string} segment - URI segment + * @param {TemplatePart} expression - Expression part + * @param {Record} params - Parameters object + * @returns {boolean} Whether the match was successful + */ +function handle_query_match(segment, expression, params) { + if (expression.type !== 'expression') { + return false; + } + + const clean_segment = segment.replace(/^[?&]/, ''); + + if (expression.expressions.length === 1) { + const expr = expression.expressions[0]; + + if (expr.explode) { + // Split by & for explode + const values = clean_segment.split('&'); + params[expr.name] = values.map((v) => decodeURIComponent(v)); + } else { + // Parse key=value pairs + const parts = clean_segment.split('&'); + for (const part of parts) { + const eq_index = part.indexOf('='); + if (eq_index !== -1) { + const key = part.slice(0, eq_index); + const value = part.slice(eq_index + 1); + + if (key === expr.name) { + params[expr.name] = decodeURIComponent(value); + } + } + } + } + } else { + // Multiple variables + const parts = clean_segment.split('&'); + for (const part of parts) { + const eq_index = part.indexOf('='); + if (eq_index !== -1) { + const key = part.slice(0, eq_index); + const value = part.slice(eq_index + 1); + + const expr = expression.expressions.find((e) => e.name === key); + if (expr) { + params[expr.name] = decodeURIComponent(value); + } + } + } + } + + return true; +} diff --git a/tools/ui/node_modules/uri-template-matcher/src/types.js b/tools/ui/node_modules/uri-template-matcher/src/types.js new file mode 100644 index 0000000000000000000000000000000000000000..79a0d7cb4669514998f9f422e5402506f5ca28d4 --- /dev/null +++ b/tools/ui/node_modules/uri-template-matcher/src/types.js @@ -0,0 +1,42 @@ +/** + * @fileoverview Type definitions for URI template matching + */ + +/** + * @typedef {Object} TemplateExpression + * @property {string} name - Variable name + * @property {number} [prefix] - Prefix length modifier (e.g., :3) + * @property {boolean} explode - Whether to explode arrays/objects + */ + +/** + * @typedef {Object} LiteralPart + * @property {'literal'} type - Part type + * @property {string} value - Literal text value + */ + +/** + * @typedef {Object} ExpressionPart + * @property {'expression'} type - Part type + * @property {TemplateExpression[]} expressions - Array of variable expressions + * @property {string} [operator] - RFC 6570 operator (+, #, ., /, ;, ?, &) + */ + +/** + * @typedef {LiteralPart | ExpressionPart} TemplatePart + */ + +/** + * @typedef {Object} ParsedTemplate + * @property {string} template - Original template string + * @property {TemplatePart[]} parts - Parsed template parts + */ + +/** + * @typedef {Object} MatchResult + * @property {string} template - Matched template string + * @property {Record} params - Extracted parameters + */ + +// Export empty object to make this a proper ES module +export {}; diff --git a/tools/ui/node_modules/url-join/.travis.yml b/tools/ui/node_modules/url-join/.travis.yml new file mode 100644 index 0000000000000000000000000000000000000000..7e2eb1fc64528006648c9e1d442dcd06cfe14c81 --- /dev/null +++ b/tools/ui/node_modules/url-join/.travis.yml @@ -0,0 +1,5 @@ +language: node_js +node_js: + - "5" + - "4" + - "0.12" \ No newline at end of file diff --git a/tools/ui/node_modules/url-join/CHANGELOG.md b/tools/ui/node_modules/url-join/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..83e22e43c23f9674b4d4ce97a9e343dc3abc7158 --- /dev/null +++ b/tools/ui/node_modules/url-join/CHANGELOG.md @@ -0,0 +1,88 @@ +## 4.0.0 - 2018-02-02 + + - Ignore empty string arguments and throw an exception for non-string. Closes #36, #18 ([da05242f381bfe1ae09d00b708cfdbdb93c1a85d](https://github.com/jfromaniello/url-join/commit/da05242f381bfe1ae09d00b708cfdbdb93c1a85d)), closes [#36](https://github.com/jfromaniello/url-join/issues/36) [#18](https://github.com/jfromaniello/url-join/issues/18) + + + +## 3.0.0 - 2018-01-12 + + - add new test ([d65d7c1696cb53b53ceabadf1a77917196967b4c](https://github.com/jfromaniello/url-join/commit/d65d7c1696cb53b53ceabadf1a77917196967b4c)) + - Fixed to handle the colon in non-protocol separation role in the first part. ([9212db75f805031a9cc06120b5dd08a6cdd805e4](https://github.com/jfromaniello/url-join/commit/9212db75f805031a9cc06120b5dd08a6cdd805e4)) + + + +## 2.0.5 - 2018-01-10 + + - revert to previous behavior #30 ([b6943343af7bd723cbca266388e84e036543577d](https://github.com/jfromaniello/url-join/commit/b6943343af7bd723cbca266388e84e036543577d)), closes [#30](https://github.com/jfromaniello/url-join/issues/30) + + + +## 2.0.4 - 2018-01-10 + + - fix bower.json ([9677895a4afe51d8a1d670980bc6fede71252e9a](https://github.com/jfromaniello/url-join/commit/9677895a4afe51d8a1d670980bc6fede71252e9a)) + + + +## 2.0.3 - 2018-01-09 + + - 2.0.3 ([7b7806b21cf81a3476e39ddb8a6f51272a276186](https://github.com/jfromaniello/url-join/commit/7b7806b21cf81a3476e39ddb8a6f51272a276186)) + - Added a test for simple paths for issue #21 ([be99b10a707b4d22aac015d19eb087fff46d4270](https://github.com/jfromaniello/url-join/commit/be99b10a707b4d22aac015d19eb087fff46d4270)), closes [#21](https://github.com/jfromaniello/url-join/issues/21) + - Added some new tests for cases that fail. ([f1afbd62c3149476a9ef099ba523e85fb4839732](https://github.com/jfromaniello/url-join/commit/f1afbd62c3149476a9ef099ba523e85fb4839732)) + - Passes all the tests with these changes. ([8cde667f400fa83efc7ed5c2437c7cb25c7d7600](https://github.com/jfromaniello/url-join/commit/8cde667f400fa83efc7ed5c2437c7cb25c7d7600)) + - The protocol slashes should be normalized also when the protocol is not alone in the first argument. ([0ce1239c60f7bbb625d4ccbf1fcf044f37488bd8](https://github.com/jfromaniello/url-join/commit/0ce1239c60f7bbb625d4ccbf1fcf044f37488bd8)) + + + +## 2.0.2 - 2017-05-18 + + - fix: remove consecutives slashes ([33639364ef186e257b8424620017b9d1ba225539](https://github.com/jfromaniello/url-join/commit/33639364ef186e257b8424620017b9d1ba225539)) + + + +## 2.0.1 - 2017-04-12 + + - update mocha and bower.json ([ebd3665028b2408d405f9a31f8479e91c4ef52c1](https://github.com/jfromaniello/url-join/commit/ebd3665028b2408d405f9a31f8479e91c4ef52c1)) + - feat: add test ([46d3387141e5d2f751da699e02d57fc36bfe37a8](https://github.com/jfromaniello/url-join/commit/46d3387141e5d2f751da699e02d57fc36bfe37a8)) + - fix: ignore encoded url when removing consecusive slashes ([711add4e8af8fc97390adef14b9a4722cac5e70a](https://github.com/jfromaniello/url-join/commit/711add4e8af8fc97390adef14b9a4722cac5e70a)) + + + +## 2.0.0 - 2017-04-11 + + - Add a LICENSE file ([ffd3b2253470cee648152c55dd51c1bf4e688a60](https://github.com/jfromaniello/url-join/commit/ffd3b2253470cee648152c55dd51c1bf4e688a60)) + - change copyright year ([9f67671dd8ab23b4d2da6ae775efdf66d594eac3](https://github.com/jfromaniello/url-join/commit/9f67671dd8ab23b4d2da6ae775efdf66d594eac3)) + - refactor: use local startsWith function ([a1e1214644cd187f2584b79b4241ac3b8c9b9f1b](https://github.com/jfromaniello/url-join/commit/a1e1214644cd187f2584b79b4241ac3b8c9b9f1b)) + - fix: split logic for files ([d7053a99aa40b0c2f4802819f7e0643be8889ac4](https://github.com/jfromaniello/url-join/commit/d7053a99aa40b0c2f4802819f7e0643be8889ac4)) + - feat: add file protocol support ([48ebe0d84e8e2eca3a02fe5e3259cdd294e519dc](https://github.com/jfromaniello/url-join/commit/48ebe0d84e8e2eca3a02fe5e3259cdd294e519dc)) + + + +## 1.1.0 - 2016-04-05 + + - add .travis.yml ([c75e7507f72fd4be101b64bb44539fd249842cc0](https://github.com/jfromaniello/url-join/commit/c75e7507f72fd4be101b64bb44539fd249842cc0)) + - added new syntax to allow options, fixed #! urls ([b8e5d8372c55187cdd9c6fa5e02830f76858347e](https://github.com/jfromaniello/url-join/commit/b8e5d8372c55187cdd9c6fa5e02830f76858347e)) + - added travis, updated version in bower.json ([5a58405d89298e693e8f97a74b14324d83a8a87a](https://github.com/jfromaniello/url-join/commit/5a58405d89298e693e8f97a74b14324d83a8a87a)) + - fixed query string handling, closes #9, closes #4 ([e190fe28282287204dbe7877979f18b4570042f9](https://github.com/jfromaniello/url-join/commit/e190fe28282287204dbe7877979f18b4570042f9)), closes [#9](https://github.com/jfromaniello/url-join/issues/9) [#4](https://github.com/jfromaniello/url-join/issues/4) + + + +## 1.0.0 - 2016-03-23 + + + + +## 0.1.0 - 2016-03-23 + + - 0.1.0 ([2db128d268dfd531f1af6c9bd0543458387e94cd](https://github.com/jfromaniello/url-join/commit/2db128d268dfd531f1af6c9bd0543458387e94cd)) + - add support for AMD and windows['url-join'] ([b02169596877a1e6cd518f1b0d711f38c721fb02](https://github.com/jfromaniello/url-join/commit/b02169596877a1e6cd518f1b0d711f38c721fb02)) + - added comments, fixed leading // ([3f72b6ea6fa84c4b254d0c656815a5df6b89a10a](https://github.com/jfromaniello/url-join/commit/3f72b6ea6fa84c4b254d0c656815a5df6b89a10a)) + - added test for leading // ([baac627b2052e1d9b5c05e48c8dc6a05a80e08fa](https://github.com/jfromaniello/url-join/commit/baac627b2052e1d9b5c05e48c8dc6a05a80e08fa)) + - bower init ([650dcfe72eee854108dd0832963553eae5ede7c5](https://github.com/jfromaniello/url-join/commit/650dcfe72eee854108dd0832963553eae5ede7c5)) + - initial ([af68a208966de3d4be757c9d0f4a918c6dfa360e](https://github.com/jfromaniello/url-join/commit/af68a208966de3d4be757c9d0f4a918c6dfa360e)) + - minor ([dde2dc6815f9a0476d7aade1d6848cbc5f3a14a4](https://github.com/jfromaniello/url-join/commit/dde2dc6815f9a0476d7aade1d6848cbc5f3a14a4)) + - minor ([4d9d8ee16591da2092739a172145f968f71598dc](https://github.com/jfromaniello/url-join/commit/4d9d8ee16591da2092739a172145f968f71598dc)) + - minor ([9ed0161497ee7d7d1b4b04d1735483a6216fe2c6](https://github.com/jfromaniello/url-join/commit/9ed0161497ee7d7d1b4b04d1735483a6216fe2c6)) + - simplify normalize function ([d6886a362828eacc028c6167b9ae0efd8b2fbfc8](https://github.com/jfromaniello/url-join/commit/d6886a362828eacc028c6167b9ae0efd8b2fbfc8)) + + + diff --git a/tools/ui/node_modules/url-join/LICENSE b/tools/ui/node_modules/url-join/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..4c2ef041bcc56ca294012e456322d20688bbbbea --- /dev/null +++ b/tools/ui/node_modules/url-join/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2015 José F. Romaniello + +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/url-join/README.md b/tools/ui/node_modules/url-join/README.md new file mode 100644 index 0000000000000000000000000000000000000000..13012c8d3bb7818d730b87af03e4dba6db81b30d --- /dev/null +++ b/tools/ui/node_modules/url-join/README.md @@ -0,0 +1,47 @@ +Join all arguments together and normalize the resulting url. + +## Install + +~~~ +npm install url-join +~~~ + +## Usage + +~~~javascript +var urljoin = require('url-join'); + +var fullUrl = urljoin('http://www.google.com', 'a', '/b/cd', '?foo=123'); + +console.log(fullUrl); + +~~~ + +Prints: + +~~~ +'http://www.google.com/a/b/cd?foo=123' +~~~ + +## Browser and AMD + +It also works in the browser, you can either include ```lib/url-join.js``` in your page: + +~~~html + + +~~~ + +Or using an AMD module system like requirejs: + +~~~javascript +define(['path/url-join.js'], function (urljoin) { + urljoin('http://blabla.com', 'foo?a=1'); +}); +~~~ + +## License + +MIT diff --git a/tools/ui/node_modules/url-join/bin/changelog b/tools/ui/node_modules/url-join/bin/changelog new file mode 100644 index 0000000000000000000000000000000000000000..32bd74160b48d5e5428ea49f9ddd47d983bb3954 --- /dev/null +++ b/tools/ui/node_modules/url-join/bin/changelog @@ -0,0 +1,28 @@ +#!/usr/bin/env node + +var changelog = require('conventional-changelog'); +var semver_regex = /\bv?(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)\.(?:0|[1-9][0-9]*)(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?\b/ig; + +const commitPartial = ` - {{header}} + +{{~!-- commit hash --}} {{#if @root.linkReferences}}([{{hash}}]({{#if @root.host}}{{@root.host}}/{{/if}}{{#if @root.owner}}{{@root.owner}}/{{/if}}{{@root.repository}}/{{@root.commit}}/{{hash}})){{else}}{{hash~}}{{/if}} + +{{~!-- commit references --}}{{#if references}}, closes{{~#each references}} {{#if @root.linkReferences}}[{{#if this.owner}}{{this.owner}}/{{/if}}{{this.repository}}#{{this.issue}}]({{#if @root.host}}{{@root.host}}/{{/if}}{{#if this.repository}}{{#if this.owner}}{{this.owner}}/{{/if}}{{this.repository}}{{else}}{{#if @root.owner}}{{@root.owner}}/{{/if}}{{@root.repository}}{{/if}}/{{@root.issue}}/{{this.issue}}){{else}}{{#if this.owner}}{{this.owner}}/{{/if}}{{this.repository}}#{{this.issue}}{{/if}}{{/each}}{{/if}} +`; + +const headerPartial = `## {{version}}{{#if title}} "{{title}}"{{/if}}{{#if date}} - {{date}}{{/if}} +`; + +changelog({ + releaseCount: 19, + // preset: 'jshint' +}, null, null, null, { + transform: function (commit) { + if (commit.header && semver_regex.exec(commit.header)) { + return null; + } + return commit; + }, + commitPartial: commitPartial, + headerPartial: headerPartial +}).pipe(process.stdout); diff --git a/tools/ui/node_modules/url-join/lib/url-join.js b/tools/ui/node_modules/url-join/lib/url-join.js new file mode 100644 index 0000000000000000000000000000000000000000..e23bb1670481c9b868eda5ac6745835499ff5fd8 --- /dev/null +++ b/tools/ui/node_modules/url-join/lib/url-join.js @@ -0,0 +1,78 @@ +(function (name, context, definition) { + if (typeof module !== 'undefined' && module.exports) module.exports = definition(); + else if (typeof define === 'function' && define.amd) define(definition); + else context[name] = definition(); +})('urljoin', this, function () { + + function normalize (strArray) { + var resultArray = []; + if (strArray.length === 0) { return ''; } + + if (typeof strArray[0] !== 'string') { + throw new TypeError('Url must be a string. Received ' + strArray[0]); + } + + // If the first part is a plain protocol, we combine it with the next part. + if (strArray[0].match(/^[^/:]+:\/*$/) && strArray.length > 1) { + var first = strArray.shift(); + strArray[0] = first + strArray[0]; + } + + // There must be two or three slashes in the file protocol, two slashes in anything else. + if (strArray[0].match(/^file:\/\/\//)) { + strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1:///'); + } else { + strArray[0] = strArray[0].replace(/^([^/:]+):\/*/, '$1://'); + } + + for (var i = 0; i < strArray.length; i++) { + var component = strArray[i]; + + if (typeof component !== 'string') { + throw new TypeError('Url must be a string. Received ' + component); + } + + if (component === '') { continue; } + + if (i > 0) { + // Removing the starting slashes for each component but the first. + component = component.replace(/^[\/]+/, ''); + } + if (i < strArray.length - 1) { + // Removing the ending slashes for each component but the last. + component = component.replace(/[\/]+$/, ''); + } else { + // For the last component we will combine multiple slashes to a single one. + component = component.replace(/[\/]+$/, '/'); + } + + resultArray.push(component); + + } + + var str = resultArray.join('/'); + // Each input component is now separated by a single slash except the possible first plain protocol part. + + // remove trailing slash before parameters or hash + str = str.replace(/\/(\?|&|#[^!])/g, '$1'); + + // replace ? in parameters with & + var parts = str.split('?'); + str = parts.shift() + (parts.length > 0 ? '?': '') + parts.join('&'); + + return str; + } + + return function () { + var input; + + if (typeof arguments[0] === 'object') { + input = arguments[0]; + } else { + input = [].slice.call(arguments); + } + + return normalize(input); + }; + +}); diff --git a/tools/ui/node_modules/url-join/package.json b/tools/ui/node_modules/url-join/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2d5aa75eaa35d5d5f0e9d429790b30ff3ac69ebf --- /dev/null +++ b/tools/ui/node_modules/url-join/package.json @@ -0,0 +1,24 @@ +{ + "name": "url-join", + "version": "4.0.1", + "description": "Join urls and normalize as in path.join.", + "main": "lib/url-join.js", + "scripts": { + "test": "mocha --require should" + }, + "repository": { + "type": "git", + "url": "git://github.com/jfromaniello/url-join.git" + }, + "keywords": [ + "url", + "join" + ], + "author": "José F. Romaniello (http://joseoncode.com)", + "license": "MIT", + "devDependencies": { + "conventional-changelog": "^1.1.10", + "mocha": "^3.2.0", + "should": "~1.2.1" + } +} diff --git a/tools/ui/node_modules/url-join/test/tests.js b/tools/ui/node_modules/url-join/test/tests.js new file mode 100644 index 0000000000000000000000000000000000000000..6876276b46909ba68f38087b6f4cb45a85f3a889 --- /dev/null +++ b/tools/ui/node_modules/url-join/test/tests.js @@ -0,0 +1,151 @@ +var urljoin = require('../lib/url-join'); +var assert = require('assert'); + +describe('url join', function () { + it('should work for simple case', function () { + urljoin('http://www.google.com/', 'foo/bar', '?test=123') + .should.eql('http://www.google.com/foo/bar?test=123'); + }); + + it('should work for simple case with new syntax', function () { + urljoin(['http://www.google.com/', 'foo/bar', '?test=123']) + .should.eql('http://www.google.com/foo/bar?test=123'); + }); + + it('should work for hashbang urls', function () { + urljoin(['http://www.google.com', '#!', 'foo/bar', '?test=123']) + .should.eql('http://www.google.com/#!/foo/bar?test=123'); + }); + + it('should be able to join protocol', function () { + urljoin('http:', 'www.google.com/', 'foo/bar', '?test=123') + .should.eql('http://www.google.com/foo/bar?test=123'); + }); + + it('should be able to join protocol with slashes', function () { + urljoin('http://', 'www.google.com/', 'foo/bar', '?test=123') + .should.eql('http://www.google.com/foo/bar?test=123'); + }); + + it('should remove extra slashes', function () { + urljoin('http:', 'www.google.com///', 'foo/bar', '?test=123') + .should.eql('http://www.google.com/foo/bar?test=123'); + }); + + it('should not remove extra slashes in an encoded URL', function () { + urljoin('http:', 'www.google.com///', 'foo/bar', '?url=http%3A//Ftest.com') + .should.eql('http://www.google.com/foo/bar?url=http%3A//Ftest.com'); + + urljoin('http://a.com/23d04b3/', '/b/c.html') + .should.eql('http://a.com/23d04b3/b/c.html') + .should.not.eql('http://a.com/23d04b3//b/c.html'); + }); + + it('should support anchors in urls', function () { + urljoin('http:', 'www.google.com///', 'foo/bar', '?test=123', '#faaaaa') + .should.eql('http://www.google.com/foo/bar?test=123#faaaaa'); + }); + + it('should support protocol-relative urls', function () { + urljoin('//www.google.com', 'foo/bar', '?test=123') + .should.eql('//www.google.com/foo/bar?test=123') + }); + + it('should support file protocol urls', function () { + urljoin('file:/', 'android_asset', 'foo/bar') + .should.eql('file://android_asset/foo/bar') + + urljoin('file:', '/android_asset', 'foo/bar') + .should.eql('file://android_asset/foo/bar') + }); + + it('should support absolute file protocol urls', function () { + urljoin('file:', '///android_asset', 'foo/bar') + .should.eql('file:///android_asset/foo/bar') + + urljoin('file:///', 'android_asset', 'foo/bar') + .should.eql('file:///android_asset/foo/bar') + + urljoin('file:///', '//android_asset', 'foo/bar') + .should.eql('file:///android_asset/foo/bar') + + urljoin('file:///android_asset', 'foo/bar') + .should.eql('file:///android_asset/foo/bar') + }); + + it('should merge multiple query params properly', function () { + urljoin('http:', 'www.google.com///', 'foo/bar', '?test=123', '?key=456') + .should.eql('http://www.google.com/foo/bar?test=123&key=456'); + + urljoin('http:', 'www.google.com///', 'foo/bar', '?test=123', '?boom=value', '&key=456') + .should.eql('http://www.google.com/foo/bar?test=123&boom=value&key=456'); + + urljoin('http://example.org/x', '?a=1', '?b=2', '?c=3', '?d=4') + .should.eql('http://example.org/x?a=1&b=2&c=3&d=4'); + }); + + it('should merge slashes in paths correctly', function () { + urljoin('http://example.org', 'a//', 'b//', 'A//', 'B//') + .should.eql('http://example.org/a/b/A/B/'); + }); + + it('should merge colons in paths correctly', function () { + urljoin('http://example.org/', ':foo:', 'bar') + .should.eql('http://example.org/:foo:/bar'); + }); + + it('should merge just a simple path without URL correctly', function() { + urljoin('/', 'test') + .should.eql('/test'); + }); + + it('should fail with segments that are not string', function() { + assert.throws(() => urljoin(true), + /Url must be a string. Received true/); + assert.throws(() => urljoin('http://blabla.com/', 1), + /Url must be a string. Received 1/); + assert.throws(() => urljoin('http://blabla.com/', undefined, 'test'), + /Url must be a string. Received undefined/); + assert.throws(() => urljoin('http://blabla.com/', null, 'test'), + /Url must be a string. Received null/); + assert.throws(() => urljoin('http://blabla.com/', { foo: 123 }, 'test'), + /Url must be a string. Received \[object Object\]/); + }); + + it('should merge a path with colon properly', function(){ + urljoin('/users/:userId', '/cars/:carId') + .should.eql('/users/:userId/cars/:carId'); + }); + + it('should merge slashes in protocol correctly', function () { + urljoin('http://example.org', 'a') + .should.eql('http://example.org/a'); + urljoin('http:', '//example.org', 'a') + .should.eql('http://example.org/a'); + urljoin('http:///example.org', 'a') + .should.eql('http://example.org/a'); + urljoin('file:///example.org', 'a') + .should.eql('file:///example.org/a'); + + urljoin('file:example.org', 'a') + .should.eql('file://example.org/a'); + + urljoin('file:/', 'example.org', 'a') + .should.eql('file://example.org/a'); + urljoin('file:', '/example.org', 'a') + .should.eql('file://example.org/a'); + urljoin('file:', '//example.org', 'a') + .should.eql('file://example.org/a'); + }); + + it('should skip empty strings', function() { + urljoin('http://foobar.com', '', 'test') + .should.eql('http://foobar.com/test'); + urljoin('', 'http://foobar.com', '', 'test') + .should.eql('http://foobar.com/test'); + }); + + it('should return an empty string if no arguments are supplied', function() { + urljoin().should.eql(''); + }); +}); diff --git a/tools/ui/node_modules/use-sync-external-store/LICENSE b/tools/ui/node_modules/use-sync-external-store/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b93be90515ccd0b9daedaa589e42bf5929693f1f --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Meta Platforms, Inc. and affiliates. + +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/use-sync-external-store/README.md b/tools/ui/node_modules/use-sync-external-store/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e9987a399b65f1e0a931bb4b0dbdb974147f3f79 --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/README.md @@ -0,0 +1,5 @@ +# use-sync-external-store + +Backwards-compatible shim for [`React.useSyncExternalStore`](https://reactjs.org/docs/hooks-reference.html#usesyncexternalstore). Works with any React that supports Hooks. + +See also https://github.com/reactwg/react-18/discussions/86. diff --git a/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js new file mode 100644 index 0000000000000000000000000000000000000000..b75894ebd0e755457a74a1896332865e7881f6e1 --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js @@ -0,0 +1,95 @@ +/** + * @license React + * use-sync-external-store-shim.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); + } + function useSyncExternalStore$2(subscribe, getSnapshot) { + didWarnOld18Alpha || + void 0 === React.startTransition || + ((didWarnOld18Alpha = !0), + console.error( + "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." + )); + var value = getSnapshot(); + if (!didWarnUncachedGetSnapshot) { + var cachedValue = getSnapshot(); + objectIs(value, cachedValue) || + (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } + cachedValue = useState({ + inst: { value: value, getSnapshot: getSnapshot } + }); + var inst = cachedValue[0].inst, + forceUpdate = cachedValue[1]; + useLayoutEffect( + function () { + inst.value = value; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + }, + [subscribe, value, getSnapshot] + ); + useEffect( + function () { + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + }); + }, + [subscribe] + ); + useDebugValue(value); + return value; + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } + } + function useSyncExternalStore$1(subscribe, getSnapshot) { + return getSnapshot(); + } + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && + "function" === + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); + var React = require("react"), + objectIs = "function" === typeof Object.is ? Object.is : is, + useState = React.useState, + useEffect = React.useEffect, + useLayoutEffect = React.useLayoutEffect, + useDebugValue = React.useDebugValue, + didWarnOld18Alpha = !1, + didWarnUncachedGetSnapshot = !1, + shim = + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ? useSyncExternalStore$1 + : useSyncExternalStore$2; + exports.useSyncExternalStore = + void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim; + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && + "function" === + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); + })(); diff --git a/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js new file mode 100644 index 0000000000000000000000000000000000000000..a513baf99bbb4515f73acce6a4ea3111a02687ff --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js @@ -0,0 +1,88 @@ +/** + * @license React + * use-sync-external-store-shim.native.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); + } + function useSyncExternalStore$1(subscribe, getSnapshot) { + didWarnOld18Alpha || + void 0 === React.startTransition || + ((didWarnOld18Alpha = !0), + console.error( + "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." + )); + var value = getSnapshot(); + if (!didWarnUncachedGetSnapshot) { + var cachedValue = getSnapshot(); + objectIs(value, cachedValue) || + (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), + (didWarnUncachedGetSnapshot = !0)); + } + cachedValue = useState({ + inst: { value: value, getSnapshot: getSnapshot } + }); + var inst = cachedValue[0].inst, + forceUpdate = cachedValue[1]; + useLayoutEffect( + function () { + inst.value = value; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + }, + [subscribe, value, getSnapshot] + ); + useEffect( + function () { + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + }); + }, + [subscribe] + ); + useDebugValue(value); + return value; + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } + } + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && + "function" === + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); + var React = require("react"), + objectIs = "function" === typeof Object.is ? Object.is : is, + useState = React.useState, + useEffect = React.useEffect, + useLayoutEffect = React.useLayoutEffect, + useDebugValue = React.useDebugValue, + didWarnOld18Alpha = !1, + didWarnUncachedGetSnapshot = !1; + exports.useSyncExternalStore = + void 0 !== React.useSyncExternalStore + ? React.useSyncExternalStore + : useSyncExternalStore$1; + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && + "function" === + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); + })(); diff --git a/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.js b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.js new file mode 100644 index 0000000000000000000000000000000000000000..cb7b9309cefe637ef1c430845e8acf9571ad764d --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.js @@ -0,0 +1,59 @@ +/** + * @license React + * use-sync-external-store-shim.native.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var React = require("react"); +function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); +} +var objectIs = "function" === typeof Object.is ? Object.is : is, + useState = React.useState, + useEffect = React.useEffect, + useLayoutEffect = React.useLayoutEffect, + useDebugValue = React.useDebugValue; +function useSyncExternalStore$1(subscribe, getSnapshot) { + var value = getSnapshot(), + _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }), + inst = _useState[0].inst, + forceUpdate = _useState[1]; + useLayoutEffect( + function () { + inst.value = value; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + }, + [subscribe, value, getSnapshot] + ); + useEffect( + function () { + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + }); + }, + [subscribe] + ); + useDebugValue(value); + return value; +} +function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } +} +exports.useSyncExternalStore = + void 0 !== React.useSyncExternalStore + ? React.useSyncExternalStore + : useSyncExternalStore$1; diff --git a/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js new file mode 100644 index 0000000000000000000000000000000000000000..1d8d53546b7ef3d9b9d379b4a18c423faaa5d781 --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js @@ -0,0 +1,66 @@ +/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var React = require("react"); +function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); +} +var objectIs = "function" === typeof Object.is ? Object.is : is, + useState = React.useState, + useEffect = React.useEffect, + useLayoutEffect = React.useLayoutEffect, + useDebugValue = React.useDebugValue; +function useSyncExternalStore$2(subscribe, getSnapshot) { + var value = getSnapshot(), + _useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }), + inst = _useState[0].inst, + forceUpdate = _useState[1]; + useLayoutEffect( + function () { + inst.value = value; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + }, + [subscribe, value, getSnapshot] + ); + useEffect( + function () { + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + return subscribe(function () { + checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst }); + }); + }, + [subscribe] + ); + useDebugValue(value); + return value; +} +function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error) { + return !0; + } +} +function useSyncExternalStore$1(subscribe, getSnapshot) { + return getSnapshot(); +} +var shim = + "undefined" === typeof window || + "undefined" === typeof window.document || + "undefined" === typeof window.document.createElement + ? useSyncExternalStore$1 + : useSyncExternalStore$2; +exports.useSyncExternalStore = + void 0 !== React.useSyncExternalStore ? React.useSyncExternalStore : shim; diff --git a/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js new file mode 100644 index 0000000000000000000000000000000000000000..f2f5b5fd5420b49126cdbabb1e6e17131cc02c27 --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js @@ -0,0 +1,97 @@ +/** + * @license React + * use-sync-external-store-shim/with-selector.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); + } + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && + "function" === + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); + var React = require("react"), + shim = require("use-sync-external-store/shim"), + objectIs = "function" === typeof Object.is ? Object.is : is, + useSyncExternalStore = shim.useSyncExternalStore, + useRef = React.useRef, + useEffect = React.useEffect, + useMemo = React.useMemo, + useDebugValue = React.useDebugValue; + exports.useSyncExternalStoreWithSelector = function ( + subscribe, + getSnapshot, + getServerSnapshot, + selector, + isEqual + ) { + var instRef = useRef(null); + if (null === instRef.current) { + var inst = { hasValue: !1, value: null }; + instRef.current = inst; + } else inst = instRef.current; + instRef = useMemo( + function () { + function memoizedSelector(nextSnapshot) { + if (!hasMemo) { + hasMemo = !0; + memoizedSnapshot = nextSnapshot; + nextSnapshot = selector(nextSnapshot); + if (void 0 !== isEqual && inst.hasValue) { + var currentSelection = inst.value; + if (isEqual(currentSelection, nextSnapshot)) + return (memoizedSelection = currentSelection); + } + return (memoizedSelection = nextSnapshot); + } + currentSelection = memoizedSelection; + if (objectIs(memoizedSnapshot, nextSnapshot)) + return currentSelection; + var nextSelection = selector(nextSnapshot); + if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) + return (memoizedSnapshot = nextSnapshot), currentSelection; + memoizedSnapshot = nextSnapshot; + return (memoizedSelection = nextSelection); + } + var hasMemo = !1, + memoizedSnapshot, + memoizedSelection, + maybeGetServerSnapshot = + void 0 === getServerSnapshot ? null : getServerSnapshot; + return [ + function () { + return memoizedSelector(getSnapshot()); + }, + null === maybeGetServerSnapshot + ? void 0 + : function () { + return memoizedSelector(maybeGetServerSnapshot()); + } + ]; + }, + [getSnapshot, getServerSnapshot, selector, isEqual] + ); + var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]); + useEffect( + function () { + inst.hasValue = !0; + inst.value = value; + }, + [value] + ); + useDebugValue(value); + return value; + }; + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && + "function" === + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); + })(); diff --git a/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js new file mode 100644 index 0000000000000000000000000000000000000000..00f53702904d44c40d1dd9048cd0c68d5118bec1 --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js @@ -0,0 +1,85 @@ +/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var React = require("react"), + shim = require("use-sync-external-store/shim"); +function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); +} +var objectIs = "function" === typeof Object.is ? Object.is : is, + useSyncExternalStore = shim.useSyncExternalStore, + useRef = React.useRef, + useEffect = React.useEffect, + useMemo = React.useMemo, + useDebugValue = React.useDebugValue; +exports.useSyncExternalStoreWithSelector = function ( + subscribe, + getSnapshot, + getServerSnapshot, + selector, + isEqual +) { + var instRef = useRef(null); + if (null === instRef.current) { + var inst = { hasValue: !1, value: null }; + instRef.current = inst; + } else inst = instRef.current; + instRef = useMemo( + function () { + function memoizedSelector(nextSnapshot) { + if (!hasMemo) { + hasMemo = !0; + memoizedSnapshot = nextSnapshot; + nextSnapshot = selector(nextSnapshot); + if (void 0 !== isEqual && inst.hasValue) { + var currentSelection = inst.value; + if (isEqual(currentSelection, nextSnapshot)) + return (memoizedSelection = currentSelection); + } + return (memoizedSelection = nextSnapshot); + } + currentSelection = memoizedSelection; + if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection; + var nextSelection = selector(nextSnapshot); + if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) + return (memoizedSnapshot = nextSnapshot), currentSelection; + memoizedSnapshot = nextSnapshot; + return (memoizedSelection = nextSelection); + } + var hasMemo = !1, + memoizedSnapshot, + memoizedSelection, + maybeGetServerSnapshot = + void 0 === getServerSnapshot ? null : getServerSnapshot; + return [ + function () { + return memoizedSelector(getSnapshot()); + }, + null === maybeGetServerSnapshot + ? void 0 + : function () { + return memoizedSelector(maybeGetServerSnapshot()); + } + ]; + }, + [getSnapshot, getServerSnapshot, selector, isEqual] + ); + var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]); + useEffect( + function () { + inst.hasValue = !0; + inst.value = value; + }, + [value] + ); + useDebugValue(value); + return value; +}; diff --git a/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js new file mode 100644 index 0000000000000000000000000000000000000000..8a2973d00d880bb2341664001b8e56378dc9561b --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js @@ -0,0 +1,96 @@ +/** + * @license React + * use-sync-external-store-with-selector.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +"production" !== process.env.NODE_ENV && + (function () { + function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); + } + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && + "function" === + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); + var React = require("react"), + objectIs = "function" === typeof Object.is ? Object.is : is, + useSyncExternalStore = React.useSyncExternalStore, + useRef = React.useRef, + useEffect = React.useEffect, + useMemo = React.useMemo, + useDebugValue = React.useDebugValue; + exports.useSyncExternalStoreWithSelector = function ( + subscribe, + getSnapshot, + getServerSnapshot, + selector, + isEqual + ) { + var instRef = useRef(null); + if (null === instRef.current) { + var inst = { hasValue: !1, value: null }; + instRef.current = inst; + } else inst = instRef.current; + instRef = useMemo( + function () { + function memoizedSelector(nextSnapshot) { + if (!hasMemo) { + hasMemo = !0; + memoizedSnapshot = nextSnapshot; + nextSnapshot = selector(nextSnapshot); + if (void 0 !== isEqual && inst.hasValue) { + var currentSelection = inst.value; + if (isEqual(currentSelection, nextSnapshot)) + return (memoizedSelection = currentSelection); + } + return (memoizedSelection = nextSnapshot); + } + currentSelection = memoizedSelection; + if (objectIs(memoizedSnapshot, nextSnapshot)) + return currentSelection; + var nextSelection = selector(nextSnapshot); + if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) + return (memoizedSnapshot = nextSnapshot), currentSelection; + memoizedSnapshot = nextSnapshot; + return (memoizedSelection = nextSelection); + } + var hasMemo = !1, + memoizedSnapshot, + memoizedSelection, + maybeGetServerSnapshot = + void 0 === getServerSnapshot ? null : getServerSnapshot; + return [ + function () { + return memoizedSelector(getSnapshot()); + }, + null === maybeGetServerSnapshot + ? void 0 + : function () { + return memoizedSelector(maybeGetServerSnapshot()); + } + ]; + }, + [getSnapshot, getServerSnapshot, selector, isEqual] + ); + var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]); + useEffect( + function () { + inst.hasValue = !0; + inst.value = value; + }, + [value] + ); + useDebugValue(value); + return value; + }; + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && + "function" === + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); + })(); diff --git a/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js new file mode 100644 index 0000000000000000000000000000000000000000..5cb994088d0c2a9331b9d3524be303cdba9ad4d1 --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js @@ -0,0 +1,84 @@ +/** + * @license React + * use-sync-external-store-with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var React = require("react"); +function is(x, y) { + return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y); +} +var objectIs = "function" === typeof Object.is ? Object.is : is, + useSyncExternalStore = React.useSyncExternalStore, + useRef = React.useRef, + useEffect = React.useEffect, + useMemo = React.useMemo, + useDebugValue = React.useDebugValue; +exports.useSyncExternalStoreWithSelector = function ( + subscribe, + getSnapshot, + getServerSnapshot, + selector, + isEqual +) { + var instRef = useRef(null); + if (null === instRef.current) { + var inst = { hasValue: !1, value: null }; + instRef.current = inst; + } else inst = instRef.current; + instRef = useMemo( + function () { + function memoizedSelector(nextSnapshot) { + if (!hasMemo) { + hasMemo = !0; + memoizedSnapshot = nextSnapshot; + nextSnapshot = selector(nextSnapshot); + if (void 0 !== isEqual && inst.hasValue) { + var currentSelection = inst.value; + if (isEqual(currentSelection, nextSnapshot)) + return (memoizedSelection = currentSelection); + } + return (memoizedSelection = nextSnapshot); + } + currentSelection = memoizedSelection; + if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection; + var nextSelection = selector(nextSnapshot); + if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) + return (memoizedSnapshot = nextSnapshot), currentSelection; + memoizedSnapshot = nextSnapshot; + return (memoizedSelection = nextSelection); + } + var hasMemo = !1, + memoizedSnapshot, + memoizedSelection, + maybeGetServerSnapshot = + void 0 === getServerSnapshot ? null : getServerSnapshot; + return [ + function () { + return memoizedSelector(getSnapshot()); + }, + null === maybeGetServerSnapshot + ? void 0 + : function () { + return memoizedSelector(maybeGetServerSnapshot()); + } + ]; + }, + [getSnapshot, getServerSnapshot, selector, isEqual] + ); + var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]); + useEffect( + function () { + inst.hasValue = !0; + inst.value = value; + }, + [value] + ); + useDebugValue(value); + return value; +}; diff --git a/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store.development.js b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store.development.js new file mode 100644 index 0000000000000000000000000000000000000000..f8d52da50ae8a45c4c1e06d5da2565d6ccdec50d --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store.development.js @@ -0,0 +1,27 @@ +/** + * @license React + * use-sync-external-store.development.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +if ("production" !== process.env.NODE_ENV) { + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && + "function" === + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); + var useSyncExternalStore$jscomp$inline_1 = + require("react").useSyncExternalStore; + console.error( + "The main 'use-sync-external-store' entry point is not supported; all it does is re-export useSyncExternalStore from the 'react' package, so it only works with React 18+.\n\nIf you wish to support React 16 and 17, import from 'use-sync-external-store/shim' instead. It will fall back to a shimmed implementation when the native one is not available.\n\nIf you only support React 18+, you can import directly from 'react'." + ); + exports.useSyncExternalStore = useSyncExternalStore$jscomp$inline_1; + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && + "function" === + typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && + __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); +} diff --git a/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store.production.js b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store.production.js new file mode 100644 index 0000000000000000000000000000000000000000..b1fcea8d929486bf7281940fbbac6ffbace91e24 --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/cjs/use-sync-external-store.production.js @@ -0,0 +1,13 @@ +/** + * @license React + * use-sync-external-store.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +"use strict"; +var useSyncExternalStore = require("react").useSyncExternalStore; +exports.useSyncExternalStore = useSyncExternalStore; diff --git a/tools/ui/node_modules/use-sync-external-store/index.js b/tools/ui/node_modules/use-sync-external-store/index.js new file mode 100644 index 0000000000000000000000000000000000000000..303d4b916e8f72b7c8cf8ea81995971e086c2cd5 --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/index.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/use-sync-external-store.production.js'); +} else { + module.exports = require('./cjs/use-sync-external-store.development.js'); +} diff --git a/tools/ui/node_modules/use-sync-external-store/package.json b/tools/ui/node_modules/use-sync-external-store/package.json new file mode 100644 index 0000000000000000000000000000000000000000..24b3dca9491504d361d3865b9e8a78d4abd4dc9f --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/package.json @@ -0,0 +1,43 @@ +{ + "name": "use-sync-external-store", + "description": "Backwards compatible shim for React's useSyncExternalStore. Works with any React that supports hooks.", + "version": "1.6.0", + "exports": { + ".": "./index.js", + "./with-selector": "./with-selector.js", + "./with-selector.js": "./with-selector.js", + "./shim": { + "react-native": "./shim/index.native.js", + "default": "./shim/index.js" + }, + "./shim/index.js": "./shim/index.js", + "./shim/index.native": "./shim/index.native.js", + "./shim/index.native.js": "./shim/index.native.js", + "./shim/with-selector": "./shim/with-selector.js", + "./shim/with-selector.js": "./shim/with-selector.js", + "./package.json": "./package.json" + }, + "repository": { + "type": "git", + "url": "https://github.com/facebook/react.git", + "directory": "packages/use-sync-external-store" + }, + "files": [ + "LICENSE", + "README.md", + "index.js", + "index.native.js", + "with-selector.js", + "with-selector.native.js", + "shim/", + "cjs/" + ], + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "devDependencies": { + "react-17": "npm:react@^17", + "react-dom-17": "npm:react-dom@^17" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/use-sync-external-store/shim/index.js b/tools/ui/node_modules/use-sync-external-store/shim/index.js new file mode 100644 index 0000000000000000000000000000000000000000..974854c2cd8ad8adc102db0c12a3880c41ee2529 --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/shim/index.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('../cjs/use-sync-external-store-shim.production.js'); +} else { + module.exports = require('../cjs/use-sync-external-store-shim.development.js'); +} diff --git a/tools/ui/node_modules/use-sync-external-store/shim/index.native.js b/tools/ui/node_modules/use-sync-external-store/shim/index.native.js new file mode 100644 index 0000000000000000000000000000000000000000..69bc7586babc85345ea904cc0361bb4a95803b7f --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/shim/index.native.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('../cjs/use-sync-external-store-shim.native.production.js'); +} else { + module.exports = require('../cjs/use-sync-external-store-shim.native.development.js'); +} diff --git a/tools/ui/node_modules/use-sync-external-store/shim/with-selector.js b/tools/ui/node_modules/use-sync-external-store/shim/with-selector.js new file mode 100644 index 0000000000000000000000000000000000000000..91859dbd47282b19308a9b52e4afb897167ad0ec --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/shim/with-selector.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js'); +} else { + module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js'); +} diff --git a/tools/ui/node_modules/use-sync-external-store/with-selector.js b/tools/ui/node_modules/use-sync-external-store/with-selector.js new file mode 100644 index 0000000000000000000000000000000000000000..c0d0da3b43d46a04d00aa0acdffa66bbdf681ee9 --- /dev/null +++ b/tools/ui/node_modules/use-sync-external-store/with-selector.js @@ -0,0 +1,7 @@ +'use strict'; + +if (process.env.NODE_ENV === 'production') { + module.exports = require('./cjs/use-sync-external-store-with-selector.production.js'); +} else { + module.exports = require('./cjs/use-sync-external-store-with-selector.development.js'); +} diff --git a/tools/ui/node_modules/util-deprecate/History.md b/tools/ui/node_modules/util-deprecate/History.md new file mode 100644 index 0000000000000000000000000000000000000000..acc8675372e980824723cfcfec09c0ba43a3195a --- /dev/null +++ b/tools/ui/node_modules/util-deprecate/History.md @@ -0,0 +1,16 @@ + +1.0.2 / 2015-10-07 +================== + + * use try/catch when checking `localStorage` (#3, @kumavis) + +1.0.1 / 2014-11-25 +================== + + * browser: use `console.warn()` for deprecation calls + * browser: more jsdocs + +1.0.0 / 2014-04-30 +================== + + * initial commit diff --git a/tools/ui/node_modules/util-deprecate/LICENSE b/tools/ui/node_modules/util-deprecate/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..6a60e8c225c9baca25907f87c74b428e5d85de0c --- /dev/null +++ b/tools/ui/node_modules/util-deprecate/LICENSE @@ -0,0 +1,24 @@ +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +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/util-deprecate/README.md b/tools/ui/node_modules/util-deprecate/README.md new file mode 100644 index 0000000000000000000000000000000000000000..75622fa7c250a6605f4778d9dffe97bf60291d17 --- /dev/null +++ b/tools/ui/node_modules/util-deprecate/README.md @@ -0,0 +1,53 @@ +util-deprecate +============== +### The Node.js `util.deprecate()` function with browser support + +In Node.js, this module simply re-exports the `util.deprecate()` function. + +In the web browser (i.e. via browserify), a browser-specific implementation +of the `util.deprecate()` function is used. + + +## API + +A `deprecate()` function is the only thing exposed by this module. + +``` javascript +// setup: +exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); + + +// users see: +foo(); +// foo() is deprecated, use bar() instead +foo(); +foo(); +``` + + +## License + +(The MIT License) + +Copyright (c) 2014 Nathan Rajlich + +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/util-deprecate/browser.js b/tools/ui/node_modules/util-deprecate/browser.js new file mode 100644 index 0000000000000000000000000000000000000000..549ae2f065ea5add2c4b3667e412a9d0e7d2b1af --- /dev/null +++ b/tools/ui/node_modules/util-deprecate/browser.js @@ -0,0 +1,67 @@ + +/** + * Module exports. + */ + +module.exports = deprecate; + +/** + * Mark that a method should not be used. + * Returns a modified function which warns once by default. + * + * If `localStorage.noDeprecation = true` is set, then it is a no-op. + * + * If `localStorage.throwDeprecation = true` is set, then deprecated functions + * will throw an Error when invoked. + * + * If `localStorage.traceDeprecation = true` is set, then deprecated functions + * will invoke `console.trace()` instead of `console.error()`. + * + * @param {Function} fn - the function to deprecate + * @param {String} msg - the string to print to the console when `fn` is invoked + * @returns {Function} a new "deprecated" version of `fn` + * @api public + */ + +function deprecate (fn, msg) { + if (config('noDeprecation')) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (config('throwDeprecation')) { + throw new Error(msg); + } else if (config('traceDeprecation')) { + console.trace(msg); + } else { + console.warn(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +} + +/** + * Checks `localStorage` for boolean values for the given `name`. + * + * @param {String} name + * @returns {Boolean} + * @api private + */ + +function config (name) { + // accessing global.localStorage can trigger a DOMException in sandboxed iframes + try { + if (!global.localStorage) return false; + } catch (_) { + return false; + } + var val = global.localStorage[name]; + if (null == val) return false; + return String(val).toLowerCase() === 'true'; +} diff --git a/tools/ui/node_modules/util-deprecate/node.js b/tools/ui/node_modules/util-deprecate/node.js new file mode 100644 index 0000000000000000000000000000000000000000..5e6fcff5ddd3fbf8bdda6310c224114d30b7509e --- /dev/null +++ b/tools/ui/node_modules/util-deprecate/node.js @@ -0,0 +1,6 @@ + +/** + * For Node.js, simply re-export the core `util.deprecate` function. + */ + +module.exports = require('util').deprecate; diff --git a/tools/ui/node_modules/util-deprecate/package.json b/tools/ui/node_modules/util-deprecate/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2e79f89a90f58369ef197534e8488158f379d264 --- /dev/null +++ b/tools/ui/node_modules/util-deprecate/package.json @@ -0,0 +1,27 @@ +{ + "name": "util-deprecate", + "version": "1.0.2", + "description": "The Node.js `util.deprecate()` function with browser support", + "main": "node.js", + "browser": "browser.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git://github.com/TooTallNate/util-deprecate.git" + }, + "keywords": [ + "util", + "deprecate", + "browserify", + "browser", + "node" + ], + "author": "Nathan Rajlich (http://n8.io/)", + "license": "MIT", + "bugs": { + "url": "https://github.com/TooTallNate/util-deprecate/issues" + }, + "homepage": "https://github.com/TooTallNate/util-deprecate" +} diff --git a/tools/ui/node_modules/uuid/LICENSE.md b/tools/ui/node_modules/uuid/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..3934168364063216aa8805f06e3a1a8605133d68 --- /dev/null +++ b/tools/ui/node_modules/uuid/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2010-2020 Robert Kieffer and other contributors + +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/uuid/README.md b/tools/ui/node_modules/uuid/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9bd966aea3161ead736409f5ebf9dc90017de042 --- /dev/null +++ b/tools/ui/node_modules/uuid/README.md @@ -0,0 +1,499 @@ + + +# uuid [![CI](https://github.com/uuidjs/uuid/workflows/CI/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [![Browser](https://github.com/uuidjs/uuid/workflows/Browser/badge.svg)](https://github.com/uuidjs/uuid/actions/workflows/browser.yml) + +For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (formerly [RFC4122](https://www.rfc-editor.org/rfc/rfc4122.html)) UUIDs + +- **Complete** - Support for all RFC9562 UUID versions +- **Cross-platform** - Support for... + - [Typescript](#support) + - [Chrome, Safari, Firefox, and Edge](#support) + - [NodeJS](#support) + - [React Native / Expo](#react-native--expo) +- **Secure** - Uses modern `crypto` API for random values +- **Compact** - Zero-dependency, [tree-shakable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking) +- **CLI** - [`uuid` command line](#command-line) utility + + +> [!NOTE] +> +> Starting with `uuid@12` CommonJS is no longer supported. See [implications](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) and [motivation](https://github.com/uuidjs/uuid/issues/881) for details. + +## Quickstart + +**1. Install** + +```shell +npm install uuid +``` + +**2. Create a UUID** + +```javascript +import { v4 as uuidv4 } from 'uuid'; + +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' +``` + +For timestamp UUIDs, namespace UUIDs, and other options read on ... + +## API Summary + +| | | | +| --- | --- | --- | +| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | New in `uuid@8.3` | +| [`uuid.MAX`](#uuidmax) | The max UUID string (all ones) | New in `uuid@9.1` | +| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | New in `uuid@8.3` | +| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | New in `uuid@8.3` | +| [`uuid.v1()`](#uuidv1options-buffer-offset) | Create a version 1 (timestamp) UUID | | +| [`uuid.v1ToV6()`](#uuidv1tov6uuid) | Create a version 6 UUID from a version 1 UUID | New in `uuid@10` | +| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Create a version 3 (namespace w/ MD5) UUID | | +| [`uuid.v4()`](#uuidv4options-buffer-offset) | Create a version 4 (random) UUID | | +| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Create a version 5 (namespace w/ SHA-1) UUID | | +| [`uuid.v6()`](#uuidv6options-buffer-offset) | Create a version 6 (timestamp, reordered) UUID | New in `uuid@10` | +| [`uuid.v6ToV1()`](#uuidv6tov1uuid) | Create a version 1 UUID from a version 6 UUID | New in `uuid@10` | +| [`uuid.v7()`](#uuidv7options-buffer-offset) | Create a version 7 (Unix Epoch time-based) UUID | New in `uuid@10` | +| ~~[`uuid.v8()`](#uuidv8)~~ | "Intentionally left blank" | | +| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID | New in `uuid@8.3` | +| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID | New in `uuid@8.3` | + +## API + +### uuid.NIL + +The nil UUID string (all zeros). + +Example: + +```javascript +import { NIL as NIL_UUID } from 'uuid'; + +NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000' +``` + +### uuid.MAX + +The max UUID string (all ones). + +Example: + +```javascript +import { MAX as MAX_UUID } from 'uuid'; + +MAX_UUID; // ⇨ 'ffffffff-ffff-ffff-ffff-ffffffffffff' +``` + +### uuid.parse(str) + +Convert UUID string to array of bytes + +| | | +| --------- | ---------------------------------------- | +| `str` | A valid UUID `String` | +| _returns_ | `Uint8Array[16]` | +| _throws_ | `TypeError` if `str` is not a valid UUID | + + +> [!NOTE] +> Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below. + +Example: + +```javascript +import { parse as uuidParse } from 'uuid'; + +// Parse a UUID +uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ +// Uint8Array(16) [ +// 110, 192, 189, 127, 17, +// 192, 67, 218, 151, 94, +// 42, 138, 217, 235, 174, +// 11 +// ] +``` + +### uuid.stringify(arr[, offset]) + +Convert array of bytes to UUID string + +| | | +| -------------- | ---------------------------------------------------------------------------- | +| `arr` | `Array`-like collection of 16 values (starting from `offset`) between 0-255. | +| [`offset` = 0] | `Number` Starting index in the Array | +| _returns_ | `String` | +| _throws_ | `TypeError` if a valid UUID string cannot be generated | + + +> [!NOTE] +> Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below. + +Example: + +```javascript +import { stringify as uuidStringify } from 'uuid'; + +const uuidBytes = Uint8Array.of( + 0x6e, + 0xc0, + 0xbd, + 0x7f, + 0x11, + 0xc0, + 0x43, + 0xda, + 0x97, + 0x5e, + 0x2a, + 0x8a, + 0xd9, + 0xeb, + 0xae, + 0x0b +); + +uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b' +``` + +### uuid.v1([options[, buffer[, offset]]]) + +Create an RFC version 1 (timestamp) UUID + +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.node = (random)` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) | +| [`options.clockseq = (random)`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff | +| [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) | +| [`options.nsecs = 0`] | RFC "timestamp" field (`Number` of nanoseconds to add to `msecs`, should be 0-10,000) | +| [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | +| _throws_ | `Error` if more than 10M UUIDs/sec are requested | + + +> [!NOTE] +> The default [node id](https://datatracker.ietf.org/doc/html/rfc9562#section-5.1) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process. + + +> [!NOTE] +> `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields. + +Example: + +```javascript +import { v1 as uuidv1 } from 'uuid'; + +uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-9b5d-ab8dfbbd4bed' +``` + +Example using `options`: + +```javascript +import { v1 as uuidv1 } from 'uuid'; + +const options = { + node: Uint8Array.of(0x01, 0x23, 0x45, 0x67, 0x89, 0xab), + clockseq: 0x1234, + msecs: new Date('2011-11-01').getTime(), + nsecs: 5678, +}; +uuidv1(options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab' +``` + +### uuid.v1ToV6(uuid) + +Convert a UUID from version 1 to version 6 + +```javascript +import { v1ToV6 } from 'uuid'; + +v1ToV6('92f62d9e-22c4-11ef-97e9-325096b39f47'); // ⇨ '1ef22c49-2f62-6d9e-97e9-325096b39f47' +``` + +### uuid.v3(name, namespace[, buffer[, offset]]) + +Create an RFC version 3 (namespace w/ MD5) UUID + +API is identical to `v5()`, but uses "v3" instead. + + +> [!IMPORTANT] +> Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_." + +### uuid.v4([options[, buffer[, offset]]]) + +Create an RFC version 4 (random) UUID + +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.random`] | `Array` of 16 random bytes (0-255) | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | + +Example: + +```javascript +import { v4 as uuidv4 } from 'uuid'; + +uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' +``` + +Example using predefined `random` values: + +```javascript +import { v4 as uuidv4 } from 'uuid'; + +const v4options = { + random: Uint8Array.of( + 0x10, + 0x91, + 0x56, + 0xbe, + 0xc4, + 0xfb, + 0xc1, + 0xea, + 0x71, + 0xb4, + 0xef, + 0xe1, + 0x67, + 0x1c, + 0x58, + 0x36 + ), +}; +uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836' +``` + +### uuid.v5(name, namespace[, buffer[, offset]]) + +Create an RFC version 5 (namespace w/ SHA-1) UUID + +| | | +| --- | --- | +| `name` | `String \| Array` | +| `namespace` | `String \| Array[16]` Namespace UUID | +| [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | + + +> [!NOTE] +> The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`. + +Example with custom namespace: + +```javascript +import { v5 as uuidv5 } from 'uuid'; + +// Define a custom namespace. Readers, create your own using something like +// https://www.uuidgenerator.net/ +const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; + +uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681' +``` + +Example with RFC `URL` namespace: + +```javascript +import { v5 as uuidv5 } from 'uuid'; + +uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1' +``` + +### uuid.v6([options[, buffer[, offset]]]) + +Create an RFC version 6 (timestamp, reordered) UUID + +This method takes the same arguments as uuid.v1(). + +```javascript +import { v6 as uuidv6 } from 'uuid'; + +uuidv6(); // ⇨ '1e940672-c5ea-64c1-9bdd-2b0d7b3dcb6d' +``` + +Example using `options`: + +```javascript +import { v6 as uuidv6 } from 'uuid'; + +const options = { + node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], + clockseq: 0x1234, + msecs: new Date('2011-11-01').getTime(), + nsecs: 5678, +}; +uuidv6(options); // ⇨ '1e1041c7-10b9-662e-9234-0123456789ab' +``` + +### uuid.v6ToV1(uuid) + +Convert a UUID from version 6 to version 1 + +```javascript +import { v6ToV1 } from 'uuid'; + +v6ToV1('1ef22c49-2f62-6d9e-97e9-325096b39f47'); // ⇨ '92f62d9e-22c4-11ef-97e9-325096b39f47' +``` + +### uuid.v7([options[, buffer[, offset]]]) + +Create an RFC version 7 (random) UUID + +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) | +| [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`options.seq = (random)`] | 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help ensure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. | +| [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | + +Example: + +```javascript +import { v7 as uuidv7 } from 'uuid'; + +uuidv7(); // ⇨ '01695553-c90c-745a-b76f-770d7b3dcb6d' +``` + +### ~~uuid.v8()~~ + +**_"Intentionally left blank"_** + + +> [!NOTE] +> Version 8 (experimental) UUIDs are "[for experimental or vendor-specific use cases](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-8)". The RFC does not define a creation algorithm for them, which is why this package does not offer a `v8()` method. The `validate()` and `version()` methods do work with such UUIDs, however. + +### uuid.validate(str) + +Test a string to see if it is a valid UUID + +| | | +| --------- | --------------------------------------------------- | +| `str` | `String` to validate | +| _returns_ | `true` if string is a valid UUID, `false` otherwise | + +Example: + +```javascript +import { validate as uuidValidate } from 'uuid'; + +uuidValidate('not a UUID'); // ⇨ false +uuidValidate('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ true +``` + +Using `validate` and `version` together it is possible to do per-version validation, e.g. validate for only v4 UUIds. + +```javascript +import { version as uuidVersion } from 'uuid'; +import { validate as uuidValidate } from 'uuid'; + +function uuidValidateV4(uuid) { + return uuidValidate(uuid) && uuidVersion(uuid) === 4; +} + +const v1Uuid = 'd9428888-122b-11e1-b85c-61cd3cbb3210'; +const v4Uuid = '109156be-c4fb-41ea-b1b4-efe1671c5836'; + +uuidValidateV4(v4Uuid); // ⇨ true +uuidValidateV4(v1Uuid); // ⇨ false +``` + +### uuid.version(str) + +Detect RFC version of a UUID + +| | | +| --------- | ---------------------------------------- | +| `str` | A valid UUID `String` | +| _returns_ | `Number` The RFC version of the UUID | +| _throws_ | `TypeError` if `str` is not a valid UUID | + +Example: + +```javascript +import { version as uuidVersion } from 'uuid'; + +uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1 +uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4 +``` + + +> [!NOTE] +> This method returns `0` for the `NIL` UUID, and `15` for the `MAX` UUID. + +## Command Line + +UUIDs can be generated from the command line using `uuid`. + +```shell +$ npx uuid +ddeb27fb-d9a0-4624-be4d-4615062daed4 +``` + +The default is to generate version 4 UUIDS, however the other versions are supported. Type `uuid --help` for details: + +```shell +$ npx uuid --help + +Usage: + uuid + uuid v1 + uuid v3 + uuid v4 + uuid v5 + uuid v7 + uuid --help + +Note: may be "URL" or "DNS" to use the corresponding UUIDs +defined by RFC9562 +``` + +## `options` Handling for Timestamp UUIDs + +Prior to `uuid@11`, it was possible for `options` state to interfere with the internal state used to ensure uniqueness of timestamp-based UUIDs (the `v1()`, `v6()`, and `v7()` methods). Starting with `uuid@11`, this issue has been addressed by using the presence of the `options` argument as a flag to select between two possible behaviors: + +- Without `options`: Internal state is utilized to improve UUID uniqueness. +- With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed. + +## Support + +**Browsers**: `uuid` [builds are tested](/uuidjs/uuid/blob/main/wdio.conf.js) against the latest version of desktop Chrome, Safari, Firefox, and Edge. Mobile versions of these same browsers are expected to work but aren't currently tested. + +**Node**: `uuid` [builds are tested](https://github.com/uuidjs/uuid/blob/main/.github/workflows/ci.yml#L26-L27) against node ([LTS releases](https://github.com/nodejs/Release)), plus one prior. E.g. At the time of this writing `node@20` is the "maintenance" release and `node@24` is the "current" release, so `uuid` supports `node@18`-`node@24`. + +**Typescript**: TS versions released within the past two years are supported. [source](https://github.com/microsoft/TypeScript/issues/49088#issuecomment-2468723715) + +## Known issues + + + +### "getRandomValues() not supported" + +This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill: + +#### React Native / Expo + +1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme) +1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point: + +```javascript +import 'react-native-get-random-values'; +import { v4 as uuidv4 } from 'uuid'; +``` + +--- + +Markdown generated from [README_js.md](README_js.md) by diff --git a/tools/ui/node_modules/uuid/dist-node/bin/uuid b/tools/ui/node_modules/uuid/dist-node/bin/uuid new file mode 100644 index 0000000000000000000000000000000000000000..b4f612d447167233cc1473bf54424766c54bc243 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/bin/uuid @@ -0,0 +1,2 @@ +#!/usr/bin/env node +import '../uuid-bin.js'; diff --git a/tools/ui/node_modules/uuid/dist-node/index.js b/tools/ui/node_modules/uuid/dist-node/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3193e9a3b3f8ec1095a347a0d4f58da9b448511e --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/index.js @@ -0,0 +1,14 @@ +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/tools/ui/node_modules/uuid/dist-node/max.js b/tools/ui/node_modules/uuid/dist-node/max.js new file mode 100644 index 0000000000000000000000000000000000000000..58951f653f3f0e9cb593d011b00fcdf23bec2aea --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/max.js @@ -0,0 +1 @@ +export default 'ffffffff-ffff-ffff-ffff-ffffffffffff'; diff --git a/tools/ui/node_modules/uuid/dist-node/md5.js b/tools/ui/node_modules/uuid/dist-node/md5.js new file mode 100644 index 0000000000000000000000000000000000000000..4fae4854e3123877826bd5ac4ce14e47e8fb5c8a --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/md5.js @@ -0,0 +1,11 @@ +import { createHash } from 'node:crypto'; +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } + else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + return createHash('md5').update(bytes).digest(); +} +export default md5; diff --git a/tools/ui/node_modules/uuid/dist-node/native.js b/tools/ui/node_modules/uuid/dist-node/native.js new file mode 100644 index 0000000000000000000000000000000000000000..7f8062b37bf95fd1c5b7d429f60264ed6e2637a4 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/native.js @@ -0,0 +1,2 @@ +import { randomUUID } from 'node:crypto'; +export default { randomUUID }; diff --git a/tools/ui/node_modules/uuid/dist-node/nil.js b/tools/ui/node_modules/uuid/dist-node/nil.js new file mode 100644 index 0000000000000000000000000000000000000000..de6f830ee5d3455947380272a0e717023b09b3f9 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/nil.js @@ -0,0 +1 @@ +export default '00000000-0000-0000-0000-000000000000'; diff --git a/tools/ui/node_modules/uuid/dist-node/parse.js b/tools/ui/node_modules/uuid/dist-node/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..64ac401a2d6158ee54eb7317d88dcad91e328d21 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/parse.js @@ -0,0 +1,9 @@ +import validate from './validate.js'; +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + let v; + return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff); +} +export default parse; diff --git a/tools/ui/node_modules/uuid/dist-node/regex.js b/tools/ui/node_modules/uuid/dist-node/regex.js new file mode 100644 index 0000000000000000000000000000000000000000..3e385919064ddbb53a45ac41064d3470b6ad4d99 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/regex.js @@ -0,0 +1 @@ +export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i; diff --git a/tools/ui/node_modules/uuid/dist-node/rng.js b/tools/ui/node_modules/uuid/dist-node/rng.js new file mode 100644 index 0000000000000000000000000000000000000000..5dcaf3cb6d2e5eade14bc50ca96083c6e7f19023 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/rng.js @@ -0,0 +1,10 @@ +import { randomFillSync } from 'node:crypto'; +const rnds8Pool = new Uint8Array(256); +let poolPtr = rnds8Pool.length; +export default function rng() { + if (poolPtr > rnds8Pool.length - 16) { + randomFillSync(rnds8Pool); + poolPtr = 0; + } + return rnds8Pool.slice(poolPtr, (poolPtr += 16)); +} diff --git a/tools/ui/node_modules/uuid/dist-node/sha1.js b/tools/ui/node_modules/uuid/dist-node/sha1.js new file mode 100644 index 0000000000000000000000000000000000000000..7dfd27cc4388ca51ff98cfdeb37e3fefb7f96567 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/sha1.js @@ -0,0 +1,11 @@ +import { createHash } from 'node:crypto'; +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } + else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + return createHash('sha1').update(bytes).digest(); +} +export default sha1; diff --git a/tools/ui/node_modules/uuid/dist-node/stringify.js b/tools/ui/node_modules/uuid/dist-node/stringify.js new file mode 100644 index 0000000000000000000000000000000000000000..962738cb1442b7c7cd5e6a83aa5f78bc47093a59 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/stringify.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; +const byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} +export function unsafeStringify(arr, offset = 0) { + return (byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + '-' + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + '-' + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + '-' + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + '-' + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]]).toLowerCase(); +} +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + return uuid; +} +export default stringify; diff --git a/tools/ui/node_modules/uuid/dist-node/types.js b/tools/ui/node_modules/uuid/dist-node/types.js new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/types.js @@ -0,0 +1 @@ +export {}; diff --git a/tools/ui/node_modules/uuid/dist-node/uuid-bin.js b/tools/ui/node_modules/uuid/dist-node/uuid-bin.js new file mode 100644 index 0000000000000000000000000000000000000000..aa4d4ac4b6ce8c3a2cb51ca805db9aa6a8e16f2d --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/uuid-bin.js @@ -0,0 +1,70 @@ +import * as assert from 'node:assert/strict'; +import v1 from './v1.js'; +import v3 from './v3.js'; +import v4 from './v4.js'; +import v5 from './v5.js'; +import v6 from './v6.js'; +import v7 from './v7.js'; +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid v6'); + console.log(' uuid v7'); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562'); +} +const args = process.argv.slice(2); +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} +const version = args.shift() || 'v4'; +switch (version) { + case 'v1': + console.log(v1()); + break; + case 'v3': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v3 name not specified'); + assert.ok(namespace != null, 'v3 namespace not specified'); + if (namespace === 'URL') { + namespace = v3.URL; + } + if (namespace === 'DNS') { + namespace = v3.DNS; + } + console.log(v3(name, namespace)); + break; + } + case 'v4': + console.log(v4()); + break; + case 'v5': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v5 name not specified'); + assert.ok(namespace != null, 'v5 namespace not specified'); + if (namespace === 'URL') { + namespace = v5.URL; + } + if (namespace === 'DNS') { + namespace = v5.DNS; + } + console.log(v5(name, namespace)); + break; + } + case 'v6': + console.log(v6()); + break; + case 'v7': + console.log(v7()); + break; + default: + usage(); + process.exit(1); +} diff --git a/tools/ui/node_modules/uuid/dist-node/v1.js b/tools/ui/node_modules/uuid/dist-node/v1.js new file mode 100644 index 0000000000000000000000000000000000000000..65e3f68fb712d34bce12b141b4b2f04402d57f9c --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/v1.js @@ -0,0 +1,83 @@ +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +const _state = {}; +function v1(options, buf, offset) { + let bytes; + const isV6 = options?._v6 ?? false; + if (options) { + const optionsKeys = Object.keys(options); + if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') { + options = undefined; + } + } + if (options) { + bytes = v1Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset); + } + else { + const now = Date.now(); + const rnds = rng(); + updateV1State(_state, now, rnds); + bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset); + } + return buf ?? unsafeStringify(bytes); +} +export function updateV1State(state, now, rnds) { + state.msecs ??= -Infinity; + state.nsecs ??= 0; + if (now === state.msecs) { + state.nsecs++; + if (state.nsecs >= 10000) { + state.node = undefined; + state.nsecs = 0; + } + } + else if (now > state.msecs) { + state.nsecs = 0; + } + else if (now < state.msecs) { + state.node = undefined; + } + if (!state.node) { + state.node = rnds.slice(10, 16); + state.node[0] |= 0x01; + state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff; + } + state.msecs = now; + return state; +} +function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + nsecs ??= 0; + clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff; + node ??= rnds.slice(10, 16); + msecs += 12219292800000; + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + buf[offset++] = (tl >>> 24) & 0xff; + buf[offset++] = (tl >>> 16) & 0xff; + buf[offset++] = (tl >>> 8) & 0xff; + buf[offset++] = tl & 0xff; + const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; + buf[offset++] = (tmh >>> 8) & 0xff; + buf[offset++] = tmh & 0xff; + buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10; + buf[offset++] = (tmh >>> 16) & 0xff; + buf[offset++] = (clockseq >>> 8) | 0x80; + buf[offset++] = clockseq & 0xff; + for (let n = 0; n < 6; ++n) { + buf[offset++] = node[n]; + } + return buf; +} +export default v1; diff --git a/tools/ui/node_modules/uuid/dist-node/v1ToV6.js b/tools/ui/node_modules/uuid/dist-node/v1ToV6.js new file mode 100644 index 0000000000000000000000000000000000000000..da0f76341f6585d050022ac80e988b193a267f42 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/v1ToV6.js @@ -0,0 +1,10 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export default function v1ToV6(uuid) { + const v1Bytes = typeof uuid === 'string' ? parse(uuid) : uuid; + const v6Bytes = _v1ToV6(v1Bytes); + return typeof uuid === 'string' ? unsafeStringify(v6Bytes) : v6Bytes; +} +function _v1ToV6(v1Bytes) { + return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]); +} diff --git a/tools/ui/node_modules/uuid/dist-node/v3.js b/tools/ui/node_modules/uuid/dist-node/v3.js new file mode 100644 index 0000000000000000000000000000000000000000..b5c3781de7589f2cc36842bcac6211ce7430bcbf --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/v3.js @@ -0,0 +1,9 @@ +import md5 from './md5.js'; +import v35, { DNS, URL } from './v35.js'; +export { DNS, URL } from './v35.js'; +function v3(value, namespace, buf, offset) { + return v35(0x30, md5, value, namespace, buf, offset); +} +v3.DNS = DNS; +v3.URL = URL; +export default v3; diff --git a/tools/ui/node_modules/uuid/dist-node/v35.js b/tools/ui/node_modules/uuid/dist-node/v35.js new file mode 100644 index 0000000000000000000000000000000000000000..2e0284268d2d50894e00e273d07be5fffdbe8269 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/v35.js @@ -0,0 +1,39 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + const bytes = new Uint8Array(str.length); + for (let i = 0; i < str.length; ++i) { + bytes[i] = str.charCodeAt(i); + } + return bytes; +} +export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +export default function v35(version, hash, value, namespace, buf, offset) { + const valueBytes = typeof value === 'string' ? stringToBytes(value) : value; + const namespaceBytes = typeof namespace === 'string' ? parse(namespace) : namespace; + if (typeof namespace === 'string') { + namespace = parse(namespace); + } + if (namespace?.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } + let bytes = new Uint8Array(16 + valueBytes.length); + bytes.set(namespaceBytes); + bytes.set(valueBytes, namespaceBytes.length); + bytes = hash(bytes); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return unsafeStringify(bytes); +} diff --git a/tools/ui/node_modules/uuid/dist-node/v4.js b/tools/ui/node_modules/uuid/dist-node/v4.js new file mode 100644 index 0000000000000000000000000000000000000000..cc9dc2d8d8cb2fc1ce720ab81cdcd505bd057c73 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/v4.js @@ -0,0 +1,30 @@ +import native from './native.js'; +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +function _v4(options, buf, offset) { + options = options || {}; + const rnds = options.random ?? options.rng?.() ?? rng(); + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return unsafeStringify(rnds); +} +function v4(options, buf, offset) { + if (native.randomUUID && !buf && !options) { + return native.randomUUID(); + } + return _v4(options, buf, offset); +} +export default v4; diff --git a/tools/ui/node_modules/uuid/dist-node/v5.js b/tools/ui/node_modules/uuid/dist-node/v5.js new file mode 100644 index 0000000000000000000000000000000000000000..bd470a4581f93d5c36b233d55c97fef43f7867ab --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/v5.js @@ -0,0 +1,9 @@ +import sha1 from './sha1.js'; +import v35, { DNS, URL } from './v35.js'; +export { DNS, URL } from './v35.js'; +function v5(value, namespace, buf, offset) { + return v35(0x50, sha1, value, namespace, buf, offset); +} +v5.DNS = DNS; +v5.URL = URL; +export default v5; diff --git a/tools/ui/node_modules/uuid/dist-node/v6.js b/tools/ui/node_modules/uuid/dist-node/v6.js new file mode 100644 index 0000000000000000000000000000000000000000..bd1fc35ebebd8dd67061ff2553723ae7f645d0e4 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/v6.js @@ -0,0 +1,20 @@ +import { unsafeStringify } from './stringify.js'; +import v1 from './v1.js'; +import v1ToV6 from './v1ToV6.js'; +function v6(options, buf, offset) { + options ??= {}; + offset ??= 0; + let bytes = v1({ ...options, _v6: true }, new Uint8Array(16)); + bytes = v1ToV6(bytes); + if (buf) { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; i++) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return unsafeStringify(bytes); +} +export default v6; diff --git a/tools/ui/node_modules/uuid/dist-node/v6ToV1.js b/tools/ui/node_modules/uuid/dist-node/v6ToV1.js new file mode 100644 index 0000000000000000000000000000000000000000..bfd942fdafa88835e45d1743af2e48dbb13ed8f8 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/v6ToV1.js @@ -0,0 +1,10 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export default function v6ToV1(uuid) { + const v6Bytes = typeof uuid === 'string' ? parse(uuid) : uuid; + const v1Bytes = _v6ToV1(v6Bytes); + return typeof uuid === 'string' ? unsafeStringify(v1Bytes) : v1Bytes; +} +function _v6ToV1(v6Bytes) { + return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]); +} diff --git a/tools/ui/node_modules/uuid/dist-node/v7.js b/tools/ui/node_modules/uuid/dist-node/v7.js new file mode 100644 index 0000000000000000000000000000000000000000..276c9bf6f04fa4ba169eaed5a0931fe8912f2891 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/v7.js @@ -0,0 +1,65 @@ +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +const _state = {}; +function v7(options, buf, offset) { + let bytes; + if (options) { + bytes = v7Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.seq, buf, offset); + } + else { + const now = Date.now(); + const rnds = rng(); + updateV7State(_state, now, rnds); + bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset); + } + return buf ?? unsafeStringify(bytes); +} +export function updateV7State(state, now, rnds) { + state.msecs ??= -Infinity; + state.seq ??= 0; + if (now > state.msecs) { + state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + state.msecs = now; + } + else { + state.seq = (state.seq + 1) | 0; + if (state.seq === 0) { + state.msecs++; + } + } + return state; +} +function v7Bytes(rnds, msecs, seq, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + buf[offset++] = (msecs / 0x10000000000) & 0xff; + buf[offset++] = (msecs / 0x100000000) & 0xff; + buf[offset++] = (msecs / 0x1000000) & 0xff; + buf[offset++] = (msecs / 0x10000) & 0xff; + buf[offset++] = (msecs / 0x100) & 0xff; + buf[offset++] = msecs & 0xff; + buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f); + buf[offset++] = (seq >>> 20) & 0xff; + buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f); + buf[offset++] = (seq >>> 6) & 0xff; + buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03); + buf[offset++] = rnds[11]; + buf[offset++] = rnds[12]; + buf[offset++] = rnds[13]; + buf[offset++] = rnds[14]; + buf[offset++] = rnds[15]; + return buf; +} +export default v7; diff --git a/tools/ui/node_modules/uuid/dist-node/validate.js b/tools/ui/node_modules/uuid/dist-node/validate.js new file mode 100644 index 0000000000000000000000000000000000000000..444a1a2f904db825c3ed2ad4d4029ad0ecfb742c --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/validate.js @@ -0,0 +1,5 @@ +import REGEX from './regex.js'; +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} +export default validate; diff --git a/tools/ui/node_modules/uuid/dist-node/version.js b/tools/ui/node_modules/uuid/dist-node/version.js new file mode 100644 index 0000000000000000000000000000000000000000..bae91d3fdd22481454ed12680dc43c43b2f99a62 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist-node/version.js @@ -0,0 +1,8 @@ +import validate from './validate.js'; +function version(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + return parseInt(uuid.slice(14, 15), 16); +} +export default version; diff --git a/tools/ui/node_modules/uuid/dist/index.d.ts b/tools/ui/node_modules/uuid/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7d4edc392e85770f0b5cc66a045393e83e44dba --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/index.d.ts @@ -0,0 +1,15 @@ +export type * from './types.js'; +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/tools/ui/node_modules/uuid/dist/index.js b/tools/ui/node_modules/uuid/dist/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3193e9a3b3f8ec1095a347a0d4f58da9b448511e --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/index.js @@ -0,0 +1,14 @@ +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/tools/ui/node_modules/uuid/dist/max.d.ts b/tools/ui/node_modules/uuid/dist/max.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a1e972af402b95f8fd07daa402b3f628c51f0c9 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/max.d.ts @@ -0,0 +1,2 @@ +declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff"; +export default _default; diff --git a/tools/ui/node_modules/uuid/dist/max.js b/tools/ui/node_modules/uuid/dist/max.js new file mode 100644 index 0000000000000000000000000000000000000000..58951f653f3f0e9cb593d011b00fcdf23bec2aea --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/max.js @@ -0,0 +1 @@ +export default 'ffffffff-ffff-ffff-ffff-ffffffffffff'; diff --git a/tools/ui/node_modules/uuid/dist/md5.d.ts b/tools/ui/node_modules/uuid/dist/md5.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a55f51ebdf22d0479e086d30ecca2552fbd7f48 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/md5.d.ts @@ -0,0 +1,2 @@ +declare function md5(bytes: Uint8Array): Uint8Array; +export default md5; diff --git a/tools/ui/node_modules/uuid/dist/md5.js b/tools/ui/node_modules/uuid/dist/md5.js new file mode 100644 index 0000000000000000000000000000000000000000..918be8c9b8b0ece11205108715b9f7b165eeb556 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/md5.js @@ -0,0 +1,135 @@ +function md5(bytes) { + const words = uint8ToUint32(bytes); + const md5Bytes = wordsToMd5(words, bytes.length * 8); + return uint32ToUint8(md5Bytes); +} +function uint32ToUint8(input) { + const bytes = new Uint8Array(input.length * 4); + for (let i = 0; i < input.length * 4; i++) { + bytes[i] = (input[i >> 2] >>> ((i % 4) * 8)) & 0xff; + } + return bytes; +} +function getOutputLength(inputLength8) { + return (((inputLength8 + 64) >>> 9) << 4) + 14 + 1; +} +function wordsToMd5(x, len) { + const xpad = new Uint32Array(getOutputLength(len)).fill(0); + xpad.set(x); + xpad[len >> 5] |= 0x80 << len % 32; + xpad[xpad.length - 1] = len; + x = xpad; + let a = 1732584193; + let b = -271733879; + let c = -1732584194; + let d = 271733878; + for (let i = 0; i < x.length; i += 16) { + const olda = a; + const oldb = b; + const oldc = c; + const oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + return Uint32Array.of(a, b, c, d); +} +function uint8ToUint32(input) { + if (input.length === 0) { + return new Uint32Array(); + } + const output = new Uint32Array(getOutputLength(input.length * 8)).fill(0); + for (let i = 0; i < input.length; i++) { + output[i >> 2] |= (input[i] & 0xff) << ((i % 4) * 8); + } + return output; +} +function safeAdd(x, y) { + const lsw = (x & 0xffff) + (y & 0xffff); + const msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xffff); +} +function bitRotateLeft(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); +} +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} +function md5ff(a, b, c, d, x, s, t) { + return md5cmn((b & c) | (~b & d), a, b, x, s, t); +} +function md5gg(a, b, c, d, x, s, t) { + return md5cmn((b & d) | (c & ~d), a, b, x, s, t); +} +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} +export default md5; diff --git a/tools/ui/node_modules/uuid/dist/native.d.ts b/tools/ui/node_modules/uuid/dist/native.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9418fd3a4b74ce18be454686aef0fc70c084f6b2 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/native.d.ts @@ -0,0 +1,4 @@ +declare const _default: { + randomUUID: false | (() => `${string}-${string}-${string}-${string}-${string}`); +}; +export default _default; diff --git a/tools/ui/node_modules/uuid/dist/native.js b/tools/ui/node_modules/uuid/dist/native.js new file mode 100644 index 0000000000000000000000000000000000000000..76f44f91ffbd98b1cea83202dc814072c9d58353 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/native.js @@ -0,0 +1,2 @@ +const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); +export default { randomUUID }; diff --git a/tools/ui/node_modules/uuid/dist/nil.d.ts b/tools/ui/node_modules/uuid/dist/nil.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b03bb98efded8bfe1c4f25a48b2bc8f99626c968 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/nil.d.ts @@ -0,0 +1,2 @@ +declare const _default: "00000000-0000-0000-0000-000000000000"; +export default _default; diff --git a/tools/ui/node_modules/uuid/dist/nil.js b/tools/ui/node_modules/uuid/dist/nil.js new file mode 100644 index 0000000000000000000000000000000000000000..de6f830ee5d3455947380272a0e717023b09b3f9 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/nil.js @@ -0,0 +1 @@ +export default '00000000-0000-0000-0000-000000000000'; diff --git a/tools/ui/node_modules/uuid/dist/parse.d.ts b/tools/ui/node_modules/uuid/dist/parse.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a316fb1178e124153d05b4af1792425790396e2e --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/parse.d.ts @@ -0,0 +1,2 @@ +declare function parse(uuid: string): Uint8Array; +export default parse; diff --git a/tools/ui/node_modules/uuid/dist/parse.js b/tools/ui/node_modules/uuid/dist/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..64ac401a2d6158ee54eb7317d88dcad91e328d21 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/parse.js @@ -0,0 +1,9 @@ +import validate from './validate.js'; +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + let v; + return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff); +} +export default parse; diff --git a/tools/ui/node_modules/uuid/dist/regex.d.ts b/tools/ui/node_modules/uuid/dist/regex.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d39fa3f6a8024c9630bdff1602a6388b4d88f046 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/regex.d.ts @@ -0,0 +1,2 @@ +declare const _default: RegExp; +export default _default; diff --git a/tools/ui/node_modules/uuid/dist/regex.js b/tools/ui/node_modules/uuid/dist/regex.js new file mode 100644 index 0000000000000000000000000000000000000000..3e385919064ddbb53a45ac41064d3470b6ad4d99 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/regex.js @@ -0,0 +1 @@ +export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i; diff --git a/tools/ui/node_modules/uuid/dist/rng.d.ts b/tools/ui/node_modules/uuid/dist/rng.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..73e60cf3482580b42f2d5ab912ef9d26117dafbf --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/rng.d.ts @@ -0,0 +1 @@ +export default function rng(): Uint8Array; diff --git a/tools/ui/node_modules/uuid/dist/rng.js b/tools/ui/node_modules/uuid/dist/rng.js new file mode 100644 index 0000000000000000000000000000000000000000..770f2e271786c463033d363e54265ffdc8791778 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/rng.js @@ -0,0 +1,11 @@ +let getRandomValues; +const rnds8 = new Uint8Array(16); +export default function rng() { + if (!getRandomValues) { + if (typeof crypto === 'undefined' || !crypto.getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + getRandomValues = crypto.getRandomValues.bind(crypto); + } + return getRandomValues(rnds8); +} diff --git a/tools/ui/node_modules/uuid/dist/sha1.d.ts b/tools/ui/node_modules/uuid/dist/sha1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a6552e5d11ef244f44b2c681a1233f4a7444964e --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/sha1.d.ts @@ -0,0 +1,2 @@ +declare function sha1(bytes: Uint8Array): Uint8Array; +export default sha1; diff --git a/tools/ui/node_modules/uuid/dist/sha1.js b/tools/ui/node_modules/uuid/dist/sha1.js new file mode 100644 index 0000000000000000000000000000000000000000..dbb78aeac3b44aa2296d8e3521c425ef57c15657 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/sha1.js @@ -0,0 +1,70 @@ +function f(s, x, y, z) { + switch (s) { + case 0: + return (x & y) ^ (~x & z); + case 1: + return x ^ y ^ z; + case 2: + return (x & y) ^ (x & z) ^ (y & z); + case 3: + return x ^ y ^ z; + } +} +function ROTL(x, n) { + return (x << n) | (x >>> (32 - n)); +} +function sha1(bytes) { + const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + const newBytes = new Uint8Array(bytes.length + 1); + newBytes.set(bytes); + newBytes[bytes.length] = 0x80; + bytes = newBytes; + const l = bytes.length / 4 + 2; + const N = Math.ceil(l / 16); + const M = new Array(N); + for (let i = 0; i < N; ++i) { + const arr = new Uint32Array(16); + for (let j = 0; j < 16; ++j) { + arr[j] = + (bytes[i * 64 + j * 4] << 24) | + (bytes[i * 64 + j * 4 + 1] << 16) | + (bytes[i * 64 + j * 4 + 2] << 8) | + bytes[i * 64 + j * 4 + 3]; + } + M[i] = arr; + } + M[N - 1][14] = ((bytes.length - 1) * 8) / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff; + for (let i = 0; i < N; ++i) { + const W = new Uint32Array(80); + for (let t = 0; t < 16; ++t) { + W[t] = M[i][t]; + } + for (let t = 16; t < 80; ++t) { + W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); + } + let a = H[0]; + let b = H[1]; + let c = H[2]; + let d = H[3]; + let e = H[4]; + for (let t = 0; t < 80; ++t) { + const s = Math.floor(t / 20); + const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + H[0] = (H[0] + a) >>> 0; + H[1] = (H[1] + b) >>> 0; + H[2] = (H[2] + c) >>> 0; + H[3] = (H[3] + d) >>> 0; + H[4] = (H[4] + e) >>> 0; + } + return Uint8Array.of(H[0] >> 24, H[0] >> 16, H[0] >> 8, H[0], H[1] >> 24, H[1] >> 16, H[1] >> 8, H[1], H[2] >> 24, H[2] >> 16, H[2] >> 8, H[2], H[3] >> 24, H[3] >> 16, H[3] >> 8, H[3], H[4] >> 24, H[4] >> 16, H[4] >> 8, H[4]); +} +export default sha1; diff --git a/tools/ui/node_modules/uuid/dist/stringify.d.ts b/tools/ui/node_modules/uuid/dist/stringify.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..16cb0088333c77894fefc4e4716312a40997a1fb --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/stringify.d.ts @@ -0,0 +1,3 @@ +export declare function unsafeStringify(arr: Uint8Array, offset?: number): string; +declare function stringify(arr: Uint8Array, offset?: number): string; +export default stringify; diff --git a/tools/ui/node_modules/uuid/dist/stringify.js b/tools/ui/node_modules/uuid/dist/stringify.js new file mode 100644 index 0000000000000000000000000000000000000000..962738cb1442b7c7cd5e6a83aa5f78bc47093a59 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/stringify.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; +const byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} +export function unsafeStringify(arr, offset = 0) { + return (byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + '-' + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + '-' + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + '-' + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + '-' + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]]).toLowerCase(); +} +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + return uuid; +} +export default stringify; diff --git a/tools/ui/node_modules/uuid/dist/types.d.ts b/tools/ui/node_modules/uuid/dist/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ecaed97ce0eedfa5931d6ec71bf038cab4cb21e0 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/types.d.ts @@ -0,0 +1,21 @@ +export type UUIDTypes = string | TBuf; +export type Version1Options = { + node?: Uint8Array; + clockseq?: number; + random?: Uint8Array; + rng?: () => Uint8Array; + msecs?: number; + nsecs?: number; + _v6?: boolean; +}; +export type Version4Options = { + random?: Uint8Array; + rng?: () => Uint8Array; +}; +export type Version6Options = Version1Options; +export type Version7Options = { + random?: Uint8Array; + msecs?: number; + seq?: number; + rng?: () => Uint8Array; +}; diff --git a/tools/ui/node_modules/uuid/dist/types.js b/tools/ui/node_modules/uuid/dist/types.js new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/types.js @@ -0,0 +1 @@ +export {}; diff --git a/tools/ui/node_modules/uuid/dist/uuid-bin.d.ts b/tools/ui/node_modules/uuid/dist/uuid-bin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/uuid-bin.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/tools/ui/node_modules/uuid/dist/uuid-bin.js b/tools/ui/node_modules/uuid/dist/uuid-bin.js new file mode 100644 index 0000000000000000000000000000000000000000..aa4d4ac4b6ce8c3a2cb51ca805db9aa6a8e16f2d --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/uuid-bin.js @@ -0,0 +1,70 @@ +import * as assert from 'node:assert/strict'; +import v1 from './v1.js'; +import v3 from './v3.js'; +import v4 from './v4.js'; +import v5 from './v5.js'; +import v6 from './v6.js'; +import v7 from './v7.js'; +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid v6'); + console.log(' uuid v7'); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562'); +} +const args = process.argv.slice(2); +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} +const version = args.shift() || 'v4'; +switch (version) { + case 'v1': + console.log(v1()); + break; + case 'v3': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v3 name not specified'); + assert.ok(namespace != null, 'v3 namespace not specified'); + if (namespace === 'URL') { + namespace = v3.URL; + } + if (namespace === 'DNS') { + namespace = v3.DNS; + } + console.log(v3(name, namespace)); + break; + } + case 'v4': + console.log(v4()); + break; + case 'v5': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v5 name not specified'); + assert.ok(namespace != null, 'v5 namespace not specified'); + if (namespace === 'URL') { + namespace = v5.URL; + } + if (namespace === 'DNS') { + namespace = v5.DNS; + } + console.log(v5(name, namespace)); + break; + } + case 'v6': + console.log(v6()); + break; + case 'v7': + console.log(v7()); + break; + default: + usage(); + process.exit(1); +} diff --git a/tools/ui/node_modules/uuid/dist/v1.d.ts b/tools/ui/node_modules/uuid/dist/v1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8ecee0cd996079d82cb7c712355ea7675fb4c0e --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v1.d.ts @@ -0,0 +1,11 @@ +import { Version1Options } from './types.js'; +type V1State = { + node?: Uint8Array; + clockseq?: number; + msecs?: number; + nsecs?: number; +}; +declare function v1(options?: Version1Options, buf?: undefined, offset?: number): string; +declare function v1(options: Version1Options | undefined, buf: Buf, offset?: number): Buf; +export declare function updateV1State(state: V1State, now: number, rnds: Uint8Array): V1State; +export default v1; diff --git a/tools/ui/node_modules/uuid/dist/v1.js b/tools/ui/node_modules/uuid/dist/v1.js new file mode 100644 index 0000000000000000000000000000000000000000..65e3f68fb712d34bce12b141b4b2f04402d57f9c --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v1.js @@ -0,0 +1,83 @@ +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +const _state = {}; +function v1(options, buf, offset) { + let bytes; + const isV6 = options?._v6 ?? false; + if (options) { + const optionsKeys = Object.keys(options); + if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') { + options = undefined; + } + } + if (options) { + bytes = v1Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset); + } + else { + const now = Date.now(); + const rnds = rng(); + updateV1State(_state, now, rnds); + bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset); + } + return buf ?? unsafeStringify(bytes); +} +export function updateV1State(state, now, rnds) { + state.msecs ??= -Infinity; + state.nsecs ??= 0; + if (now === state.msecs) { + state.nsecs++; + if (state.nsecs >= 10000) { + state.node = undefined; + state.nsecs = 0; + } + } + else if (now > state.msecs) { + state.nsecs = 0; + } + else if (now < state.msecs) { + state.node = undefined; + } + if (!state.node) { + state.node = rnds.slice(10, 16); + state.node[0] |= 0x01; + state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff; + } + state.msecs = now; + return state; +} +function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + nsecs ??= 0; + clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff; + node ??= rnds.slice(10, 16); + msecs += 12219292800000; + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + buf[offset++] = (tl >>> 24) & 0xff; + buf[offset++] = (tl >>> 16) & 0xff; + buf[offset++] = (tl >>> 8) & 0xff; + buf[offset++] = tl & 0xff; + const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; + buf[offset++] = (tmh >>> 8) & 0xff; + buf[offset++] = tmh & 0xff; + buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10; + buf[offset++] = (tmh >>> 16) & 0xff; + buf[offset++] = (clockseq >>> 8) | 0x80; + buf[offset++] = clockseq & 0xff; + for (let n = 0; n < 6; ++n) { + buf[offset++] = node[n]; + } + return buf; +} +export default v1; diff --git a/tools/ui/node_modules/uuid/dist/v1ToV6.d.ts b/tools/ui/node_modules/uuid/dist/v1ToV6.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..38eaaf0c260e5e8ee1cc554fee0399cfb0b19a16 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v1ToV6.d.ts @@ -0,0 +1,2 @@ +export default function v1ToV6(uuid: string): string; +export default function v1ToV6(uuid: Uint8Array): Uint8Array; diff --git a/tools/ui/node_modules/uuid/dist/v1ToV6.js b/tools/ui/node_modules/uuid/dist/v1ToV6.js new file mode 100644 index 0000000000000000000000000000000000000000..da0f76341f6585d050022ac80e988b193a267f42 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v1ToV6.js @@ -0,0 +1,10 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export default function v1ToV6(uuid) { + const v1Bytes = typeof uuid === 'string' ? parse(uuid) : uuid; + const v6Bytes = _v1ToV6(v1Bytes); + return typeof uuid === 'string' ? unsafeStringify(v6Bytes) : v6Bytes; +} +function _v1ToV6(v1Bytes) { + return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]); +} diff --git a/tools/ui/node_modules/uuid/dist/v3.d.ts b/tools/ui/node_modules/uuid/dist/v3.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d1c434ddbcf621df7db9d9b4f293ca61eb96750 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v3.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v3 { + var DNS: string; + var URL: string; +} +export default v3; diff --git a/tools/ui/node_modules/uuid/dist/v3.js b/tools/ui/node_modules/uuid/dist/v3.js new file mode 100644 index 0000000000000000000000000000000000000000..b5c3781de7589f2cc36842bcac6211ce7430bcbf --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v3.js @@ -0,0 +1,9 @@ +import md5 from './md5.js'; +import v35, { DNS, URL } from './v35.js'; +export { DNS, URL } from './v35.js'; +function v3(value, namespace, buf, offset) { + return v35(0x30, md5, value, namespace, buf, offset); +} +v3.DNS = DNS; +v3.URL = URL; +export default v3; diff --git a/tools/ui/node_modules/uuid/dist/v35.d.ts b/tools/ui/node_modules/uuid/dist/v35.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e6e9d5982fb10b50224ae97d1488e1ed93b14cc --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v35.d.ts @@ -0,0 +1,7 @@ +import { UUIDTypes } from './types.js'; +export declare function stringToBytes(str: string): Uint8Array; +export declare const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; +export declare const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; +type HashFunction = (bytes: Uint8Array) => Uint8Array; +export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: TBuf, offset?: number): UUIDTypes; +export {}; diff --git a/tools/ui/node_modules/uuid/dist/v35.js b/tools/ui/node_modules/uuid/dist/v35.js new file mode 100644 index 0000000000000000000000000000000000000000..2e0284268d2d50894e00e273d07be5fffdbe8269 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v35.js @@ -0,0 +1,39 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + const bytes = new Uint8Array(str.length); + for (let i = 0; i < str.length; ++i) { + bytes[i] = str.charCodeAt(i); + } + return bytes; +} +export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +export default function v35(version, hash, value, namespace, buf, offset) { + const valueBytes = typeof value === 'string' ? stringToBytes(value) : value; + const namespaceBytes = typeof namespace === 'string' ? parse(namespace) : namespace; + if (typeof namespace === 'string') { + namespace = parse(namespace); + } + if (namespace?.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } + let bytes = new Uint8Array(16 + valueBytes.length); + bytes.set(namespaceBytes); + bytes.set(valueBytes, namespaceBytes.length); + bytes = hash(bytes); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return unsafeStringify(bytes); +} diff --git a/tools/ui/node_modules/uuid/dist/v4.d.ts b/tools/ui/node_modules/uuid/dist/v4.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8205333fd5d2f871b2a221bcf720ac7c134ec5ba --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v4.d.ts @@ -0,0 +1,4 @@ +import { Version4Options } from './types.js'; +declare function v4(options?: Version4Options, buf?: undefined, offset?: number): string; +declare function v4(options: Version4Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v4; diff --git a/tools/ui/node_modules/uuid/dist/v4.js b/tools/ui/node_modules/uuid/dist/v4.js new file mode 100644 index 0000000000000000000000000000000000000000..cc9dc2d8d8cb2fc1ce720ab81cdcd505bd057c73 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v4.js @@ -0,0 +1,30 @@ +import native from './native.js'; +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +function _v4(options, buf, offset) { + options = options || {}; + const rnds = options.random ?? options.rng?.() ?? rng(); + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return unsafeStringify(rnds); +} +function v4(options, buf, offset) { + if (native.randomUUID && !buf && !options) { + return native.randomUUID(); + } + return _v4(options, buf, offset); +} +export default v4; diff --git a/tools/ui/node_modules/uuid/dist/v5.d.ts b/tools/ui/node_modules/uuid/dist/v5.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e2ff2f34d3b6fc92cadf7bc5afccb789c624c6e --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v5.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v5 { + var DNS: string; + var URL: string; +} +export default v5; diff --git a/tools/ui/node_modules/uuid/dist/v5.js b/tools/ui/node_modules/uuid/dist/v5.js new file mode 100644 index 0000000000000000000000000000000000000000..bd470a4581f93d5c36b233d55c97fef43f7867ab --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v5.js @@ -0,0 +1,9 @@ +import sha1 from './sha1.js'; +import v35, { DNS, URL } from './v35.js'; +export { DNS, URL } from './v35.js'; +function v5(value, namespace, buf, offset) { + return v35(0x50, sha1, value, namespace, buf, offset); +} +v5.DNS = DNS; +v5.URL = URL; +export default v5; diff --git a/tools/ui/node_modules/uuid/dist/v6.d.ts b/tools/ui/node_modules/uuid/dist/v6.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cabf4a0d13b36ac6bbc0ef03500dd4d64d1351c9 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v6.d.ts @@ -0,0 +1,4 @@ +import { Version6Options } from './types.js'; +declare function v6(options?: Version6Options, buf?: undefined, offset?: number): string; +declare function v6(options: Version6Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v6; diff --git a/tools/ui/node_modules/uuid/dist/v6.js b/tools/ui/node_modules/uuid/dist/v6.js new file mode 100644 index 0000000000000000000000000000000000000000..bd1fc35ebebd8dd67061ff2553723ae7f645d0e4 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v6.js @@ -0,0 +1,20 @@ +import { unsafeStringify } from './stringify.js'; +import v1 from './v1.js'; +import v1ToV6 from './v1ToV6.js'; +function v6(options, buf, offset) { + options ??= {}; + offset ??= 0; + let bytes = v1({ ...options, _v6: true }, new Uint8Array(16)); + bytes = v1ToV6(bytes); + if (buf) { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; i++) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return unsafeStringify(bytes); +} +export default v6; diff --git a/tools/ui/node_modules/uuid/dist/v6ToV1.d.ts b/tools/ui/node_modules/uuid/dist/v6ToV1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b3ffc2113edc98b12972bcb73302a5c7fb10dec --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v6ToV1.d.ts @@ -0,0 +1,2 @@ +export default function v6ToV1(uuid: string): string; +export default function v6ToV1(uuid: Uint8Array): Uint8Array; diff --git a/tools/ui/node_modules/uuid/dist/v6ToV1.js b/tools/ui/node_modules/uuid/dist/v6ToV1.js new file mode 100644 index 0000000000000000000000000000000000000000..bfd942fdafa88835e45d1743af2e48dbb13ed8f8 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v6ToV1.js @@ -0,0 +1,10 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export default function v6ToV1(uuid) { + const v6Bytes = typeof uuid === 'string' ? parse(uuid) : uuid; + const v1Bytes = _v6ToV1(v6Bytes); + return typeof uuid === 'string' ? unsafeStringify(v1Bytes) : v1Bytes; +} +function _v6ToV1(v6Bytes) { + return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]); +} diff --git a/tools/ui/node_modules/uuid/dist/v7.d.ts b/tools/ui/node_modules/uuid/dist/v7.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f49b03d55f2c7f99fd7d21e2b1755282bac165b4 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v7.d.ts @@ -0,0 +1,9 @@ +import { Version7Options } from './types.js'; +type V7State = { + msecs?: number; + seq?: number; +}; +declare function v7(options?: Version7Options, buf?: undefined, offset?: number): string; +declare function v7(options: Version7Options | undefined, buf: TBuf, offset?: number): TBuf; +export declare function updateV7State(state: V7State, now: number, rnds: Uint8Array): V7State; +export default v7; diff --git a/tools/ui/node_modules/uuid/dist/v7.js b/tools/ui/node_modules/uuid/dist/v7.js new file mode 100644 index 0000000000000000000000000000000000000000..276c9bf6f04fa4ba169eaed5a0931fe8912f2891 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/v7.js @@ -0,0 +1,65 @@ +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +const _state = {}; +function v7(options, buf, offset) { + let bytes; + if (options) { + bytes = v7Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.seq, buf, offset); + } + else { + const now = Date.now(); + const rnds = rng(); + updateV7State(_state, now, rnds); + bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset); + } + return buf ?? unsafeStringify(bytes); +} +export function updateV7State(state, now, rnds) { + state.msecs ??= -Infinity; + state.seq ??= 0; + if (now > state.msecs) { + state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + state.msecs = now; + } + else { + state.seq = (state.seq + 1) | 0; + if (state.seq === 0) { + state.msecs++; + } + } + return state; +} +function v7Bytes(rnds, msecs, seq, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + buf[offset++] = (msecs / 0x10000000000) & 0xff; + buf[offset++] = (msecs / 0x100000000) & 0xff; + buf[offset++] = (msecs / 0x1000000) & 0xff; + buf[offset++] = (msecs / 0x10000) & 0xff; + buf[offset++] = (msecs / 0x100) & 0xff; + buf[offset++] = msecs & 0xff; + buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f); + buf[offset++] = (seq >>> 20) & 0xff; + buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f); + buf[offset++] = (seq >>> 6) & 0xff; + buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03); + buf[offset++] = rnds[11]; + buf[offset++] = rnds[12]; + buf[offset++] = rnds[13]; + buf[offset++] = rnds[14]; + buf[offset++] = rnds[15]; + return buf; +} +export default v7; diff --git a/tools/ui/node_modules/uuid/dist/validate.d.ts b/tools/ui/node_modules/uuid/dist/validate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..57da03d7d9d569a5ee5c901956de67773ad83d46 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/validate.d.ts @@ -0,0 +1,2 @@ +declare function validate(uuid: unknown): boolean; +export default validate; diff --git a/tools/ui/node_modules/uuid/dist/validate.js b/tools/ui/node_modules/uuid/dist/validate.js new file mode 100644 index 0000000000000000000000000000000000000000..444a1a2f904db825c3ed2ad4d4029ad0ecfb742c --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/validate.js @@ -0,0 +1,5 @@ +import REGEX from './regex.js'; +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} +export default validate; diff --git a/tools/ui/node_modules/uuid/dist/version.d.ts b/tools/ui/node_modules/uuid/dist/version.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f1948dc805f934ed2941636085cab037c3e4b649 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/version.d.ts @@ -0,0 +1,2 @@ +declare function version(uuid: string): number; +export default version; diff --git a/tools/ui/node_modules/uuid/dist/version.js b/tools/ui/node_modules/uuid/dist/version.js new file mode 100644 index 0000000000000000000000000000000000000000..bae91d3fdd22481454ed12680dc43c43b2f99a62 --- /dev/null +++ b/tools/ui/node_modules/uuid/dist/version.js @@ -0,0 +1,8 @@ +import validate from './validate.js'; +function version(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + return parseInt(uuid.slice(14, 15), 16); +} +export default version; diff --git a/tools/ui/node_modules/uuid/package.json b/tools/ui/node_modules/uuid/package.json new file mode 100644 index 0000000000000000000000000000000000000000..2026b599713ccb8ba4493325504569b3a7b85bfd --- /dev/null +++ b/tools/ui/node_modules/uuid/package.json @@ -0,0 +1,119 @@ +{ + "name": "uuid", + "version": "13.0.2", + "description": "RFC9562 UUIDs", + "type": "module", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "keywords": [ + "uuid", + "guid", + "rfc4122", + "rfc9562" + ], + "license": "MIT", + "bin": { + "uuid": "./dist-node/bin/uuid" + }, + "sideEffects": false, + "types": "./dist/index.d.ts", + "exports": { + ".": { + "node": "./dist-node/index.js", + "default": "./dist/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "dist", + "dist-node", + "!**/test" + ], + "devDependencies": { + "@babel/eslint-parser": "7.27.1", + "@commitlint/cli": "19.8.0", + "@commitlint/config-conventional": "19.8.0", + "@eslint/js": "9.26.0", + "bundlewatch": "0.4.1", + "commander": "13.1.0", + "eslint": "9.26.0", + "eslint-config-prettier": "10.1.2", + "eslint-plugin-prettier": "5.4.0", + "globals": "16.0.0", + "husky": "9.1.7", + "jest": "29.7.0", + "lint-staged": "15.5.2", + "neostandard": "0.12.1", + "npm-run-all": "4.1.5", + "prettier": "3.5.3", + "release-please": "17.0.0", + "runmd": "1.4.1", + "standard-version": "9.5.0", + "typescript": "5.2.2", + "typescript-eslint": "8.32.0" + }, + "optionalDevDependencies": { + "@wdio/browserstack-service": "9.2.1", + "@wdio/cli": "9.2.1", + "@wdio/jasmine-framework": "9.2.1", + "@wdio/local-runner": "9.2.1", + "@wdio/spec-reporter": "9.1.3", + "@wdio/static-server-service": "9.1.3" + }, + "scripts": { + "build": "./scripts/build.sh", + "build:watch": "tsc --watch -p tsconfig.json", + "bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json", + "docs:diff": "npm run docs && git diff --quiet -I \"[0-9a-f-]{36}\" README.md", + "docs": "npm run build && npx runmd --output=README.md README_js.md", + "eslint:check": "eslint src/ test/ examples/ *.[jt]s", + "eslint:fix": "eslint --fix src/ test/ examples/ *.[jt]s", + "examples:browser:rollup:build": "cd examples/browser-rollup && npm run build", + "examples:browser:webpack:build": "cd examples/browser-webpack && npm run build", + "examples:node:esmodules:test": "cd examples/node-esmodules && npm test", + "examples:node:jest:test": "cd examples/node-jest && npm test", + "examples:node:typescript:test": "cd examples/typescript && npm test", + "lint": "npm run eslint:check && npm run prettier:check", + "md": "runmd --watch --output=README.md README_js.md", + "prepack": "npm run build -- --no-pack", + "prepare": "husky", + "prepublishOnly": "npm run build", + "pretest:benchmark": "npm run build", + "pretest:browser": "./scripts/iodd && npm run build && npm-run-all --parallel examples:browser:**", + "pretest:node": "npm run build", + "pretest": "npm run build", + "prettier:check": "prettier --check .", + "prettier:fix": "prettier --write .", + "release": "standard-version --no-verify", + "test:benchmark": "cd examples/benchmark && npm test", + "test:browser": "wdio run ./wdio.conf.js", + "test:node": "npm-run-all --parallel examples:node:**", + "test:watch": "node --test --enable-source-maps --watch dist-node/test/*.js", + "test": "node --test --enable-source-maps dist-node/test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/uuidjs/uuid.git" + }, + "lint-staged": { + "*": [ + "prettier --no-error-on-unmatched-pattern --write" + ], + "*.{js,jsx}": [ + "eslint --no-error-on-unmatched-pattern --fix" + ] + }, + "standard-version": { + "scripts": { + "postchangelog": "prettier --write CHANGELOG.md" + } + }, + "packageManager": "npm@11.3.0" +} diff --git a/tools/ui/node_modules/valibot/LICENSE.md b/tools/ui/node_modules/valibot/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..3a695a6a34eb5ad09a784ee966bc276ef19fbdcd --- /dev/null +++ b/tools/ui/node_modules/valibot/LICENSE.md @@ -0,0 +1,9 @@ +MIT License + +Copyright (c) Fabian Hiller + +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/valibot/README.md b/tools/ui/node_modules/valibot/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4a8a1a8331c01ffe5890d135eb683b5fb17947fe --- /dev/null +++ b/tools/ui/node_modules/valibot/README.md @@ -0,0 +1,94 @@ +![Valibot Logo](https://github.com/open-circle/valibot/blob/main/valibot.jpg?raw=true) + +# Valibot + +[![License: MIT][license-image]][license-url] +[![CI][ci-image]][ci-url] +[![NPM version][npm-image]][npm-url] +[![Downloads][downloads-image]][npm-url] +[![JSR version][jsr-image]][jsr-url] +[![Discord][discord-image]][discord-url] + +Hello, I am Valibot and I would like to help you validate data easily using a schema. No matter if it is incoming data on a server, a form or even configuration files. I have no dependencies and can run in any JavaScript environment. + +> I highly recommend you read the [announcement post](https://www.builder.io/blog/introducing-valibot), and if you are a nerd like me, the [bachelor's thesis](https://valibot.dev/thesis.pdf) I am based on. + +## Highlights + +- Fully type safe with static type inference +- Small bundle size starting at less than 700 bytes +- Validate everything from strings to complex objects +- Open source and fully tested with 100 % coverage +- Many transformation and validation actions included +- Well structured source code without dependencies +- Minimal, readable and well thought out API + +## Example + +First you create a schema that describes a structured data set. A schema can be compared to a type definition in TypeScript. The big difference is that TypeScript types are "not executed" and are more or less a DX feature. A schema on the other hand, apart from the inferred type definition, can also be executed at runtime to guarantee the type safety of unknown data. + + +```ts +import * as v from 'valibot'; // 1.31 kB + +// Create login schema with email and password +const LoginSchema = v.object({ + email: v.pipe(v.string(), v.email()), + password: v.pipe(v.string(), v.minLength(8)), +}); + +// Infer output TypeScript type of login schema as +// { email: string; password: string } +type LoginData = v.InferOutput; + +// Throws error for email and password +const output1 = v.parse(LoginSchema, { email: '', password: '' }); + +// Returns data as { email: string; password: string } +const output2 = v.parse(LoginSchema, { + email: 'jane@example.com', + password: '12345678', +}); +``` + +Apart from `parse` I also offer a non-exception-based API with `safeParse` and a type guard function with `is`. You can read more about it [here](https://valibot.dev/guides/parse-data/). + +## Comparison + +Instead of relying on a few large functions with many methods, my API design and source code is based on many small and independent functions, each with just a single task. This modular design has several advantages. + +For example, this allows a bundler to use the import statements to remove code that is not needed. This way, only the code that is actually used gets into your production build. This can reduce the bundle size by up to 95 % compared to [Zod](https://zod.dev/). + +In addition, it allows you to easily extend my functionality with external code and makes my source code more robust and secure because the functionality of the individual functions can be tested much more easily through unit tests. + +> Coming from [Zod](https://zod.dev/)? Read our [migration article](https://valibot.dev/blog/why-migrate-to-valibot/) to see the benefits of Valibot, and use our [migration guide](https://valibot.dev/guides/migrate-from-zod/) to migrate your schemas with confidence. + +## Partners + +Thanks to our partners who support my development! [Join them](https://github.com/sponsors/fabian-hiller) and contribute to the sustainability of open source software! + +![Partners of Valibot](https://github.com/open-circle/valibot/blob/main/partners.webp?raw=true) + +## Credits + +My friend [Fabian](https://github.com/fabian-hiller) created me as part of his [bachelor thesis](https://valibot.dev/thesis.pdf) at [Stuttgart Media University](https://www.hdm-stuttgart.de/en/), supervised by Walter Kriha, [Miško Hevery](https://github.com/mhevery) and [Ryan Carniato](https://github.com/ryansolid). My role models also include [Colin McDonnell](https://github.com/colinhacks), who had a big influence on my API design with [Zod](https://zod.dev/). + +## Feedback + +Find a bug or have an idea how to improve my code? Please fill out an [issue](https://github.com/open-circle/valibot/issues/new). Together we can make the library even better! + +## License + +I am completely free and licensed under the [MIT license](https://github.com/open-circle/valibot/blob/main/LICENSE.md). But if you like, you can feed me with a star on [GitHub](https://github.com/open-circle/valibot). + +[license-image]: https://img.shields.io/badge/License-MIT-brightgreen.svg?style=flat-square +[license-url]: https://opensource.org/licenses/MIT +[ci-image]: https://img.shields.io/github/actions/workflow/status/open-circle/valibot/ci.yml?branch=main&logo=github&style=flat-square +[ci-url]: https://github.com/open-circle/valibot/actions/workflows/ci.yml +[npm-image]: https://img.shields.io/npm/v/valibot.svg?style=flat-square +[npm-url]: https://npmjs.org/package/valibot +[downloads-image]: https://img.shields.io/npm/dm/valibot.svg?style=flat-square +[jsr-image]: https://jsr.io/badges/@valibot/valibot?style=flat-square +[jsr-url]: https://jsr.io/@valibot/valibot +[discord-image]: https://img.shields.io/discord/1252985447273992222?label=Discord&style=flat-square +[discord-url]: https://discord.gg/tkMjQACf2P diff --git a/tools/ui/node_modules/valibot/dist/index.cjs b/tools/ui/node_modules/valibot/dist/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..075b57284db245713f11f03e152efc997a742499 --- /dev/null +++ b/tools/ui/node_modules/valibot/dist/index.cjs @@ -0,0 +1,7974 @@ + +//#region src/storages/globalConfig/globalConfig.ts +let store$4; +const DEFAULT_CONFIG = { + lang: void 0, + message: void 0, + abortEarly: void 0, + abortPipeEarly: void 0 +}; +/** +* Sets the global configuration. +* +* @param config The configuration. +*/ +function setGlobalConfig(config$1) { + store$4 = { + ...store$4, + ...config$1 + }; +} +/** +* Returns the global configuration. +* +* @param config The config to merge. +* +* @returns The configuration. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getGlobalConfig(config$1) { + if (!config$1 && !store$4) return DEFAULT_CONFIG; + return { + lang: config$1?.lang ?? store$4?.lang, + message: config$1?.message, + abortEarly: config$1?.abortEarly ?? store$4?.abortEarly, + abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly + }; +} +/** +* Deletes the global configuration. +*/ +function deleteGlobalConfig() { + store$4 = void 0; +} + +//#endregion +//#region src/storages/globalMessage/globalMessage.ts +let store$3; +/** +* Sets a global error message. +* +* @param message The error message. +* @param lang The language of the message. +*/ +function setGlobalMessage(message$1, lang) { + if (!store$3) store$3 = /* @__PURE__ */ new Map(); + store$3.set(lang, message$1); +} +/** +* Returns a global error message. +* +* @param lang The language of the message. +* +* @returns The error message. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getGlobalMessage(lang) { + return store$3?.get(lang); +} +/** +* Deletes a global error message. +* +* @param lang The language of the message. +*/ +function deleteGlobalMessage(lang) { + store$3?.delete(lang); +} + +//#endregion +//#region src/storages/schemaMessage/schemaMessage.ts +let store$2; +/** +* Sets a schema error message. +* +* @param message The error message. +* @param lang The language of the message. +*/ +function setSchemaMessage(message$1, lang) { + if (!store$2) store$2 = /* @__PURE__ */ new Map(); + store$2.set(lang, message$1); +} +/** +* Returns a schema error message. +* +* @param lang The language of the message. +* +* @returns The error message. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getSchemaMessage(lang) { + return store$2?.get(lang); +} +/** +* Deletes a schema error message. +* +* @param lang The language of the message. +*/ +function deleteSchemaMessage(lang) { + store$2?.delete(lang); +} + +//#endregion +//#region src/storages/specificMessage/specificMessage.ts +let store$1; +/** +* Sets a specific error message. +* +* @param reference The identifier reference. +* @param message The error message. +* @param lang The language of the message. +*/ +function setSpecificMessage(reference, message$1, lang) { + if (!store$1) store$1 = /* @__PURE__ */ new Map(); + if (!store$1.get(reference)) store$1.set(reference, /* @__PURE__ */ new Map()); + store$1.get(reference).set(lang, message$1); +} +/** +* Returns a specific error message. +* +* @param reference The identifier reference. +* @param lang The language of the message. +* +* @returns The error message. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getSpecificMessage(reference, lang) { + return store$1?.get(reference)?.get(lang); +} +/** +* Deletes a specific error message. +* +* @param reference The identifier reference. +* @param lang The language of the message. +*/ +function deleteSpecificMessage(reference, lang) { + store$1?.get(reference)?.delete(lang); +} + +//#endregion +//#region src/utils/_stringify/_stringify.ts +/** +* Stringifies an unknown input to a literal or type string. +* +* @param input The unknown input. +* +* @returns A literal or type string. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _stringify(input) { + const type = typeof input; + if (type === "string") return `"${input}"`; + if (type === "number" || type === "bigint" || type === "boolean") return `${input}`; + if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null"; + return type; +} + +//#endregion +//#region src/utils/_addIssue/_addIssue.ts +/** +* Adds an issue to the dataset. +* +* @param context The issue context. +* @param label The issue label. +* @param dataset The input dataset. +* @param config The configuration. +* @param other The optional props. +* +* @internal +*/ +function _addIssue(context, label, dataset, config$1, other) { + const input = other && "input" in other ? other.input : dataset.value; + const expected = other?.expected ?? context.expects ?? null; + const received = other?.received ?? /* @__PURE__ */ _stringify(input); + const issue = { + kind: context.kind, + type: context.type, + input, + expected, + received, + message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`, + requirement: context.requirement, + path: other?.path, + issues: other?.issues, + lang: config$1.lang, + abortEarly: config$1.abortEarly, + abortPipeEarly: config$1.abortPipeEarly + }; + const isSchema = context.kind === "schema"; + const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang); + if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1; + if (isSchema) dataset.typed = false; + if (dataset.issues) dataset.issues.push(issue); + else dataset.issues = [issue]; +} + +//#endregion +//#region src/utils/_cloneDataset/_cloneDataset.ts +/** +* Creates a shallow copy of a dataset. +* +* Hint: The `value` is copied by reference, but the `issues` array is cloned +* to avoid reusing mutable dataset state across multiple runs. Mutating a +* returned object or array value can therefore affect later cache hits that +* reuse the same cached output. +* +* @param dataset The output dataset. +* +* @returns The copied output dataset. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _cloneDataset(dataset) { + return { + typed: dataset.typed, + value: dataset.value, + issues: dataset.issues && [...dataset.issues] + }; +} + +//#endregion +//#region src/utils/_formatCase/_formatCase.ts +/** +* Splits a string into lowercase words and rejoins them with the given +* separator and capitalization rules. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. Whether the first or subsequent words are +* capitalized is controlled by `capFirst` and `capRest`. +* +* Hint: Implemented in a single pass that emits directly to the result +* string to avoid an intermediate `string[]` allocation. ASCII chars are +* classified via char codes to skip `.toLowerCase()` and `.toUpperCase()` +* method calls in the common case. +* +* Hint: Digits are treated as a separate character class, so `item2Name` +* yields `item2` and `name` rather than `item`, `2` and `name`. +* +* @param input The input string. +* @param separator The string inserted between words. +* @param capFirst Whether to capitalize the first word. +* @param capRest Whether to capitalize subsequent words. +* +* @returns The formatted string. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _formatCase(input, separator, capFirst, capRest) { + let result = ""; + let firstWord = true; + let start = 0; + let prev = 0; + let prevPrev = 0; + const flush = (end) => { + if (end > start) { + let word = input.slice(start, end).toLowerCase(); + if (firstWord ? capFirst : capRest) { + const firstCode = word.charCodeAt(0); + if (firstCode >= 97 && firstCode <= 122) word = String.fromCharCode(firstCode - 32) + word.slice(1); + else { + const charLen = firstCode >= 55296 && firstCode <= 56319 ? 2 : 1; + word = word.slice(0, charLen).toUpperCase() + word.slice(charLen); + } + } + result += firstWord ? word : separator + word; + firstWord = false; + } + }; + for (let index = 0; index < input.length; index++) { + const code = input.charCodeAt(index); + let type; + if (code === 32 || code === 9 || code === 10 || code === 11 || code === 12 || code === 13 || code === 45 || code === 95) { + flush(index); + start = index + 1; + type = 0; + } else if (code < 128) type = code >= 65 && code <= 90 ? 1 : code >= 97 && code <= 122 ? 2 : 3; + else { + const char = input[index]; + const charLower = char.toLowerCase(); + type = charLower === char.toUpperCase() ? 3 : char === charLower ? 2 : 1; + } + if (type === 1 && (prev === 2 || prev === 3) && index > start) { + flush(index); + start = index; + } else if (type === 2 && prev === 1 && prevPrev === 1 && index - 1 > start) { + flush(index - 1); + start = index - 1; + } + prevPrev = prev; + prev = type; + } + flush(input.length); + return result; +} + +//#endregion +//#region src/utils/_getByteCount/_getByteCount.ts +let textEncoder; +/** +* Returns the byte count of the input. +* +* @param input The input to be measured. +* +* @returns The byte count. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _getByteCount(input) { + if (!textEncoder) textEncoder = new TextEncoder(); + return textEncoder.encode(input).length; +} + +//#endregion +//#region src/utils/_getGraphemeCount/_getGraphemeCount.ts +let segmenter; +/** +* Returns the grapheme count of the input. +* +* @param input The input to be measured. +* +* @returns The grapheme count. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _getGraphemeCount(input) { + if (!segmenter) segmenter = new Intl.Segmenter(); + const segments = segmenter.segment(input); + let count = 0; + for (const _ of segments) count++; + return count; +} + +//#endregion +//#region src/utils/_getLastMetadata/_getLastMetadata.ts +/** +* Returns the last top-level value of a given metadata type from a schema +* using a breadth-first search that starts with the last item in the pipeline. +* +* @param schema The schema to search. +* @param type The metadata type. +* +* @returns The value, if any. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _getLastMetadata(schema, type) { + if ("pipe" in schema) { + const nestedSchemas = []; + for (let index = schema.pipe.length - 1; index >= 0; index--) { + const item = schema.pipe[index]; + if (item.kind === "schema" && "pipe" in item) nestedSchemas.push(item); + else if (item.kind === "metadata" && item.type === type) return item[type]; + } + for (const nestedSchema of nestedSchemas) { + const result = /* @__PURE__ */ _getLastMetadata(nestedSchema, type); + if (result !== void 0) return result; + } + } +} + +//#endregion +//#region src/utils/_getStandardProps/_getStandardProps.ts +const _standardCache = /* @__PURE__ */ new WeakMap(); +/** +* Returns the Standard Schema properties. +* +* @param context The schema context. +* +* @returns The Standard Schema properties. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _getStandardProps(context) { + let cached = _standardCache.get(context); + if (!cached) { + cached = { + version: 1, + vendor: "valibot", + validate(value$1) { + return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig()); + } + }; + _standardCache.set(context, cached); + } + return cached; +} + +//#endregion +//#region src/utils/_getWordCount/_getWordCount.ts +let store; +/** +* Returns the word count of the input. +* +* @param locales The locales to be used. +* @param input The input to be measured. +* +* @returns The word count. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _getWordCount(locales, input) { + if (!store) store = /* @__PURE__ */ new Map(); + const key = String(locales); + let segmenter$1 = store.get(key); + if (!segmenter$1) { + segmenter$1 = new Intl.Segmenter(locales, { granularity: "word" }); + store.set(key, segmenter$1); + } + const segments = segmenter$1.segment(input); + let count = 0; + for (const segment of segments) if (segment.isWordLike) count++; + return count; +} + +//#endregion +//#region src/utils/_isLuhnAlgo/_isLuhnAlgo.ts +/** +* Non-digit regex. +*/ +const NON_DIGIT_REGEX = /\D/gu; +/** +* Checks whether a string with numbers corresponds to the luhn algorithm. +* +* @param input The input to be checked. +* +* @returns Whether input is valid. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _isLuhnAlgo(input) { + const number$1 = input.replace(NON_DIGIT_REGEX, ""); + let length$1 = number$1.length; + let bit = 1; + let sum = 0; + while (length$1) { + const value$1 = +number$1[--length$1]; + bit ^= 1; + sum += bit ? [ + 0, + 2, + 4, + 6, + 8, + 1, + 3, + 5, + 7, + 9 + ][value$1] : value$1; + } + return sum % 10 === 0; +} + +//#endregion +//#region src/utils/_isValidObjectKey/_isValidObjectKey.ts +/** +* Disallows inherited object properties and prevents object prototype +* pollution by disallowing certain keys. +* +* @param object The object to check. +* @param key The key to check. +* +* @returns Whether the key is allowed. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _isValidObjectKey(object$1, key) { + return Object.prototype.hasOwnProperty.call(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor"; +} + +//#endregion +//#region src/utils/_joinExpects/_joinExpects.ts +/** +* Joins multiple `expects` values with the given separator. +* +* @param values The `expects` values. +* @param separator The separator. +* +* @returns The joined `expects` property. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _joinExpects(values$1, separator) { + const list = [...new Set(values$1)]; + if (list.length > 1) return `(${list.join(` ${separator} `)})`; + return list[0] ?? "never"; +} + +//#endregion +//#region src/utils/entriesFromList/entriesFromList.ts +/** +* Creates an object entries definition from a list of keys and a schema. +* +* @param list A list of keys. +* @param schema The schema of the keys. +* +* @returns The object entries. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function entriesFromList(list, schema) { + const entries$1 = {}; + for (const key of list) entries$1[key] = schema; + return entries$1; +} + +//#endregion +//#region src/utils/entriesFromObjects/entriesFromObjects.ts +/* @__NO_SIDE_EFFECTS__ */ +function entriesFromObjects(schemas) { + const entries$1 = {}; + for (const schema of schemas) Object.assign(entries$1, schema.entries); + return entries$1; +} + +//#endregion +//#region src/utils/getDotPath/getDotPath.ts +/* @__NO_SIDE_EFFECTS__ */ +function getDotPath(issue) { + if (issue.path) { + let key = ""; + for (const item of issue.path) if (typeof item.key === "string" || typeof item.key === "number") if (key) key += `.${item.key}`; + else key += item.key; + else return null; + return key; + } + return null; +} + +//#endregion +//#region src/utils/isOfKind/isOfKind.ts +/** +* A generic type guard to check the kind of an object. +* +* @param kind The kind to check for. +* @param object The object to check. +* +* @returns Whether it matches. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function isOfKind(kind, object$1) { + return object$1.kind === kind; +} + +//#endregion +//#region src/utils/isOfType/isOfType.ts +/** +* A generic type guard to check the type of an object. +* +* @param type The type to check for. +* @param object The object to check. +* +* @returns Whether it matches. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function isOfType(type, object$1) { + return object$1.type === type; +} + +//#endregion +//#region src/utils/isValiError/isValiError.ts +/** +* A type guard to check if an error is a ValiError. +* +* @param error The error to check. +* +* @returns Whether its a ValiError. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function isValiError(error) { + return error instanceof ValiError; +} + +//#endregion +//#region src/utils/ValiError/ValiError.ts +/** +* A Valibot error with useful information. +*/ +var ValiError = class extends Error { + /** + * Creates a Valibot error with useful information. + * + * @param issues The error issues. + */ + constructor(issues) { + super(issues[0].message); + this.name = "ValiError"; + this.issues = issues; + } +}; + +//#endregion +//#region src/actions/args/args.ts +/* @__NO_SIDE_EFFECTS__ */ +function args(schema) { + return { + kind: "transformation", + type: "args", + reference: args, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = (...args_) => { + const argsDataset = this.schema["~run"]({ value: args_ }, config$1); + if (argsDataset.issues) throw new ValiError(argsDataset.issues); + return func(...argsDataset.value); + }; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/args/argsAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function argsAsync(schema) { + return { + kind: "transformation", + type: "args", + reference: argsAsync, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = async (...args$1) => { + const argsDataset = await schema["~run"]({ value: args$1 }, config$1); + if (argsDataset.issues) throw new ValiError(argsDataset.issues); + return func(...argsDataset.value); + }; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/await/awaitAsync.ts +/** +* Creates an await transformation action. +* +* @returns An await action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function awaitAsync() { + return { + kind: "transformation", + type: "await", + reference: awaitAsync, + async: true, + async "~run"(dataset) { + dataset.value = await dataset.value; + return dataset; + } + }; +} + +//#endregion +//#region src/regex.ts +/** +* [Base64](https://en.wikipedia.org/wiki/Base64) regex. +*/ +const BASE64_REGEX = /^(?:[\da-z+/]{4})*(?:[\da-z+/]{2}==|[\da-z+/]{3}=)?$/iu; +/** +* [BIC](https://en.wikipedia.org/wiki/ISO_9362) regex. +*/ +const BIC_REGEX = /^[A-Z]{6}(?!00)[\dA-Z]{2}(?:[\dA-Z]{3})?$/u; +/** +* [Cuid2](https://github.com/paralleldrive/cuid2) regex. +*/ +const CUID2_REGEX = /^[a-z][\da-z]*$/u; +/** +* [Decimal](https://en.wikipedia.org/wiki/Decimal) regex. +*/ +const DECIMAL_REGEX = /^[+-]?(?:\d*\.)?\d+$/u; +/** +* [Digits](https://en.wikipedia.org/wiki/Numerical_digit) regex. +*/ +const DIGITS_REGEX = /^\d+$/u; +/** +* [Domain name](https://en.wikipedia.org/wiki/Domain_name) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +* ASCII-only validation. Internationalized domain names (IDNs) are not +* supported, including Punycode-encoded labels. +*/ +const DOMAIN_REGEX = /^(?=.{1,253}$)(?:(?![Xx][Nn]--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]{2,63}$/u; +/** +* [Email address](https://en.wikipedia.org/wiki/Email_address) regex. +*/ +const EMAIL_REGEX = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu; +/** +* Emoji regex from [emoji-regex-xs](https://github.com/slevithan/emoji-regex-xs) v1.0.0 (MIT license). +* +* Hint: We decided against the newer `/^\p{RGI_Emoji}+$/v` regex because it is +* not supported in older runtimes and does not match all emoji. +*/ +const EMOJI_REGEX = /^(?:[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation}))*)+$/u; +/** +* [Hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +const HEXADECIMAL_REGEX = /^(?:0[hx])?[\da-fA-F]+$/u; +/** +* [Hex color](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +const HEX_COLOR_REGEX = /^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u; +/** +* [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) regex. +*/ +const IMEI_REGEX = /^\d{15}$|^\d{2}-\d{6}-\d{6}-\d$/u; +/** +* [IPv4](https://en.wikipedia.org/wiki/IPv4) regex. +*/ +const IPV4_REGEX = /^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u; +/** +* [IPv6](https://en.wikipedia.org/wiki/IPv6) regex. +*/ +const IPV6_REGEX = /^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu; +/** +* [IP](https://en.wikipedia.org/wiki/IP_address) regex. +*/ +const IP_REGEX = /^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$|^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date regex. +*/ +const ISO_DATE_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time regex. +*/ +const ISO_DATE_TIME_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3]):[0-5]\d$/u; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with seconds regex. +*/ +const ISO_DATE_TIME_SECOND_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time regex. +*/ +const ISO_TIME_REGEX = /^(?:0\d|1\d|2[0-3]):[0-5]\d$/u; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time with seconds regex. +*/ +const ISO_TIME_SECOND_REGEX = /^(?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp regex. Allows a +* space as a date/time separator and an optional space before the UTC offset. +*/ +const ISO_TIMESTAMP_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) week regex. +*/ +const ISO_WEEK_REGEX = /^\d{4}-W(?:0[1-9]|[1-4]\d|5[0-3])$/u; +/** +* [JWS compact serialization](https://datatracker.ietf.org/doc/html/rfc7515#section-3.1) +* regex. +* +* Hint: Empty payload and signature segments are allowed because the +* Base64URL-encoded representation of an empty octet sequence is an empty +* string. +*/ +const JWS_COMPACT_REGEX = /^(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)\.(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)?\.(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)?$/u; +/** +* [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) regex. +*/ +const ISRC_REGEX = /^(?:[A-Z]{2}[A-Z\d]{3}\d{7}|[A-Z]{2}-[A-Z\d]{3}-\d{2}-\d{5})$/u; +/** +* [MAC](https://en.wikipedia.org/wiki/MAC_address) 48 bit regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +const MAC48_REGEX = /^(?:[\da-fA-F]{2}:){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){2}[\da-fA-F]{4}$/u; +/** +* [MAC](https://en.wikipedia.org/wiki/MAC_address) 64 bit regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +const MAC64_REGEX = /^(?:[\da-fA-F]{2}:){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){3}[\da-fA-F]{4}$|^(?:[\da-fA-F]{4}:){3}[\da-fA-F]{4}$/u; +/** +* [MAC](https://en.wikipedia.org/wiki/MAC_address) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +const MAC_REGEX = /^(?:[\da-fA-F]{2}:){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){2}[\da-fA-F]{4}$|^(?:[\da-fA-F]{2}:){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){3}[\da-fA-F]{4}$|^(?:[\da-fA-F]{4}:){3}[\da-fA-F]{4}$/u; +/** +* [Nano ID](https://github.com/ai/nanoid) regex. +*/ +const NANO_ID_REGEX = /^[\w-]+$/u; +/** +* [Octal](https://en.wikipedia.org/wiki/Octal) regex. +*/ +const OCTAL_REGEX = /^(?:0o)?[0-7]+$/u; +/** +* [RFC 5322 email address](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) regex. +* +* Hint: This regex was taken from the [HTML Living Standard Specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) and does not perfectly represent RFC 5322. +*/ +const RFC_EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; +/** +* [Slug](https://en.wikipedia.org/wiki/Clean_URL#Slug) regex. +*/ +const SLUG_REGEX = /^[\da-z]+(?:[-_][\da-z]+)*$/u; +/** +* [ULID](https://github.com/ulid/spec) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +const ULID_REGEX = /^[\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{26}$/u; +/** +* [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) regex. +*/ +const UUID_REGEX = /^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu; + +//#endregion +//#region src/actions/base64/base64.ts +/* @__NO_SIDE_EFFECTS__ */ +function base64(message$1) { + return { + kind: "validation", + type: "base64", + reference: base64, + async: false, + expects: null, + requirement: BASE64_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Base64", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/bic/bic.ts +/* @__NO_SIDE_EFFECTS__ */ +function bic(message$1) { + return { + kind: "validation", + type: "bic", + reference: bic, + async: false, + expects: null, + requirement: BIC_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "BIC", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/brand/brand.ts +/** +* Creates a brand transformation action. +* +* @param name The brand name. +* +* @returns A brand action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function brand(name) { + return { + kind: "transformation", + type: "brand", + reference: brand, + async: false, + name, + "~run"(dataset) { + return dataset; + } + }; +} + +//#endregion +//#region src/actions/bytes/bytes.ts +/* @__NO_SIDE_EFFECTS__ */ +function bytes(requirement, message$1) { + return { + kind: "validation", + type: "bytes", + reference: bytes, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 !== this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/check/check.ts +/* @__NO_SIDE_EFFECTS__ */ +function check(requirement, message$1) { + return { + kind: "validation", + type: "check", + reference: check, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/check/checkAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function checkAsync(requirement, message$1) { + return { + kind: "validation", + type: "check", + reference: checkAsync, + async: true, + expects: null, + requirement, + message: message$1, + async "~run"(dataset, config$1) { + if (dataset.typed && !await this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/checkItems/checkItems.ts +/* @__NO_SIDE_EFFECTS__ */ +function checkItems(requirement, message$1) { + return { + kind: "validation", + type: "check_items", + reference: checkItems, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) for (let index = 0; index < dataset.value.length; index++) { + const item = dataset.value[index]; + if (!this.requirement(item, index, dataset.value)) _addIssue(this, "item", dataset, config$1, { + input: item, + path: [{ + type: "array", + origin: "value", + input: dataset.value, + key: index, + value: item + }] + }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/checkItems/checkItemsAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function checkItemsAsync(requirement, message$1) { + return { + kind: "validation", + type: "check_items", + reference: checkItemsAsync, + async: true, + expects: null, + requirement, + message: message$1, + async "~run"(dataset, config$1) { + if (dataset.typed) { + const requirementResults = await Promise.all(dataset.value.map(this.requirement)); + for (let index = 0; index < dataset.value.length; index++) if (!requirementResults[index]) { + const item = dataset.value[index]; + _addIssue(this, "item", dataset, config$1, { + input: item, + path: [{ + type: "array", + origin: "value", + input: dataset.value, + key: index, + value: item + }] + }); + } + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/creditCard/creditCard.ts +/** +* Credit card regex. +*/ +const CREDIT_CARD_REGEX = /^(?:\d{13,19}|\d{4}(?: \d{3,6}){2,4}|\d{4}(?:-\d{3,6}){2,4})$/u; +/** +* Sanitize regex. +*/ +const SANITIZE_REGEX = /[- ]/gu; +/** +* Provider regex list. +*/ +const PROVIDER_REGEX_LIST = [ + /^3[47]\d{13}$/u, + /^3(?:0[0-5]|[68]\d)\d{11,13}$/u, + /^6(?:011|5\d{2})\d{12,15}$/u, + /^(?:2131|1800|35\d{3})\d{11}$/u, + /^(?:5[1-5]\d{2}|222\d|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}$/u, + /^(?:6[27]\d{14,17}|81\d{14,17})$/u, + /^4\d{12}(?:\d{3,6})?$/u +]; +/* @__NO_SIDE_EFFECTS__ */ +function creditCard(message$1) { + return { + kind: "validation", + type: "credit_card", + reference: creditCard, + async: false, + expects: null, + requirement(input) { + let sanitized; + return CREDIT_CARD_REGEX.test(input) && (sanitized = input.replace(SANITIZE_REGEX, "")) && PROVIDER_REGEX_LIST.some((regex$1) => regex$1.test(sanitized)) && /* @__PURE__ */ _isLuhnAlgo(sanitized); + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "credit card", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/cuid2/cuid2.ts +/* @__NO_SIDE_EFFECTS__ */ +function cuid2(message$1) { + return { + kind: "validation", + type: "cuid2", + reference: cuid2, + async: false, + expects: null, + requirement: CUID2_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Cuid2", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/decimal/decimal.ts +/* @__NO_SIDE_EFFECTS__ */ +function decimal(message$1) { + return { + kind: "validation", + type: "decimal", + reference: decimal, + async: false, + expects: null, + requirement: DECIMAL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "decimal", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/description/description.ts +/** +* Creates a description metadata action. +* +* @param description_ The description text. +* +* @returns A description action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function description(description_) { + return { + kind: "metadata", + type: "description", + reference: description, + description: description_ + }; +} + +//#endregion +//#region src/actions/digits/digits.ts +/* @__NO_SIDE_EFFECTS__ */ +function digits(message$1) { + return { + kind: "validation", + type: "digits", + reference: digits, + async: false, + expects: null, + requirement: DIGITS_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "digits", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/domain/domain.ts +/* @__NO_SIDE_EFFECTS__ */ +function domain(message$1) { + return { + kind: "validation", + type: "domain", + reference: domain, + expects: null, + async: false, + requirement: DOMAIN_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "domain", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/email/email.ts +/* @__NO_SIDE_EFFECTS__ */ +function email(message$1) { + return { + kind: "validation", + type: "email", + reference: email, + expects: null, + async: false, + requirement: EMAIL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "email", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/emoji/emoji.ts +/* @__NO_SIDE_EFFECTS__ */ +function emoji(message$1) { + return { + kind: "validation", + type: "emoji", + reference: emoji, + async: false, + expects: null, + requirement: EMOJI_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "emoji", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/empty/empty.ts +/* @__NO_SIDE_EFFECTS__ */ +function empty(message$1) { + return { + kind: "validation", + type: "empty", + reference: empty, + async: false, + expects: "0", + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length > 0) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/endsWith/endsWith.ts +/* @__NO_SIDE_EFFECTS__ */ +function endsWith(requirement, message$1) { + return { + kind: "validation", + type: "ends_with", + reference: endsWith, + async: false, + expects: `"${requirement}"`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.endsWith(this.requirement)) _addIssue(this, "end", dataset, config$1, { received: `"${dataset.value.slice(-this.requirement.length)}"` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/entries/entries.ts +/* @__NO_SIDE_EFFECTS__ */ +function entries(requirement, message$1) { + return { + kind: "validation", + type: "entries", + reference: entries, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count !== this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/everyItem/everyItem.ts +/* @__NO_SIDE_EFFECTS__ */ +function everyItem(requirement, message$1) { + return { + kind: "validation", + type: "every_item", + reference: everyItem, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.every(this.requirement)) _addIssue(this, "item", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/examples/examples.ts +/** +* Creates an examples metadata action. +* +* @param examples_ The examples. +* +* @returns An examples action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function examples(examples_) { + return { + kind: "metadata", + type: "examples", + reference: examples, + examples: examples_ + }; +} + +//#endregion +//#region src/actions/excludes/excludes.ts +/* @__NO_SIDE_EFFECTS__ */ +function excludes(requirement, message$1) { + const received = /* @__PURE__ */ _stringify(requirement); + return { + kind: "validation", + type: "excludes", + reference: excludes, + async: false, + expects: `!${received}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.includes(this.requirement)) _addIssue(this, "content", dataset, config$1, { received }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/filterItems/filterItems.ts +/* @__NO_SIDE_EFFECTS__ */ +function filterItems(operation) { + return { + kind: "transformation", + type: "filter_items", + reference: filterItems, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.filter(this.operation); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/findItem/findItem.ts +/* @__NO_SIDE_EFFECTS__ */ +function findItem(operation) { + return { + kind: "transformation", + type: "find_item", + reference: findItem, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.find(this.operation); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/finite/finite.ts +/* @__NO_SIDE_EFFECTS__ */ +function finite(message$1) { + return { + kind: "validation", + type: "finite", + reference: finite, + async: false, + expects: null, + requirement: Number.isFinite, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "finite", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/flavor/flavor.ts +/** +* Creates a flavor transformation action. +* +* @param name The flavor name. +* +* @returns A flavor action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function flavor(name) { + return { + kind: "transformation", + type: "flavor", + reference: flavor, + async: false, + name, + "~run"(dataset) { + return dataset; + } + }; +} + +//#endregion +//#region src/actions/graphemes/graphemes.ts +/* @__NO_SIDE_EFFECTS__ */ +function graphemes(requirement, message$1) { + return { + kind: "validation", + type: "graphemes", + reference: graphemes, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count !== this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/gtValue/gtValue.ts +/* @__NO_SIDE_EFFECTS__ */ +function gtValue(requirement, message$1) { + return { + kind: "validation", + type: "gt_value", + reference: gtValue, + async: false, + expects: `>${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value > this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/guard/guard.ts +/* @__NO_SIDE_EFFECTS__ */ +function guard(requirement, message$1) { + return { + kind: "transformation", + type: "guard", + reference: guard, + async: false, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) { + _addIssue(this, "input", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/hash/hash.ts +/** +* Hash lengths object. +*/ +const HASH_LENGTHS = { + md4: 32, + md5: 32, + sha1: 40, + sha256: 64, + sha384: 96, + sha512: 128, + ripemd128: 32, + ripemd160: 40, + tiger128: 32, + tiger160: 40, + tiger192: 48, + crc32: 8, + crc32b: 8, + adler32: 8 +}; +/* @__NO_SIDE_EFFECTS__ */ +function hash(types, message$1) { + return { + kind: "validation", + type: "hash", + reference: hash, + expects: null, + async: false, + requirement: RegExp(types.map((type) => `^[a-fA-F0-9]{${HASH_LENGTHS[type]}}$`).join("|"), "u"), + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "hash", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/hexadecimal/hexadecimal.ts +/* @__NO_SIDE_EFFECTS__ */ +function hexadecimal(message$1) { + return { + kind: "validation", + type: "hexadecimal", + reference: hexadecimal, + async: false, + expects: null, + requirement: HEXADECIMAL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "hexadecimal", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/hexColor/hexColor.ts +/* @__NO_SIDE_EFFECTS__ */ +function hexColor(message$1) { + return { + kind: "validation", + type: "hex_color", + reference: hexColor, + async: false, + expects: null, + requirement: HEX_COLOR_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "hex color", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/imei/imei.ts +/* @__NO_SIDE_EFFECTS__ */ +function imei(message$1) { + return { + kind: "validation", + type: "imei", + reference: imei, + async: false, + expects: null, + requirement(input) { + return IMEI_REGEX.test(input) && /* @__PURE__ */ _isLuhnAlgo(input); + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "IMEI", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/includes/includes.ts +/* @__NO_SIDE_EFFECTS__ */ +function includes(requirement, message$1) { + const expects = /* @__PURE__ */ _stringify(requirement); + return { + kind: "validation", + type: "includes", + reference: includes, + async: false, + expects, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.includes(this.requirement)) _addIssue(this, "content", dataset, config$1, { received: `!${expects}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/integer/integer.ts +/* @__NO_SIDE_EFFECTS__ */ +function integer(message$1) { + return { + kind: "validation", + type: "integer", + reference: integer, + async: false, + expects: null, + requirement: Number.isInteger, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "integer", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/ip/ip.ts +/* @__NO_SIDE_EFFECTS__ */ +function ip(message$1) { + return { + kind: "validation", + type: "ip", + reference: ip, + async: false, + expects: null, + requirement: IP_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IP", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/ipv4/ipv4.ts +/* @__NO_SIDE_EFFECTS__ */ +function ipv4(message$1) { + return { + kind: "validation", + type: "ipv4", + reference: ipv4, + async: false, + expects: null, + requirement: IPV4_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IPv4", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/ipv6/ipv6.ts +/* @__NO_SIDE_EFFECTS__ */ +function ipv6(message$1) { + return { + kind: "validation", + type: "ipv6", + reference: ipv6, + async: false, + expects: null, + requirement: IPV6_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IPv6", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isbn/utils/_isIsbn10.ts +/** +* [Validates an ISBN-10](https://en.wikipedia.org/wiki/ISBN#ISBN-10_check_digits). +* +* @param input The input value. +* +* @returns `true` if the input is a valid ISBN-10, `false` otherwise. +* +* @internal +*/ +function _isIsbn10(input) { + const digits$1 = input.split("").map((c) => c === "X" ? 10 : parseInt(c)); + let sum = 0; + for (let i = 0; i < 10; i++) sum += digits$1[i] * (10 - i); + return sum % 11 === 0; +} + +//#endregion +//#region src/actions/isbn/utils/_isIsbn13.ts +/** +* [Validates an ISBN-13](https://en.wikipedia.org/wiki/ISBN#ISBN-13_check_digit_calculation). +* +* @param input The input value. +* +* @returns `true` if the input is a valid ISBN-13, `false` otherwise. +* +* @internal +*/ +function _isIsbn13(input) { + const digits$1 = input.split("").map((c) => parseInt(c)); + let sum = 0; + for (let i = 0; i < 13; i++) sum += digits$1[i] * (i % 2 === 0 ? 1 : 3); + return sum % 10 === 0; +} + +//#endregion +//#region src/actions/isbn/isbn.ts +/** +* ISBN separator regex. +*/ +const ISBN_SEPARATOR_REGEX = /[- ]/gu; +/** +* ISBN-10 detection regex. +*/ +const ISBN_10_DETECTION_REGEX = /^\d{9}[\dX]$/u; +/** +* ISBN-13 detection regex. +*/ +const ISBN_13_DETECTION_REGEX = /^\d{13}$/u; +/* @__NO_SIDE_EFFECTS__ */ +function isbn(message$1) { + return { + kind: "validation", + type: "isbn", + reference: isbn, + async: false, + expects: null, + requirement(input) { + const replacedInput = input.replace(ISBN_SEPARATOR_REGEX, ""); + if (ISBN_10_DETECTION_REGEX.test(replacedInput)) return _isIsbn10(replacedInput); + else if (ISBN_13_DETECTION_REGEX.test(replacedInput)) return _isIsbn13(replacedInput); + return false; + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "ISBN", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isrc/isrc.ts +/* @__NO_SIDE_EFFECTS__ */ +function isrc(message$1) { + return { + kind: "validation", + type: "isrc", + reference: isrc, + async: false, + expects: null, + requirement: ISRC_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "ISRC", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoDate/isoDate.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoDate(message$1) { + return { + kind: "validation", + type: "iso_date", + reference: isoDate, + async: false, + expects: null, + requirement: ISO_DATE_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "date", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoDateTime/isoDateTime.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoDateTime(message$1) { + return { + kind: "validation", + type: "iso_date_time", + reference: isoDateTime, + async: false, + expects: null, + requirement: ISO_DATE_TIME_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "date-time", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoDateTimeSecond/isoDateTimeSecond.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoDateTimeSecond(message$1) { + return { + kind: "validation", + type: "iso_date_time_second", + reference: isoDateTimeSecond, + async: false, + expects: null, + requirement: ISO_DATE_TIME_SECOND_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "date-time-second", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoTime/isoTime.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoTime(message$1) { + return { + kind: "validation", + type: "iso_time", + reference: isoTime, + async: false, + expects: null, + requirement: ISO_TIME_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "time", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoTimeSecond/isoTimeSecond.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoTimeSecond(message$1) { + return { + kind: "validation", + type: "iso_time_second", + reference: isoTimeSecond, + async: false, + expects: null, + requirement: ISO_TIME_SECOND_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "time-second", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoTimestamp/isoTimestamp.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoTimestamp(message$1) { + return { + kind: "validation", + type: "iso_timestamp", + reference: isoTimestamp, + async: false, + expects: null, + requirement: ISO_TIMESTAMP_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "timestamp", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoWeek/isoWeek.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoWeek(message$1) { + return { + kind: "validation", + type: "iso_week", + reference: isoWeek, + async: false, + expects: null, + requirement: ISO_WEEK_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "week", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/jwsCompact/jwsCompact.ts +/* @__NO_SIDE_EFFECTS__ */ +function jwsCompact(message$1) { + return { + kind: "validation", + type: "jws_compact", + reference: jwsCompact, + async: false, + expects: null, + requirement: JWS_COMPACT_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "JWS compact", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/length/length.ts +/* @__NO_SIDE_EFFECTS__ */ +function length(requirement, message$1) { + return { + kind: "validation", + type: "length", + reference: length, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length !== this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/ltValue/ltValue.ts +/* @__NO_SIDE_EFFECTS__ */ +function ltValue(requirement, message$1) { + return { + kind: "validation", + type: "lt_value", + reference: ltValue, + async: false, + expects: `<${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value < this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/mac/mac.ts +/* @__NO_SIDE_EFFECTS__ */ +function mac(message$1) { + return { + kind: "validation", + type: "mac", + reference: mac, + async: false, + expects: null, + requirement: MAC_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "MAC", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/mac48/mac48.ts +/* @__NO_SIDE_EFFECTS__ */ +function mac48(message$1) { + return { + kind: "validation", + type: "mac48", + reference: mac48, + async: false, + expects: null, + requirement: MAC48_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "48-bit MAC", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/mac64/mac64.ts +/* @__NO_SIDE_EFFECTS__ */ +function mac64(message$1) { + return { + kind: "validation", + type: "mac64", + reference: mac64, + async: false, + expects: null, + requirement: MAC64_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "64-bit MAC", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/mapItems/mapItems.ts +/* @__NO_SIDE_EFFECTS__ */ +function mapItems(operation) { + return { + kind: "transformation", + type: "map_items", + reference: mapItems, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.map(this.operation); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxBytes/maxBytes.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxBytes(requirement, message$1) { + return { + kind: "validation", + type: "max_bytes", + reference: maxBytes, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 > this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxEntries/maxEntries.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxEntries(requirement, message$1) { + return { + kind: "validation", + type: "max_entries", + reference: maxEntries, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count > this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxGraphemes/maxGraphemes.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxGraphemes(requirement, message$1) { + return { + kind: "validation", + type: "max_graphemes", + reference: maxGraphemes, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count > this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxLength/maxLength.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxLength(requirement, message$1) { + return { + kind: "validation", + type: "max_length", + reference: maxLength, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length > this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxSize/maxSize.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxSize(requirement, message$1) { + return { + kind: "validation", + type: "max_size", + reference: maxSize, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size > this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxValue/maxValue.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxValue(requirement, message$1) { + return { + kind: "validation", + type: "max_value", + reference: maxValue, + async: false, + expects: `<=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value <= this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxWords/maxWords.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxWords(locales, requirement, message$1) { + return { + kind: "validation", + type: "max_words", + reference: maxWords, + async: false, + expects: `<=${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count > this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/metadata/metadata.ts +/** +* Creates a custom metadata action. +* +* @param metadata_ The metadata object. +* +* @returns A metadata action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function metadata(metadata_) { + return { + kind: "metadata", + type: "metadata", + reference: metadata, + metadata: metadata_ + }; +} + +//#endregion +//#region src/actions/mimeType/mimeType.ts +/* @__NO_SIDE_EFFECTS__ */ +function mimeType(requirement, message$1) { + return { + kind: "validation", + type: "mime_type", + reference: mimeType, + async: false, + expects: /* @__PURE__ */ _joinExpects(requirement.map((option) => `"${option}"`), "|"), + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.includes(dataset.value.type)) _addIssue(this, "MIME type", dataset, config$1, { received: `"${dataset.value.type}"` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minBytes/minBytes.ts +/* @__NO_SIDE_EFFECTS__ */ +function minBytes(requirement, message$1) { + return { + kind: "validation", + type: "min_bytes", + reference: minBytes, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 < this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minEntries/minEntries.ts +/* @__NO_SIDE_EFFECTS__ */ +function minEntries(requirement, message$1) { + return { + kind: "validation", + type: "min_entries", + reference: minEntries, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count < this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minGraphemes/minGraphemes.ts +/* @__NO_SIDE_EFFECTS__ */ +function minGraphemes(requirement, message$1) { + return { + kind: "validation", + type: "min_graphemes", + reference: minGraphemes, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count < this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minLength/minLength.ts +/* @__NO_SIDE_EFFECTS__ */ +function minLength(requirement, message$1) { + return { + kind: "validation", + type: "min_length", + reference: minLength, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length < this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minSize/minSize.ts +/* @__NO_SIDE_EFFECTS__ */ +function minSize(requirement, message$1) { + return { + kind: "validation", + type: "min_size", + reference: minSize, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size < this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minValue/minValue.ts +/* @__NO_SIDE_EFFECTS__ */ +function minValue(requirement, message$1) { + return { + kind: "validation", + type: "min_value", + reference: minValue, + async: false, + expects: `>=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value >= this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minWords/minWords.ts +/* @__NO_SIDE_EFFECTS__ */ +function minWords(locales, requirement, message$1) { + return { + kind: "validation", + type: "min_words", + reference: minWords, + async: false, + expects: `>=${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count < this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/multipleOf/multipleOf.ts +/* @__NO_SIDE_EFFECTS__ */ +function multipleOf(requirement, message$1) { + return { + kind: "validation", + type: "multiple_of", + reference: multipleOf, + async: false, + expects: `%${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value % this.requirement != 0) _addIssue(this, "multiple", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/nanoid/nanoid.ts +/* @__NO_SIDE_EFFECTS__ */ +function nanoid(message$1) { + return { + kind: "validation", + type: "nanoid", + reference: nanoid, + async: false, + expects: null, + requirement: NANO_ID_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Nano ID", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/nonEmpty/nonEmpty.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonEmpty(message$1) { + return { + kind: "validation", + type: "non_empty", + reference: nonEmpty, + async: false, + expects: "!0", + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length === 0) _addIssue(this, "length", dataset, config$1, { received: "0" }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/normalize/normalize.ts +/* @__NO_SIDE_EFFECTS__ */ +function normalize(form) { + return { + kind: "transformation", + type: "normalize", + reference: normalize, + async: false, + form, + "~run"(dataset) { + dataset.value = dataset.value.normalize(this.form); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notBytes/notBytes.ts +/* @__NO_SIDE_EFFECTS__ */ +function notBytes(requirement, message$1) { + return { + kind: "validation", + type: "not_bytes", + reference: notBytes, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 === this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notEntries/notEntries.ts +/* @__NO_SIDE_EFFECTS__ */ +function notEntries(requirement, message$1) { + return { + kind: "validation", + type: "not_entries", + reference: notEntries, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count === this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notGraphemes/notGraphemes.ts +/* @__NO_SIDE_EFFECTS__ */ +function notGraphemes(requirement, message$1) { + return { + kind: "validation", + type: "not_graphemes", + reference: notGraphemes, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count === this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notLength/notLength.ts +/* @__NO_SIDE_EFFECTS__ */ +function notLength(requirement, message$1) { + return { + kind: "validation", + type: "not_length", + reference: notLength, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length === this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notSize/notSize.ts +/* @__NO_SIDE_EFFECTS__ */ +function notSize(requirement, message$1) { + return { + kind: "validation", + type: "not_size", + reference: notSize, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size === this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notValue/notValue.ts +/* @__NO_SIDE_EFFECTS__ */ +function notValue(requirement, message$1) { + return { + kind: "validation", + type: "not_value", + reference: notValue, + async: false, + expects: requirement instanceof Date ? `!${requirement.toJSON()}` : `!${/* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && this.requirement <= dataset.value && this.requirement >= dataset.value) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notValues/notValues.ts +/* @__NO_SIDE_EFFECTS__ */ +function notValues(requirement, message$1) { + return { + kind: "validation", + type: "not_values", + reference: notValues, + async: false, + expects: `!${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), "|")}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && this.requirement.some((value$1) => value$1 <= dataset.value && value$1 >= dataset.value)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notWords/notWords.ts +/* @__NO_SIDE_EFFECTS__ */ +function notWords(locales, requirement, message$1) { + return { + kind: "validation", + type: "not_words", + reference: notWords, + async: false, + expects: `!${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count === this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/octal/octal.ts +/* @__NO_SIDE_EFFECTS__ */ +function octal(message$1) { + return { + kind: "validation", + type: "octal", + reference: octal, + async: false, + expects: null, + requirement: OCTAL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "octal", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/parseBoolean/parseBoolean.ts +const TRUTHY = [ + true, + 1, + "true", + "1", + "yes", + "y", + "on", + "enabled" +]; +const FALSY = [ + false, + 0, + "false", + "0", + "no", + "n", + "off", + "disabled" +]; +/* @__NO_SIDE_EFFECTS__ */ +function parseBoolean(config$1, message$1) { + const normalize$1 = (v) => typeof v === "string" ? v.toLowerCase() : v; + const truthyRaw = config$1?.truthy ?? TRUTHY; + const falsyRaw = config$1?.falsy ?? FALSY; + const truthy = config$1?.truthy ? config$1.truthy.map(normalize$1) : TRUTHY; + const falsy = config$1?.falsy ? config$1.falsy.map(normalize$1) : FALSY; + return { + kind: "transformation", + type: "parse_boolean", + reference: parseBoolean, + expects: /* @__PURE__ */ _joinExpects([...truthyRaw, ...falsyRaw].map(_stringify), "|"), + config: config$1, + message: message$1, + async: false, + "~run"(dataset, config$2) { + const input = normalize$1(dataset.value); + if (truthy.includes(input)) dataset.value = true; + else if (falsy.includes(input)) dataset.value = false; + else { + _addIssue(this, "boolean", dataset, config$2); + dataset.typed = false; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/parseJson/parseJson.ts +/* @__NO_SIDE_EFFECTS__ */ +function parseJson(config$1, message$1) { + return { + kind: "transformation", + type: "parse_json", + reference: parseJson, + config: config$1, + message: message$1, + async: false, + "~run"(dataset, config$2) { + try { + dataset.value = JSON.parse(dataset.value, this.config?.reviver); + } catch (error) { + if (error instanceof Error) { + _addIssue(this, "JSON", dataset, config$2, { received: `"${error.message}"` }); + dataset.typed = false; + } else throw error; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/partialCheck/utils/_isPartiallyTyped/_isPartiallyTyped.ts +/** +* Checks if a dataset is partially typed. +* +* @param dataset The dataset to check. +* @param paths The paths to check. +* +* @returns Whether it is partially typed. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _isPartiallyTyped(dataset, paths) { + if (dataset.issues) for (const path of paths) for (const issue of dataset.issues) { + let typed = false; + const bound = Math.min(path.length, issue.path?.length ?? 0); + for (let index = 0; index < bound; index++) if (path[index] !== issue.path[index].key && (path[index] !== "$" || issue.path[index].type !== "array")) { + typed = true; + break; + } + if (!typed) return false; + } + return true; +} + +//#endregion +//#region src/actions/partialCheck/partialCheck.ts +/* @__NO_SIDE_EFFECTS__ */ +function partialCheck(paths, requirement, message$1) { + return { + kind: "validation", + type: "partial_check", + reference: partialCheck, + async: false, + expects: null, + paths, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/partialCheck/partialCheckAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function partialCheckAsync(paths, requirement, message$1) { + return { + kind: "validation", + type: "partial_check", + reference: partialCheckAsync, + async: true, + expects: null, + paths, + requirement, + message: message$1, + async "~run"(dataset, config$1) { + if ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !await this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/rawCheck/rawCheck.ts +/** +* Creates a raw check validation action. +* +* @param action The validation action. +* +* @returns A raw check action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function rawCheck(action) { + return { + kind: "validation", + type: "raw_check", + reference: rawCheck, + async: false, + expects: null, + "~run"(dataset, config$1) { + action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info) + }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/rawCheck/rawCheckAsync.ts +/** +* Creates a raw check validation action. +* +* @param action The validation action. +* +* @returns A raw check action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function rawCheckAsync(action) { + return { + kind: "validation", + type: "raw_check", + reference: rawCheckAsync, + async: true, + expects: null, + async "~run"(dataset, config$1) { + await action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info) + }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/rawTransform/rawTransform.ts +/** +* Creates a raw transformation action. +* +* @param action The transformation action. +* +* @returns A raw transform action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function rawTransform(action) { + return { + kind: "transformation", + type: "raw_transform", + reference: rawTransform, + async: false, + "~run"(dataset, config$1) { + const output = action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info), + NEVER: null + }); + if (dataset.issues) dataset.typed = false; + else dataset.value = output; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/rawTransform/rawTransformAsync.ts +/** +* Creates a raw transformation action. +* +* @param action The transformation action. +* +* @returns A raw transform action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function rawTransformAsync(action) { + return { + kind: "transformation", + type: "raw_transform", + reference: rawTransformAsync, + async: true, + async "~run"(dataset, config$1) { + const output = await action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info), + NEVER: null + }); + if (dataset.issues) dataset.typed = false; + else dataset.value = output; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/readonly/readonly.ts +/* @__NO_SIDE_EFFECTS__ */ +function readonly() { + return { + kind: "transformation", + type: "readonly", + reference: readonly, + async: false, + "~run"(dataset) { + return dataset; + } + }; +} + +//#endregion +//#region src/actions/reduceItems/reduceItems.ts +/* @__NO_SIDE_EFFECTS__ */ +function reduceItems(operation, initial) { + return { + kind: "transformation", + type: "reduce_items", + reference: reduceItems, + async: false, + operation, + initial, + "~run"(dataset) { + dataset.value = dataset.value.reduce(this.operation, this.initial); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/regex/regex.ts +/* @__NO_SIDE_EFFECTS__ */ +function regex(requirement, message$1) { + return { + kind: "validation", + type: "regex", + reference: regex, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "format", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/returns/returns.ts +/* @__NO_SIDE_EFFECTS__ */ +function returns(schema) { + return { + kind: "transformation", + type: "returns", + reference: returns, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = (...args_) => { + const returnsDataset = this.schema["~run"]({ value: func(...args_) }, config$1); + if (returnsDataset.issues) throw new ValiError(returnsDataset.issues); + return returnsDataset.value; + }; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/returns/returnsAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function returnsAsync(schema) { + return { + kind: "transformation", + type: "returns", + reference: returnsAsync, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = async (...args_) => { + const returnsDataset = await this.schema["~run"]({ value: await func(...args_) }, config$1); + if (returnsDataset.issues) throw new ValiError(returnsDataset.issues); + return returnsDataset.value; + }; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/rfcEmail/rfcEmail.ts +/* @__NO_SIDE_EFFECTS__ */ +function rfcEmail(message$1) { + return { + kind: "validation", + type: "rfc_email", + reference: rfcEmail, + expects: null, + async: false, + requirement: RFC_EMAIL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "email", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/safeInteger/safeInteger.ts +/* @__NO_SIDE_EFFECTS__ */ +function safeInteger(message$1) { + return { + kind: "validation", + type: "safe_integer", + reference: safeInteger, + async: false, + expects: null, + requirement: Number.isSafeInteger, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "safe integer", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/size/size.ts +/* @__NO_SIDE_EFFECTS__ */ +function size(requirement, message$1) { + return { + kind: "validation", + type: "size", + reference: size, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size !== this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/slug/slug.ts +/* @__NO_SIDE_EFFECTS__ */ +function slug(message$1) { + return { + kind: "validation", + type: "slug", + reference: slug, + async: false, + expects: null, + requirement: SLUG_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "slug", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/someItem/someItem.ts +/* @__NO_SIDE_EFFECTS__ */ +function someItem(requirement, message$1) { + return { + kind: "validation", + type: "some_item", + reference: someItem, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.some(this.requirement)) _addIssue(this, "item", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/sortItems/sortItems.ts +/* @__NO_SIDE_EFFECTS__ */ +function sortItems(operation) { + return { + kind: "transformation", + type: "sort_items", + reference: sortItems, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.sort(this.operation); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/startsWith/startsWith.ts +/* @__NO_SIDE_EFFECTS__ */ +function startsWith(requirement, message$1) { + return { + kind: "validation", + type: "starts_with", + reference: startsWith, + async: false, + expects: `"${requirement}"`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.startsWith(this.requirement)) _addIssue(this, "start", dataset, config$1, { received: `"${dataset.value.slice(0, this.requirement.length)}"` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/stringifyJson/stringifyJson.ts +/* @__NO_SIDE_EFFECTS__ */ +function stringifyJson(config$1, message$1) { + return { + kind: "transformation", + type: "stringify_json", + reference: stringifyJson, + message: message$1, + config: config$1, + async: false, + "~run"(dataset, config$2) { + try { + const output = JSON.stringify(dataset.value, this.config?.replacer, this.config?.space); + if (output === void 0) { + _addIssue(this, "JSON", dataset, config$2); + dataset.typed = false; + } + dataset.value = output; + } catch (error) { + if (error instanceof Error) { + _addIssue(this, "JSON", dataset, config$2, { received: `"${error.message}"` }); + dataset.typed = false; + } else throw error; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/title/title.ts +/** +* Creates a title metadata action. +* +* @param title_ The title text. +* +* @returns A title action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function title(title_) { + return { + kind: "metadata", + type: "title", + reference: title, + title: title_ + }; +} + +//#endregion +//#region src/actions/toBigint/toBigint.ts +/* @__NO_SIDE_EFFECTS__ */ +function toBigint(message$1) { + return { + kind: "transformation", + type: "to_bigint", + reference: toBigint, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = BigInt(dataset.value); + } catch { + _addIssue(this, "bigint", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toBoolean/toBoolean.ts +/** +* Creates a to boolean transformation action. +* +* @returns A to boolean action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toBoolean() { + return { + kind: "transformation", + type: "to_boolean", + reference: toBoolean, + async: false, + "~run"(dataset) { + dataset.value = Boolean(dataset.value); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toCamelCase/toCamelCase.ts +/** +* Creates a to camel case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `parseUrlValue`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `item2Name`). +* +* @returns A to camel case action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toCamelCase() { + return { + kind: "transformation", + type: "to_camel_case", + reference: toCamelCase, + async: false, + "~run"(dataset) { + dataset.value = /* @__PURE__ */ _formatCase(dataset.value, "", false, true); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toDate/toDate.ts +/* @__NO_SIDE_EFFECTS__ */ +function toDate(message$1) { + return { + kind: "transformation", + type: "to_date", + reference: toDate, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = new Date(dataset.value); + if (isNaN(dataset.value)) { + _addIssue(this, "date", dataset, config$1, { received: "\"Invalid Date\"" }); + dataset.typed = false; + } + } catch { + _addIssue(this, "date", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toKebabCase/toKebabCase.ts +/** +* Creates a to kebab case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `parse-url-value`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `item2-name`). +* +* @returns A to kebab case action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toKebabCase() { + return { + kind: "transformation", + type: "to_kebab_case", + reference: toKebabCase, + async: false, + "~run"(dataset) { + dataset.value = /* @__PURE__ */ _formatCase(dataset.value, "-", false, false); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toLowerCase/toLowerCase.ts +/** +* Creates a to lower case transformation action. +* +* @returns A to lower case action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toLowerCase() { + return { + kind: "transformation", + type: "to_lower_case", + reference: toLowerCase, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.toLowerCase(); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toMaxValue/toMaxValue.ts +/** +* Creates a to max value transformation action. +* +* @param requirement The maximum value. +* +* @returns A to max value action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toMaxValue(requirement) { + return { + kind: "transformation", + type: "to_max_value", + reference: toMaxValue, + async: false, + requirement, + "~run"(dataset) { + dataset.value = dataset.value > this.requirement ? this.requirement : dataset.value; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toMinValue/toMinValue.ts +/** +* Creates a to min value transformation action. +* +* @param requirement The minimum value. +* +* @returns A to min value action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toMinValue(requirement) { + return { + kind: "transformation", + type: "to_min_value", + reference: toMinValue, + async: false, + requirement, + "~run"(dataset) { + dataset.value = dataset.value < this.requirement ? this.requirement : dataset.value; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toNumber/toNumber.ts +/* @__NO_SIDE_EFFECTS__ */ +function toNumber(message$1) { + return { + kind: "transformation", + type: "to_number", + reference: toNumber, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = Number(dataset.value); + if (isNaN(dataset.value)) { + _addIssue(this, "number", dataset, config$1); + dataset.typed = false; + } + } catch { + _addIssue(this, "number", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toPascalCase/toPascalCase.ts +/** +* Creates a to pascal case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `ParseUrlValue`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `Item2Name`). +* +* @returns A to pascal case action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toPascalCase() { + return { + kind: "transformation", + type: "to_pascal_case", + reference: toPascalCase, + async: false, + "~run"(dataset) { + dataset.value = /* @__PURE__ */ _formatCase(dataset.value, "", true, true); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toSnakeCase/toSnakeCase.ts +/** +* Creates a to snake case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `parse_url_value`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `item2_name`). +* +* @returns A to snake case action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toSnakeCase() { + return { + kind: "transformation", + type: "to_snake_case", + reference: toSnakeCase, + async: false, + "~run"(dataset) { + dataset.value = /* @__PURE__ */ _formatCase(dataset.value, "_", false, false); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toString/toString.ts +/* @__NO_SIDE_EFFECTS__ */ +function toString(message$1) { + return { + kind: "transformation", + type: "to_string", + reference: toString, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = String(dataset.value); + } catch { + _addIssue(this, "string", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toUpperCase/toUpperCase.ts +/** +* Creates a to upper case transformation action. +* +* @returns A to upper case action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toUpperCase() { + return { + kind: "transformation", + type: "to_upper_case", + reference: toUpperCase, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.toUpperCase(); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/transform/transform.ts +/** +* Creates a custom transformation action. +* +* @param operation The transformation operation. +* +* @returns A transform action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function transform(operation) { + return { + kind: "transformation", + type: "transform", + reference: transform, + async: false, + operation, + "~run"(dataset) { + dataset.value = this.operation(dataset.value); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/transform/transformAsync.ts +/** +* Creates a custom transformation action. +* +* @param operation The transformation operation. +* +* @returns A transform action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function transformAsync(operation) { + return { + kind: "transformation", + type: "transform", + reference: transformAsync, + async: true, + operation, + async "~run"(dataset) { + dataset.value = await this.operation(dataset.value); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/trim/trim.ts +/** +* Creates a trim transformation action. +* +* @returns A trim action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function trim() { + return { + kind: "transformation", + type: "trim", + reference: trim, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.trim(); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/trimEnd/trimEnd.ts +/** +* Creates a trim end transformation action. +* +* @returns A trim end action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function trimEnd() { + return { + kind: "transformation", + type: "trim_end", + reference: trimEnd, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.trimEnd(); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/trimStart/trimStart.ts +/** +* Creates a trim start transformation action. +* +* @returns A trim start action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function trimStart() { + return { + kind: "transformation", + type: "trim_start", + reference: trimStart, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.trimStart(); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/ulid/ulid.ts +/* @__NO_SIDE_EFFECTS__ */ +function ulid(message$1) { + return { + kind: "validation", + type: "ulid", + reference: ulid, + async: false, + expects: null, + requirement: ULID_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "ULID", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/url/url.ts +/* @__NO_SIDE_EFFECTS__ */ +function url(message$1) { + return { + kind: "validation", + type: "url", + reference: url, + async: false, + expects: null, + requirement(input) { + try { + new URL(input); + return true; + } catch { + return false; + } + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "URL", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/uuid/uuid.ts +/* @__NO_SIDE_EFFECTS__ */ +function uuid(message$1) { + return { + kind: "validation", + type: "uuid", + reference: uuid, + async: false, + expects: null, + requirement: UUID_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "UUID", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/value/value.ts +/* @__NO_SIDE_EFFECTS__ */ +function value(requirement, message$1) { + return { + kind: "validation", + type: "value", + reference: value, + async: false, + expects: requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement), + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(this.requirement <= dataset.value && this.requirement >= dataset.value)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/values/values.ts +/* @__NO_SIDE_EFFECTS__ */ +function values(requirement, message$1) { + return { + kind: "validation", + type: "values", + reference: values, + async: false, + expects: `${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), "|")}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.some((value$1) => value$1 <= dataset.value && value$1 >= dataset.value)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/words/words.ts +/* @__NO_SIDE_EFFECTS__ */ +function words(locales, requirement, message$1) { + return { + kind: "validation", + type: "words", + reference: words, + async: false, + expects: `${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count !== this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/const.ts +const ABORT_EARLY_CONFIG = { abortEarly: true }; + +//#endregion +//#region src/methods/assert/assert.ts +/** +* Checks if the input matches the schema. As this is an assertion function, it +* can be used as a type guard. +* +* @param schema The schema to be used. +* @param input The input to be tested. +*/ +function assert(schema, input) { + const issues = schema["~run"]({ value: input }, ABORT_EARLY_CONFIG).issues; + if (issues) throw new ValiError(issues); +} + +//#endregion +//#region src/methods/cache/_LruCache.ts +/** +* Efficient LRU cache using Map iteration order. +*/ +var _LruCache = class { + constructor(config$1) { + this.refCount = 0; + this.maxSize = config$1?.maxSize ?? 1e3; + this.maxAge = config$1?.maxAge ?? Infinity; + this.hasMaxAge = isFinite(this.maxAge); + } + /** + * Stringifies an unknown input to a cache key component. + * + * @param input The unknown input. + * + * @returns A cache key component. + */ + stringify(input) { + const type = typeof input; + if (type === "string") return `"${input}"`; + if (type === "number" || type === "boolean") return `${input}`; + if (type === "bigint") return `${input}n`; + if (type === "object" || type === "function") { + if (input) { + this.refIds ?? (this.refIds = /* @__PURE__ */ new WeakMap()); + let id = this.refIds.get(input); + if (!id) { + id = ++this.refCount; + this.refIds.set(input, id); + } + return `#${id}`; + } + return "null"; + } + return type; + } + /** + * Creates a cache key from input and config. + * + * @param input The input value. + * @param config The parse configuration. + * + * @returns The cache key. + */ + key(input, config$1 = {}) { + return `${this.stringify(input)}|${this.stringify(config$1.lang)}|${this.stringify(config$1.message)}|${this.stringify(config$1.abortEarly)}|${this.stringify(config$1.abortPipeEarly)}`; + } + /** + * Gets a value from the cache by key. + * + * @param key The cache key. + * + * @returns The cached value. + */ + get(key) { + if (!this.store) return void 0; + const entry = this.store.get(key); + if (!entry) return void 0; + if (this.hasMaxAge && Date.now() - entry[1] > this.maxAge) { + this.store.delete(key); + return; + } + this.store.delete(key); + this.store.set(key, entry); + return entry[0]; + } + /** + * Sets a value in the cache by key. + * + * @param key The cache key. + * @param value The cached value. + */ + set(key, value$1) { + this.store ?? (this.store = /* @__PURE__ */ new Map()); + this.store.delete(key); + const timestamp = this.hasMaxAge ? Date.now() : 0; + this.store.set(key, [value$1, timestamp]); + if (this.store.size > this.maxSize) this.store.delete(this.store.keys().next().value); + } + /** + * Clears all entries from the cache. + */ + clear() { + this.store?.clear(); + } +}; + +//#endregion +//#region src/methods/cache/cache.ts +/* @__NO_SIDE_EFFECTS__ */ +function cache(schema, config$1) { + return { + ...schema, + cacheConfig: config$1, + cache: new _LruCache(config$1), + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, runConfig) { + const key = this.cache.key(dataset.value, runConfig); + let outputDataset = this.cache.get(key); + if (!outputDataset) this.cache.set(key, outputDataset = schema["~run"](dataset, runConfig)); + return /* @__PURE__ */ _cloneDataset(outputDataset); + } + }; +} + +//#endregion +//#region src/methods/cache/cacheAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function cacheAsync(schema, config$1) { + let activeRuns; + return { + ...schema, + async: true, + cacheConfig: config$1, + cache: new _LruCache(config$1), + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, runConfig) { + const key = this.cache.key(dataset.value, runConfig); + const cached = this.cache.get(key); + if (cached) return /* @__PURE__ */ _cloneDataset(cached); + let promise$1 = activeRuns?.get(key); + if (!promise$1) { + activeRuns ?? (activeRuns = /* @__PURE__ */ new Map()); + promise$1 = Promise.resolve(schema["~run"](dataset, runConfig)); + activeRuns.set(key, promise$1); + } + try { + const outputDataset = await promise$1; + this.cache.set(key, outputDataset); + return /* @__PURE__ */ _cloneDataset(outputDataset); + } finally { + activeRuns?.delete(key); + } + } + }; +} + +//#endregion +//#region src/methods/config/config.ts +/** +* Changes the local configuration of a schema. +* +* @param schema The schema to configure. +* @param config The parse configuration. +* +* @returns The configured schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function config(schema, config$1) { + return { + ...schema, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config_) { + return schema["~run"](dataset, { + ...config_, + ...config$1 + }); + } + }; +} + +//#endregion +//#region src/methods/getFallback/getFallback.ts +/** +* Returns the fallback value of the schema. +* +* @param schema The schema to get it from. +* @param dataset The output dataset if available. +* @param config The config if available. +* +* @returns The fallback value. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getFallback(schema, dataset, config$1) { + return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback; +} + +//#endregion +//#region src/methods/fallback/fallback.ts +/** +* Returns a fallback value as output if the input does not match the schema. +* +* @param schema The schema to catch. +* @param fallback The fallback value. +* +* @returns The passed schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function fallback(schema, fallback$1) { + return { + ...schema, + fallback: fallback$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const outputDataset = schema["~run"](dataset, config$1); + return outputDataset.issues ? { + typed: true, + value: /* @__PURE__ */ getFallback(this, outputDataset, config$1) + } : outputDataset; + } + }; +} + +//#endregion +//#region src/methods/fallback/fallbackAsync.ts +/** +* Returns a fallback value as output if the input does not match the schema. +* +* @param schema The schema to catch. +* @param fallback The fallback value. +* +* @returns The passed schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function fallbackAsync(schema, fallback$1) { + return { + ...schema, + fallback: fallback$1, + async: true, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const outputDataset = await schema["~run"](dataset, config$1); + return outputDataset.issues ? { + typed: true, + value: await /* @__PURE__ */ getFallback(this, outputDataset, config$1) + } : outputDataset; + } + }; +} + +//#endregion +//#region src/methods/flatten/flatten.ts +/* @__NO_SIDE_EFFECTS__ */ +function flatten(issues) { + const flatErrors = {}; + for (const issue of issues) if (issue.path) { + const dotPath = /* @__PURE__ */ getDotPath(issue); + if (dotPath) { + if (!flatErrors.nested) flatErrors.nested = {}; + if (Object.prototype.hasOwnProperty.call(flatErrors.nested, dotPath)) flatErrors.nested[dotPath].push(issue.message); + else flatErrors.nested[dotPath] = [issue.message]; + } else if (flatErrors.other) flatErrors.other.push(issue.message); + else flatErrors.other = [issue.message]; + } else if (flatErrors.root) flatErrors.root.push(issue.message); + else flatErrors.root = [issue.message]; + return flatErrors; +} + +//#endregion +//#region src/methods/forward/forward.ts +/** +* Forwards the issues of the passed validation action. +* +* @param action The validation action. +* @param path The path to forward the issues to. +* +* @returns The modified action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function forward(action, path) { + return { + ...action, + "~run"(dataset, config$1) { + const prevIssues = dataset.issues && [...dataset.issues]; + dataset = action["~run"](dataset, config$1); + if (dataset.issues) { + for (const issue of dataset.issues) if (!prevIssues?.includes(issue)) { + let pathInput = dataset.value; + for (const key of path) { + const pathValue = pathInput[key]; + const pathItem = { + type: "unknown", + origin: "value", + input: pathInput, + key, + value: pathValue + }; + if (issue.path) issue.path.push(pathItem); + else issue.path = [pathItem]; + if (!pathValue) break; + pathInput = pathValue; + } + } + } + return dataset; + } + }; +} + +//#endregion +//#region src/methods/forward/forwardAsync.ts +/** +* Forwards the issues of the passed validation action. +* +* @param action The validation action. +* @param path The path to forward the issues to. +* +* @returns The modified action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function forwardAsync(action, path) { + return { + ...action, + async: true, + async "~run"(dataset, config$1) { + const prevIssues = dataset.issues && [...dataset.issues]; + dataset = await action["~run"](dataset, config$1); + if (dataset.issues) { + for (const issue of dataset.issues) if (!prevIssues?.includes(issue)) { + let pathInput = dataset.value; + for (const key of path) { + const pathValue = pathInput[key]; + const pathItem = { + type: "unknown", + origin: "value", + input: pathInput, + key, + value: pathValue + }; + if (issue.path) issue.path.push(pathItem); + else issue.path = [pathItem]; + if (!pathValue) break; + pathInput = pathValue; + } + } + } + return dataset; + } + }; +} + +//#endregion +//#region src/methods/getDefault/getDefault.ts +/** +* Returns the default value of the schema. +* +* @param schema The schema to get it from. +* @param dataset The input dataset if available. +* @param config The config if available. +* +* @returns The default value. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getDefault(schema, dataset, config$1) { + return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default; +} + +//#endregion +//#region src/methods/getDefaults/getDefaults.ts +/** +* Returns the default values of the schema. +* +* Hint: The difference to `getDefault` is that for object and tuple schemas +* this function recursively returns the default values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The default values. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getDefaults(schema) { + if ("entries" in schema) { + const object$1 = {}; + for (const key in schema.entries) object$1[key] = /* @__PURE__ */ getDefaults(schema.entries[key]); + return object$1; + } + if ("items" in schema) return schema.items.map(getDefaults); + return /* @__PURE__ */ getDefault(schema); +} + +//#endregion +//#region src/methods/getDefaults/getDefaultsAsync.ts +/** +* Returns the default values of the schema. +* +* Hint: The difference to `getDefault` is that for object and tuple schemas +* this function recursively returns the default values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The default values. +*/ +/* @__NO_SIDE_EFFECTS__ */ +async function getDefaultsAsync(schema) { + if ("entries" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getDefaultsAsync(value$1)]))); + if ("items" in schema) return Promise.all(schema.items.map(getDefaultsAsync)); + return /* @__PURE__ */ getDefault(schema); +} + +//#endregion +//#region src/methods/getDescription/getDescription.ts +/** +* Returns the description of the schema. +* +* If multiple descriptions are defined, the last one of the highest level is +* returned. If no description is defined, `undefined` is returned. +* +* @param schema The schema to get the description from. +* +* @returns The description, if any. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getDescription(schema) { + return /* @__PURE__ */ _getLastMetadata(schema, "description"); +} + +//#endregion +//#region src/methods/getExamples/getExamples.ts +/** +* Returns the examples of a schema. +* +* If multiple examples are defined, it concatenates them using depth-first +* search. If no examples are defined, an empty array is returned. +* +* @param schema The schema to get the examples from. +* +* @returns The examples, if any. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getExamples(schema) { + const examples$1 = []; + function depthFirstCollect(schema$1) { + if ("pipe" in schema$1) { + for (const item of schema$1.pipe) if (item.kind === "schema" && "pipe" in item) depthFirstCollect(item); + else if (item.kind === "metadata" && item.type === "examples") for (const example of item.examples) examples$1.push(example); + } + } + depthFirstCollect(schema); + return examples$1; +} + +//#endregion +//#region src/methods/getFallbacks/getFallbacks.ts +/** +* Returns the fallback values of the schema. +* +* Hint: The difference to `getFallback` is that for object and tuple schemas +* this function recursively returns the fallback values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The fallback values. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getFallbacks(schema) { + if ("entries" in schema) { + const object$1 = {}; + for (const key in schema.entries) object$1[key] = /* @__PURE__ */ getFallbacks(schema.entries[key]); + return object$1; + } + if ("items" in schema) return schema.items.map(getFallbacks); + return /* @__PURE__ */ getFallback(schema); +} + +//#endregion +//#region src/methods/getFallbacks/getFallbacksAsync.ts +/** +* Returns the fallback values of the schema. +* +* Hint: The difference to `getFallback` is that for object and tuple schemas +* this function recursively returns the fallback values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The fallback values. +*/ +/* @__NO_SIDE_EFFECTS__ */ +async function getFallbacksAsync(schema) { + if ("entries" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getFallbacksAsync(value$1)]))); + if ("items" in schema) return Promise.all(schema.items.map(getFallbacksAsync)); + return /* @__PURE__ */ getFallback(schema); +} + +//#endregion +//#region src/methods/getMetadata/getMetadata.ts +/** +* Returns the metadata of a schema. +* +* If multiple metadata are defined, it shallowly merges them using depth-first +* search. If no metadata is defined, an empty object is returned. +* +* @param schema Schema to get the metadata from. +* +* @returns The metadata, if any. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getMetadata(schema) { + const result = {}; + function depthFirstMerge(schema$1) { + if ("pipe" in schema$1) { + for (const item of schema$1.pipe) if (item.kind === "schema" && "pipe" in item) depthFirstMerge(item); + else if (item.kind === "metadata" && item.type === "metadata") Object.assign(result, item.metadata); + } + } + depthFirstMerge(schema); + return result; +} + +//#endregion +//#region src/methods/getTitle/getTitle.ts +/** +* Returns the title of the schema. +* +* If multiple titles are defined, the last one of the highest level is +* returned. If no title is defined, `undefined` is returned. +* +* @param schema The schema to get the title from. +* +* @returns The title, if any. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getTitle(schema) { + return /* @__PURE__ */ _getLastMetadata(schema, "title"); +} + +//#endregion +//#region src/methods/is/is.ts +/** +* Checks if the input matches the schema. By using a type predicate, this +* function can be used as a type guard. +* +* @param schema The schema to be used. +* @param input The input to be tested. +* +* @returns Whether the input matches the schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function is(schema, input) { + return !schema["~run"]({ value: input }, ABORT_EARLY_CONFIG).issues; +} + +//#endregion +//#region src/schemas/any/any.ts +/** +* Creates an any schema. +* +* Hint: This schema function exists only for completeness and is not +* recommended in practice. Instead, `unknown` should be used to accept +* unknown data. +* +* @returns An any schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function any() { + return { + kind: "schema", + type: "any", + reference: any, + expects: "any", + async: false, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset) { + dataset.typed = true; + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/array/array.ts +/* @__NO_SIDE_EFFECTS__ */ +function array(item, message$1) { + return { + kind: "schema", + type: "array", + reference: array, + expects: "Array", + async: false, + item, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < input.length; key++) { + const value$1 = input[key]; + const itemDataset = this.item["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/array/arrayAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function arrayAsync(item, message$1) { + return { + kind: "schema", + type: "array", + reference: arrayAsync, + expects: "Array", + async: true, + item, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(input.map((value$1) => this.item["~run"]({ value: value$1 }, config$1))); + for (let key = 0; key < itemDatasets.length; key++) { + const itemDataset = itemDatasets[key]; + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: input[key] + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/bigint/bigint.ts +/* @__NO_SIDE_EFFECTS__ */ +function bigint(message$1) { + return { + kind: "schema", + type: "bigint", + reference: bigint, + expects: "bigint", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "bigint") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/blob/blob.ts +/* @__NO_SIDE_EFFECTS__ */ +function blob(message$1) { + return { + kind: "schema", + type: "blob", + reference: blob, + expects: "Blob", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof Blob) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/boolean/boolean.ts +/* @__NO_SIDE_EFFECTS__ */ +function boolean(message$1) { + return { + kind: "schema", + type: "boolean", + reference: boolean, + expects: "boolean", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "boolean") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/custom/custom.ts +/* @__NO_SIDE_EFFECTS__ */ +function custom(check$1, message$1) { + return { + kind: "schema", + type: "custom", + reference: custom, + expects: "unknown", + async: false, + check: check$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.check(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/custom/customAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function customAsync(check$1, message$1) { + return { + kind: "schema", + type: "custom", + reference: customAsync, + expects: "unknown", + async: true, + check: check$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (await this.check(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/date/date.ts +/* @__NO_SIDE_EFFECTS__ */ +function date(message$1) { + return { + kind: "schema", + type: "date", + reference: date, + expects: "Date", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof Date) if (!isNaN(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1, { received: "\"Invalid Date\"" }); + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/enum/enum.ts +/* @__NO_SIDE_EFFECTS__ */ +function enum_(enum__, message$1) { + const options = []; + for (const key in enum__) if (`${+key}` !== key || typeof enum__[key] !== "string" || !Object.is(enum__[enum__[key]], +key)) options.push(enum__[key]); + return { + kind: "schema", + type: "enum", + reference: enum_, + expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"), + async: false, + enum: enum__, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.options.includes(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/exactOptional/exactOptional.ts +/* @__NO_SIDE_EFFECTS__ */ +function exactOptional(wrapped, default_) { + return { + kind: "schema", + type: "exact_optional", + reference: exactOptional, + expects: wrapped.expects, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/exactOptional/exactOptionalAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function exactOptionalAsync(wrapped, default_) { + return { + kind: "schema", + type: "exact_optional", + reference: exactOptionalAsync, + expects: wrapped.expects, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/file/file.ts +/* @__NO_SIDE_EFFECTS__ */ +function file(message$1) { + return { + kind: "schema", + type: "file", + reference: file, + expects: "File", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof File) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/function/function.ts +/* @__NO_SIDE_EFFECTS__ */ +function function_(message$1) { + return { + kind: "schema", + type: "function", + reference: function_, + expects: "Function", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "function") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/instance/instance.ts +/* @__NO_SIDE_EFFECTS__ */ +function instance(class_, message$1) { + return { + kind: "schema", + type: "instance", + reference: instance, + expects: class_.name, + async: false, + class: class_, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof this.class) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/intersect/utils/_merge/_merge.ts +/** +* Merges two values into one single output. +* +* @param value1 First value. +* @param value2 Second value. +* +* @returns The merge dataset. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _merge(value1, value2) { + if (typeof value1 === typeof value2) { + if (value1 === value2 || value1 instanceof Date && value2 instanceof Date && +value1 === +value2) return { value: value1 }; + if (value1 && value2 && value1.constructor === Object && value2.constructor === Object) { + const nextValue = { ...value1 }; + for (const key in value2) if (Object.prototype.hasOwnProperty.call(value1, key)) { + const dataset = /* @__PURE__ */ _merge(value1[key], value2[key]); + if (dataset.issue) return dataset; + nextValue[key] = dataset.value; + } else nextValue[key] = value2[key]; + return { value: nextValue }; + } + if (Array.isArray(value1) && Array.isArray(value2)) { + if (value1.length === value2.length) { + const nextValue = [...value1]; + for (let index = 0; index < value1.length; index++) { + const dataset = /* @__PURE__ */ _merge(value1[index], value2[index]); + if (dataset.issue) return dataset; + nextValue[index] = dataset.value; + } + return { value: nextValue }; + } + } + } + return { issue: true }; +} + +//#endregion +//#region src/schemas/intersect/intersect.ts +/* @__NO_SIDE_EFFECTS__ */ +function intersect(options, message$1) { + return { + kind: "schema", + type: "intersect", + reference: intersect, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "&"), + async: false, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.options.length) { + const input = dataset.value; + let outputs; + dataset.typed = true; + for (const schema of this.options) { + const optionDataset = schema["~run"]({ value: input }, config$1); + if (optionDataset.issues) { + if (dataset.issues) for (const issue of optionDataset.issues) dataset.issues.push(issue); + else dataset.issues = optionDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!optionDataset.typed) dataset.typed = false; + if (dataset.typed) if (outputs) outputs.push(optionDataset.value); + else outputs = [optionDataset.value]; + } + if (dataset.typed) { + dataset.value = outputs[0]; + for (let index = 1; index < outputs.length; index++) { + const mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index]); + if (mergeDataset.issue) { + _addIssue(this, "type", dataset, config$1, { received: "unknown" }); + break; + } + dataset.value = mergeDataset.value; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/intersect/intersectAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function intersectAsync(options, message$1) { + return { + kind: "schema", + type: "intersect", + reference: intersectAsync, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "&"), + async: true, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (this.options.length) { + const input = dataset.value; + let outputs; + dataset.typed = true; + const optionDatasets = await Promise.all(this.options.map((schema) => schema["~run"]({ value: input }, config$1))); + for (const optionDataset of optionDatasets) { + if (optionDataset.issues) { + if (dataset.issues) for (const issue of optionDataset.issues) dataset.issues.push(issue); + else dataset.issues = optionDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!optionDataset.typed) dataset.typed = false; + if (dataset.typed) if (outputs) outputs.push(optionDataset.value); + else outputs = [optionDataset.value]; + } + if (dataset.typed) { + dataset.value = outputs[0]; + for (let index = 1; index < outputs.length; index++) { + const mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index]); + if (mergeDataset.issue) { + _addIssue(this, "type", dataset, config$1, { received: "unknown" }); + break; + } + dataset.value = mergeDataset.value; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/lazy/lazy.ts +/** +* Creates a lazy schema. +* +* @param getter The schema getter. +* +* @returns A lazy schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function lazy(getter) { + return { + kind: "schema", + type: "lazy", + reference: lazy, + expects: "unknown", + async: false, + getter, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + return this.getter(dataset.value)["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/lazy/lazyAsync.ts +/** +* Creates a lazy schema. +* +* @param getter The schema getter. +* +* @returns A lazy schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function lazyAsync(getter) { + return { + kind: "schema", + type: "lazy", + reference: lazyAsync, + expects: "unknown", + async: true, + getter, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + return (await this.getter(dataset.value))["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/literal/literal.ts +/* @__NO_SIDE_EFFECTS__ */ +function literal(literal_, message$1) { + return { + kind: "schema", + type: "literal", + reference: literal, + expects: /* @__PURE__ */ _stringify(literal_), + async: false, + literal: literal_, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === this.literal) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/looseObject/looseObject.ts +/* @__NO_SIDE_EFFECTS__ */ +function looseObject(entries$1, message$1) { + return { + kind: "schema", + type: "loose_object", + reference: looseObject, + expects: "Object", + async: false, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key]; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/looseObject/looseObjectAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function looseObjectAsync(entries$1, message$1) { + return { + kind: "schema", + type: "loose_object", + reference: looseObjectAsync, + expects: "Object", + async: true, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })); + for (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key]; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/looseTuple/looseTuple.ts +/* @__NO_SIDE_EFFECTS__ */ +function looseTuple(items, message$1) { + return { + kind: "schema", + type: "loose_tuple", + reference: looseTuple, + expects: "Array", + async: false, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/looseTuple/looseTupleAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function looseTupleAsync(items, message$1) { + return { + kind: "schema", + type: "loose_tuple", + reference: looseTupleAsync, + expects: "Array", + async: true, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })); + for (const [key, value$1, itemDataset] of itemDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/map/map.ts +/* @__NO_SIDE_EFFECTS__ */ +function map(key, value$1, message$1) { + return { + kind: "schema", + type: "map", + reference: map, + expects: "Map", + async: false, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Map) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Map(); + for (const [inputKey, inputValue] of input) { + const keyDataset = this.key["~run"]({ value: inputKey }, config$1); + if (keyDataset.issues) { + const pathItem = { + type: "map", + origin: "key", + input, + key: inputKey, + value: inputValue + }; + for (const issue of keyDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + const valueDataset = this.value["~run"]({ value: inputValue }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "map", + origin: "value", + input, + key: inputKey, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + dataset.value.set(keyDataset.value, valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/map/mapAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function mapAsync(key, value$1, message$1) { + return { + kind: "schema", + type: "map", + reference: mapAsync, + expects: "Map", + async: true, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Map) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Map(); + const datasets = await Promise.all([...input].map(([inputKey, inputValue]) => Promise.all([ + inputKey, + inputValue, + this.key["~run"]({ value: inputKey }, config$1), + this.value["~run"]({ value: inputValue }, config$1) + ]))); + for (const [inputKey, inputValue, keyDataset, valueDataset] of datasets) { + if (keyDataset.issues) { + const pathItem = { + type: "map", + origin: "key", + input, + key: inputKey, + value: inputValue + }; + for (const issue of keyDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (valueDataset.issues) { + const pathItem = { + type: "map", + origin: "value", + input, + key: inputKey, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + dataset.value.set(keyDataset.value, valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nan/nan.ts +/* @__NO_SIDE_EFFECTS__ */ +function nan(message$1) { + return { + kind: "schema", + type: "nan", + reference: nan, + expects: "NaN", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (Number.isNaN(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/never/never.ts +/* @__NO_SIDE_EFFECTS__ */ +function never(message$1) { + return { + kind: "schema", + type: "never", + reference: never, + expects: "never", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nonNullable/nonNullable.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonNullable(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullable", + reference: nonNullable, + expects: "!null", + async: false, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value !== null) dataset = this.wrapped["~run"](dataset, config$1); + if (dataset.value === null) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nonNullable/nonNullableAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonNullableAsync(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullable", + reference: nonNullableAsync, + expects: "!null", + async: true, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value !== null) dataset = await this.wrapped["~run"](dataset, config$1); + if (dataset.value === null) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nonNullish/nonNullish.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonNullish(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullish", + reference: nonNullish, + expects: "(!null & !undefined)", + async: false, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (!(dataset.value === null || dataset.value === void 0)) dataset = this.wrapped["~run"](dataset, config$1); + if (dataset.value === null || dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nonNullish/nonNullishAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonNullishAsync(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullish", + reference: nonNullishAsync, + expects: "(!null & !undefined)", + async: true, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (!(dataset.value === null || dataset.value === void 0)) dataset = await this.wrapped["~run"](dataset, config$1); + if (dataset.value === null || dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nonOptional/nonOptional.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonOptional(wrapped, message$1) { + return { + kind: "schema", + type: "non_optional", + reference: nonOptional, + expects: "!undefined", + async: false, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value !== void 0) dataset = this.wrapped["~run"](dataset, config$1); + if (dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nonOptional/nonOptionalAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonOptionalAsync(wrapped, message$1) { + return { + kind: "schema", + type: "non_optional", + reference: nonOptionalAsync, + expects: "!undefined", + async: true, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value !== void 0) dataset = await this.wrapped["~run"](dataset, config$1); + if (dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/null/null.ts +/* @__NO_SIDE_EFFECTS__ */ +function null_(message$1) { + return { + kind: "schema", + type: "null", + reference: null_, + expects: "null", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === null) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nullable/nullable.ts +/* @__NO_SIDE_EFFECTS__ */ +function nullable(wrapped, default_) { + return { + kind: "schema", + type: "nullable", + reference: nullable, + expects: `(${wrapped.expects} | null)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === null) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/nullable/nullableAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function nullableAsync(wrapped, default_) { + return { + kind: "schema", + type: "nullable", + reference: nullableAsync, + expects: `(${wrapped.expects} | null)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === null) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/nullish/nullish.ts +/* @__NO_SIDE_EFFECTS__ */ +function nullish(wrapped, default_) { + return { + kind: "schema", + type: "nullish", + reference: nullish, + expects: `(${wrapped.expects} | null | undefined)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === null || dataset.value === void 0) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null || dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/nullish/nullishAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function nullishAsync(wrapped, default_) { + return { + kind: "schema", + type: "nullish", + reference: nullishAsync, + expects: `(${wrapped.expects} | null | undefined)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === null || dataset.value === void 0) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null || dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/number/number.ts +/* @__NO_SIDE_EFFECTS__ */ +function number(message$1) { + return { + kind: "schema", + type: "number", + reference: number, + expects: "number", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/object/object.ts +/* @__NO_SIDE_EFFECTS__ */ +function object(entries$1, message$1) { + return { + kind: "schema", + type: "object", + reference: object, + expects: "Object", + async: false, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/object/objectAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function objectAsync(entries$1, message$1) { + return { + kind: "schema", + type: "object", + reference: objectAsync, + expects: "Object", + async: true, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })); + for (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/objectWithRest/objectWithRest.ts +/* @__NO_SIDE_EFFECTS__ */ +function objectWithRest(entries$1, rest, message$1) { + return { + kind: "schema", + type: "object_with_rest", + reference: objectWithRest, + expects: "Object", + async: false, + entries: entries$1, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) { + const valueDataset = this.rest["~run"]({ value: input[key] }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: input[key] + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/objectWithRest/objectWithRestAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function objectWithRestAsync(entries$1, rest, message$1) { + return { + kind: "schema", + type: "object_with_rest", + reference: objectWithRestAsync, + expects: "Object", + async: true, + entries: entries$1, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const [normalDatasets, restDatasets] = await Promise.all([Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })), Promise.all(Object.entries(input).filter(([key]) => /* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)).map(async ([key, value$1]) => [ + key, + value$1, + await this.rest["~run"]({ value: value$1 }, config$1) + ]))]); + for (const [key, value$1, valueSchema, valueDataset] of normalDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + if (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, valueDataset] of restDatasets) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/optional/optional.ts +/* @__NO_SIDE_EFFECTS__ */ +function optional(wrapped, default_) { + return { + kind: "schema", + type: "optional", + reference: optional, + expects: `(${wrapped.expects} | undefined)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/optional/optionalAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function optionalAsync(wrapped, default_) { + return { + kind: "schema", + type: "optional", + reference: optionalAsync, + expects: `(${wrapped.expects} | undefined)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/picklist/picklist.ts +/* @__NO_SIDE_EFFECTS__ */ +function picklist(options, message$1) { + return { + kind: "schema", + type: "picklist", + reference: picklist, + expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"), + async: false, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.options.includes(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/promise/promise.ts +/* @__NO_SIDE_EFFECTS__ */ +function promise(message$1) { + return { + kind: "schema", + type: "promise", + reference: promise, + expects: "Promise", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof Promise) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/record/record.ts +/* @__NO_SIDE_EFFECTS__ */ +function record(key, value$1, message$1) { + return { + kind: "schema", + type: "record", + reference: record, + expects: "Object", + async: false, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) { + const entryValue = input[entryKey]; + const keyDataset = this.key["~run"]({ value: entryKey }, config$1); + if (keyDataset.issues) { + const pathItem = { + type: "object", + origin: "key", + input, + key: entryKey, + value: entryValue + }; + for (const issue of keyDataset.issues) { + issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + const valueDataset = this.value["~run"]({ value: entryValue }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key: entryKey, + value: entryValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/record/recordAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function recordAsync(key, value$1, message$1) { + return { + kind: "schema", + type: "record", + reference: recordAsync, + expects: "Object", + async: true, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const datasets = await Promise.all(Object.entries(input).filter(([key$1]) => /* @__PURE__ */ _isValidObjectKey(input, key$1)).map(([entryKey, entryValue]) => Promise.all([ + entryKey, + entryValue, + this.key["~run"]({ value: entryKey }, config$1), + this.value["~run"]({ value: entryValue }, config$1) + ]))); + for (const [entryKey, entryValue, keyDataset, valueDataset] of datasets) { + if (keyDataset.issues) { + const pathItem = { + type: "object", + origin: "key", + input, + key: entryKey, + value: entryValue + }; + for (const issue of keyDataset.issues) { + issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key: entryKey, + value: entryValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/set/set.ts +/* @__NO_SIDE_EFFECTS__ */ +function set(value$1, message$1) { + return { + kind: "schema", + type: "set", + reference: set, + expects: "Set", + async: false, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Set) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Set(); + for (const inputValue of input) { + const valueDataset = this.value["~run"]({ value: inputValue }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "set", + origin: "value", + input, + key: null, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value.add(valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/set/setAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function setAsync(value$1, message$1) { + return { + kind: "schema", + type: "set", + reference: setAsync, + expects: "Set", + async: true, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Set) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Set(); + const valueDatasets = await Promise.all([...input].map(async (inputValue) => [inputValue, await this.value["~run"]({ value: inputValue }, config$1)])); + for (const [inputValue, valueDataset] of valueDatasets) { + if (valueDataset.issues) { + const pathItem = { + type: "set", + origin: "value", + input, + key: null, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value.add(valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/strictObject/strictObject.ts +/* @__NO_SIDE_EFFECTS__ */ +function strictObject(entries$1, message$1) { + return { + kind: "schema", + type: "strict_object", + reference: strictObject, + expects: "Object", + async: false, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (!(key in this.entries)) { + _addIssue(this, "key", dataset, config$1, { + input: key, + expected: "never", + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + break; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/strictObject/strictObjectAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function strictObjectAsync(entries$1, message$1) { + return { + kind: "schema", + type: "strict_object", + reference: strictObjectAsync, + expects: "Object", + async: true, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })); + for (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (!(key in this.entries)) { + _addIssue(this, "key", dataset, config$1, { + input: key, + expected: "never", + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + break; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/strictTuple/strictTuple.ts +/* @__NO_SIDE_EFFECTS__ */ +function strictTuple(items, message$1) { + return { + kind: "schema", + type: "strict_tuple", + reference: strictTuple, + expects: "Array", + async: false, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, "type", dataset, config$1, { + input: input[this.items.length], + expected: "never", + path: [{ + type: "array", + origin: "value", + input, + key: this.items.length, + value: input[this.items.length] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/strictTuple/strictTupleAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function strictTupleAsync(items, message$1) { + return { + kind: "schema", + type: "strict_tuple", + reference: strictTupleAsync, + expects: "Array", + async: true, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })); + for (const [key, value$1, itemDataset] of itemDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, "type", dataset, config$1, { + input: input[this.items.length], + expected: "never", + path: [{ + type: "array", + origin: "value", + input, + key: this.items.length, + value: input[this.items.length] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/string/string.ts +/* @__NO_SIDE_EFFECTS__ */ +function string(message$1) { + return { + kind: "schema", + type: "string", + reference: string, + expects: "string", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "string") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/symbol/symbol.ts +/* @__NO_SIDE_EFFECTS__ */ +function symbol(message$1) { + return { + kind: "schema", + type: "symbol", + reference: symbol, + expects: "symbol", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "symbol") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/tuple/tuple.ts +/* @__NO_SIDE_EFFECTS__ */ +function tuple(items, message$1) { + return { + kind: "schema", + type: "tuple", + reference: tuple, + expects: "Array", + async: false, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/tuple/tupleAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function tupleAsync(items, message$1) { + return { + kind: "schema", + type: "tuple", + reference: tupleAsync, + expects: "Array", + async: true, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })); + for (const [key, value$1, itemDataset] of itemDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/tupleWithRest/tupleWithRest.ts +/* @__NO_SIDE_EFFECTS__ */ +function tupleWithRest(items, rest, message$1) { + return { + kind: "schema", + type: "tuple_with_rest", + reference: tupleWithRest, + expects: "Array", + async: false, + items, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) { + const value$1 = input[key]; + const itemDataset = this.rest["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/tupleWithRest/tupleWithRestAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function tupleWithRestAsync(items, rest, message$1) { + return { + kind: "schema", + type: "tuple_with_rest", + reference: tupleWithRestAsync, + expects: "Array", + async: true, + items, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const [normalDatasets, restDatasets] = await Promise.all([Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })), Promise.all(input.slice(this.items.length).map(async (value$1, key) => { + return [ + key + this.items.length, + value$1, + await this.rest["~run"]({ value: value$1 }, config$1) + ]; + }))]); + for (const [key, value$1, itemDataset] of normalDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, itemDataset] of restDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/undefined/undefined.ts +/* @__NO_SIDE_EFFECTS__ */ +function undefined_(message$1) { + return { + kind: "schema", + type: "undefined", + reference: undefined_, + expects: "undefined", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/undefinedable/undefinedable.ts +/* @__NO_SIDE_EFFECTS__ */ +function undefinedable(wrapped, default_) { + return { + kind: "schema", + type: "undefinedable", + reference: undefinedable, + expects: `(${wrapped.expects} | undefined)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/undefinedable/undefinedableAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function undefinedableAsync(wrapped, default_) { + return { + kind: "schema", + type: "undefinedable", + reference: undefinedableAsync, + expects: `(${wrapped.expects} | undefined)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/union/utils/_subIssues/_subIssues.ts +/** +* Returns the sub issues of the provided datasets for the union issue. +* +* @param datasets The datasets. +* +* @returns The sub issues. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _subIssues(datasets) { + let issues; + if (datasets) for (const dataset of datasets) if (issues) for (const issue of dataset.issues) issues.push(issue); + else issues = dataset.issues; + return issues; +} + +//#endregion +//#region src/schemas/union/union.ts +/* @__NO_SIDE_EFFECTS__ */ +function union(options, message$1) { + return { + kind: "schema", + type: "union", + reference: union, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"), + async: false, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + let validDataset; + let typedDatasets; + let untypedDatasets; + for (const schema of this.options) { + const optionDataset = schema["~run"]({ value: dataset.value }, config$1); + if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset); + else typedDatasets = [optionDataset]; + else { + validDataset = optionDataset; + break; + } + else if (untypedDatasets) untypedDatasets.push(optionDataset); + else untypedDatasets = [optionDataset]; + } + if (validDataset) return validDataset; + if (typedDatasets) { + if (typedDatasets.length === 1) return typedDatasets[0]; + _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) }); + dataset.typed = true; + } else if (untypedDatasets?.length === 1) return untypedDatasets[0]; + else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) }); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/union/unionAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function unionAsync(options, message$1) { + return { + kind: "schema", + type: "union", + reference: unionAsync, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"), + async: true, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + let validDataset; + let typedDatasets; + let untypedDatasets; + for (const schema of this.options) { + const optionDataset = await schema["~run"]({ value: dataset.value }, config$1); + if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset); + else typedDatasets = [optionDataset]; + else { + validDataset = optionDataset; + break; + } + else if (untypedDatasets) untypedDatasets.push(optionDataset); + else untypedDatasets = [optionDataset]; + } + if (validDataset) return validDataset; + if (typedDatasets) { + if (typedDatasets.length === 1) return typedDatasets[0]; + _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) }); + dataset.typed = true; + } else if (untypedDatasets?.length === 1) return untypedDatasets[0]; + else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) }); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/unknown/unknown.ts +/** +* Creates a unknown schema. +* +* @returns A unknown schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function unknown() { + return { + kind: "schema", + type: "unknown", + reference: unknown, + expects: "unknown", + async: false, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset) { + dataset.typed = true; + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/variant/variant.ts +/* @__NO_SIDE_EFFECTS__ */ +function variant(key, options, message$1) { + return { + kind: "schema", + type: "variant", + reference: variant, + expects: "Object", + async: false, + key, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + let outputDataset; + let maxDiscriminatorPriority = 0; + let invalidDiscriminatorKey = this.key; + let expectedDiscriminators = []; + const parseOptions = (variant$1, allKeys) => { + for (const schema of variant$1.options) { + if (schema.type === "variant") parseOptions(schema, new Set(allKeys).add(schema.key)); + else { + let keysAreValid = true; + let currentPriority = 0; + for (const currentKey of allKeys) { + const discriminatorSchema = schema.entries[currentKey]; + if (currentKey in input ? discriminatorSchema["~run"]({ + typed: false, + value: input[currentKey] + }, ABORT_EARLY_CONFIG).issues : discriminatorSchema.type !== "exact_optional" && discriminatorSchema.type !== "optional" && discriminatorSchema.type !== "nullish") { + keysAreValid = false; + if (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) { + maxDiscriminatorPriority = currentPriority; + invalidDiscriminatorKey = currentKey; + expectedDiscriminators = []; + } + if (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects); + break; + } + currentPriority++; + } + if (keysAreValid) { + const optionDataset = schema["~run"]({ value: input }, config$1); + if (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset; + } + } + if (outputDataset && !outputDataset.issues) break; + } + }; + parseOptions(this, new Set([this.key])); + if (outputDataset) return outputDataset; + _addIssue(this, "type", dataset, config$1, { + input: input[invalidDiscriminatorKey], + expected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, "|"), + path: [{ + type: "object", + origin: "value", + input, + key: invalidDiscriminatorKey, + value: input[invalidDiscriminatorKey] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/variant/variantAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function variantAsync(key, options, message$1) { + return { + kind: "schema", + type: "variant", + reference: variantAsync, + expects: "Object", + async: true, + key, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + let outputDataset; + let maxDiscriminatorPriority = 0; + let invalidDiscriminatorKey = this.key; + let expectedDiscriminators = []; + const parseOptions = async (variant$1, allKeys) => { + for (const schema of variant$1.options) { + if (schema.type === "variant") await parseOptions(schema, new Set(allKeys).add(schema.key)); + else { + let keysAreValid = true; + let currentPriority = 0; + for (const currentKey of allKeys) { + const discriminatorSchema = schema.entries[currentKey]; + if (currentKey in input ? (await discriminatorSchema["~run"]({ + typed: false, + value: input[currentKey] + }, ABORT_EARLY_CONFIG)).issues : discriminatorSchema.type !== "exact_optional" && discriminatorSchema.type !== "optional" && discriminatorSchema.type !== "nullish") { + keysAreValid = false; + if (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) { + maxDiscriminatorPriority = currentPriority; + invalidDiscriminatorKey = currentKey; + expectedDiscriminators = []; + } + if (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects); + break; + } + currentPriority++; + } + if (keysAreValid) { + const optionDataset = await schema["~run"]({ value: input }, config$1); + if (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset; + } + } + if (outputDataset && !outputDataset.issues) break; + } + }; + await parseOptions(this, new Set([this.key])); + if (outputDataset) return outputDataset; + _addIssue(this, "type", dataset, config$1, { + input: input[invalidDiscriminatorKey], + expected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, "|"), + path: [{ + type: "object", + origin: "value", + input, + key: invalidDiscriminatorKey, + value: input[invalidDiscriminatorKey] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/void/void.ts +/* @__NO_SIDE_EFFECTS__ */ +function void_(message$1) { + return { + kind: "schema", + type: "void", + reference: void_, + expects: "void", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/methods/keyof/keyof.ts +/* @__NO_SIDE_EFFECTS__ */ +function keyof(schema, message$1) { + return /* @__PURE__ */ picklist(Object.keys(schema.entries), message$1); +} + +//#endregion +//#region src/methods/message/message.ts +/** +* Changes the local message configuration of a schema. +* +* @param schema The schema to configure. +* @param message_ The error message. +* +* @returns The configured schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function message(schema, message_) { + return { + ...schema, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + return schema["~run"](dataset, { + ...config$1, + message: message_ + }); + } + }; +} + +//#endregion +//#region src/methods/omit/omit.ts +/** +* Creates a modified copy of an object schema that does not contain the +* selected entries. +* +* @param schema The schema to omit from. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function omit(schema, keys) { + const entries$1 = { ...schema.entries }; + for (const key of keys) delete entries$1[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; +} + +//#endregion +//#region src/methods/parse/parse.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parsed input. +*/ +function parse(schema, input, config$1) { + const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + if (dataset.issues) throw new ValiError(dataset.issues); + return dataset.value; +} + +//#endregion +//#region src/methods/parse/parseAsync.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parsed input. +*/ +async function parseAsync(schema, input, config$1) { + const dataset = await schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + if (dataset.issues) throw new ValiError(dataset.issues); + return dataset.value; +} + +//#endregion +//#region src/methods/parser/parser.ts +/* @__NO_SIDE_EFFECTS__ */ +function parser(schema, config$1) { + const func = (input) => parse(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; +} + +//#endregion +//#region src/methods/parser/parserAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function parserAsync(schema, config$1) { + const func = (input) => parseAsync(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; +} + +//#endregion +//#region src/methods/partial/partial.ts +/* @__NO_SIDE_EFFECTS__ */ +function partial(schema, keys) { + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optional(schema.entries[key]) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; +} + +//#endregion +//#region src/methods/partial/partialAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function partialAsync(schema, keys) { + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optionalAsync(schema.entries[key]) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; +} + +//#endregion +//#region src/methods/pick/pick.ts +/** +* Creates a modified copy of an object schema that contains only the selected +* entries. +* +* @param schema The schema to pick from. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function pick(schema, keys) { + const entries$1 = {}; + for (const key of keys) entries$1[key] = schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; +} + +//#endregion +//#region src/methods/pipe/pipe.ts +/* @__NO_SIDE_EFFECTS__ */ +function pipe(...pipe$1) { + return { + ...pipe$1[0], + pipe: pipe$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + for (const item of pipe$1) if (item.kind !== "metadata") { + if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) { + dataset.typed = false; + break; + } + if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1); + } + return dataset; + } + }; +} + +//#endregion +//#region src/methods/pipe/pipeAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function pipeAsync(...pipe$1) { + return { + ...pipe$1[0], + pipe: pipe$1, + async: true, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + for (const item of pipe$1) if (item.kind !== "metadata") { + if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) { + dataset.typed = false; + break; + } + if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = await item["~run"](dataset, config$1); + } + return dataset; + } + }; +} + +//#endregion +//#region src/methods/required/required.ts +/* @__NO_SIDE_EFFECTS__ */ +function required(schema, arg2, arg3) { + const keys = Array.isArray(arg2) ? arg2 : void 0; + const message$1 = Array.isArray(arg2) ? arg3 : arg2; + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptional(schema.entries[key], message$1) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; +} + +//#endregion +//#region src/methods/required/requiredAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function requiredAsync(schema, arg2, arg3) { + const keys = Array.isArray(arg2) ? arg2 : void 0; + const message$1 = Array.isArray(arg2) ? arg3 : arg2; + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptionalAsync(schema.entries[key], message$1) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; +} + +//#endregion +//#region src/methods/safeParse/safeParse.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parse result. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function safeParse(schema, input, config$1) { + const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + return { + typed: dataset.typed, + success: !dataset.issues, + output: dataset.value, + issues: dataset.issues + }; +} + +//#endregion +//#region src/methods/safeParse/safeParseAsync.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parse result. +*/ +/* @__NO_SIDE_EFFECTS__ */ +async function safeParseAsync(schema, input, config$1) { + const dataset = await schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + return { + typed: dataset.typed, + success: !dataset.issues, + output: dataset.value, + issues: dataset.issues + }; +} + +//#endregion +//#region src/methods/safeParser/safeParser.ts +/* @__NO_SIDE_EFFECTS__ */ +function safeParser(schema, config$1) { + const func = (input) => /* @__PURE__ */ safeParse(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; +} + +//#endregion +//#region src/methods/safeParser/safeParserAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function safeParserAsync(schema, config$1) { + const func = (input) => /* @__PURE__ */ safeParseAsync(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; +} + +//#endregion +//#region src/methods/summarize/summarize.ts +/** +* Summarize the error messages of issues in a pretty-printable multi-line string. +* +* @param issues The list of issues. +* +* @returns A summary of the issues. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function summarize(issues) { + let summary = ""; + for (const issue of issues) { + if (summary) summary += "\n"; + summary += `× ${issue.message}`; + const dotPath = /* @__PURE__ */ getDotPath(issue); + if (dotPath) summary += `\n → at ${dotPath}`; + } + return summary; +} + +//#endregion +//#region src/methods/unwrap/unwrap.ts +/** +* Unwraps the wrapped schema. +* +* @param schema The schema to be unwrapped. +* +* @returns The unwrapped schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function unwrap(schema) { + return schema.wrapped; +} + +//#endregion +exports.BASE64_REGEX = BASE64_REGEX; +exports.BIC_REGEX = BIC_REGEX; +exports.CUID2_REGEX = CUID2_REGEX; +exports.DECIMAL_REGEX = DECIMAL_REGEX; +exports.DIGITS_REGEX = DIGITS_REGEX; +exports.DOMAIN_REGEX = DOMAIN_REGEX; +exports.EMAIL_REGEX = EMAIL_REGEX; +exports.EMOJI_REGEX = EMOJI_REGEX; +exports.HEXADECIMAL_REGEX = HEXADECIMAL_REGEX; +exports.HEX_COLOR_REGEX = HEX_COLOR_REGEX; +exports.IMEI_REGEX = IMEI_REGEX; +exports.IPV4_REGEX = IPV4_REGEX; +exports.IPV6_REGEX = IPV6_REGEX; +exports.IP_REGEX = IP_REGEX; +exports.ISO_DATE_REGEX = ISO_DATE_REGEX; +exports.ISO_DATE_TIME_REGEX = ISO_DATE_TIME_REGEX; +exports.ISO_DATE_TIME_SECOND_REGEX = ISO_DATE_TIME_SECOND_REGEX; +exports.ISO_TIMESTAMP_REGEX = ISO_TIMESTAMP_REGEX; +exports.ISO_TIME_REGEX = ISO_TIME_REGEX; +exports.ISO_TIME_SECOND_REGEX = ISO_TIME_SECOND_REGEX; +exports.ISO_WEEK_REGEX = ISO_WEEK_REGEX; +exports.ISRC_REGEX = ISRC_REGEX; +exports.JWS_COMPACT_REGEX = JWS_COMPACT_REGEX; +exports.MAC48_REGEX = MAC48_REGEX; +exports.MAC64_REGEX = MAC64_REGEX; +exports.MAC_REGEX = MAC_REGEX; +exports.NANO_ID_REGEX = NANO_ID_REGEX; +exports.OCTAL_REGEX = OCTAL_REGEX; +exports.RFC_EMAIL_REGEX = RFC_EMAIL_REGEX; +exports.SLUG_REGEX = SLUG_REGEX; +exports.ULID_REGEX = ULID_REGEX; +exports.UUID_REGEX = UUID_REGEX; +exports.ValiError = ValiError; +exports._addIssue = _addIssue; +exports._cloneDataset = _cloneDataset; +exports._formatCase = _formatCase; +exports._getByteCount = _getByteCount; +exports._getGraphemeCount = _getGraphemeCount; +exports._getLastMetadata = _getLastMetadata; +exports._getStandardProps = _getStandardProps; +exports._getWordCount = _getWordCount; +exports._isLuhnAlgo = _isLuhnAlgo; +exports._isValidObjectKey = _isValidObjectKey; +exports._joinExpects = _joinExpects; +exports._stringify = _stringify; +exports.any = any; +exports.args = args; +exports.argsAsync = argsAsync; +exports.array = array; +exports.arrayAsync = arrayAsync; +exports.assert = assert; +exports.awaitAsync = awaitAsync; +exports.base64 = base64; +exports.bic = bic; +exports.bigint = bigint; +exports.blob = blob; +exports.boolean = boolean; +exports.brand = brand; +exports.bytes = bytes; +exports.cache = cache; +exports.cacheAsync = cacheAsync; +exports.check = check; +exports.checkAsync = checkAsync; +exports.checkItems = checkItems; +exports.checkItemsAsync = checkItemsAsync; +exports.config = config; +exports.creditCard = creditCard; +exports.cuid2 = cuid2; +exports.custom = custom; +exports.customAsync = customAsync; +exports.date = date; +exports.decimal = decimal; +exports.deleteGlobalConfig = deleteGlobalConfig; +exports.deleteGlobalMessage = deleteGlobalMessage; +exports.deleteSchemaMessage = deleteSchemaMessage; +exports.deleteSpecificMessage = deleteSpecificMessage; +exports.description = description; +exports.digits = digits; +exports.domain = domain; +exports.email = email; +exports.emoji = emoji; +exports.empty = empty; +exports.endsWith = endsWith; +exports.entries = entries; +exports.entriesFromList = entriesFromList; +exports.entriesFromObjects = entriesFromObjects; +exports.enum = enum_; +exports.enum_ = enum_; +exports.everyItem = everyItem; +exports.exactOptional = exactOptional; +exports.exactOptionalAsync = exactOptionalAsync; +exports.examples = examples; +exports.excludes = excludes; +exports.fallback = fallback; +exports.fallbackAsync = fallbackAsync; +exports.file = file; +exports.filterItems = filterItems; +exports.findItem = findItem; +exports.finite = finite; +exports.flatten = flatten; +exports.flavor = flavor; +exports.forward = forward; +exports.forwardAsync = forwardAsync; +exports.function = function_; +exports.function_ = function_; +exports.getDefault = getDefault; +exports.getDefaults = getDefaults; +exports.getDefaultsAsync = getDefaultsAsync; +exports.getDescription = getDescription; +exports.getDotPath = getDotPath; +exports.getExamples = getExamples; +exports.getFallback = getFallback; +exports.getFallbacks = getFallbacks; +exports.getFallbacksAsync = getFallbacksAsync; +exports.getGlobalConfig = getGlobalConfig; +exports.getGlobalMessage = getGlobalMessage; +exports.getMetadata = getMetadata; +exports.getSchemaMessage = getSchemaMessage; +exports.getSpecificMessage = getSpecificMessage; +exports.getTitle = getTitle; +exports.graphemes = graphemes; +exports.gtValue = gtValue; +exports.guard = guard; +exports.hash = hash; +exports.hexColor = hexColor; +exports.hexadecimal = hexadecimal; +exports.imei = imei; +exports.includes = includes; +exports.instance = instance; +exports.integer = integer; +exports.intersect = intersect; +exports.intersectAsync = intersectAsync; +exports.ip = ip; +exports.ipv4 = ipv4; +exports.ipv6 = ipv6; +exports.is = is; +exports.isOfKind = isOfKind; +exports.isOfType = isOfType; +exports.isValiError = isValiError; +exports.isbn = isbn; +exports.isoDate = isoDate; +exports.isoDateTime = isoDateTime; +exports.isoDateTimeSecond = isoDateTimeSecond; +exports.isoTime = isoTime; +exports.isoTimeSecond = isoTimeSecond; +exports.isoTimestamp = isoTimestamp; +exports.isoWeek = isoWeek; +exports.isrc = isrc; +exports.jwsCompact = jwsCompact; +exports.keyof = keyof; +exports.lazy = lazy; +exports.lazyAsync = lazyAsync; +exports.length = length; +exports.literal = literal; +exports.looseObject = looseObject; +exports.looseObjectAsync = looseObjectAsync; +exports.looseTuple = looseTuple; +exports.looseTupleAsync = looseTupleAsync; +exports.ltValue = ltValue; +exports.mac = mac; +exports.mac48 = mac48; +exports.mac64 = mac64; +exports.map = map; +exports.mapAsync = mapAsync; +exports.mapItems = mapItems; +exports.maxBytes = maxBytes; +exports.maxEntries = maxEntries; +exports.maxGraphemes = maxGraphemes; +exports.maxLength = maxLength; +exports.maxSize = maxSize; +exports.maxValue = maxValue; +exports.maxWords = maxWords; +exports.message = message; +exports.metadata = metadata; +exports.mimeType = mimeType; +exports.minBytes = minBytes; +exports.minEntries = minEntries; +exports.minGraphemes = minGraphemes; +exports.minLength = minLength; +exports.minSize = minSize; +exports.minValue = minValue; +exports.minWords = minWords; +exports.multipleOf = multipleOf; +exports.nan = nan; +exports.nanoid = nanoid; +exports.never = never; +exports.nonEmpty = nonEmpty; +exports.nonNullable = nonNullable; +exports.nonNullableAsync = nonNullableAsync; +exports.nonNullish = nonNullish; +exports.nonNullishAsync = nonNullishAsync; +exports.nonOptional = nonOptional; +exports.nonOptionalAsync = nonOptionalAsync; +exports.normalize = normalize; +exports.notBytes = notBytes; +exports.notEntries = notEntries; +exports.notGraphemes = notGraphemes; +exports.notLength = notLength; +exports.notSize = notSize; +exports.notValue = notValue; +exports.notValues = notValues; +exports.notWords = notWords; +exports.null = null_; +exports.null_ = null_; +exports.nullable = nullable; +exports.nullableAsync = nullableAsync; +exports.nullish = nullish; +exports.nullishAsync = nullishAsync; +exports.number = number; +exports.object = object; +exports.objectAsync = objectAsync; +exports.objectWithRest = objectWithRest; +exports.objectWithRestAsync = objectWithRestAsync; +exports.octal = octal; +exports.omit = omit; +exports.optional = optional; +exports.optionalAsync = optionalAsync; +exports.parse = parse; +exports.parseAsync = parseAsync; +exports.parseBoolean = parseBoolean; +exports.parseJson = parseJson; +exports.parser = parser; +exports.parserAsync = parserAsync; +exports.partial = partial; +exports.partialAsync = partialAsync; +exports.partialCheck = partialCheck; +exports.partialCheckAsync = partialCheckAsync; +exports.pick = pick; +exports.picklist = picklist; +exports.pipe = pipe; +exports.pipeAsync = pipeAsync; +exports.promise = promise; +exports.rawCheck = rawCheck; +exports.rawCheckAsync = rawCheckAsync; +exports.rawTransform = rawTransform; +exports.rawTransformAsync = rawTransformAsync; +exports.readonly = readonly; +exports.record = record; +exports.recordAsync = recordAsync; +exports.reduceItems = reduceItems; +exports.regex = regex; +exports.required = required; +exports.requiredAsync = requiredAsync; +exports.returns = returns; +exports.returnsAsync = returnsAsync; +exports.rfcEmail = rfcEmail; +exports.safeInteger = safeInteger; +exports.safeParse = safeParse; +exports.safeParseAsync = safeParseAsync; +exports.safeParser = safeParser; +exports.safeParserAsync = safeParserAsync; +exports.set = set; +exports.setAsync = setAsync; +exports.setGlobalConfig = setGlobalConfig; +exports.setGlobalMessage = setGlobalMessage; +exports.setSchemaMessage = setSchemaMessage; +exports.setSpecificMessage = setSpecificMessage; +exports.size = size; +exports.slug = slug; +exports.someItem = someItem; +exports.sortItems = sortItems; +exports.startsWith = startsWith; +exports.strictObject = strictObject; +exports.strictObjectAsync = strictObjectAsync; +exports.strictTuple = strictTuple; +exports.strictTupleAsync = strictTupleAsync; +exports.string = string; +exports.stringifyJson = stringifyJson; +exports.summarize = summarize; +exports.symbol = symbol; +exports.title = title; +exports.toBigint = toBigint; +exports.toBoolean = toBoolean; +exports.toCamelCase = toCamelCase; +exports.toDate = toDate; +exports.toKebabCase = toKebabCase; +exports.toLowerCase = toLowerCase; +exports.toMaxValue = toMaxValue; +exports.toMinValue = toMinValue; +exports.toNumber = toNumber; +exports.toPascalCase = toPascalCase; +exports.toSnakeCase = toSnakeCase; +exports.toString = toString; +exports.toUpperCase = toUpperCase; +exports.transform = transform; +exports.transformAsync = transformAsync; +exports.trim = trim; +exports.trimEnd = trimEnd; +exports.trimStart = trimStart; +exports.tuple = tuple; +exports.tupleAsync = tupleAsync; +exports.tupleWithRest = tupleWithRest; +exports.tupleWithRestAsync = tupleWithRestAsync; +exports.ulid = ulid; +exports.undefined = undefined_; +exports.undefined_ = undefined_; +exports.undefinedable = undefinedable; +exports.undefinedableAsync = undefinedableAsync; +exports.union = union; +exports.unionAsync = unionAsync; +exports.unknown = unknown; +exports.unwrap = unwrap; +exports.url = url; +exports.uuid = uuid; +exports.value = value; +exports.values = values; +exports.variant = variant; +exports.variantAsync = variantAsync; +exports.void = void_; +exports.void_ = void_; +exports.words = words; \ No newline at end of file diff --git a/tools/ui/node_modules/valibot/dist/index.d.cts b/tools/ui/node_modules/valibot/dist/index.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..f6978d3acc62dc8521242602e1c4ae791f62cb5c --- /dev/null +++ b/tools/ui/node_modules/valibot/dist/index.d.cts @@ -0,0 +1,16184 @@ +//#region src/methods/assert/assert.d.ts +/** +* Checks if the input matches the schema. As this is an assertion function, it +* can be used as a type guard. +* +* @param schema The schema to be used. +* @param input The input to be tested. +*/ +declare function assert>>(schema: TSchema, input: unknown): asserts input is InferInput; +//#endregion +//#region src/methods/cache/types.d.ts +/** +* Cache interface type. +* +* @beta +*/ +interface Cache { + /** + * Creates a cache key from input and config. + * + * Hint: Primitive inputs are keyed by value. Object and function inputs are + * keyed by reference identity. + */ + key(input: unknown, config?: Config>): string; + /** + * Gets a value from the cache by key. + */ + get(key: string): TValue$1 | undefined; + /** + * Sets a value in the cache by key. + */ + set(key: string, value: TValue$1): void; + /** + * Clears all entries from the cache. + */ + clear(): void; +} +/** +* Cache config type. +* +* @beta +*/ +interface CacheConfig { + /** + * The maximum number of items to cache. + * + * @default 1000 + */ + maxSize?: number; + /** + * The maximum age of a cache entry in milliseconds. + * + * @default Infinity + */ + maxAge?: number; +} +//#endregion +//#region src/methods/cache/cache.d.ts +/** +* Schema with cache type. +* +* @beta +*/ +type SchemaWithCache>, TCacheConfig extends CacheConfig | undefined> = TSchema & { + /** + * The cache config. + */ + readonly cacheConfig: TCacheConfig; + /** + * The cache instance. + */ + readonly cache: Cache, InferIssue>>; +}; +/** +* Caches the output of a schema. +* +* Hint: Primitive inputs are cached by value. Object and function inputs are +* cached by reference identity, so mutating input objects and reusing the same +* reference can return a stale cached dataset. Returned objects are also +* reused by reference, so mutating cached output can affect later cache hits. +* +* @param schema The schema to cache. +* +* @returns The cached schema. +* +* @beta +*/ +declare function cache>>(schema: TSchema): SchemaWithCache; +/** +* Caches the output of a schema. +* +* Hint: Primitive inputs are cached by value. Object and function inputs are +* cached by reference identity, so mutating input objects and reusing the same +* reference can return a stale cached dataset. Returned objects are also +* reused by reference, so mutating cached output can affect later cache hits. +* +* @param schema The schema to cache. +* @param config The cache config. +* +* @returns The cached schema. +* +* @beta +*/ +declare function cache>, const TCacheConfig extends CacheConfig | undefined>(schema: TSchema, config: TCacheConfig): SchemaWithCache; +//#endregion +//#region src/methods/cache/cacheAsync.d.ts +/** +* Schema with cache async type. +* +* @beta +*/ +type SchemaWithCacheAsync> | BaseSchemaAsync>, TCacheConfig extends CacheConfig | undefined> = Omit & { + /** + * Whether it's async. + */ + readonly async: true; + /** + * The cache config. + */ + readonly cacheConfig: TCacheConfig; + /** + * The cache instance. + */ + readonly cache: Cache, InferIssue>>; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps, InferOutput>; + /** + * Parses unknown input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise, InferIssue>>; +}; +/** +* Caches the output of a schema. +* +* Hint: Primitive inputs are cached by value. Object and function inputs are +* cached by reference identity, so mutating input objects and reusing the same +* reference can return a stale cached dataset. Returned objects are also +* reused by reference, so mutating cached output can affect later cache hits. +* +* @param schema The schema to cache. +* +* @returns The cached schema. +* +* @beta +*/ +declare function cacheAsync> | BaseSchemaAsync>>(schema: TSchema): SchemaWithCacheAsync; +/** +* Caches the output of a schema. +* +* Hint: Primitive inputs are cached by value. Object and function inputs are +* cached by reference identity, so mutating input objects and reusing the same +* reference can return a stale cached dataset. Returned objects are also +* reused by reference, so mutating cached output can affect later cache hits. +* +* @param schema The schema to cache. +* @param config The cache config. +* +* @returns The cached schema. +* +* @beta +*/ +declare function cacheAsync> | BaseSchemaAsync>, const TCacheConfig extends CacheConfig | undefined>(schema: TSchema, config: TCacheConfig): SchemaWithCacheAsync; +//#endregion +//#region src/methods/config/config.d.ts +/** +* Changes the local configuration of a schema. +* +* @param schema The schema to configure. +* @param config The parse configuration. +* +* @returns The configured schema. +*/ +declare function config> | BaseSchemaAsync>>(schema: TSchema, config: Config>): TSchema; +//#endregion +//#region src/methods/fallback/fallback.d.ts +/** +* Fallback type. +*/ +type Fallback>> = MaybeDeepReadonly> | ((dataset?: OutputDataset, InferIssue>, config?: Config>) => MaybeDeepReadonly>); +/** +* Schema with fallback type. +*/ +type SchemaWithFallback>, TFallback$1 extends Fallback> = TSchema & { + /** + * The fallback value. + */ + readonly fallback: TFallback$1; +}; +/** +* Returns a fallback value as output if the input does not match the schema. +* +* @param schema The schema to catch. +* @param fallback The fallback value. +* +* @returns The passed schema. +*/ +declare function fallback>, const TFallback$1 extends Fallback>(schema: TSchema, fallback: TFallback$1): SchemaWithFallback; +//#endregion +//#region src/methods/fallback/fallbackAsync.d.ts +/** +* Fallback async type. +*/ +type FallbackAsync> | BaseSchemaAsync>> = MaybeDeepReadonly> | ((dataset?: OutputDataset, InferIssue>, config?: Config>) => MaybePromise>>); +/** +* Schema with fallback async type. +*/ +type SchemaWithFallbackAsync> | BaseSchemaAsync>, TFallback$1 extends FallbackAsync> = Omit & { + /** + * The fallback value. + */ + readonly fallback: TFallback$1; + /** + * Whether it's async. + */ + readonly async: true; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps, InferOutput>; + /** + * Parses unknown input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise, InferIssue>>; +}; +/** +* Returns a fallback value as output if the input does not match the schema. +* +* @param schema The schema to catch. +* @param fallback The fallback value. +* +* @returns The passed schema. +*/ +declare function fallbackAsync> | BaseSchemaAsync>, const TFallback$1 extends FallbackAsync>(schema: TSchema, fallback: TFallback$1): SchemaWithFallbackAsync; +//#endregion +//#region src/methods/flatten/flatten.d.ts +/** +* Flat errors type. +*/ +type FlatErrors> | BaseSchemaAsync> | undefined> = Prettify<{ + /** + * The root errors. + * + * Hint: The error messages of issues without a path that belong to the root + * of the schema are added to this key. + */ + readonly root?: [string, ...string[]]; + /** + * The nested errors. + * + * Hint: The error messages of issues with a path that belong to the nested + * parts of the schema and can be converted to a dot path are added to this + * key. + */ + readonly nested?: Prettify> | BaseSchemaAsync> ? IssueDotPath : string, [string, ...string[]]>>>>; + /** + * The other errors. + * + * Hint: Some issue paths, for example for complex data types like `Set` and + * `Map`, have no key or a key that cannot be converted to a dot path. These + * error messages are added to this key. + */ + readonly other?: [string, ...string[]]; +}>; +/** +* Flatten the error messages of issues. +* +* @param issues The list of issues. +* +* @returns A flat error object. +*/ +declare function flatten(issues: readonly [BaseIssue, ...BaseIssue[]]): FlatErrors; +/** +* Flatten the error messages of issues. +* +* @param issues The list of issues. +* +* @returns A flat error object. +*/ +declare function flatten> | BaseSchemaAsync>>(issues: readonly [InferIssue, ...InferIssue[]]): FlatErrors; +//#endregion +//#region src/methods/forward/types.d.ts +/** +* Extracts the exact keys of a tuple, array or object. +*/ +type KeyOf$1 = IsAny extends true ? never : TValue$1 extends readonly unknown[] ? number extends TValue$1["length"] ? number : { [TKey in keyof TValue$1]: TKey extends `${infer TIndex extends number}` ? TIndex : never }[number] : TValue$1 extends Record ? keyof TValue$1 & (string | number) : never; +/** +* Path type. +*/ +type Path$1 = readonly (string | number)[]; +/** +* Required path type. +*/ +type RequiredPath$1 = readonly [string | number, ...Path$1]; +/** +* Lazily evaluate only the first valid path segment based on the given value. +*/ +type LazyPath$1 = TPathToCheck extends readonly [] ? TValidPath : TPathToCheck extends readonly [infer TFirstKey extends KeyOf$1 & keyof TValue$1, ...infer TPathRest extends Path$1] ? LazyPath$1 : IsNever> extends false ? readonly [...TValidPath, KeyOf$1] : TValidPath; +/** +* Returns the path if valid, otherwise the first possible valid path based on +* the given value. +*/ +type ValidPath$1 | ArrayLike, TPath extends RequiredPath$1> = TPath extends LazyPath$1 ? TPath : LazyPath$1; +//#endregion +//#region src/methods/forward/forward.d.ts +/** +* Forwards the issues of the passed validation action. +* +* @param action The validation action. +* @param path The path to forward the issues to. +* +* @returns The modified action. +*/ +declare function forward | ArrayLike, TIssue extends BaseIssue, const TPath extends RequiredPath$1>(action: BaseValidation, path: ValidPath$1): BaseValidation; +//#endregion +//#region src/methods/forward/forwardAsync.d.ts +/** +* Forwards the issues of the passed validation action. +* +* @param action The validation action. +* @param path The path to forward the issues to. +* +* @returns The modified action. +*/ +declare function forwardAsync | ArrayLike, TIssue extends BaseIssue, const TPath extends RequiredPath$1>(action: BaseValidation | BaseValidationAsync, path: ValidPath$1): BaseValidationAsync; +//#endregion +//#region src/methods/getDefault/getDefault.d.ts +/** +* Schema with default type. +*/ +type SchemaWithDefault = ExactOptionalSchema>, unknown> | NullableSchema>, unknown> | NullishSchema>, unknown> | OptionalSchema>, unknown> | UndefinedableSchema>, unknown>; +/** +* Schema with default async type. +*/ +type SchemaWithDefaultAsync = ExactOptionalSchemaAsync> | BaseSchemaAsync>, unknown> | NullableSchemaAsync> | BaseSchemaAsync>, unknown> | NullishSchemaAsync> | BaseSchemaAsync>, unknown> | OptionalSchemaAsync> | BaseSchemaAsync>, unknown> | UndefinedableSchemaAsync> | BaseSchemaAsync>, unknown>; +/** +* Infer default type. +*/ +type InferDefault> | BaseSchemaAsync> | SchemaWithDefault | SchemaWithDefaultAsync> = TSchema extends SchemaWithDefault | SchemaWithDefaultAsync ? TSchema["default"] extends ((...args: any) => any) ? ReturnType : TSchema["default"] : undefined; +/** +* Returns the default value of the schema. +* +* @param schema The schema to get it from. +* @param dataset The input dataset if available. +* @param config The config if available. +* +* @returns The default value. +*/ +declare function getDefault> | BaseSchemaAsync>>(schema: TSchema, dataset?: UnknownDataset, config?: Config>): InferDefault; +//#endregion +//#region src/methods/getDefaults/types.d.ts +/** +* Infer defaults type. +*/ +type InferDefaults> | BaseSchemaAsync>> = TSchema extends LooseObjectSchema | undefined> | ObjectSchema | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | StrictObjectSchema | undefined> ? { -readonly [TKey in keyof TEntries]: InferDefaults } : TSchema extends LooseObjectSchemaAsync | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchemaAsync | undefined> ? { -readonly [TKey in keyof TEntries]: InferDefaults } : TSchema extends LooseTupleSchema | undefined> | StrictTupleSchema | undefined> | TupleSchema | undefined> | TupleWithRestSchema>, ErrorMessage | undefined> ? { -readonly [TKey in keyof TItems]: InferDefaults } : TSchema extends LooseTupleSchemaAsync | undefined> | StrictTupleSchemaAsync | undefined> | TupleSchemaAsync | undefined> | TupleWithRestSchemaAsync>, ErrorMessage | undefined> ? { -readonly [TKey in keyof TItems]: InferDefaults } : Awaited>; +//#endregion +//#region src/methods/getDefaults/getDefaults.d.ts +/** +* Returns the default values of the schema. +* +* Hint: The difference to `getDefault` is that for object and tuple schemas +* this function recursively returns the default values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The default values. +*/ +declare function getDefaults> | LooseObjectSchema | undefined> | LooseTupleSchema | undefined> | ObjectSchema | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictTupleSchema | undefined> | TupleSchema | undefined> | TupleWithRestSchema>, ErrorMessage | undefined>>(schema: TSchema): InferDefaults; +//#endregion +//#region src/methods/getDefaults/getDefaultsAsync.d.ts +/** +* Returns the default values of the schema. +* +* Hint: The difference to `getDefault` is that for object and tuple schemas +* this function recursively returns the default values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The default values. +*/ +declare function getDefaultsAsync> | BaseSchemaAsync> | LooseObjectSchema | undefined> | LooseObjectSchemaAsync | undefined> | LooseTupleSchema | undefined> | LooseTupleSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined> | StrictTupleSchema | undefined> | StrictTupleSchemaAsync | undefined> | TupleSchema | undefined> | TupleSchemaAsync | undefined> | TupleWithRestSchema>, ErrorMessage | undefined> | TupleWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined>>(schema: TSchema): Promise>; +//#endregion +//#region src/methods/getDescription/getDescription.d.ts +/** +* Schema type. +*/ +type Schema$14 = BaseSchema> | BaseSchemaAsync> | SchemaWithPipe>, ...(PipeItem> | DescriptionAction)[]]> | SchemaWithPipeAsync> | BaseSchemaAsync>), ...(PipeItem> | PipeItemAsync> | DescriptionAction)[]]>; +/** +* Returns the description of the schema. +* +* If multiple descriptions are defined, the last one of the highest level is +* returned. If no description is defined, `undefined` is returned. +* +* @param schema The schema to get the description from. +* +* @returns The description, if any. +* +* @beta +*/ +declare function getDescription(schema: Schema$14): string | undefined; +//#endregion +//#region src/methods/getExamples/getExamples.d.ts +/** +* Schema type. +*/ +type Schema$13 = BaseSchema> | BaseSchemaAsync> | SchemaWithPipe>, ...(PipeItem> | ExamplesAction)[]]> | SchemaWithPipeAsync> | BaseSchemaAsync>), ...(PipeItem> | PipeItemAsync> | ExamplesAction)[]]>; +/** +* Recursively concat type. +*/ +type RecursiveConcat> | PipeItemAsync>)[], TCollectedExamples extends unknown[] = []> = TRootPipe extends readonly [infer TFirstItem, ...infer TPipeRest extends readonly (PipeItem> | PipeItemAsync>)[]] ? TFirstItem extends SchemaWithPipe | SchemaWithPipeAsync ? RecursiveConcat> : TFirstItem extends ExamplesAction ? RecursiveConcat : RecursiveConcat : TCollectedExamples; +/** +* Infer examples type. +*/ +type InferExamples = TSchema extends SchemaWithPipe | SchemaWithPipeAsync ? Readonly> : []; +/** +* Returns the examples of a schema. +* +* If multiple examples are defined, it concatenates them using depth-first +* search. If no examples are defined, an empty array is returned. +* +* @param schema The schema to get the examples from. +* +* @returns The examples, if any. +* +* @beta +*/ +declare function getExamples(schema: TSchema): InferExamples; +//#endregion +//#region src/methods/getFallback/getFallback.d.ts +/** +* Infer fallback type. +*/ +type InferFallback> | BaseSchemaAsync>> = TSchema extends SchemaWithFallback>, infer TFallback> | SchemaWithFallbackAsync> | BaseSchemaAsync>, infer TFallback> ? TFallback extends MaybeDeepReadonly> ? TFallback : TFallback extends (() => MaybePromise>>) ? ReturnType : never : undefined; +/** +* Returns the fallback value of the schema. +* +* @param schema The schema to get it from. +* @param dataset The output dataset if available. +* @param config The config if available. +* +* @returns The fallback value. +*/ +declare function getFallback> | BaseSchemaAsync>>(schema: TSchema, dataset?: OutputDataset, InferIssue>, config?: Config>): InferFallback; +//#endregion +//#region src/methods/getFallbacks/types.d.ts +/** +* Infer fallbacks type. +*/ +type InferFallbacks> | BaseSchemaAsync>> = TSchema extends LooseObjectSchema | undefined> | ObjectSchema | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | StrictObjectSchema | undefined> ? { -readonly [TKey in keyof TEntries]: InferFallbacks } : TSchema extends LooseObjectSchemaAsync | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchemaAsync | undefined> ? { -readonly [TKey in keyof TEntries]: InferFallbacks } : TSchema extends LooseTupleSchema | undefined> | StrictTupleSchema | undefined> | TupleSchema | undefined> | TupleWithRestSchema>, ErrorMessage | undefined> ? { -readonly [TKey in keyof TItems]: InferFallbacks } : TSchema extends LooseTupleSchemaAsync | undefined> | StrictTupleSchemaAsync | undefined> | TupleSchemaAsync | undefined> | TupleWithRestSchemaAsync>, ErrorMessage | undefined> ? { -readonly [TKey in keyof TItems]: InferFallbacks } : Awaited>; +//#endregion +//#region src/methods/getFallbacks/getFallbacks.d.ts +/** +* Returns the fallback values of the schema. +* +* Hint: The difference to `getFallback` is that for object and tuple schemas +* this function recursively returns the fallback values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The fallback values. +*/ +declare function getFallbacks> | LooseObjectSchema | undefined> | LooseTupleSchema | undefined> | ObjectSchema | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictTupleSchema | undefined> | TupleSchema | undefined> | TupleWithRestSchema>, ErrorMessage | undefined>>(schema: TSchema): InferFallbacks; +//#endregion +//#region src/methods/getFallbacks/getFallbacksAsync.d.ts +/** +* Returns the fallback values of the schema. +* +* Hint: The difference to `getFallback` is that for object and tuple schemas +* this function recursively returns the fallback values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The fallback values. +*/ +declare function getFallbacksAsync> | BaseSchemaAsync> | LooseObjectSchema | undefined> | LooseObjectSchemaAsync | undefined> | LooseTupleSchema | undefined> | LooseTupleSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined> | StrictTupleSchema | undefined> | StrictTupleSchemaAsync | undefined> | TupleSchema | undefined> | TupleSchemaAsync | undefined> | TupleWithRestSchema>, ErrorMessage | undefined> | TupleWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined>>(schema: TSchema): Promise>; +//#endregion +//#region src/methods/pipe/pipe.d.ts +/** +* Schema with pipe type. +*/ +type SchemaWithPipe>, ...PipeItem>[]]> = Omit, "pipe" | "~standard" | "~run" | "~types"> & { + /** + * The pipe items. + */ + readonly pipe: TPipe$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferOutput>>; + /** + * Parses unknown input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset>, InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferInput>; + readonly output: InferOutput>; + readonly issue: InferIssue; + } | undefined; +}; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* @param item17 The seventeenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue>, const TItem17 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue>, item17: TItem17 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* @param item17 The seventeenth pipe item. +* @param item18 The eighteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue>, const TItem17 extends PipeItem, unknown, BaseIssue>, const TItem18 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue>, item17: TItem17 | PipeAction, InferOutput, InferIssue>, item18: TItem18 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* @param item17 The seventeenth pipe item. +* @param item18 The eighteenth pipe item. +* @param item19 The nineteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue>, const TItem17 extends PipeItem, unknown, BaseIssue>, const TItem18 extends PipeItem, unknown, BaseIssue>, const TItem19 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue>, item17: TItem17 | PipeAction, InferOutput, InferIssue>, item18: TItem18 | PipeAction, InferOutput, InferIssue>, item19: TItem19 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param items The pipe items. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItems$1 extends readonly PipeItem, InferOutput, BaseIssue>[]>(schema: TSchema, ...items: TItems$1): SchemaWithPipe; +//#endregion +//#region src/methods/pipe/pipeAsync.d.ts +/** +* Schema with pipe async type. +*/ +type SchemaWithPipeAsync> | BaseSchemaAsync>), ...(PipeItem> | PipeItemAsync>)[]]> = Omit, "async" | "pipe" | "~standard" | "~run" | "~types"> & { + /** + * The pipe items. + */ + readonly pipe: TPipe$1; + /** + * Whether it's async. + */ + readonly async: true; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferOutput>>; + /** + * Parses unknown input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>, InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferInput>; + readonly output: InferOutput>; + readonly issue: InferIssue; + } | undefined; +}; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* @param item17 The seventeenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem17 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item17: TItem17 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* @param item17 The seventeenth pipe item. +* @param item18 The eighteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem17 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem18 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item17: TItem17 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item18: TItem18 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* @param item17 The seventeenth pipe item. +* @param item18 The eighteenth pipe item. +* @param item19 The nineteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem17 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem18 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem19 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item17: TItem17 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item18: TItem18 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item19: TItem19 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param items The pipe items. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItems$1 extends readonly (PipeItem, InferOutput, BaseIssue> | PipeItemAsync, InferOutput, BaseIssue>)[]>(schema: TSchema, ...items: TItems$1): SchemaWithPipeAsync; +//#endregion +//#region src/methods/getMetadata/getMetadata.d.ts +/** +* Schema type. +*/ +type Schema$12 = BaseSchema> | BaseSchemaAsync> | SchemaWithPipe>, ...(PipeItem> | MetadataAction>)[]]> | SchemaWithPipeAsync> | BaseSchemaAsync>), ...(PipeItem> | PipeItemAsync> | MetadataAction>)[]]>; +/** +* Basic pipe item type. +*/ +type BasicPipeItem = PipeItem> | PipeItemAsync> | MetadataAction>; +/** +* Recursive merge type. +*/ +type RecursiveMerge$1 = {}> = TRootPipe extends readonly [infer TFirstItem, ...infer TPipeRest extends readonly BasicPipeItem[]] ? TFirstItem extends SchemaWithPipe | SchemaWithPipeAsync ? RecursiveMerge$1> : TFirstItem extends MetadataAction ? RecursiveMerge$1> : RecursiveMerge$1 : TCollectedMetadata; +/** +* Infer metadata type. +* +* @beta +*/ +type InferMetadata = BaseSchema extends TSchema ? Record : BaseSchemaAsync extends TSchema ? Record : TSchema extends SchemaWithPipe | SchemaWithPipeAsync ? Prettify> : {}; +/** +* Returns the metadata of a schema. +* +* If multiple metadata are defined, it shallowly merges them using depth-first +* search. If no metadata is defined, an empty object is returned. +* +* @param schema Schema to get the metadata from. +* +* @returns The metadata, if any. +* +* @beta +*/ +declare function getMetadata(schema: TSchema): InferMetadata; +//#endregion +//#region src/actions/title/title.d.ts +/** +* Title action interface. +*/ +interface TitleAction extends BaseMetadata { + /** + * The action type. + */ + readonly type: "title"; + /** + * The action reference. + */ + readonly reference: typeof title; + /** + * The title text. + */ + readonly title: TTitle; +} +/** +* Creates a title metadata action. +* +* @param title_ The title text. +* +* @returns A title action. +*/ +declare function title(title_: TTitle): TitleAction; +//#endregion +//#region src/methods/getTitle/getTitle.d.ts +/** +* Schema type. +*/ +type Schema$11 = BaseSchema> | BaseSchemaAsync> | SchemaWithPipe>, ...(PipeItem> | TitleAction)[]]> | SchemaWithPipeAsync> | BaseSchemaAsync>), ...(PipeItem> | PipeItemAsync> | TitleAction)[]]>; +/** +* Returns the title of the schema. +* +* If multiple titles are defined, the last one of the highest level is +* returned. If no title is defined, `undefined` is returned. +* +* @param schema The schema to get the title from. +* +* @returns The title, if any. +* +* @beta +*/ +declare function getTitle(schema: Schema$11): string | undefined; +//#endregion +//#region src/methods/is/is.d.ts +/** +* Checks if the input matches the schema. By using a type predicate, this +* function can be used as a type guard. +* +* @param schema The schema to be used. +* @param input The input to be tested. +* +* @returns Whether the input matches the schema. +*/ +declare function is>>(schema: TSchema, input: unknown): input is InferInput; +//#endregion +//#region src/methods/keyof/keyof.d.ts +/** +* Schema type. +*/ +type Schema$10 = LooseObjectSchema | undefined> | LooseObjectSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined>; +/** +* Force tuple type. +*/ +type ForceTuple = T extends [string, ...string[]] ? T : []; +/** +* Object keys type. +*/ +type ObjectKeys$1 = ForceTuple>; +/** +* Creates a picklist schema of object keys. +* +* @param schema The object schema. +* +* @returns A picklist schema. +*/ +declare function keyof(schema: TSchema): PicklistSchema, undefined>; +/** +* Creates a picklist schema of object keys. +* +* @param schema The object schema. +* @param message The error message. +* +* @returns A picklist schema. +*/ +declare function keyof | undefined>(schema: TSchema, message: TMessage): PicklistSchema, TMessage>; +//#endregion +//#region src/methods/message/message.d.ts +/** +* Changes the local message configuration of a schema. +* +* @param schema The schema to configure. +* @param message_ The error message. +* +* @returns The configured schema. +*/ +declare function message> | BaseSchemaAsync>>(schema: TSchema, message_: ErrorMessage>): TSchema; +//#endregion +//#region src/methods/omit/omit.d.ts +/** +* Schema type. +*/ +type Schema$9 = SchemaWithoutPipe | undefined> | LooseObjectSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined>>; +/** +* Schema with omit type. +*/ +type SchemaWithOmit> = TSchema extends ObjectSchema | undefined> | StrictObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Omit; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset>, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends ObjectSchemaAsync | undefined> | StrictObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Omit; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends LooseObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Omit; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectInput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: unknown; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends LooseObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Omit; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectInput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: unknown; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends ObjectWithRestSchema>, ErrorMessage | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Omit; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: InferOutput; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue; + } | undefined; +} : TSchema extends ObjectWithRestSchemaAsync>, ErrorMessage | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Omit; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: InferOutput; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue; + } | undefined; +} : never; +/** +* Creates a modified copy of an object schema that does not contain the +* selected entries. +* +* @param schema The schema to omit from. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +declare function omit>(schema: TSchema, keys: TKeys): SchemaWithOmit; +//#endregion +//#region src/methods/parse/parse.d.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parsed input. +*/ +declare function parse>>(schema: TSchema, input: unknown, config?: Config>): InferOutput; +//#endregion +//#region src/methods/parse/parseAsync.d.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parsed input. +*/ +declare function parseAsync> | BaseSchemaAsync>>(schema: TSchema, input: unknown, config?: Config>): Promise>; +//#endregion +//#region src/methods/parser/parser.d.ts +/** +* The parser interface. +*/ +interface Parser>, TConfig extends Config> | undefined> { + /** + * Parses an unknown input based on the schema. + */ + (input: unknown): InferOutput; + /** + * The schema to be used. + */ + readonly schema: TSchema; + /** + * The parser configuration. + */ + readonly config: TConfig; +} +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* +* @returns The parser function. +*/ +declare function parser>>(schema: TSchema): Parser; +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param config The parser configuration. +* +* @returns The parser function. +*/ +declare function parser>, const TConfig extends Config> | undefined>(schema: TSchema, config: TConfig): Parser; +//#endregion +//#region src/methods/parser/parserAsync.d.ts +/** +* The parser async interface. +*/ +interface ParserAsync> | BaseSchemaAsync>, TConfig extends Config> | undefined> { + /** + * Parses an unknown input based on the schema. + */ + (input: unknown): Promise>; + /** + * The schema to be used. + */ + readonly schema: TSchema; + /** + * The parser configuration. + */ + readonly config: TConfig; +} +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* +* @returns The parser function. +*/ +declare function parserAsync> | BaseSchemaAsync>>(schema: TSchema): ParserAsync; +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param config The parser configuration. +* +* @returns The parser function. +*/ +declare function parserAsync> | BaseSchemaAsync>, const TConfig extends Config> | undefined>(schema: TSchema, config: TConfig): ParserAsync; +//#endregion +//#region src/methods/partial/partial.d.ts +/** +* Schema type. +*/ +type Schema$8 = SchemaWithoutPipe | undefined> | ObjectSchema | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | StrictObjectSchema | undefined>>; +/** +* Partial entries type. +*/ +type PartialEntries$1 = { [TKey in keyof TEntries$1]: TKeys extends readonly (keyof TEntries$1)[] ? TKey extends TKeys[number] ? OptionalSchema : TEntries$1[TKey] : OptionalSchema }; +/** +* Schema with partial type. +*/ +type SchemaWithPartial | undefined> = TSchema extends ObjectSchema | undefined> | StrictObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: PartialEntries$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset>, InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: InferIssue; + } | undefined; +} : TSchema extends LooseObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: PartialEntries$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectOutput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: unknown; + }, InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: InferIssue; + } | undefined; +} : TSchema extends ObjectWithRestSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: PartialEntries$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: InferOutput; + }, InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: InferIssue; + } | undefined; +} : never; +/** +* Creates a modified copy of an object schema that marks all entries as optional. +* +* @param schema The schema to modify. +* +* @returns An object schema. +*/ +declare function partial(schema: TSchema): SchemaWithPartial; +/** +* Creates a modified copy of an object schema that marks the selected entries +* as optional. +* +* @param schema The schema to modify. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +declare function partial>(schema: TSchema, keys: TKeys): SchemaWithPartial; +//#endregion +//#region src/methods/partial/partialAsync.d.ts +/** +* Schema type. +*/ +type Schema$7 = SchemaWithoutPipe | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchemaAsync | undefined>>; +/** +* Partial entries type. +*/ +type PartialEntries = { [TKey in keyof TEntries$1]: TKeys extends readonly (keyof TEntries$1)[] ? TKey extends TKeys[number] ? OptionalSchemaAsync : TEntries$1[TKey] : OptionalSchemaAsync }; +/** +* Schema with partial type. +*/ +type SchemaWithPartialAsync | undefined> = TSchema extends ObjectSchemaAsync | undefined> | StrictObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: PartialEntries; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>, InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: InferIssue; + } | undefined; +} : TSchema extends LooseObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: PartialEntries; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectOutput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: unknown; + }, InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: InferIssue; + } | undefined; +} : TSchema extends ObjectWithRestSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: PartialEntries; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: InferOutput; + }, InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: InferIssue; + } | undefined; +} : never; +/** +* Creates a modified copy of an object schema that marks all entries as optional. +* +* @param schema The schema to modify. +* +* @returns An object schema. +*/ +declare function partialAsync(schema: TSchema): SchemaWithPartialAsync; +/** +* Creates a modified copy of an object schema that marks the selected entries +* as optional. +* +* @param schema The schema to modify. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +declare function partialAsync>(schema: TSchema, keys: TKeys): SchemaWithPartialAsync; +//#endregion +//#region src/methods/pick/pick.d.ts +/** +* The schema type. +*/ +type Schema$6 = SchemaWithoutPipe | undefined> | LooseObjectSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined>>; +/** +* Schema with pick type. +*/ +type SchemaWithPick> = TSchema extends ObjectSchema | undefined> | StrictObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Pick; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset>, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends ObjectSchemaAsync | undefined> | StrictObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Pick; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends LooseObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Pick; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectOutput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: unknown; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends LooseObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Pick; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectOutput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: unknown; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends ObjectWithRestSchema>, ErrorMessage | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Pick; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: InferOutput; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue; + } | undefined; +} : TSchema extends ObjectWithRestSchemaAsync>, ErrorMessage | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Pick; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: InferOutput; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue; + } | undefined; +} : never; +/** +* Creates a modified copy of an object schema that contains only the selected +* entries. +* +* @param schema The schema to pick from. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +declare function pick>(schema: TSchema, keys: TKeys): SchemaWithPick; +//#endregion +//#region src/methods/required/required.d.ts +/** +* Schema type. +*/ +type Schema$5 = SchemaWithoutPipe | undefined> | ObjectSchema | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | StrictObjectSchema | undefined>>; +/** +* Required entries type. +*/ +type RequiredEntries$1 | undefined> = { [TKey in keyof TEntries$1]: TKeys extends readonly (keyof TEntries$1)[] ? TKey extends TKeys[number] ? NonOptionalSchema : TEntries$1[TKey] : NonOptionalSchema }; +/** +* Schema with required type. +*/ +type SchemaWithRequired | undefined, TMessage extends ErrorMessage | undefined> = TSchema extends ObjectSchema | undefined> | StrictObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: RequiredEntries$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset>, NonOptionalIssue | InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: NonOptionalIssue | InferIssue; + } | undefined; +} : TSchema extends LooseObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: RequiredEntries$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectOutput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: unknown; + }, NonOptionalIssue | InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: NonOptionalIssue | InferIssue; + } | undefined; +} : TSchema extends ObjectWithRestSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: RequiredEntries$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: InferOutput; + }, NonOptionalIssue | InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: NonOptionalIssue | InferIssue; + } | undefined; +} : never; +/** +* Creates a modified copy of an object schema that marks all entries as required. +* +* @param schema The schema to modify. +* +* @returns An object schema. +*/ +declare function required(schema: TSchema): SchemaWithRequired; +/** +* Creates a modified copy of an object schema that marks all entries as required. +* +* @param schema The schema to modify. +* @param message The error message. +* +* @returns An object schema. +*/ +declare function required | undefined>(schema: TSchema, message: TMessage): SchemaWithRequired; +/** +* Creates a modified copy of an object schema that marks the selected entries +* as required. +* +* @param schema The schema to modify. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +declare function required>(schema: TSchema, keys: TKeys): SchemaWithRequired; +/** +* Creates a modified copy of an object schema that marks the selected entries +* as required. +* +* @param schema The schema to modify. +* @param keys The selected entries. +* @param message The error message. +* +* @returns An object schema. +*/ +declare function required, const TMessage extends ErrorMessage | undefined>(schema: TSchema, keys: TKeys, message: TMessage): SchemaWithRequired; +//#endregion +//#region src/methods/required/requiredAsync.d.ts +/** +* Schema type. +*/ +type Schema$4 = SchemaWithoutPipe | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchemaAsync | undefined>>; +/** +* Required entries type. +*/ +type RequiredEntries | undefined> = { [TKey in keyof TEntries$1]: TKeys extends readonly (keyof TEntries$1)[] ? TKey extends TKeys[number] ? NonOptionalSchemaAsync : TEntries$1[TKey] : NonOptionalSchemaAsync }; +/** +* Schema with required type. +*/ +type SchemaWithRequiredAsync | undefined, TMessage extends ErrorMessage | undefined> = TSchema extends ObjectSchemaAsync | undefined> | StrictObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: RequiredEntries; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>, NonOptionalIssue | InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: NonOptionalIssue | InferIssue; + } | undefined; +} : TSchema extends LooseObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: RequiredEntries; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectOutput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: unknown; + }, NonOptionalIssue | InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: NonOptionalIssue | InferIssue; + } | undefined; +} : TSchema extends ObjectWithRestSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: RequiredEntries; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: InferOutput; + }, NonOptionalIssue | InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: NonOptionalIssue | InferIssue; + } | undefined; +} : never; +/** +* Creates a modified copy of an object schema that marks all entries as required. +* +* @param schema The schema to modify. +* +* @returns An object schema. +*/ +declare function requiredAsync(schema: TSchema): SchemaWithRequiredAsync; +/** +* Creates a modified copy of an object schema that marks all entries as required. +* +* @param schema The schema to modify. +* @param message The error message. +* +* @returns An object schema. +*/ +declare function requiredAsync | undefined>(schema: TSchema, message: TMessage): SchemaWithRequiredAsync; +/** +* Creates a modified copy of an object schema that marks the selected entries +* as required. +* +* @param schema The schema to modify. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +declare function requiredAsync>(schema: TSchema, keys: TKeys): SchemaWithRequiredAsync; +/** +* Creates a modified copy of an object schema that marks the selected entries +* as required. +* +* @param schema The schema to modify. +* @param keys The selected entries. +* @param message The error message. +* +* @returns An object schema. +*/ +declare function requiredAsync, const TMessage extends ErrorMessage | undefined>(schema: TSchema, keys: TKeys, message: TMessage): SchemaWithRequiredAsync; +//#endregion +//#region src/methods/safeParse/types.d.ts +/** +* Safe parse result type. +*/ +type SafeParseResult> | BaseSchemaAsync>> = { + /** + * Whether is's typed. + */ + readonly typed: true; + /** + * Whether it's successful. + */ + readonly success: true; + /** + * The output value. + */ + readonly output: InferOutput; + /** + * The issues, if any. + */ + readonly issues: undefined; +} | { + readonly typed: true; + readonly success: false; + readonly output: InferOutput; + readonly issues: [InferIssue, ...InferIssue[]]; +} | { + readonly typed: false; + readonly success: false; + readonly output: unknown; + readonly issues: [InferIssue, ...InferIssue[]]; +}; +//#endregion +//#region src/methods/safeParse/safeParse.d.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parse result. +*/ +declare function safeParse>>(schema: TSchema, input: unknown, config?: Config>): SafeParseResult; +//#endregion +//#region src/methods/safeParse/safeParseAsync.d.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parse result. +*/ +declare function safeParseAsync> | BaseSchemaAsync>>(schema: TSchema, input: unknown, config?: Config>): Promise>; +//#endregion +//#region src/methods/safeParser/safeParser.d.ts +/** +* The safe parser interface. +*/ +interface SafeParser>, TConfig extends Config> | undefined> { + /** + * Parses an unknown input based on the schema. + */ + (input: unknown): SafeParseResult; + /** + * The schema to be used. + */ + readonly schema: TSchema; + /** + * The parser configuration. + */ + readonly config: TConfig; +} +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* +* @returns The parser function. +*/ +declare function safeParser>>(schema: TSchema): SafeParser; +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param config The parser configuration. +* +* @returns The parser function. +*/ +declare function safeParser>, const TConfig extends Config> | undefined>(schema: TSchema, config: TConfig): SafeParser; +//#endregion +//#region src/methods/safeParser/safeParserAsync.d.ts +/** +* The safe parser async interface. +*/ +interface SafeParserAsync> | BaseSchemaAsync>, TConfig extends Config> | undefined> { + /** + * Parses an unknown input based on the schema. + */ + (input: unknown): Promise>; + /** + * The schema to be used. + */ + readonly schema: TSchema; + /** + * The parser configuration. + */ + readonly config: TConfig; +} +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* +* @returns The parser function. +*/ +declare function safeParserAsync> | BaseSchemaAsync>>(schema: TSchema): SafeParserAsync; +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param config The parser configuration. +* +* @returns The parser function. +*/ +declare function safeParserAsync> | BaseSchemaAsync>, const TConfig extends Config> | undefined>(schema: TSchema, config: TConfig): SafeParserAsync; +//#endregion +//#region src/methods/summarize/summarize.d.ts +/** +* Summarize the error messages of issues in a pretty-printable multi-line string. +* +* @param issues The list of issues. +* +* @returns A summary of the issues. +* +* @beta +*/ +declare function summarize(issues: [BaseIssue, ...BaseIssue[]]): string; +//#endregion +//#region src/methods/unwrap/unwrap.d.ts +/** +* Unwraps the wrapped schema. +* +* @param schema The schema to be unwrapped. +* +* @returns The unwrapped schema. +*/ +declare function unwrap>, unknown> | ExactOptionalSchemaAsync> | BaseSchemaAsync>, unknown> | NonNullableSchema>, ErrorMessage | undefined> | NonNullableSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | NonNullishSchema>, ErrorMessage | undefined> | NonNullishSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | NonOptionalSchema>, ErrorMessage | undefined> | NonOptionalSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | NullableSchema>, unknown> | NullableSchemaAsync> | BaseSchemaAsync>, unknown> | NullishSchema>, unknown> | NullishSchemaAsync> | BaseSchemaAsync>, unknown> | OptionalSchema>, unknown> | OptionalSchemaAsync> | BaseSchemaAsync>, unknown> | UndefinedableSchema>, unknown> | UndefinedableSchemaAsync> | BaseSchemaAsync>, unknown>>(schema: TSchema): TSchema["wrapped"]; +//#endregion +//#region src/types/metadata.d.ts +/** +* Base metadata interface. +*/ +interface BaseMetadata { + /** + * The object kind. + */ + readonly kind: "metadata"; + /** + * The metadata type. + */ + readonly type: string; + /** + * The metadata reference. + */ + readonly reference: (...args: any[]) => BaseMetadata; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: TInput$1; + readonly output: TInput$1; + readonly issue: never; + } | undefined; +} +/** +* Generic metadata type. +*/ +type GenericMetadata = BaseMetadata; +//#endregion +//#region src/types/dataset.d.ts +/** +* Unknown dataset interface. +*/ +interface UnknownDataset { + /** + * Whether is's typed. + */ + typed?: false; + /** + * The dataset value. + */ + value: unknown; + /** + * The dataset issues. + */ + issues?: undefined; +} +/** +* Success dataset interface. +*/ +interface SuccessDataset { + /** + * Whether is's typed. + */ + typed: true; + /** + * The dataset value. + */ + value: TValue$1; + /** + * The dataset issues. + */ + issues?: undefined; +} +/** +* Partial dataset interface. +*/ +interface PartialDataset> { + /** + * Whether is's typed. + */ + typed: true; + /** + * The dataset value. + */ + value: TValue$1; + /** + * The dataset issues. + */ + issues: [TIssue, ...TIssue[]]; +} +/** +* Failure dataset interface. +*/ +interface FailureDataset> { + /** + * Whether is's typed. + */ + typed: false; + /** + * The dataset value. + */ + value: unknown; + /** + * The dataset issues. + */ + issues: [TIssue, ...TIssue[]]; +} +/** +* Output dataset type. +*/ +type OutputDataset> = SuccessDataset | PartialDataset | FailureDataset; +//#endregion +//#region src/types/standard.d.ts +/** +* The Standard Schema properties interface. +*/ +interface StandardProps { + /** + * The version number of the standard. + */ + readonly version: 1; + /** + * The vendor name of the schema library. + */ + readonly vendor: "valibot"; + /** + * Validates unknown input values. + */ + readonly validate: (value: unknown) => StandardResult | Promise>; + /** + * Inferred types associated with the schema. + */ + readonly types?: StandardTypes | undefined; +} +/** +* The result interface of the validate function. +*/ +type StandardResult = StandardSuccessResult | StandardFailureResult; +/** +* The result interface if validation succeeds. +*/ +interface StandardSuccessResult { + /** + * The typed output value. + */ + readonly value: TOutput$1; + /** + * The non-existent issues. + */ + readonly issues?: undefined; +} +/** +* The result interface if validation fails. +*/ +interface StandardFailureResult { + /** + * The issues of failed validation. + */ + readonly issues: readonly StandardIssue[]; +} +/** +* The issue interface of the failure output. +*/ +interface StandardIssue { + /** + * The error message of the issue. + */ + readonly message: string; + /** + * The path of the issue, if any. + */ + readonly path?: readonly (PropertyKey | StandardPathItem)[] | undefined; +} +/** +* The path item interface of the issue. +*/ +interface StandardPathItem { + /** + * The key of the path item. + */ + readonly key: PropertyKey; +} +/** +* The Standard Schema types interface. +*/ +interface StandardTypes { + /** + * The input type of the schema. + */ + readonly input: TInput$1; + /** + * The output type of the schema. + */ + readonly output: TOutput$1; +} +//#endregion +//#region src/types/schema.d.ts +/** +* Base schema interface. +*/ +interface BaseSchema> { + /** + * The object kind. + */ + readonly kind: "schema"; + /** + * The schema type. + */ + readonly type: string; + /** + * The schema reference. + */ + readonly reference: (...args: any[]) => BaseSchema>; + /** + * The expected property. + */ + readonly expects: string; + /** + * Whether it's async. + */ + readonly async: false; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps; + /** + * Parses unknown input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: TInput$1; + readonly output: TOutput$1; + readonly issue: TIssue; + } | undefined; +} +/** +* Base schema async interface. +*/ +interface BaseSchemaAsync> extends Omit, "reference" | "async" | "~run"> { + /** + * The schema reference. + */ + readonly reference: (...args: any[]) => BaseSchema> | BaseSchemaAsync>; + /** + * Whether it's async. + */ + readonly async: true; + /** + * Parses unknown input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>; +} +/** +* Generic schema type. +*/ +type GenericSchema = BaseIssue> = BaseSchema; +/** +* Generic schema async type. +*/ +type GenericSchemaAsync = BaseIssue> = BaseSchemaAsync; +//#endregion +//#region src/types/transformation.d.ts +/** +* Base transformation interface. +*/ +interface BaseTransformation> { + /** + * The object kind. + */ + readonly kind: "transformation"; + /** + * The transformation type. + */ + readonly type: string; + /** + * The transformation reference. + */ + readonly reference: (...args: any[]) => BaseTransformation>; + /** + * Whether it's async. + */ + readonly async: false; + /** + * Transforms known input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: SuccessDataset, config: Config>) => OutputDataset | TIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: TInput$1; + readonly output: TOutput$1; + readonly issue: TIssue; + } | undefined; +} +/** +* Base transformation async interface. +*/ +interface BaseTransformationAsync> extends Omit, "reference" | "async" | "~run"> { + /** + * The transformation reference. + */ + readonly reference: (...args: any[]) => BaseTransformation> | BaseTransformationAsync>; + /** + * Whether it's async. + */ + readonly async: true; + /** + * Transforms known input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: SuccessDataset, config: Config>) => Promise | TIssue>>; +} +/** +* Generic transformation type. +*/ +type GenericTransformation = BaseIssue> = BaseTransformation; +/** +* Generic transformation async type. +*/ +type GenericTransformationAsync = BaseIssue> = BaseTransformationAsync; +//#endregion +//#region src/types/validation.d.ts +/** +* Base validation interface. +*/ +interface BaseValidation> { + /** + * The object kind. + */ + readonly kind: "validation"; + /** + * The validation type. + */ + readonly type: string; + /** + * The validation reference. + */ + readonly reference: (...args: any[]) => BaseValidation>; + /** + * The expected property. + */ + readonly expects: string | null; + /** + * Whether it's async. + */ + readonly async: false; + /** + * Validates known input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: OutputDataset>, config: Config>) => OutputDataset | TIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: TInput$1; + readonly output: TOutput$1; + readonly issue: TIssue; + } | undefined; +} +/** +* Base validation async interface. +*/ +interface BaseValidationAsync> extends Omit, "reference" | "async" | "~run"> { + /** + * The validation reference. + */ + readonly reference: (...args: any[]) => BaseValidation> | BaseValidationAsync>; + /** + * Whether it's async. + */ + readonly async: true; + /** + * Validates known input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: OutputDataset>, config: Config>) => Promise | TIssue>>; +} +/** +* Generic validation type. +*/ +type GenericValidation = BaseIssue> = BaseValidation; +/** +* Generic validation async type. +*/ +type GenericValidationAsync = BaseIssue> = BaseValidationAsync; +//#endregion +//#region src/types/infer.d.ts +/** +* Infer input type. +*/ +type InferInput> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync> | BaseMetadata> = NonNullable["input"]; +/** +* Infer output type. +*/ +type InferOutput> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync> | BaseMetadata> = NonNullable["output"]; +/** +* Infer issue type. +*/ +type InferIssue> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync> | BaseMetadata> = NonNullable["issue"]; +//#endregion +//#region src/types/utils.d.ts +/** +* Checks if a type is `any`. +*/ +type IsAny = 0 extends 1 & Type ? true : false; +/** +* Checks if a type is `never`. +*/ +type IsNever = [Type] extends [never] ? true : false; +/** +* Extracts `null` from a type. +*/ +type NonNullable$1 = TValue$1 extends null ? never : TValue$1; +/** +* Extracts `null` and `undefined` from a type. +*/ +type NonNullish = TValue$1 extends null | undefined ? never : TValue$1; +/** +* Extracts `undefined` from a type. +*/ +type NonOptional = TValue$1 extends undefined ? never : TValue$1; +/** +* Constructs a type that is maybe readonly. +*/ +type MaybeReadonly = TValue$1 | Readonly; +/** +* Constructs a type that is deeply readonly. +*/ +type DeepReadonly = TValue$1 extends Record | readonly unknown[] ? { readonly [TKey in keyof TValue$1]: DeepReadonly } : TValue$1; +/** +* Constructs a type that is maybe deeply readonly. +*/ +type MaybeDeepReadonly = TValue$1 | DeepReadonly; +/** +* Constructs a type that is maybe a promise. +*/ +type MaybePromise = TValue$1 | Promise; +/** +* Prettifies a type for better readability. +* +* Hint: This type has no effect and is only used so that TypeScript displays +* the final type in the preview instead of the utility types used. +*/ +type Prettify = { [TKey in keyof TObject]: TObject[TKey] } & {}; +/** +* Marks specific keys as optional. +*/ +type MarkOptional = { [TKey in keyof TObject]?: unknown } & Omit & Partial>; +/** +* Merges two objects. Overlapping entries from the second object overwrite +* properties from the first object. +*/ +type Merge = Omit & TSecondObject; +/** +* Extracts first tuple item. +*/ +type FirstTupleItem = TTuple[0]; +/** +* Extracts last tuple item. +*/ +type LastTupleItem = TTuple[TTuple extends readonly [unknown, ...infer TRest] ? TRest["length"] : never]; +/** +* Converts union to intersection type. +*/ +type UnionToIntersect = (TUnion extends any ? (arg: TUnion) => void : never) extends ((arg: infer Intersect) => void) ? Intersect : never; +/** +* Converts union to tuple type using an accumulator. +* +* For more information: {@link https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#tail-recursion-elimination-on-conditional-types} +*/ +type UnionToTupleHelper = UnionToIntersect TUnion> extends (() => infer TLast) ? UnionToTupleHelper, [TLast, ...TResult]> : TResult; +/** +* Converts union to tuple type. +*/ +type UnionToTuple = UnionToTupleHelper; +//#endregion +//#region src/types/other.d.ts +/** +* Error message type. +*/ +type ErrorMessage> = ((issue: TIssue) => string) | string; +/** +* Default type. +*/ +type Default>, TInput$1 extends null | undefined> = MaybeDeepReadonly | TInput$1> | ((dataset?: UnknownDataset, config?: Config>) => MaybeDeepReadonly | TInput$1>) | undefined; +/** +* Default async type. +*/ +type DefaultAsync> | BaseSchemaAsync>, TInput$1 extends null | undefined> = MaybeDeepReadonly | TInput$1> | ((dataset?: UnknownDataset, config?: Config>) => MaybePromise | TInput$1>>) | undefined; +/** +* Default value type. +*/ +type DefaultValue>, null | undefined> | DefaultAsync> | BaseSchemaAsync>, null | undefined>> = TDefault extends DefaultAsync> | BaseSchemaAsync>, infer TInput> ? TDefault extends ((dataset?: UnknownDataset, config?: Config>) => MaybePromise | TInput>>) ? Awaited> : TDefault : never; +//#endregion +//#region src/types/object.d.ts +/** +* Optional entry schema type. +*/ +type OptionalEntrySchema = ExactOptionalSchema>, unknown> | NullishSchema>, unknown> | OptionalSchema>, unknown>; +/** +* Optional entry schema async type. +*/ +type OptionalEntrySchemaAsync = ExactOptionalSchemaAsync> | BaseSchemaAsync>, unknown> | NullishSchemaAsync> | BaseSchemaAsync>, unknown> | OptionalSchemaAsync> | BaseSchemaAsync>, unknown>; +/** +* Object entries interface. +*/ +interface ObjectEntries { + [key: string]: BaseSchema> | SchemaWithFallback>, unknown> | OptionalEntrySchema; +} +/** +* Object entries async interface. +*/ +interface ObjectEntriesAsync { + [key: string]: BaseSchema> | BaseSchemaAsync> | SchemaWithFallback>, unknown> | SchemaWithFallbackAsync> | BaseSchemaAsync>, unknown> | OptionalEntrySchema | OptionalEntrySchemaAsync; +} +/** +* Object keys type. +*/ +type ObjectKeys | undefined> | LooseObjectSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined>> = MaybeReadonly<[keyof TSchema["entries"], ...(keyof TSchema["entries"])[]]>; +/** +* Infer entries input type. +*/ +type InferEntriesInput = { -readonly [TKey in keyof TEntries$1]: InferInput }; +/** +* Infer entries output type. +*/ +type InferEntriesOutput = { -readonly [TKey in keyof TEntries$1]: InferOutput }; +/** +* Optional input keys type. +*/ +type OptionalInputKeys = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? TKey : never }[keyof TEntries$1]; +/** +* Optional output keys type. +*/ +type OptionalOutputKeys = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? undefined extends TEntries$1[TKey]["default"] ? TKey : never : never }[keyof TEntries$1]; +/** +* Input with question marks type. +*/ +type InputWithQuestionMarks> = MarkOptional>; +/** +* Output with question marks type. +*/ +type OutputWithQuestionMarks> = MarkOptional>; +/** +* Readonly output keys type. +*/ +type ReadonlyOutputKeys = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends { + readonly pipe: readonly unknown[]; +} ? ReadonlyAction extends TEntries$1[TKey]["pipe"][number] ? TKey : never : never }[keyof TEntries$1]; +/** +* Output with readonly type. +*/ +type OutputWithReadonly>> = ReadonlyOutputKeys extends never ? TObject : Readonly & Pick>>; +/** +* Infer object input type. +*/ +type InferObjectInput = Prettify>>; +/** +* Infer object output type. +*/ +type InferObjectOutput = Prettify>>>; +/** +* Infer object issue type. +*/ +type InferObjectIssue = InferIssue; +//#endregion +//#region src/types/tuple.d.ts +/** +* Tuple items type. +*/ +type TupleItems = MaybeReadonly>[]>; +/** +* Tuple items async type. +*/ +type TupleItemsAsync = MaybeReadonly<(BaseSchema> | BaseSchemaAsync>)[]>; +/** +* Infer tuple input type. +*/ +type InferTupleInput = { -readonly [TKey in keyof TItems$1]: InferInput }; +/** +* Infer tuple output type. +*/ +type InferTupleOutput = { -readonly [TKey in keyof TItems$1]: InferOutput }; +/** +* Infer tuple issue type. +*/ +type InferTupleIssue = InferIssue; +//#endregion +//#region src/types/issue.d.ts +/** +* Array path item interface. +*/ +interface ArrayPathItem { + /** + * The path item type. + */ + readonly type: "array"; + /** + * The path item origin. + */ + readonly origin: "value"; + /** + * The path item input. + */ + readonly input: MaybeReadonly; + /** + * The path item key. + */ + readonly key: number; + /** + * The path item value. + */ + readonly value: unknown; +} +/** +* Map path item interface. +*/ +interface MapPathItem { + /** + * The path item type. + */ + readonly type: "map"; + /** + * The path item origin. + */ + readonly origin: "key" | "value"; + /** + * The path item input. + */ + readonly input: Map; + /** + * The path item key. + */ + readonly key: unknown; + /** + * The path item value. + */ + readonly value: unknown; +} +/** +* Object path item interface. +*/ +interface ObjectPathItem { + /** + * The path item type. + */ + readonly type: "object"; + /** + * The path item origin. + */ + readonly origin: "key" | "value"; + /** + * The path item input. + */ + readonly input: Record; + /** + * The path item key. + */ + readonly key: string; + /** + * The path item value. + */ + readonly value: unknown; +} +/** +* Set path item interface. +*/ +interface SetPathItem { + /** + * The path item type. + */ + readonly type: "set"; + /** + * The path item origin. + */ + readonly origin: "value"; + /** + * The path item input. + */ + readonly input: Set; + /** + * The path item key. + */ + readonly key: null; + /** + * The path item key. + */ + readonly value: unknown; +} +/** +* Unknown path item interface. +*/ +interface UnknownPathItem { + /** + * The path item type. + */ + readonly type: "unknown"; + /** + * The path item origin. + */ + readonly origin: "key" | "value"; + /** + * The path item input. + */ + readonly input: unknown; + /** + * The path item key. + */ + readonly key: unknown; + /** + * The path item value. + */ + readonly value: unknown; +} +/** +* Issue path item type. +*/ +type IssuePathItem = ArrayPathItem | MapPathItem | ObjectPathItem | SetPathItem | UnknownPathItem; +/** +* Base issue interface. +*/ +interface BaseIssue extends Config> { + /** + * The issue kind. + */ + readonly kind: "schema" | "validation" | "transformation"; + /** + * The issue type. + */ + readonly type: string; + /** + * The raw input data. + */ + readonly input: TInput$1; + /** + * The expected property. + */ + readonly expected: string | null; + /** + * The received property. + */ + readonly received: string; + /** + * The error message. + */ + readonly message: string; + /** + * The input requirement. + */ + readonly requirement?: unknown | undefined; + /** + * The issue path. + */ + readonly path?: [IssuePathItem, ...IssuePathItem[]] | undefined; + /** + * The sub issues. + */ + readonly issues?: [BaseIssue, ...BaseIssue[]] | undefined; +} +/** +* Generic issue type. +*/ +type GenericIssue = BaseIssue; +/** +* Dot path type. +*/ +type DotPath> | BaseSchemaAsync>> = TKey$1 extends string | number ? `${TKey$1}` | `${TKey$1}.${IssueDotPath}` : never; +/** +* Object path type. +*/ +type ObjectPath = { [TKey in keyof TEntries$1]: DotPath }[keyof TEntries$1]; +/** +* Tuple keys type. +*/ +type TupleKeys = Exclude; +/** +* Tuple path type. +*/ +type TuplePath = { [TKey in TupleKeys]: TItems$1[TKey] extends BaseSchema> | BaseSchemaAsync> ? DotPath : never }[TupleKeys]; +/** +* Issue dot path type. +*/ +type IssueDotPath> | BaseSchemaAsync>> = TSchema extends SchemaWithPipe ? IssueDotPath> : TSchema extends SchemaWithPipeAsync ? IssueDotPath> : TSchema extends ArraySchema | undefined> ? DotPath : TSchema extends ArraySchemaAsync | undefined> ? DotPath : TSchema extends IntersectSchema | undefined> | UnionSchema>> | undefined> | VariantSchema | undefined> ? IssueDotPath : TSchema extends IntersectSchemaAsync | undefined> | UnionSchemaAsync>> | undefined> | VariantSchemaAsync | undefined> ? IssueDotPath : TSchema extends MapSchema | undefined> | RecordSchema | undefined> ? DotPath, TValue> : TSchema extends MapSchemaAsync | undefined> | RecordSchemaAsync | undefined> ? DotPath, TValue> : TSchema extends LooseObjectSchema | undefined> | ObjectSchema | undefined> | StrictObjectSchema | undefined> ? ObjectPath : TSchema extends LooseObjectSchemaAsync | undefined> | ObjectSchemaAsync | undefined> | StrictObjectSchemaAsync | undefined> ? ObjectPath : TSchema extends ObjectWithRestSchema>, ErrorMessage | undefined> ? string : TSchema extends ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> ? string : TSchema extends SetSchema | undefined> ? DotPath : TSchema extends SetSchemaAsync | undefined> ? DotPath : TSchema extends LooseTupleSchema | undefined> | StrictTupleSchema | undefined> | TupleSchema | undefined> ? TuplePath : TSchema extends LooseTupleSchemaAsync | undefined> | StrictTupleSchemaAsync | undefined> | TupleSchemaAsync | undefined> ? TuplePath : TSchema extends TupleWithRestSchema | undefined> ? TuplePath | DotPath : TSchema extends TupleWithRestSchemaAsync | undefined> ? TuplePath | DotPath : TSchema extends ExactOptionalSchema>, never>> | LazySchema | NonNullableSchema | undefined> | NonNullishSchema | undefined> | NonOptionalSchema | undefined> | NullableSchema>, null>> | NullishSchema>, null | undefined>> | OptionalSchema>, undefined>> | UndefinedableSchema>, undefined>> ? IssueDotPath : TSchema extends ExactOptionalSchemaAsync> | BaseSchemaAsync>, never>> | LazySchemaAsync | NonNullableSchemaAsync | undefined> | NonNullishSchemaAsync | undefined> | NonOptionalSchemaAsync | undefined> | NullableSchemaAsync> | BaseSchemaAsync>, null>> | NullishSchemaAsync> | BaseSchemaAsync>, null | undefined>> | OptionalSchemaAsync> | BaseSchemaAsync>, undefined>> | UndefinedableSchemaAsync> | BaseSchemaAsync>, undefined>> ? IssueDotPath : never; +//#endregion +//#region src/types/config.d.ts +/** +* Config interface. +*/ +interface Config> { + /** + * The selected language. + */ + readonly lang?: string | undefined; + /** + * The error message. + */ + readonly message?: ErrorMessage | undefined; + /** + * Whether it should be aborted early. + */ + readonly abortEarly?: boolean | undefined; + /** + * Whether a pipe should be aborted early. + */ + readonly abortPipeEarly?: boolean | undefined; +} +//#endregion +//#region src/types/pipe.d.ts +/** +* Pipe action type. +*/ +type PipeAction> = BaseValidation | BaseTransformation | BaseMetadata; +/** +* Pipe action async type. +*/ +type PipeActionAsync> = BaseValidationAsync | BaseTransformationAsync; +/** +* Pipe item type. +*/ +type PipeItem> = BaseSchema | PipeAction; +/** +* Pipe item async type. +*/ +type PipeItemAsync> = BaseSchemaAsync | PipeActionAsync; +/** +* Schema without pipe type. +*/ +type SchemaWithoutPipe> | BaseSchemaAsync>> = TSchema & { + pipe?: never; +}; +/** +* Generic pipe action type. +*/ +type GenericPipeAction = BaseIssue> = PipeAction; +/** +* Generic pipe action async type. +*/ +type GenericPipeActionAsync = BaseIssue> = PipeActionAsync; +/** +* Generic pipe item type. +*/ +type GenericPipeItem = BaseIssue> = PipeItem; +/** +* Generic pipe item async type. +*/ +type GenericPipeItemAsync = BaseIssue> = PipeItemAsync; +//#endregion +//#region src/schemas/any/any.d.ts +/** +* Any schema interface. +*/ +interface AnySchema extends BaseSchema { + /** + * The schema type. + */ + readonly type: "any"; + /** + * The schema reference. + */ + readonly reference: typeof any; + /** + * The expected property. + */ + readonly expects: "any"; +} +/** +* Creates an any schema. +* +* Hint: This schema function exists only for completeness and is not +* recommended in practice. Instead, `unknown` should be used to accept +* unknown data. +* +* @returns An any schema. +*/ +declare function any(): AnySchema; +//#endregion +//#region src/schemas/array/types.d.ts +/** +* Array issue interface. +*/ +interface ArrayIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "array"; + /** + * The expected property. + */ + readonly expected: "Array"; +} +//#endregion +//#region src/schemas/array/array.d.ts +/** +* Array schema interface. +*/ +interface ArraySchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema[], InferOutput[], ArrayIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "array"; + /** + * The schema reference. + */ + readonly reference: typeof array; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The array item schema. + */ + readonly item: TItem$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an array schema. +* +* @param item The item schema. +* +* @returns An array schema. +*/ +declare function array>>(item: TItem$1): ArraySchema; +/** +* Creates an array schema. +* +* @param item The item schema. +* @param message The error message. +* +* @returns An array schema. +*/ +declare function array>, const TMessage extends ErrorMessage | undefined>(item: TItem$1, message: TMessage): ArraySchema; +//#endregion +//#region src/schemas/array/arrayAsync.d.ts +/** +* Array schema interface. +*/ +interface ArraySchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync[], InferOutput[], ArrayIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "array"; + /** + * The schema reference. + */ + readonly reference: typeof array | typeof arrayAsync; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The array item schema. + */ + readonly item: TItem$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an array schema. +* +* @param item The item schema. +* +* @returns An array schema. +*/ +declare function arrayAsync> | BaseSchemaAsync>>(item: TItem$1): ArraySchemaAsync; +/** +* Creates an array schema. +* +* @param item The item schema. +* @param message The error message. +* +* @returns An array schema. +*/ +declare function arrayAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(item: TItem$1, message: TMessage): ArraySchemaAsync; +//#endregion +//#region src/schemas/bigint/bigint.d.ts +/** +* Bigint issue interface. +*/ +interface BigintIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "bigint"; + /** + * The expected property. + */ + readonly expected: "bigint"; +} +/** +* Bigint schema interface. +*/ +interface BigintSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "bigint"; + /** + * The schema reference. + */ + readonly reference: typeof bigint; + /** + * The expected property. + */ + readonly expects: "bigint"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a bigint schema. +* +* @returns A bigint schema. +*/ +declare function bigint(): BigintSchema; +/** +* Creates a bigint schema. +* +* @param message The error message. +* +* @returns A bigint schema. +*/ +declare function bigint | undefined>(message: TMessage): BigintSchema; +//#endregion +//#region src/schemas/blob/blob.d.ts +/** +* Blob issue interface. +*/ +interface BlobIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "blob"; + /** + * The expected property. + */ + readonly expected: "Blob"; +} +/** +* Blob schema interface. +*/ +interface BlobSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "blob"; + /** + * The schema reference. + */ + readonly reference: typeof blob; + /** + * The expected property. + */ + readonly expects: "Blob"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a blob schema. +* +* @returns A blob schema. +*/ +declare function blob(): BlobSchema; +/** +* Creates a blob schema. +* +* @param message The error message. +* +* @returns A blob schema. +*/ +declare function blob | undefined>(message: TMessage): BlobSchema; +//#endregion +//#region src/schemas/boolean/boolean.d.ts +/** +* Boolean issue interface. +*/ +interface BooleanIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "boolean"; + /** + * The expected property. + */ + readonly expected: "boolean"; +} +/** +* Boolean schema interface. +*/ +interface BooleanSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "boolean"; + /** + * The schema reference. + */ + readonly reference: typeof boolean; + /** + * The expected property. + */ + readonly expects: "boolean"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a boolean schema. +* +* @returns A boolean schema. +*/ +declare function boolean(): BooleanSchema; +/** +* Creates a boolean schema. +* +* @param message The error message. +* +* @returns A boolean schema. +*/ +declare function boolean | undefined>(message: TMessage): BooleanSchema; +//#endregion +//#region src/schemas/custom/types.d.ts +/** +* Custom issue interface. +*/ +interface CustomIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "custom"; + /** + * The expected property. + */ + readonly expected: "unknown"; +} +//#endregion +//#region src/schemas/custom/custom.d.ts +/** +* Check type. +*/ +type Check = (input: unknown) => boolean; +/** +* Custom schema interface. +*/ +interface CustomSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "custom"; + /** + * The schema reference. + */ + readonly reference: typeof custom; + /** + * The expected property. + */ + readonly expects: "unknown"; + /** + * The type check function. + */ + readonly check: Check; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a custom schema. +* +* @param check The type check function. +* +* @returns A custom schema. +*/ +declare function custom(check: Check): CustomSchema; +/** +* Creates a custom schema. +* +* @param check The type check function. +* @param message The error message. +* +* @returns A custom schema. +*/ +declare function custom | undefined = ErrorMessage | undefined>(check: Check, message: TMessage): CustomSchema; +//#endregion +//#region src/schemas/custom/customAsync.d.ts +/** +* Check async type. +*/ +type CheckAsync = (input: unknown) => MaybePromise; +/** +* Custom schema async interface. +*/ +interface CustomSchemaAsync | undefined> extends BaseSchemaAsync { + /** + * The schema type. + */ + readonly type: "custom"; + /** + * The schema reference. + */ + readonly reference: typeof custom | typeof customAsync; + /** + * The expected property. + */ + readonly expects: "unknown"; + /** + * The type check function. + */ + readonly check: CheckAsync; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a custom schema. +* +* @param check The type check function. +* +* @returns A custom schema. +*/ +declare function customAsync(check: CheckAsync): CustomSchemaAsync; +/** +* Creates a custom schema. +* +* @param check The type check function. +* @param message The error message. +* +* @returns A custom schema. +*/ +declare function customAsync | undefined = ErrorMessage | undefined>(check: CheckAsync, message: TMessage): CustomSchemaAsync; +//#endregion +//#region src/schemas/date/date.d.ts +/** +* Date issue interface. +*/ +interface DateIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "date"; + /** + * The expected property. + */ + readonly expected: "Date"; +} +/** +* Date schema interface. +*/ +interface DateSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "date"; + /** + * The schema reference. + */ + readonly reference: typeof date; + /** + * The expected property. + */ + readonly expects: "Date"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a date schema. +* +* @returns A date schema. +*/ +declare function date(): DateSchema; +/** +* Creates a date schema. +* +* @param message The error message. +* +* @returns A date schema. +*/ +declare function date | undefined>(message: TMessage): DateSchema; +//#endregion +//#region src/schemas/enum/enum.d.ts +/** +* Enum interface. +*/ +interface Enum { + [key: string]: string | number; +} +/** +* Enum values type. +*/ +type EnumValues = { [TKey in keyof TEnum]: TKey extends number ? TEnum[TKey] extends string ? TEnum[TEnum[TKey]] extends TKey ? never : TEnum[TKey] : TEnum[TKey] : TKey extends "NaN" | "Infinity" | "-Infinity" ? TEnum[TKey] extends string ? TEnum[TEnum[TKey]] extends number ? never : TEnum[TKey] : TEnum[TKey] : TKey extends `+${number}` ? TEnum[TKey] : TKey extends `${infer TNumber extends number}` ? TEnum[TKey] extends string ? TEnum[TEnum[TKey]] extends TNumber ? never : TEnum[TKey] : TEnum[TKey] : TEnum[TKey] }[keyof TEnum]; +/** +* Enum issue interface. +*/ +interface EnumIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "enum"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Enum schema interface. +*/ +interface EnumSchema | undefined> extends BaseSchema, EnumValues, EnumIssue> { + /** + * The schema type. + */ + readonly type: "enum"; + /** + * The schema reference. + */ + readonly reference: typeof enum_; + /** + * The enum object. + */ + readonly enum: TEnum; + /** + * The enum options. + */ + readonly options: EnumValues[]; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an enum schema. +* +* @param enum__ The enum object. +* +* @returns An enum schema. +*/ +declare function enum_(enum__: TEnum): EnumSchema; +/** +* Creates an enum schema. +* +* @param enum__ The enum object. +* @param message The error message. +* +* @returns An enum schema. +*/ +declare function enum_ | undefined>(enum__: TEnum, message: TMessage): EnumSchema; +//#endregion +//#region src/schemas/exactOptional/exactOptional.d.ts +/** +* Exact optional schema interface. +*/ +interface ExactOptionalSchema>, TDefault extends Default> extends BaseSchema, InferOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "exact_optional"; + /** + * The schema reference. + */ + readonly reference: typeof exactOptional; + /** + * The expected property. + */ + readonly expects: TWrapped$1["expects"]; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates an exact optional schema. +* +* @param wrapped The wrapped schema. +* +* @returns An exact optional schema. +*/ +declare function exactOptional>>(wrapped: TWrapped$1): ExactOptionalSchema; +/** +* Creates an exact optional schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns An exact optional schema. +*/ +declare function exactOptional>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): ExactOptionalSchema; +//#endregion +//#region src/schemas/exactOptional/exactOptionalAsync.d.ts +/** +* Exact optional schema async interface. +*/ +interface ExactOptionalSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync, InferOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "exact_optional"; + /** + * The schema reference. + */ + readonly reference: typeof exactOptional | typeof exactOptionalAsync; + /** + * The expected property. + */ + readonly expects: TWrapped$1["expects"]; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates an exact optional schema. +* +* @param wrapped The wrapped schema. +* +* @returns An exact optional schema. +*/ +declare function exactOptionalAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): ExactOptionalSchemaAsync; +/** +* Creates an exact optional schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns An exact optional schema. +*/ +declare function exactOptionalAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): ExactOptionalSchemaAsync; +//#endregion +//#region src/schemas/file/file.d.ts +/** +* File issue interface. +*/ +interface FileIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "file"; + /** + * The expected property. + */ + readonly expected: "File"; +} +/** +* File schema interface. +*/ +interface FileSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "file"; + /** + * The schema reference. + */ + readonly reference: typeof file; + /** + * The expected property. + */ + readonly expects: "File"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a file schema. +* +* @returns A file schema. +*/ +declare function file(): FileSchema; +/** +* Creates a file schema. +* +* @param message The error message. +* +* @returns A file schema. +*/ +declare function file | undefined>(message: TMessage): FileSchema; +//#endregion +//#region src/schemas/function/function.d.ts +/** +* Function issue interface. +*/ +interface FunctionIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "function"; + /** + * The expected property. + */ + readonly expected: "Function"; +} +/** +* Function schema interface. +*/ +interface FunctionSchema | undefined> extends BaseSchema<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown, FunctionIssue> { + /** + * The schema type. + */ + readonly type: "function"; + /** + * The schema reference. + */ + readonly reference: typeof function_; + /** + * The expected property. + */ + readonly expects: "Function"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a function schema. +* +* @returns A function schema. +*/ +declare function function_(): FunctionSchema; +/** +* Creates a function schema. +* +* @param message The error message. +* +* @returns A function schema. +*/ +declare function function_ | undefined>(message: TMessage): FunctionSchema; +//#endregion +//#region src/schemas/instance/instance.d.ts +/** +* Class type. +*/ +type Class = new (...args: any[]) => any; +/** +* Instance issue interface. +*/ +interface InstanceIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "instance"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Instance schema interface. +*/ +interface InstanceSchema | undefined> extends BaseSchema, InstanceType, InstanceIssue> { + /** + * The schema type. + */ + readonly type: "instance"; + /** + * The schema reference. + */ + readonly reference: typeof instance; + /** + * The class of the instance. + */ + readonly class: TClass; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an instance schema. +* +* @param class_ The class of the instance. +* +* @returns An instance schema. +*/ +declare function instance(class_: TClass): InstanceSchema; +/** +* Creates an instance schema. +* +* @param class_ The class of the instance. +* @param message The error message. +* +* @returns An instance schema. +*/ +declare function instance | undefined>(class_: TClass, message: TMessage): InstanceSchema; +//#endregion +//#region src/schemas/intersect/types.d.ts +/** +* Intersect issue interface. +*/ +interface IntersectIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "intersect"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Intersect options type. +*/ +type IntersectOptions = MaybeReadonly>[]>; +/** +* Intersect options async type. +*/ +type IntersectOptionsAsync = MaybeReadonly<(BaseSchema> | BaseSchemaAsync>)[]>; +/** +* Infer option type. +*/ +type InferOption = BaseSchema> | BaseSchemaAsync>; +/** +* Infer intersect input type. +*/ +type InferIntersectInput = TOptions$1 extends readonly [InferOption, ...infer TRest] ? TRest extends readonly [InferOption, ...InferOption[]] ? TInput & InferIntersectInput : TInput : IsNever extends true ? never : UnionToIntersect>; +/** +* Infer intersect output type. +*/ +type InferIntersectOutput = TOptions$1 extends readonly [InferOption, ...infer TRest] ? TRest extends readonly [InferOption, ...InferOption[]] ? TOutput & InferIntersectOutput : TOutput : IsNever extends true ? never : UnionToIntersect>; +//#endregion +//#region src/schemas/intersect/intersect.d.ts +/** +* Intersect schema interface. +*/ +interface IntersectSchema | undefined> extends BaseSchema, InferIntersectOutput, IntersectIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "intersect"; + /** + * The schema reference. + */ + readonly reference: typeof intersect; + /** + * The intersect options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an intersect schema. +* +* @param options The intersect options. +* +* @returns An intersect schema. +*/ +declare function intersect(options: TOptions$1): IntersectSchema; +/** +* Creates an intersect schema. +* +* @param options The intersect options. +* @param message The error message. +* +* @returns An intersect schema. +*/ +declare function intersect | undefined>(options: TOptions$1, message: TMessage): IntersectSchema; +//#endregion +//#region src/schemas/intersect/intersectAsync.d.ts +/** +* Intersect schema async interface. +*/ +interface IntersectSchemaAsync | undefined> extends BaseSchemaAsync, InferIntersectOutput, IntersectIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "intersect"; + /** + * The schema reference. + */ + readonly reference: typeof intersect | typeof intersectAsync; + /** + * The intersect options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an intersect schema. +* +* @param options The intersect options. +* +* @returns An intersect schema. +*/ +declare function intersectAsync(options: TOptions$1): IntersectSchemaAsync; +/** +* Creates an intersect schema. +* +* @param options The intersect options. +* @param message The error message. +* +* @returns An intersect schema. +*/ +declare function intersectAsync | undefined>(options: TOptions$1, message: TMessage): IntersectSchemaAsync; +//#endregion +//#region src/schemas/lazy/lazy.d.ts +/** +* Lazy schema interface. +*/ +interface LazySchema>> extends BaseSchema, InferOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "lazy"; + /** + * The schema reference. + */ + readonly reference: typeof lazy; + /** + * The expected property. + */ + readonly expects: "unknown"; + /** + * The schema getter. + */ + readonly getter: (input: unknown) => TWrapped$1; +} +/** +* Creates a lazy schema. +* +* @param getter The schema getter. +* +* @returns A lazy schema. +*/ +declare function lazy>>(getter: (input: unknown) => TWrapped$1): LazySchema; +//#endregion +//#region src/schemas/lazy/lazyAsync.d.ts +/** +* Lazy schema async interface. +*/ +interface LazySchemaAsync> | BaseSchemaAsync>> extends BaseSchemaAsync, InferOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "lazy"; + /** + * The schema reference. + */ + readonly reference: typeof lazy | typeof lazyAsync; + /** + * The expected property. + */ + readonly expects: "unknown"; + /** + * The schema getter. + */ + readonly getter: (input: unknown) => MaybePromise; +} +/** +* Creates a lazy schema. +* +* @param getter The schema getter. +* +* @returns A lazy schema. +*/ +declare function lazyAsync> | BaseSchemaAsync>>(getter: (input: unknown) => MaybePromise): LazySchemaAsync; +//#endregion +//#region src/schemas/literal/literal.d.ts +/** +* Literal type. +*/ +type Literal = bigint | boolean | number | string | symbol; +/** +* Literal issue interface. +*/ +interface LiteralIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "literal"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Literal schema interface. +*/ +interface LiteralSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "literal"; + /** + * The schema reference. + */ + readonly reference: typeof literal; + /** + * The literal value. + */ + readonly literal: TLiteral; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a literal schema. +* +* @param literal_ The literal value. +* +* @returns A literal schema. +*/ +declare function literal(literal_: TLiteral): LiteralSchema; +/** +* Creates a literal schema. +* +* @param literal_ The literal value. +* @param message The error message. +* +* @returns A literal schema. +*/ +declare function literal | undefined>(literal_: TLiteral, message: TMessage): LiteralSchema; +//#endregion +//#region src/schemas/looseObject/types.d.ts +/** +* Loose object issue interface. +*/ +interface LooseObjectIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "loose_object"; + /** + * The expected property. + */ + readonly expected: "Object" | `"${string}"`; +} +//#endregion +//#region src/schemas/looseObject/looseObject.d.ts +/** +* Loose object schema interface. +*/ +interface LooseObjectSchema | undefined> extends BaseSchema & { + [key: string]: unknown; +}, InferObjectOutput & { + [key: string]: unknown; +}, LooseObjectIssue | InferObjectIssue> { + /** + * The schema type. + */ + readonly type: "loose_object"; + /** + * The schema reference. + */ + readonly reference: typeof looseObject; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a loose object schema. +* +* @param entries The entries schema. +* +* @returns A loose object schema. +*/ +declare function looseObject(entries: TEntries$1): LooseObjectSchema; +/** +* Creates a loose object schema. +* +* @param entries The entries schema. +* @param message The error message. +* +* @returns A loose object schema. +*/ +declare function looseObject | undefined>(entries: TEntries$1, message: TMessage): LooseObjectSchema; +//#endregion +//#region src/schemas/looseObject/looseObjectAsync.d.ts +/** +* Object schema async interface. +*/ +interface LooseObjectSchemaAsync | undefined> extends BaseSchemaAsync & { + [key: string]: unknown; +}, InferObjectOutput & { + [key: string]: unknown; +}, LooseObjectIssue | InferObjectIssue> { + /** + * The schema type. + */ + readonly type: "loose_object"; + /** + * The schema reference. + */ + readonly reference: typeof looseObject | typeof looseObjectAsync; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a loose object schema. +* +* @param entries The entries schema. +* +* @returns A loose object schema. +*/ +declare function looseObjectAsync(entries: TEntries$1): LooseObjectSchemaAsync; +/** +* Creates a loose object schema. +* +* @param entries The entries schema. +* @param message The error message. +* +* @returns A loose object schema. +*/ +declare function looseObjectAsync | undefined>(entries: TEntries$1, message: TMessage): LooseObjectSchemaAsync; +//#endregion +//#region src/schemas/looseTuple/types.d.ts +/** +* Loose tuple issue interface. +*/ +interface LooseTupleIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "loose_tuple"; + /** + * The expected property. + */ + readonly expected: "Array"; +} +//#endregion +//#region src/schemas/looseTuple/looseTuple.d.ts +/** +* Loose tuple schema interface. +*/ +interface LooseTupleSchema | undefined> extends BaseSchema<[...InferTupleInput, ...unknown[]], [...InferTupleOutput, ...unknown[]], LooseTupleIssue | InferTupleIssue> { + /** + * The schema type. + */ + readonly type: "loose_tuple"; + /** + * The schema reference. + */ + readonly reference: typeof looseTuple; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a loose tuple schema. +* +* @param items The items schema. +* +* @returns A loose tuple schema. +*/ +declare function looseTuple(items: TItems$1): LooseTupleSchema; +/** +* Creates a loose tuple schema. +* +* @param items The items schema. +* @param message The error message. +* +* @returns A loose tuple schema. +*/ +declare function looseTuple | undefined>(items: TItems$1, message: TMessage): LooseTupleSchema; +//#endregion +//#region src/schemas/looseTuple/looseTupleAsync.d.ts +/** +* Loose tuple schema async interface. +*/ +interface LooseTupleSchemaAsync | undefined> extends BaseSchemaAsync<[...InferTupleInput, ...unknown[]], [...InferTupleOutput, ...unknown[]], LooseTupleIssue | InferTupleIssue> { + /** + * The schema type. + */ + readonly type: "loose_tuple"; + /** + * The schema reference. + */ + readonly reference: typeof looseTuple | typeof looseTupleAsync; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a loose tuple schema. +* +* @param items The items schema. +* +* @returns A loose tuple schema. +*/ +declare function looseTupleAsync(items: TItems$1): LooseTupleSchemaAsync; +/** +* Creates a loose tuple schema. +* +* @param items The items schema. +* @param message The error message. +* +* @returns A loose tuple schema. +*/ +declare function looseTupleAsync | undefined>(items: TItems$1, message: TMessage): LooseTupleSchemaAsync; +//#endregion +//#region src/schemas/map/types.d.ts +/** +* Map issue interface. +*/ +interface MapIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "map"; + /** + * The expected property. + */ + readonly expected: "Map"; +} +/** +* Infer map input type. +*/ +type InferMapInput> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>> = Map, InferInput>; +/** +* Infer map output type. +*/ +type InferMapOutput> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>> = Map, InferOutput>; +//#endregion +//#region src/schemas/map/map.d.ts +/** +* Map schema interface. +*/ +interface MapSchema>, TValue$1 extends BaseSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferMapOutput, MapIssue | InferIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "map"; + /** + * The schema reference. + */ + readonly reference: typeof map; + /** + * The expected property. + */ + readonly expects: "Map"; + /** + * The map key schema. + */ + readonly key: TKey$1; + /** + * The map value schema. + */ + readonly value: TValue$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a map schema. +* +* @param key The key schema. +* @param value The value schema. +* +* @returns A map schema. +*/ +declare function map>, const TValue$1 extends BaseSchema>>(key: TKey$1, value: TValue$1): MapSchema; +/** +* Creates a map schema. +* +* @param key The key schema. +* @param value The value schema. +* @param message The error message. +* +* @returns A map schema. +*/ +declare function map>, const TValue$1 extends BaseSchema>, const TMessage extends ErrorMessage | undefined>(key: TKey$1, value: TValue$1, message: TMessage): MapSchema; +//#endregion +//#region src/schemas/map/mapAsync.d.ts +/** +* Map schema async interface. +*/ +interface MapSchemaAsync> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferMapOutput, MapIssue | InferIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "map"; + /** + * The schema reference. + */ + readonly reference: typeof map | typeof mapAsync; + /** + * The expected property. + */ + readonly expects: "Map"; + /** + * The map key schema. + */ + readonly key: TKey$1; + /** + * The map value schema. + */ + readonly value: TValue$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a map schema. +* +* @param key The key schema. +* @param value The value schema. +* +* @returns A map schema. +*/ +declare function mapAsync> | BaseSchemaAsync>, const TValue$1 extends BaseSchema> | BaseSchemaAsync>>(key: TKey$1, value: TValue$1): MapSchemaAsync; +/** +* Creates a map schema. +* +* @param key The key schema. +* @param value The value schema. +* @param message The error message. +* +* @returns A map schema. +*/ +declare function mapAsync> | BaseSchemaAsync>, const TValue$1 extends BaseSchema> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(key: TKey$1, value: TValue$1, message: TMessage): MapSchemaAsync; +//#endregion +//#region src/schemas/nan/nan.d.ts +/** +* NaN issue interface. +*/ +interface NanIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "nan"; + /** + * The expected property. + */ + readonly expected: "NaN"; +} +/** +* NaN schema interface. +*/ +interface NanSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "nan"; + /** + * The schema reference. + */ + readonly reference: typeof nan; + /** + * The expected property. + */ + readonly expects: "NaN"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a NaN schema. +* +* @returns A NaN schema. +*/ +declare function nan(): NanSchema; +/** +* Creates a NaN schema. +* +* @param message The error message. +* +* @returns A NaN schema. +*/ +declare function nan | undefined>(message: TMessage): NanSchema; +//#endregion +//#region src/schemas/never/never.d.ts +/** +* Never issue interface. +*/ +interface NeverIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "never"; + /** + * The expected property. + */ + readonly expected: "never"; +} +/** +* Never schema interface. +*/ +interface NeverSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "never"; + /** + * The schema reference. + */ + readonly reference: typeof never; + /** + * The expected property. + */ + readonly expects: "never"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a never schema. +* +* @returns A never schema. +*/ +declare function never(): NeverSchema; +/** +* Creates a never schema. +* +* @param message The error message. +* +* @returns A never schema. +*/ +declare function never | undefined>(message: TMessage): NeverSchema; +//#endregion +//#region src/schemas/union/types.d.ts +/** +* Union issue interface. +*/ +interface UnionIssue> extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "union"; + /** + * The expected property. + */ + readonly expected: string; + /** + * The sub issues. + */ + readonly issues?: [TSubIssue, ...TSubIssue[]]; +} +//#endregion +//#region src/schemas/union/union.d.ts +/** +* Union options type. +*/ +type UnionOptions = MaybeReadonly>[]>; +/** +* Union schema interface. +*/ +interface UnionSchema>> | undefined> extends BaseSchema, InferOutput, UnionIssue> | InferIssue> { + /** + * The schema type. + */ + readonly type: "union"; + /** + * The schema reference. + */ + readonly reference: typeof union; + /** + * The union options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an union schema. +* +* @param options The union options. +* +* @returns An union schema. +*/ +declare function union(options: TOptions$1): UnionSchema; +/** +* Creates an union schema. +* +* @param options The union options. +* @param message The error message. +* +* @returns An union schema. +*/ +declare function union>> | undefined>(options: TOptions$1, message: TMessage): UnionSchema; +//#endregion +//#region src/schemas/union/unionAsync.d.ts +/** +* Union options async type. +*/ +type UnionOptionsAsync = MaybeReadonly<(BaseSchema> | BaseSchemaAsync>)[]>; +/** +* Union schema async interface. +*/ +interface UnionSchemaAsync>> | undefined> extends BaseSchemaAsync, InferOutput, UnionIssue> | InferIssue> { + /** + * The schema type. + */ + readonly type: "union"; + /** + * The schema reference. + */ + readonly reference: typeof union | typeof unionAsync; + /** + * The union options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an union schema. +* +* @param options The union options. +* +* @returns An union schema. +*/ +declare function unionAsync(options: TOptions$1): UnionSchemaAsync; +/** +* Creates an union schema. +* +* @param options The union options. +* @param message The error message. +* +* @returns An union schema. +*/ +declare function unionAsync>> | undefined>(options: TOptions$1, message: TMessage): UnionSchemaAsync; +//#endregion +//#region src/schemas/nonNullable/types.d.ts +/** +* Non nullable issue interface. +*/ +interface NonNullableIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "non_nullable"; + /** + * The expected property. + */ + readonly expected: "!null"; +} +/** +* Infer non nullable input type. +*/ +type InferNonNullableInput> | BaseSchemaAsync>> = NonNullable$1>; +/** +* Infer non nullable output type. +*/ +type InferNonNullableOutput> | BaseSchemaAsync>> = NonNullable$1>; +/** +* Infer non nullable issue type. +*/ +type InferNonNullableIssue> | BaseSchemaAsync>> = TWrapped$1 extends UnionSchema>> | undefined> | UnionSchemaAsync>> | undefined> ? Exclude, { + type: "null" | "union"; +}> | UnionIssue> : Exclude, { + type: "null"; +}>; +//#endregion +//#region src/schemas/nonNullable/nonNullable.d.ts +/** +* Non nullable schema interface. +*/ +interface NonNullableSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferNonNullableOutput, NonNullableIssue | InferNonNullableIssue> { + /** + * The schema type. + */ + readonly type: "non_nullable"; + /** + * The schema reference. + */ + readonly reference: typeof nonNullable; + /** + * The expected property. + */ + readonly expects: "!null"; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non nullable schema. +* +* @param wrapped The wrapped schema. +* +* @returns A non nullable schema. +*/ +declare function nonNullable>>(wrapped: TWrapped$1): NonNullableSchema; +/** +* Creates a non nullable schema. +* +* @param wrapped The wrapped schema. +* @param message The error message. +* +* @returns A non nullable schema. +*/ +declare function nonNullable>, const TMessage extends ErrorMessage | undefined>(wrapped: TWrapped$1, message: TMessage): NonNullableSchema; +//#endregion +//#region src/schemas/nonNullable/nonNullableAsync.d.ts +/** +* Non nullable schema async interface. +*/ +interface NonNullableSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferNonNullableOutput, NonNullableIssue | InferNonNullableIssue> { + /** + * The schema type. + */ + readonly type: "non_nullable"; + /** + * The schema reference. + */ + readonly reference: typeof nonNullable | typeof nonNullableAsync; + /** + * The expected property. + */ + readonly expects: "!null"; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non nullable schema. +* +* @param wrapped The wrapped schema. +* +* @returns A non nullable schema. +*/ +declare function nonNullableAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): NonNullableSchemaAsync; +/** +* Creates a non nullable schema. +* +* @param wrapped The wrapped schema. +* @param message The error message. +* +* @returns A non nullable schema. +*/ +declare function nonNullableAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(wrapped: TWrapped$1, message: TMessage): NonNullableSchemaAsync; +//#endregion +//#region src/schemas/nonNullish/types.d.ts +/** +* Non nullish issue interface. +*/ +interface NonNullishIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "non_nullish"; + /** + * The expected property. + */ + readonly expected: "(!null & !undefined)"; +} +/** +* Infer non nullish input type. +*/ +type InferNonNullishInput> | BaseSchemaAsync>> = NonNullish>; +/** +* Infer non nullish output type. +*/ +type InferNonNullishOutput> | BaseSchemaAsync>> = NonNullish>; +/** +* Infer non nullish issue type. +*/ +type InferNonNullishIssue> | BaseSchemaAsync>> = TWrapped$1 extends UnionSchema>> | undefined> | UnionSchemaAsync>> | undefined> ? Exclude, { + type: "null" | "undefined" | "union"; +}> | UnionIssue> : Exclude, { + type: "null" | "undefined"; +}>; +//#endregion +//#region src/schemas/nonNullish/nonNullish.d.ts +/** +* Non nullish schema interface. +*/ +interface NonNullishSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferNonNullishOutput, NonNullishIssue | InferNonNullishIssue> { + /** + * The schema type. + */ + readonly type: "non_nullish"; + /** + * The schema reference. + */ + readonly reference: typeof nonNullish; + /** + * The expected property. + */ + readonly expects: "(!null & !undefined)"; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non nullish schema. +* +* @param wrapped The wrapped schema. +* +* @returns A non nullish schema. +*/ +declare function nonNullish>>(wrapped: TWrapped$1): NonNullishSchema; +/** +* Creates a non nullish schema. +* +* @param wrapped The wrapped schema. +* @param message The error message. +* +* @returns A non nullish schema. +*/ +declare function nonNullish>, const TMessage extends ErrorMessage | undefined>(wrapped: TWrapped$1, message: TMessage): NonNullishSchema; +//#endregion +//#region src/schemas/nonNullish/nonNullishAsync.d.ts +/** +* Non nullish schema async interface. +*/ +interface NonNullishSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferNonNullishOutput, NonNullishIssue | InferNonNullishIssue> { + /** + * The schema type. + */ + readonly type: "non_nullish"; + /** + * The schema reference. + */ + readonly reference: typeof nonNullish | typeof nonNullishAsync; + /** + * The expected property. + */ + readonly expects: "(!null & !undefined)"; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non nullish schema. +* +* @param wrapped The wrapped schema. +* +* @returns A non nullish schema. +*/ +declare function nonNullishAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): NonNullishSchemaAsync; +/** +* Creates a non nullish schema. +* +* @param wrapped The wrapped schema. +* @param message The error message. +* +* @returns A non nullish schema. +*/ +declare function nonNullishAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(wrapped: TWrapped$1, message: TMessage): NonNullishSchemaAsync; +//#endregion +//#region src/schemas/nonOptional/types.d.ts +/** +* Non optional issue interface. +*/ +interface NonOptionalIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "non_optional"; + /** + * The expected property. + */ + readonly expected: "!undefined"; +} +/** +* Infer non optional input type. +*/ +type InferNonOptionalInput> | BaseSchemaAsync>> = NonOptional>; +/** +* Infer non optional output type. +*/ +type InferNonOptionalOutput> | BaseSchemaAsync>> = NonOptional>; +/** +* Infer non optional issue type. +*/ +type InferNonOptionalIssue> | BaseSchemaAsync>> = TWrapped$1 extends UnionSchema>> | undefined> | UnionSchemaAsync>> | undefined> ? Exclude, { + type: "undefined" | "union"; +}> | UnionIssue> : Exclude, { + type: "undefined"; +}>; +//#endregion +//#region src/schemas/nonOptional/nonOptional.d.ts +/** +* Non optional schema interface. +*/ +interface NonOptionalSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferNonOptionalOutput, NonOptionalIssue | InferNonOptionalIssue> { + /** + * The schema type. + */ + readonly type: "non_optional"; + /** + * The schema reference. + */ + readonly reference: typeof nonOptional; + /** + * The expected property. + */ + readonly expects: "!undefined"; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non optional schema. +* +* @param wrapped The wrapped schema. +* +* @returns A non optional schema. +*/ +declare function nonOptional>>(wrapped: TWrapped$1): NonOptionalSchema; +/** +* Creates a non optional schema. +* +* @param wrapped The wrapped schema. +* @param message The error message. +* +* @returns A non optional schema. +*/ +declare function nonOptional>, const TMessage extends ErrorMessage | undefined>(wrapped: TWrapped$1, message: TMessage): NonOptionalSchema; +//#endregion +//#region src/schemas/nonOptional/nonOptionalAsync.d.ts +/** +* Non optional schema async interface. +*/ +interface NonOptionalSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferNonOptionalOutput, NonOptionalIssue | InferNonOptionalIssue> { + /** + * The schema type. + */ + readonly type: "non_optional"; + /** + * The schema reference. + */ + readonly reference: typeof nonOptional | typeof nonOptionalAsync; + /** + * The expected property. + */ + readonly expects: "!undefined"; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non optional schema. +* +* @param wrapped The wrapped schema. +* +* @returns A non optional schema. +*/ +declare function nonOptionalAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): NonOptionalSchemaAsync; +/** +* Creates a non optional schema. +* +* @param wrapped The wrapped schema. +* @param message The error message. +* +* @returns A non optional schema. +*/ +declare function nonOptionalAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(wrapped: TWrapped$1, message: TMessage): NonOptionalSchemaAsync; +//#endregion +//#region src/schemas/null/null.d.ts +/** +* Null issue interface. +*/ +interface NullIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "null"; + /** + * The expected property. + */ + readonly expected: "null"; +} +/** +* Null schema interface. +*/ +interface NullSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "null"; + /** + * The schema reference. + */ + readonly reference: typeof null_; + /** + * The expected property. + */ + readonly expects: "null"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a null schema. +* +* @returns A null schema. +*/ +declare function null_(): NullSchema; +/** +* Creates a null schema. +* +* @param message The error message. +* +* @returns A null schema. +*/ +declare function null_ | undefined>(message: TMessage): NullSchema; +//#endregion +//#region src/schemas/nullable/types.d.ts +/** +* Infer nullable output type. +*/ +type InferNullableOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | null : InferOutput | Extract, null>; +//#endregion +//#region src/schemas/nullable/nullable.d.ts +/** +* Nullable schema interface. +*/ +interface NullableSchema>, TDefault extends Default> extends BaseSchema | null, InferNullableOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "nullable"; + /** + * The schema reference. + */ + readonly reference: typeof nullable; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | null)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates a nullable schema. +* +* @param wrapped The wrapped schema. +* +* @returns A nullable schema. +*/ +declare function nullable>>(wrapped: TWrapped$1): NullableSchema; +/** +* Creates a nullable schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns A nullable schema. +*/ +declare function nullable>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): NullableSchema; +//#endregion +//#region src/schemas/nullable/nullableAsync.d.ts +/** +* Nullable schema async interface. +*/ +interface NullableSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync | null, InferNullableOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "nullable"; + /** + * The schema reference. + */ + readonly reference: typeof nullable | typeof nullableAsync; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | null)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates a nullable schema. +* +* @param wrapped The wrapped schema. +* +* @returns A nullable schema. +*/ +declare function nullableAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): NullableSchemaAsync; +/** +* Creates a nullable schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns A nullable schema. +*/ +declare function nullableAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): NullableSchemaAsync; +//#endregion +//#region src/schemas/nullish/types.d.ts +/** +* Infer nullish output type. +*/ +type InferNullishOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | null | undefined : InferOutput | Extract, null | undefined>; +//#endregion +//#region src/schemas/nullish/nullish.d.ts +/** +* Nullish schema interface. +*/ +interface NullishSchema>, TDefault extends Default> extends BaseSchema | null | undefined, InferNullishOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "nullish"; + /** + * The schema reference. + */ + readonly reference: typeof nullish; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | null | undefined)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates a nullish schema. +* +* @param wrapped The wrapped schema. +* +* @returns A nullish schema. +*/ +declare function nullish>>(wrapped: TWrapped$1): NullishSchema; +/** +* Creates a nullish schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns A nullish schema. +*/ +declare function nullish>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): NullishSchema; +//#endregion +//#region src/schemas/nullish/nullishAsync.d.ts +/** +* Nullish schema async interface. +*/ +interface NullishSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync | null | undefined, InferNullishOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "nullish"; + /** + * The schema reference. + */ + readonly reference: typeof nullish | typeof nullishAsync; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | null | undefined)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates a nullish schema. +* +* @param wrapped The wrapped schema. +* +* @returns A nullish schema. +*/ +declare function nullishAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): NullishSchemaAsync; +/** +* Creates a nullish schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns A nullish schema. +*/ +declare function nullishAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): NullishSchemaAsync; +//#endregion +//#region src/schemas/number/number.d.ts +/** +* Number issue interface. +*/ +interface NumberIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "number"; + /** + * The expected property. + */ + readonly expected: "number"; +} +/** +* Number schema interface. +*/ +interface NumberSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "number"; + /** + * The schema reference. + */ + readonly reference: typeof number; + /** + * The expected property. + */ + readonly expects: "number"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a number schema. +* +* @returns A number schema. +*/ +declare function number(): NumberSchema; +/** +* Creates a number schema. +* +* @param message The error message. +* +* @returns A number schema. +*/ +declare function number | undefined>(message: TMessage): NumberSchema; +//#endregion +//#region src/schemas/object/types.d.ts +/** +* Object issue interface. +*/ +interface ObjectIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "object"; + /** + * The expected property. + */ + readonly expected: "Object" | `"${string}"`; +} +//#endregion +//#region src/schemas/object/object.d.ts +/** +* Object schema interface. +*/ +interface ObjectSchema | undefined> extends BaseSchema, InferObjectOutput, ObjectIssue | InferObjectIssue> { + /** + * The schema type. + */ + readonly type: "object"; + /** + * The schema reference. + */ + readonly reference: typeof object; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an object schema. +* +* Hint: This schema removes unknown entries. The output will only include the +* entries you specify. To include unknown entries, use `looseObject`. To +* return an issue for unknown entries, use `strictObject`. To include and +* validate unknown entries, use `objectWithRest`. +* +* @param entries The entries schema. +* +* @returns An object schema. +*/ +declare function object(entries: TEntries$1): ObjectSchema; +/** +* Creates an object schema. +* +* Hint: This schema removes unknown entries. The output will only include the +* entries you specify. To include unknown entries, use `looseObject`. To +* return an issue for unknown entries, use `strictObject`. To include and +* validate unknown entries, use `objectWithRest`. +* +* @param entries The entries schema. +* @param message The error message. +* +* @returns An object schema. +*/ +declare function object | undefined>(entries: TEntries$1, message: TMessage): ObjectSchema; +//#endregion +//#region src/schemas/object/objectAsync.d.ts +/** +* Object schema async interface. +*/ +interface ObjectSchemaAsync | undefined> extends BaseSchemaAsync, InferObjectOutput, ObjectIssue | InferObjectIssue> { + /** + * The schema type. + */ + readonly type: "object"; + /** + * The schema reference. + */ + readonly reference: typeof object | typeof objectAsync; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an object schema. +* +* Hint: This schema removes unknown entries. The output will only include the +* entries you specify. To include unknown entries, use `looseObjectAsync`. To +* return an issue for unknown entries, use `strictObjectAsync`. To include and +* validate unknown entries, use `objectWithRestAsync`. +* +* @param entries The entries schema. +* +* @returns An object schema. +*/ +declare function objectAsync(entries: TEntries$1): ObjectSchemaAsync; +/** +* Creates an object schema. +* +* Hint: This schema removes unknown entries. The output will only include the +* entries you specify. To include unknown entries, use `looseObjectAsync`. To +* return an issue for unknown entries, use `strictObjectAsync`. To include and +* validate unknown entries, use `objectWithRestAsync`. +* +* @param entries The entries schema. +* @param message The error message. +* +* @returns An object schema. +*/ +declare function objectAsync | undefined>(entries: TEntries$1, message: TMessage): ObjectSchemaAsync; +//#endregion +//#region src/schemas/objectWithRest/types.d.ts +/** +* Object with rest issue interface. +*/ +interface ObjectWithRestIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "object_with_rest"; + /** + * The expected property. + */ + readonly expected: "Object" | `"${string}"`; +} +//#endregion +//#region src/schemas/objectWithRest/objectWithRest.d.ts +/** +* Object with rest schema interface. +*/ +interface ObjectWithRestSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema & { + [key: string]: InferInput; +}, InferObjectOutput & { + [key: string]: InferOutput; +}, ObjectWithRestIssue | InferObjectIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "object_with_rest"; + /** + * The schema reference. + */ + readonly reference: typeof objectWithRest; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The rest schema. + */ + readonly rest: TRest$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an object with rest schema. +* +* @param entries The entries schema. +* @param rest The rest schema. +* +* @returns An object with rest schema. +*/ +declare function objectWithRest>>(entries: TEntries$1, rest: TRest$1): ObjectWithRestSchema; +/** +* Creates an object with rest schema. +* +* @param entries The entries schema. +* @param rest The rest schema. +* @param message The error message. +* +* @returns An object with rest schema. +*/ +declare function objectWithRest>, const TMessage extends ErrorMessage | undefined>(entries: TEntries$1, rest: TRest$1, message: TMessage): ObjectWithRestSchema; +//#endregion +//#region src/schemas/objectWithRest/objectWithRestAsync.d.ts +/** +* Object schema async interface. +*/ +interface ObjectWithRestSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync & { + [key: string]: InferInput; +}, InferObjectOutput & { + [key: string]: InferOutput; +}, ObjectWithRestIssue | InferObjectIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "object_with_rest"; + /** + * The schema reference. + */ + readonly reference: typeof objectWithRest | typeof objectWithRestAsync; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The rest schema. + */ + readonly rest: TRest$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an object with rest schema. +* +* @param entries The entries schema. +* @param rest The rest schema. +* +* @returns An object with rest schema. +*/ +declare function objectWithRestAsync> | BaseSchemaAsync>>(entries: TEntries$1, rest: TRest$1): ObjectWithRestSchemaAsync; +/** +* Creates an object with rest schema. +* +* @param entries The entries schema. +* @param rest The rest schema. +* @param message The error message. +* +* @returns An object with rest schema. +*/ +declare function objectWithRestAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(entries: TEntries$1, rest: TRest$1, message: TMessage): ObjectWithRestSchemaAsync; +//#endregion +//#region src/schemas/optional/types.d.ts +/** +* Infer optional output type. +*/ +type InferOptionalOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | undefined : InferOutput | Extract, undefined>; +//#endregion +//#region src/schemas/optional/optional.d.ts +/** +* Optional schema interface. +*/ +interface OptionalSchema>, TDefault extends Default> extends BaseSchema | undefined, InferOptionalOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "optional"; + /** + * The schema reference. + */ + readonly reference: typeof optional; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | undefined)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates an optional schema. +* +* @param wrapped The wrapped schema. +* +* @returns An optional schema. +*/ +declare function optional>>(wrapped: TWrapped$1): OptionalSchema; +/** +* Creates an optional schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns An optional schema. +*/ +declare function optional>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): OptionalSchema; +//#endregion +//#region src/schemas/optional/optionalAsync.d.ts +/** +* Optional schema async interface. +*/ +interface OptionalSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync | undefined, InferOptionalOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "optional"; + /** + * The schema reference. + */ + readonly reference: typeof optional | typeof optionalAsync; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | undefined)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates an optional schema. +* +* @param wrapped The wrapped schema. +* +* @returns An optional schema. +*/ +declare function optionalAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): OptionalSchemaAsync; +/** +* Creates an optional schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns An optional schema. +*/ +declare function optionalAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): OptionalSchemaAsync; +//#endregion +//#region src/schemas/picklist/picklist.d.ts +/** +* Picklist options type. +*/ +type PicklistOptions = MaybeReadonly<(string | number | bigint)[]>; +/** +* Picklist issue interface. +*/ +interface PicklistIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "picklist"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Picklist schema interface. +*/ +interface PicklistSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "picklist"; + /** + * The schema reference. + */ + readonly reference: typeof picklist; + /** + * The picklist options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a picklist schema. +* +* @param options The picklist options. +* +* @returns A picklist schema. +*/ +declare function picklist(options: TOptions$1): PicklistSchema; +/** +* Creates a picklist schema. +* +* @param options The picklist options. +* @param message The error message. +* +* @returns A picklist schema. +*/ +declare function picklist | undefined>(options: TOptions$1, message: TMessage): PicklistSchema; +//#endregion +//#region src/schemas/promise/promise.d.ts +/** +* Promise issue interface. +*/ +interface PromiseIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "promise"; + /** + * The expected property. + */ + readonly expected: "Promise"; +} +/** +* Promise schema interface. +*/ +interface PromiseSchema | undefined> extends BaseSchema, Promise, PromiseIssue> { + /** + * The schema type. + */ + readonly type: "promise"; + /** + * The schema reference. + */ + readonly reference: typeof promise; + /** + * The expected property. + */ + readonly expects: "Promise"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a promise schema. +* +* @returns A promise schema. +*/ +declare function promise(): PromiseSchema; +/** +* Creates a promise schema. +* +* @param message The error message. +* +* @returns A promise schema. +*/ +declare function promise | undefined>(message: TMessage): PromiseSchema; +//#endregion +//#region src/schemas/record/types.d.ts +/** +* Record issue interface. +*/ +interface RecordIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "record"; + /** + * The expected property. + */ + readonly expected: "Object"; +} +/** +* Is literal type. +*/ +type IsLiteral = string extends TKey$1 ? false : number extends TKey$1 ? false : symbol extends TKey$1 ? false : TKey$1 extends Brand ? false : true; +/** +* Optional keys type. +*/ +type OptionalKeys> = { [TKey in keyof TObject]: IsLiteral extends true ? TKey : never }[keyof TObject]; +/** +* With question marks type. +* +* Hint: We mark an entry as optional if we detect that its key is a literal +* type. The reason for this is that it is not technically possible to detect +* missing literal keys without restricting the key schema to `string`, `enum` +* and `picklist`. However, if `enum` and `picklist` are used, it is better to +* use `object` with `entriesFromList` because it already covers the needed +* functionality. This decision also reduces the bundle size of `record`, +* because it only needs to check the entries of the input and not any missing +* keys. +*/ +type WithQuestionMarks> = MarkOptional>; +/** +* With readonly type. +*/ +type WithReadonly> | BaseSchemaAsync>, TObject extends WithQuestionMarks>> = TValue$1 extends { + readonly pipe: readonly unknown[]; +} ? ReadonlyAction extends TValue$1["pipe"][number] ? Readonly : TObject : TObject; +/** +* Infer record input type. +*/ +type InferRecordInput> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>> = Prettify, InferInput>>>; +/** +* Infer record output type. +*/ +type InferRecordOutput> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>> = Prettify, InferOutput>>>>; +//#endregion +//#region src/schemas/record/record.d.ts +/** +* Record schema interface. +*/ +interface RecordSchema>, TValue$1 extends BaseSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferRecordOutput, RecordIssue | InferIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "record"; + /** + * The schema reference. + */ + readonly reference: typeof record; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The record key schema. + */ + readonly key: TKey$1; + /** + * The record value schema. + */ + readonly value: TValue$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a record schema. +* +* @param key The key schema. +* @param value The value schema. +* +* @returns A record schema. +*/ +declare function record>, const TValue$1 extends BaseSchema>>(key: TKey$1, value: TValue$1): RecordSchema; +/** +* Creates a record schema. +* +* @param key The key schema. +* @param value The value schema. +* @param message The error message. +* +* @returns A record schema. +*/ +declare function record>, const TValue$1 extends BaseSchema>, const TMessage extends ErrorMessage | undefined>(key: TKey$1, value: TValue$1, message: TMessage): RecordSchema; +//#endregion +//#region src/schemas/record/recordAsync.d.ts +/** +* Record schema async interface. +*/ +interface RecordSchemaAsync> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferRecordOutput, RecordIssue | InferIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "record"; + /** + * The schema reference. + */ + readonly reference: typeof record | typeof recordAsync; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The record key schema. + */ + readonly key: TKey$1; + /** + * The record value schema. + */ + readonly value: TValue$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a record schema. +* +* @param key The key schema. +* @param value The value schema. +* +* @returns A record schema. +*/ +declare function recordAsync> | BaseSchemaAsync>, const TValue$1 extends BaseSchema> | BaseSchemaAsync>>(key: TKey$1, value: TValue$1): RecordSchemaAsync; +/** +* Creates a record schema. +* +* @param key The key schema. +* @param value The value schema. +* @param message The error message. +* +* @returns A record schema. +*/ +declare function recordAsync> | BaseSchemaAsync>, const TValue$1 extends BaseSchema> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(key: TKey$1, value: TValue$1, message: TMessage): RecordSchemaAsync; +//#endregion +//#region src/schemas/set/types.d.ts +/** +* Set issue interface. +*/ +interface SetIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "set"; + /** + * The expected property. + */ + readonly expected: "Set"; +} +/** +* Infer set input type. +*/ +type InferSetInput> | BaseSchemaAsync>> = Set>; +/** +* Infer set output type. +*/ +type InferSetOutput> | BaseSchemaAsync>> = Set>; +//#endregion +//#region src/schemas/set/set.d.ts +/** +* Set schema interface. +*/ +interface SetSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferSetOutput, SetIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "set"; + /** + * The schema reference. + */ + readonly reference: typeof set; + /** + * The expected property. + */ + readonly expects: "Set"; + /** + * The set value schema. + */ + readonly value: TValue$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a set schema. +* +* @param value The value schema. +* +* @returns A set schema. +*/ +declare function set>>(value: TValue$1): SetSchema; +/** +* Creates a set schema. +* +* @param value The value schema. +* @param message The error message. +* +* @returns A set schema. +*/ +declare function set>, const TMessage extends ErrorMessage | undefined>(value: TValue$1, message: TMessage): SetSchema; +//#endregion +//#region src/schemas/set/setAsync.d.ts +/** +* Set schema async interface. +*/ +interface SetSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferSetOutput, SetIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "set"; + /** + * The schema reference. + */ + readonly reference: typeof set | typeof setAsync; + /** + * The expected property. + */ + readonly expects: "Set"; + /** + * The set value schema. + */ + readonly value: TValue$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a set schema. +* +* @param value The value schema. +* +* @returns A set schema. +*/ +declare function setAsync> | BaseSchemaAsync>>(value: TValue$1): SetSchemaAsync; +/** +* Creates a set schema. +* +* @param value The value schema. +* @param message The error message. +* +* @returns A set schema. +*/ +declare function setAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(value: TValue$1, message: TMessage): SetSchemaAsync; +//#endregion +//#region src/schemas/strictObject/types.d.ts +/** +* Strict object issue interface. +*/ +interface StrictObjectIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "strict_object"; + /** + * The expected property. + */ + readonly expected: "Object" | `"${string}"` | "never"; +} +//#endregion +//#region src/schemas/strictObject/strictObject.d.ts +/** +* Strict object schema interface. +*/ +interface StrictObjectSchema | undefined> extends BaseSchema, InferObjectOutput, StrictObjectIssue | InferObjectIssue> { + /** + * The schema type. + */ + readonly type: "strict_object"; + /** + * The schema reference. + */ + readonly reference: typeof strictObject; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a strict object schema. +* +* @param entries The entries schema. +* +* @returns A strict object schema. +*/ +declare function strictObject(entries: TEntries$1): StrictObjectSchema; +/** +* Creates a strict object schema. +* +* @param entries The entries schema. +* @param message The error message. +* +* @returns A strict object schema. +*/ +declare function strictObject | undefined>(entries: TEntries$1, message: TMessage): StrictObjectSchema; +//#endregion +//#region src/schemas/strictObject/strictObjectAsync.d.ts +/** +* Strict object schema async interface. +*/ +interface StrictObjectSchemaAsync | undefined> extends BaseSchemaAsync, InferObjectOutput, StrictObjectIssue | InferObjectIssue> { + /** + * The schema type. + */ + readonly type: "strict_object"; + /** + * The schema reference. + */ + readonly reference: typeof strictObject | typeof strictObjectAsync; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a strict object schema. +* +* @param entries The entries schema. +* +* @returns A strict object schema. +*/ +declare function strictObjectAsync(entries: TEntries$1): StrictObjectSchemaAsync; +/** +* Creates a strict object schema. +* +* @param entries The entries schema. +* @param message The error message. +* +* @returns A strict object schema. +*/ +declare function strictObjectAsync | undefined>(entries: TEntries$1, message: TMessage): StrictObjectSchemaAsync; +//#endregion +//#region src/schemas/strictTuple/types.d.ts +/** +* Strict tuple issue interface. +*/ +interface StrictTupleIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "strict_tuple"; + /** + * The expected property. + */ + readonly expected: "Array" | "never"; +} +//#endregion +//#region src/schemas/strictTuple/strictTuple.d.ts +/** +* Strict tuple schema interface. +*/ +interface StrictTupleSchema | undefined> extends BaseSchema, InferTupleOutput, StrictTupleIssue | InferTupleIssue> { + /** + * The schema type. + */ + readonly type: "strict_tuple"; + /** + * The schema reference. + */ + readonly reference: typeof strictTuple; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a strict tuple schema. +* +* @param items The items schema. +* +* @returns A strict tuple schema. +*/ +declare function strictTuple(items: TItems$1): StrictTupleSchema; +/** +* Creates a strict tuple schema. +* +* @param items The items schema. +* @param message The error message. +* +* @returns A strict tuple schema. +*/ +declare function strictTuple | undefined>(items: TItems$1, message: TMessage): StrictTupleSchema; +//#endregion +//#region src/schemas/strictTuple/strictTupleAsync.d.ts +/** +* Strict tuple schema async interface. +*/ +interface StrictTupleSchemaAsync | undefined> extends BaseSchemaAsync, InferTupleOutput, StrictTupleIssue | InferTupleIssue> { + /** + * The schema type. + */ + readonly type: "strict_tuple"; + /** + * The schema reference. + */ + readonly reference: typeof strictTuple | typeof strictTupleAsync; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a strict tuple schema. +* +* @param items The items schema. +* +* @returns A strict tuple schema. +*/ +declare function strictTupleAsync(items: TItems$1): StrictTupleSchemaAsync; +/** +* Creates a strict tuple schema. +* +* @param items The items schema. +* @param message The error message. +* +* @returns A strict tuple schema. +*/ +declare function strictTupleAsync | undefined>(items: TItems$1, message: TMessage): StrictTupleSchemaAsync; +//#endregion +//#region src/schemas/string/string.d.ts +/** +* String issue interface. +*/ +interface StringIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "string"; + /** + * The expected property. + */ + readonly expected: "string"; +} +/** +* String schema interface. +*/ +interface StringSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "string"; + /** + * The schema reference. + */ + readonly reference: typeof string; + /** + * The expected property. + */ + readonly expects: "string"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a string schema. +* +* @returns A string schema. +*/ +declare function string(): StringSchema; +/** +* Creates a string schema. +* +* @param message The error message. +* +* @returns A string schema. +*/ +declare function string | undefined>(message: TMessage): StringSchema; +//#endregion +//#region src/schemas/symbol/symbol.d.ts +/** +* Symbol issue interface. +*/ +interface SymbolIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "symbol"; + /** + * The expected property. + */ + readonly expected: "symbol"; +} +/** +* Symbol schema interface. +*/ +interface SymbolSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "symbol"; + /** + * The schema reference. + */ + readonly reference: typeof symbol; + /** + * The expected property. + */ + readonly expects: "symbol"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a symbol schema. +* +* @returns A symbol schema. +*/ +declare function symbol(): SymbolSchema; +/** +* Creates a symbol schema. +* +* @param message The error message. +* +* @returns A symbol schema. +*/ +declare function symbol | undefined>(message: TMessage): SymbolSchema; +//#endregion +//#region src/schemas/tuple/types.d.ts +/** +* Tuple issue interface. +*/ +interface TupleIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "tuple"; + /** + * The expected property. + */ + readonly expected: "Array"; +} +//#endregion +//#region src/schemas/tuple/tuple.d.ts +/** +* Tuple schema interface. +*/ +interface TupleSchema | undefined> extends BaseSchema, InferTupleOutput, TupleIssue | InferTupleIssue> { + /** + * The schema type. + */ + readonly type: "tuple"; + /** + * The schema reference. + */ + readonly reference: typeof tuple; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a tuple schema. +* +* Hint: This schema removes unknown items. The output will only include the +* items you specify. To include unknown items, use `looseTuple`. To +* return an issue for unknown items, use `strictTuple`. To include and +* validate unknown items, use `tupleWithRest`. +* +* @param items The items schema. +* +* @returns A tuple schema. +*/ +declare function tuple(items: TItems$1): TupleSchema; +/** +* Creates a tuple schema. +* +* Hint: This schema removes unknown items. The output will only include the +* items you specify. To include unknown items, use `looseTuple`. To +* return an issue for unknown items, use `strictTuple`. To include and +* validate unknown items, use `tupleWithRest`. +* +* @param items The items schema. +* @param message The error message. +* +* @returns A tuple schema. +*/ +declare function tuple | undefined>(items: TItems$1, message: TMessage): TupleSchema; +//#endregion +//#region src/schemas/tuple/tupleAsync.d.ts +/** +* Tuple schema async interface. +*/ +interface TupleSchemaAsync | undefined> extends BaseSchemaAsync, InferTupleOutput, TupleIssue | InferTupleIssue> { + /** + * The schema type. + */ + readonly type: "tuple"; + /** + * The schema reference. + */ + readonly reference: typeof tuple | typeof tupleAsync; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a tuple schema. +* +* Hint: This schema removes unknown items. The output will only include the +* items you specify. To include unknown items, use `looseTupleAsync`. To +* return an issue for unknown items, use `strictTupleAsync`. To include and +* validate unknown items, use `tupleWithRestAsync`. +* +* @param items The items schema. +* +* @returns A tuple schema. +*/ +declare function tupleAsync(items: TItems$1): TupleSchemaAsync; +/** +* Creates a tuple schema. +* +* Hint: This schema removes unknown items. The output will only include the +* items you specify. To include unknown items, use `looseTupleAsync`. To +* return an issue for unknown items, use `strictTupleAsync`. To include and +* validate unknown items, use `tupleWithRestAsync`. +* +* @param items The items schema. +* @param message The error message. +* +* @returns A tuple schema. +*/ +declare function tupleAsync | undefined>(items: TItems$1, message: TMessage): TupleSchemaAsync; +//#endregion +//#region src/schemas/tupleWithRest/types.d.ts +/** +* Tuple with rest issue interface. +*/ +interface TupleWithRestIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "tuple_with_rest"; + /** + * The expected property. + */ + readonly expected: "Array"; +} +//#endregion +//#region src/schemas/tupleWithRest/tupleWithRest.d.ts +/** +* Tuple with rest schema interface. +*/ +interface TupleWithRestSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema<[...InferTupleInput, ...InferInput[]], [...InferTupleOutput, ...InferOutput[]], TupleWithRestIssue | InferTupleIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "tuple_with_rest"; + /** + * The schema reference. + */ + readonly reference: typeof tupleWithRest; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The rest schema. + */ + readonly rest: TRest$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a tuple with rest schema. +* +* @param items The items schema. +* @param rest The rest schema. +* +* @returns A tuple with rest schema. +*/ +declare function tupleWithRest>>(items: TItems$1, rest: TRest$1): TupleWithRestSchema; +/** +* Creates a tuple with rest schema. +* +* @param items The items schema. +* @param rest The rest schema. +* @param message The error message. +* +* @returns A tuple with rest schema. +*/ +declare function tupleWithRest>, const TMessage extends ErrorMessage | undefined>(items: TItems$1, rest: TRest$1, message: TMessage): TupleWithRestSchema; +//#endregion +//#region src/schemas/tupleWithRest/tupleWithRestAsync.d.ts +/** +* Tuple with rest schema async interface. +*/ +interface TupleWithRestSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync<[...InferTupleInput, ...InferInput[]], [...InferTupleOutput, ...InferOutput[]], TupleWithRestIssue | InferTupleIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "tuple_with_rest"; + /** + * The schema reference. + */ + readonly reference: typeof tupleWithRest | typeof tupleWithRestAsync; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The rest schema. + */ + readonly rest: TRest$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a tuple with rest schema. +* +* @param items The items schema. +* @param rest The rest schema. +* +* @returns A tuple with rest schema. +*/ +declare function tupleWithRestAsync> | BaseSchemaAsync>>(items: TItems$1, rest: TRest$1): TupleWithRestSchemaAsync; +/** +* Creates a tuple with rest schema. +* +* @param items The items schema. +* @param rest The rest schema. +* @param message The error message. +* +* @returns A tuple with rest schema. +*/ +declare function tupleWithRestAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(items: TItems$1, rest: TRest$1, message: TMessage): TupleWithRestSchemaAsync; +//#endregion +//#region src/schemas/undefined/undefined.d.ts +/** +* Undefined issue interface. +*/ +interface UndefinedIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "undefined"; + /** + * The expected property. + */ + readonly expected: "undefined"; +} +/** +* Undefined schema interface. +*/ +interface UndefinedSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "undefined"; + /** + * The schema reference. + */ + readonly reference: typeof undefined_; + /** + * The expected property. + */ + readonly expects: "undefined"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an undefined schema. +* +* @returns An undefined schema. +*/ +declare function undefined_(): UndefinedSchema; +/** +* Creates an undefined schema. +* +* @param message The error message. +* +* @returns An undefined schema. +*/ +declare function undefined_ | undefined>(message: TMessage): UndefinedSchema; +//#endregion +//#region src/schemas/undefinedable/types.d.ts +/** +* Infer undefinedable output type. +*/ +type InferUndefinedableOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | undefined : InferOutput | Extract, undefined>; +//#endregion +//#region src/schemas/undefinedable/undefinedable.d.ts +/** +* Undefinedable schema interface. +*/ +interface UndefinedableSchema>, TDefault extends Default> extends BaseSchema | undefined, InferUndefinedableOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "undefinedable"; + /** + * The schema reference. + */ + readonly reference: typeof undefinedable; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | undefined)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates an undefinedable schema. +* +* @param wrapped The wrapped schema. +* +* @returns An undefinedable schema. +*/ +declare function undefinedable>>(wrapped: TWrapped$1): UndefinedableSchema; +/** +* Creates an undefinedable schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns An undefinedable schema. +*/ +declare function undefinedable>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): UndefinedableSchema; +//#endregion +//#region src/schemas/undefinedable/undefinedableAsync.d.ts +/** +* Undefinedable schema async interface. +*/ +interface UndefinedableSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync | undefined, InferUndefinedableOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "undefinedable"; + /** + * The schema reference. + */ + readonly reference: typeof undefinedable | typeof undefinedableAsync; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | undefined)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates an undefinedable schema. +* +* @param wrapped The wrapped schema. +* +* @returns An undefinedable schema. +*/ +declare function undefinedableAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): UndefinedableSchemaAsync; +/** +* Creates an undefinedable schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns An undefinedable schema. +*/ +declare function undefinedableAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): UndefinedableSchemaAsync; +//#endregion +//#region src/schemas/unknown/unknown.d.ts +/** +* Unknown schema interface. +*/ +interface UnknownSchema extends BaseSchema { + /** + * The schema type. + */ + readonly type: "unknown"; + /** + * The schema reference. + */ + readonly reference: typeof unknown; + /** + * The expected property. + */ + readonly expects: "unknown"; +} +/** +* Creates a unknown schema. +* +* @returns A unknown schema. +*/ +declare function unknown(): UnknownSchema; +//#endregion +//#region src/schemas/variant/variant.d.ts +/** +* Variant schema interface. +*/ +interface VariantSchema, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferOutput, VariantIssue | InferVariantIssue> { + /** + * The schema type. + */ + readonly type: "variant"; + /** + * The schema reference. + */ + readonly reference: typeof variant; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The discriminator key. + */ + readonly key: TKey$1; + /** + * The variant options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a variant schema. +* +* @param key The discriminator key. +* @param options The variant options. +* +* @returns A variant schema. +*/ +declare function variant>(key: TKey$1, options: TOptions$1): VariantSchema; +/** +* Creates a variant schema. +* +* @param key The discriminator key. +* @param options The variant options. +* @param message The error message. +* +* @returns An variant schema. +*/ +declare function variant, const TMessage extends ErrorMessage | undefined>(key: TKey$1, options: TOptions$1, message: TMessage): VariantSchema; +//#endregion +//#region src/schemas/variant/variantAsync.d.ts +/** +* Variant schema async interface. +*/ +interface VariantSchemaAsync, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferOutput, VariantIssue | InferVariantIssue> { + /** + * The schema type. + */ + readonly type: "variant"; + /** + * The schema reference. + */ + readonly reference: typeof variant | typeof variantAsync; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The discriminator key. + */ + readonly key: TKey$1; + /** + * The variant options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a variant schema. +* +* @param key The discriminator key. +* @param options The variant options. +* +* @returns A variant schema. +*/ +declare function variantAsync>(key: TKey$1, options: TOptions$1): VariantSchemaAsync; +/** +* Creates a variant schema. +* +* @param key The discriminator key. +* @param options The variant options. +* @param message The error message. +* +* @returns An variant schema. +*/ +declare function variantAsync, const TMessage extends ErrorMessage | undefined>(key: TKey$1, options: TOptions$1, message: TMessage): VariantSchemaAsync; +//#endregion +//#region src/schemas/variant/types.d.ts +/** +* Variant issue interface. +*/ +interface VariantIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "variant"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Variant option schema interface. +*/ +interface VariantOptionSchema extends BaseSchema> { + readonly type: "variant"; + readonly reference: typeof variant; + readonly key: string; + readonly options: VariantOptions; + readonly message: ErrorMessage | undefined; +} +/** +* Variant option schema async interface. +*/ +interface VariantOptionSchemaAsync extends BaseSchemaAsync> { + readonly type: "variant"; + readonly reference: typeof variant | typeof variantAsync; + readonly key: string; + readonly options: VariantOptionsAsync; + readonly message: ErrorMessage | undefined; +} +/** +* Variant object entries type. +*/ +type VariantObjectEntries = Record> | OptionalEntrySchema> & ObjectEntries; +/** +* Variant object entries async type. +*/ +type VariantObjectEntriesAsync = Record> | BaseSchemaAsync> | OptionalEntrySchema | OptionalEntrySchemaAsync> & ObjectEntriesAsync; +/** +* Variant option type. +*/ +type VariantOption = LooseObjectSchema, ErrorMessage | undefined> | ObjectSchema, ErrorMessage | undefined> | ObjectWithRestSchema, BaseSchema>, ErrorMessage | undefined> | StrictObjectSchema, ErrorMessage | undefined> | VariantOptionSchema; +/** +* Variant option async type. +*/ +type VariantOptionAsync = LooseObjectSchemaAsync, ErrorMessage | undefined> | ObjectSchemaAsync, ErrorMessage | undefined> | ObjectWithRestSchemaAsync, BaseSchema> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchemaAsync, ErrorMessage | undefined> | VariantOptionSchemaAsync; +/** +* Variant options type. +*/ +type VariantOptions = MaybeReadonly[]>; +/** +* Variant options async type. +*/ +type VariantOptionsAsync = MaybeReadonly<(VariantOption | VariantOptionAsync)[]>; +/** +* Infer variant issue type. +*/ +type InferVariantIssue | VariantOptionsAsync> = Exclude, { + type: "loose_object" | "object" | "object_with_rest"; +}>; +//#endregion +//#region src/schemas/void/void.d.ts +/** +* Void issue interface. +*/ +interface VoidIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "void"; + /** + * The expected property. + */ + readonly expected: "void"; +} +/** +* Void schema interface. +*/ +interface VoidSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "void"; + /** + * The schema reference. + */ + readonly reference: typeof void_; + /** + * The expected property. + */ + readonly expects: "void"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a void schema. +* +* @returns A void schema. +*/ +declare function void_(): VoidSchema; +/** +* Creates a void schema. +* +* @param message The error message. +* +* @returns A void schema. +*/ +declare function void_ | undefined>(message: TMessage): VoidSchema; +//#endregion +//#region src/actions/args/args.d.ts +/** +* Schema type. +*/ +type Schema$3 = LooseTupleSchema | undefined> | StrictTupleSchema | undefined> | TupleSchema | undefined> | TupleWithRestSchema>, ErrorMessage | undefined>; +/** +* Args action type. +*/ +interface ArgsAction unknown, TSchema extends Schema$3> extends BaseTransformation) => ReturnType, never> { + /** + * The action type. + */ + readonly type: "args"; + /** + * The action reference. + */ + readonly reference: typeof args; + /** + * The arguments schema. + */ + readonly schema: TSchema; +} +/** +* Creates a function arguments transformation action. +* +* @param schema The arguments schema. +* +* @returns An args action. +*/ +declare function args unknown, TSchema extends Schema$3>(schema: TSchema): ArgsAction; +//#endregion +//#region src/actions/args/argsAsync.d.ts +/** +* Schema type. +*/ +type Schema$2 = LooseTupleSchema | undefined> | LooseTupleSchemaAsync | undefined> | StrictTupleSchema | undefined> | StrictTupleSchemaAsync | undefined> | TupleSchema | undefined> | TupleSchemaAsync | undefined> | TupleWithRestSchema>, ErrorMessage | undefined> | TupleWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined>; +/** +* Args action async type. +*/ +interface ArgsActionAsync unknown, TSchema extends Schema$2> extends BaseTransformation) => Promise>>, never> { + /** + * The action type. + */ + readonly type: "args"; + /** + * The action reference. + */ + readonly reference: typeof argsAsync; + /** + * The arguments schema. + */ + readonly schema: TSchema; +} +/** +* Creates a function arguments transformation action. +* +* @param schema The arguments schema. +* +* @returns An args action. +*/ +declare function argsAsync unknown, TSchema extends Schema$2>(schema: TSchema): ArgsActionAsync; +//#endregion +//#region src/actions/await/awaitAsync.d.ts +/** +* Await action async interface. +*/ +interface AwaitActionAsync> extends BaseTransformationAsync, never> { + /** + * The action type. + */ + readonly type: "await"; + /** + * The action reference. + */ + readonly reference: typeof awaitAsync; +} +/** +* Creates an await transformation action. +* +* @returns An await action. +*/ +declare function awaitAsync>(): AwaitActionAsync; +//#endregion +//#region src/actions/base64/base64.d.ts +/** +* Base64 issue interface. +*/ +interface Base64Issue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "base64"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The Base64 regex. + */ + readonly requirement: RegExp; +} +/** +* Base64 action interface. +*/ +interface Base64Action> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "base64"; + /** + * The action reference. + */ + readonly reference: typeof base64; + /** + * The expected property. + */ + readonly expects: null; + /** + * The Base64 regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [Base64](https://en.wikipedia.org/wiki/Base64) validation action. +* +* @returns A Base64 action. +*/ +declare function base64(): Base64Action; +/** +* Creates a [Base64](https://en.wikipedia.org/wiki/Base64) validation action. +* +* @param message The error message. +* +* @returns A Base64 action. +*/ +declare function base64> | undefined>(message: TMessage): Base64Action; +//#endregion +//#region src/actions/bic/bic.d.ts +/** +* BIC issue interface. +*/ +interface BicIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "bic"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The BIC regex. + */ + readonly requirement: RegExp; +} +/** +* BIC action interface. +*/ +interface BicAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "bic"; + /** + * The action reference. + */ + readonly reference: typeof bic; + /** + * The expected property. + */ + readonly expects: null; + /** + * The BIC regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [BIC](https://en.wikipedia.org/wiki/ISO_9362) validation action. +* +* @returns A BIC action. +*/ +declare function bic(): BicAction; +/** +* Creates a [BIC](https://en.wikipedia.org/wiki/ISO_9362) validation action. +* +* @param message The error message. +* +* @returns A BIC action. +*/ +declare function bic> | undefined>(message: TMessage): BicAction; +//#endregion +//#region src/actions/brand/brand.d.ts +/** +* Brand symbol. +*/ +declare const BrandSymbol: unique symbol; +/** +* Brand name type. +*/ +type BrandName = string | number | symbol; +/** +* Brand interface. +*/ +interface Brand { + [BrandSymbol]: { [TValue in TName]: TValue }; +} +/** +* Brand action interface. +*/ +interface BrandAction extends BaseTransformation, never> { + /** + * The action type. + */ + readonly type: "brand"; + /** + * The action reference. + */ + readonly reference: typeof brand; + /** + * The brand name. + */ + readonly name: TName; +} +/** +* Creates a brand transformation action. +* +* @param name The brand name. +* +* @returns A brand action. +*/ +declare function brand(name: TName): BrandAction; +//#endregion +//#region src/actions/bytes/bytes.d.ts +/** +* Bytes issue interface. +*/ +interface BytesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "bytes"; + /** + * The expected property. + */ + readonly expected: `${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The required bytes. + */ + readonly requirement: TRequirement; +} +/** +* Bytes action interface. +*/ +interface BytesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "bytes"; + /** + * The action reference. + */ + readonly reference: typeof bytes; + /** + * The expected property. + */ + readonly expects: `${TRequirement}`; + /** + * The required bytes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The required bytes. +* +* @returns A bytes action. +*/ +declare function bytes(requirement: TRequirement): BytesAction; +/** +* Creates a [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The required bytes. +* @param message The error message. +* +* @returns A bytes action. +*/ +declare function bytes> | undefined>(requirement: TRequirement, message: TMessage): BytesAction; +//#endregion +//#region src/actions/check/types.d.ts +/** +* Check issue interface. +*/ +interface CheckIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "check"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The validation function. + */ + readonly requirement: (input: TInput$1) => MaybePromise; +} +//#endregion +//#region src/actions/check/check.d.ts +/** +* Check action interface. +*/ +interface CheckAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "check"; + /** + * The action reference. + */ + readonly reference: typeof check; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: TInput$1) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a check validation action. +* +* @param requirement The validation function. +* +* @returns A check action. +*/ +declare function check(requirement: (input: TInput$1) => boolean): CheckAction; +/** +* Creates a check validation action. +* +* @param requirement The validation function. +* @param message The error message. +* +* @returns A check action. +*/ +declare function check> | undefined>(requirement: (input: TInput$1) => boolean, message: TMessage): CheckAction; +//#endregion +//#region src/actions/check/checkAsync.d.ts +/** +* Check action async interface. +*/ +interface CheckActionAsync> | undefined> extends BaseValidationAsync> { + /** + * The action type. + */ + readonly type: "check"; + /** + * The action reference. + */ + readonly reference: typeof checkAsync; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: TInput$1) => MaybePromise; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a check validation action. +* +* @param requirement The validation function. +* +* @returns A check action. +*/ +declare function checkAsync(requirement: (input: TInput$1) => MaybePromise): CheckActionAsync; +/** +* Creates a check validation action. +* +* @param requirement The validation function. +* @param message The error message. +* +* @returns A check action. +*/ +declare function checkAsync> | undefined>(requirement: (input: TInput$1) => MaybePromise, message: TMessage): CheckActionAsync; +//#endregion +//#region src/actions/types.d.ts +/** +* Array input type. +*/ +type ArrayInput = MaybeReadonly; +/** +* Array requirement type. +*/ +type ArrayRequirement = (item: TInput$1[number], index: number, array: TInput$1) => boolean; +/** +* Array requirement async type. +*/ +type ArrayRequirementAsync = (item: TInput$1[number], index: number, array: TInput$1) => MaybePromise; +/** +* Content input type. +*/ +type ContentInput = string | MaybeReadonly; +/** +* Content requirement type. +*/ +type ContentRequirement = TInput$1 extends readonly unknown[] ? TInput$1[number] : TInput$1; +/** +* Entries input type. +*/ +type EntriesInput = Record; +/** +* Length input type. +*/ +type LengthInput = string | ArrayLike; +/** +* Size input type. +*/ +type SizeInput = Blob | Map | Set; +/** +* Value input type. +*/ +type ValueInput = string | number | bigint | boolean | Date; +//#endregion +//#region src/actions/checkItems/types.d.ts +/** +* Check items issue interface. +*/ +interface CheckItemsIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "check_items"; + /** + * The expected input. + */ + readonly expected: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirementAsync; +} +//#endregion +//#region src/actions/checkItems/checkItems.d.ts +/** +* Check items action interface. +*/ +interface CheckItemsAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "check_items"; + /** + * The action reference. + */ + readonly reference: typeof checkItems; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an check items validation action. +* +* @param requirement The validation function. +* +* @returns An check items action. +*/ +declare function checkItems(requirement: ArrayRequirement): CheckItemsAction; +/** +* Creates an check items validation action. +* +* @param requirement The validation function. +* @param message The error message. +* +* @returns An check items action. +*/ +declare function checkItems> | undefined>(requirement: ArrayRequirement, message: TMessage): CheckItemsAction; +//#endregion +//#region src/actions/checkItems/checkItemsAsync.d.ts +/** +* Check items action async interface. +*/ +interface CheckItemsActionAsync> | undefined> extends BaseValidationAsync> { + /** + * The action type. + */ + readonly type: "check_items"; + /** + * The action reference. + */ + readonly reference: typeof checkItemsAsync; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirementAsync; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a check items validation action. +* +* @param requirement The validation function. +* +* @returns A check items action. +*/ +declare function checkItemsAsync(requirement: ArrayRequirementAsync): CheckItemsActionAsync; +/** +* Creates a check items validation action. +* +* @param requirement The validation function. +* @param message The error message. +* +* @returns A check items action. +*/ +declare function checkItemsAsync> | undefined>(requirement: ArrayRequirementAsync, message: TMessage): CheckItemsActionAsync; +//#endregion +//#region src/actions/creditCard/creditCard.d.ts +/** +* Credit card issue interface. +*/ +interface CreditCardIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "credit_card"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; +} +/** +* Credit card action interface. +*/ +interface CreditCardAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "credit_card"; + /** + * The action reference. + */ + readonly reference: typeof creditCard; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [credit card](https://en.wikipedia.org/wiki/Payment_card_number) validation action. +* +* @returns A Credit card action. +*/ +declare function creditCard(): CreditCardAction; +/** +* Creates a [credit card](https://en.wikipedia.org/wiki/Payment_card_number) validation action. +* +* @param message The error message. +* +* @returns A credit card action. +*/ +declare function creditCard> | undefined>(message: TMessage): CreditCardAction; +//#endregion +//#region src/actions/cuid2/cuid2.d.ts +/** +* Cuid2 issue interface. +*/ +interface Cuid2Issue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "cuid2"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The Cuid2 regex. + */ + readonly requirement: RegExp; +} +/** +* Cuid2 action interface. +*/ +interface Cuid2Action> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "cuid2"; + /** + * The action reference. + */ + readonly reference: typeof cuid2; + /** + * The expected property. + */ + readonly expects: null; + /** + * The Cuid2 regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [Cuid2](https://github.com/paralleldrive/cuid2) validation action. +* +* @returns A Cuid2 action. +*/ +declare function cuid2(): Cuid2Action; +/** +* Creates a [Cuid2](https://github.com/paralleldrive/cuid2) validation action. +* +* @param message The error message. +* +* @returns A Cuid2 action. +*/ +declare function cuid2> | undefined>(message: TMessage): Cuid2Action; +//#endregion +//#region src/actions/decimal/decimal.d.ts +/** +* Decimal issue interface. +*/ +interface DecimalIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "decimal"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The decimal regex. + */ + readonly requirement: RegExp; +} +/** +* Decimal action interface. +*/ +interface DecimalAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "decimal"; + /** + * The action reference. + */ + readonly reference: typeof decimal; + /** + * The expected property. + */ + readonly expects: null; + /** + * The decimal regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [decimal](https://en.wikipedia.org/wiki/Decimal) validation action. +* +* The difference between `decimal` and `digits` is that `decimal` accepts +* floating point numbers and negative numbers, while `digits` accepts only the +* digits 0-9. +* +* @returns An decimal action. +*/ +declare function decimal(): DecimalAction; +/** +* Creates a [decimal](https://en.wikipedia.org/wiki/Decimal) validation action. +* +* The difference between `decimal` and `digits` is that `decimal` accepts +* floating point numbers and negative numbers, while `digits` accepts only the +* digits 0-9. +* +* @param message The error message. +* +* @returns An decimal action. +*/ +declare function decimal> | undefined>(message: TMessage): DecimalAction; +//#endregion +//#region src/actions/description/description.d.ts +/** +* Description action interface. +*/ +interface DescriptionAction extends BaseMetadata { + /** + * The action type. + */ + readonly type: "description"; + /** + * The action reference. + */ + readonly reference: typeof description; + /** + * The description text. + */ + readonly description: TDescription; +} +/** +* Creates a description metadata action. +* +* @param description_ The description text. +* +* @returns A description action. +*/ +declare function description(description_: TDescription): DescriptionAction; +//#endregion +//#region src/actions/digits/digits.d.ts +/** +* Digits issue interface. +*/ +interface DigitsIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "digits"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The digits regex. + */ + readonly requirement: RegExp; +} +/** +* Digits action interface. +*/ +interface DigitsAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "digits"; + /** + * The action reference. + */ + readonly reference: typeof digits; + /** + * The expected property. + */ + readonly expects: null; + /** + * The digits regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [digits](https://en.wikipedia.org/wiki/Numerical_digit) validation action. +* +* The difference between `digits` and `decimal` is that `digits` accepts only +* the digits 0-9, while `decimal` accepts floating point numbers and negative +* numbers. +* +* @returns An digits action. +*/ +declare function digits(): DigitsAction; +/** +* Creates a [digits](https://en.wikipedia.org/wiki/Numerical_digit) validation action. +* +* The difference between `digits` and `decimal` is that `digits` accepts only +* the digits 0-9, while `decimal` accepts floating point numbers and negative +* numbers. +* +* @param message The error message. +* +* @returns An digits action. +*/ +declare function digits> | undefined>(message: TMessage): DigitsAction; +//#endregion +//#region src/actions/domain/domain.d.ts +/** +* Domain issue interface. +* +* @beta +*/ +interface DomainIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "domain"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The domain regex. + */ + readonly requirement: RegExp; +} +/** +* Domain action interface. +* +* @beta +*/ +interface DomainAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "domain"; + /** + * The action reference. + */ + readonly reference: typeof domain; + /** + * The expected property. + */ + readonly expects: null; + /** + * The domain regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [domain name](https://en.wikipedia.org/wiki/Domain_name) validation +* action. +* +* Hint: ASCII-only validation. Internationalized domain names (IDNs) are not +* supported, including Punycode-encoded labels. +* +* @returns A domain action. +* +* @beta +*/ +declare function domain(): DomainAction; +/** +* Creates a [domain name](https://en.wikipedia.org/wiki/Domain_name) validation +* action. +* +* Hint: ASCII-only validation. Internationalized domain names (IDNs) are not +* supported, including Punycode-encoded labels. +* +* @param message The error message. +* +* @returns A domain action. +* +* @beta +*/ +declare function domain> | undefined>(message: TMessage): DomainAction; +//#endregion +//#region src/actions/email/email.d.ts +/** +* Email issue interface. +*/ +interface EmailIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "email"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The email regex. + */ + readonly requirement: RegExp; +} +/** +* Email action interface. +*/ +interface EmailAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "email"; + /** + * The action reference. + */ + readonly reference: typeof email; + /** + * The expected property. + */ + readonly expects: null; + /** + * The email regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [email](https://en.wikipedia.org/wiki/Email_address) validation +* action. +* +* Hint: This validation action intentionally only validates common email +* addresses. If you are interested in an action that covers a broader +* subset of RFC 5322 addresses, please use the `rfcEmail` action instead. +* +* @returns An email action. +*/ +declare function email(): EmailAction; +/** +* Creates an [email](https://en.wikipedia.org/wiki/Email_address) validation +* action. +* +* Hint: This validation action intentionally only validates common email +* addresses. If you are interested in an action that covers a broader +* subset of RFC 5322 addresses, please use the `rfcEmail` action instead. +* +* @param message The error message. +* +* @returns An email action. +*/ +declare function email> | undefined>(message: TMessage): EmailAction; +//#endregion +//#region src/actions/emoji/emoji.d.ts +/** +* Emoji issue interface. +*/ +interface EmojiIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "emoji"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The emoji regex. + */ + readonly requirement: RegExp; +} +/** +* Emoji action interface. +*/ +interface EmojiAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "emoji"; + /** + * The action reference. + */ + readonly reference: typeof emoji; + /** + * The expected property. + */ + readonly expects: null; + /** + * The emoji regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [emoji](https://en.wikipedia.org/wiki/Emoji) validation action. +* +* @returns An emoji action. +*/ +declare function emoji(): EmojiAction; +/** +* Creates an [emoji](https://en.wikipedia.org/wiki/Emoji) validation action. +* +* @param message The error message. +* +* @returns An emoji action. +*/ +declare function emoji> | undefined>(message: TMessage): EmojiAction; +//#endregion +//#region src/actions/empty/empty.d.ts +/** +* Empty issue interface. +*/ +interface EmptyIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "empty"; + /** + * The expected input. + */ + readonly expected: "0"; + /** + * The received input. + */ + readonly received: `${number}`; +} +/** +* Empty action interface. +*/ +interface EmptyAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "empty"; + /** + * The action reference. + */ + readonly reference: typeof empty; + /** + * The expected property. + */ + readonly expects: "0"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an empty validation action. +* +* @returns An empty action. +*/ +declare function empty(): EmptyAction; +/** +* Creates an empty validation action. +* +* @param message The error message. +* +* @returns An empty action. +*/ +declare function empty> | undefined>(message: TMessage): EmptyAction; +//#endregion +//#region src/actions/endsWith/endsWith.d.ts +/** +* Ends with issue interface. +*/ +interface EndsWithIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "ends_with"; + /** + * The expected property. + */ + readonly expected: `"${TRequirement}"`; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The end string. + */ + readonly requirement: TRequirement; +} +/** +* Ends with action interface. +*/ +interface EndsWithAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "ends_with"; + /** + * The action reference. + */ + readonly reference: typeof endsWith; + /** + * The expected property. + */ + readonly expects: `"${TRequirement}"`; + /** + * The end string. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an ends with validation action. +* +* @param requirement The end string. +* +* @returns An ends with action. +*/ +declare function endsWith(requirement: TRequirement): EndsWithAction; +/** +* Creates an ends with validation action. +* +* @param requirement The end string. +* @param message The error message. +* +* @returns An ends with action. +*/ +declare function endsWith> | undefined>(requirement: TRequirement, message: TMessage): EndsWithAction; +//#endregion +//#region src/actions/entries/entries.d.ts +/** +* Entries issue interface. +* +* @beta +*/ +interface EntriesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "entries"; + /** + * The expected property. + */ + readonly expected: `${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The required entries. + */ + readonly requirement: TRequirement; +} +/** +* Entries action interface. +* +* @beta +*/ +interface EntriesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "entries"; + /** + * The action reference. + */ + readonly reference: typeof entries; + /** + * The expected property. + */ + readonly expects: `${TRequirement}`; + /** + * The required entries. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an entries validation action. +* +* @param requirement The required entries. +* +* @returns An entries action. +* +* @beta +*/ +declare function entries(requirement: TRequirement): EntriesAction; +/** +* Creates an entries validation action. +* +* @param requirement The required entries. +* @param message The error message. +* +* @returns An entries action. +* +* @beta +*/ +declare function entries> | undefined>(requirement: TRequirement, message: TMessage): EntriesAction; +//#endregion +//#region src/actions/everyItem/everyItem.d.ts +/** +* Every item issue interface. +*/ +interface EveryItemIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "every_item"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirement; +} +/** +* Every item action interface. +*/ +interface EveryItemAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "every_item"; + /** + * The action reference. + */ + readonly reference: typeof everyItem; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an every item validation action. +* +* @param requirement The validation function. +* +* @returns An every item action. +*/ +declare function everyItem(requirement: ArrayRequirement): EveryItemAction; +/** +* Creates an every item validation action. +* +* @param requirement The validation function. +* @param message The error message. +* +* @returns An every item action. +*/ +declare function everyItem> | undefined>(requirement: ArrayRequirement, message: TMessage): EveryItemAction; +//#endregion +//#region src/actions/examples/examples.d.ts +/** +* Examples action interface. +*/ +interface ExamplesAction extends BaseMetadata { + /** + * The action type. + */ + readonly type: "examples"; + /** + * The action reference. + */ + readonly reference: typeof examples; + /** + * The examples. + */ + readonly examples: TExamples; +} +/** +* Creates an examples metadata action. +* +* @param examples_ The examples. +* +* @returns An examples action. +* +* @beta +*/ +declare function examples(examples_: TExamples): ExamplesAction; +//#endregion +//#region src/actions/excludes/excludes.d.ts +/** +* Excludes issue interface. +*/ +interface ExcludesIssue> extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "excludes"; + /** + * The expected property. + */ + readonly expected: string; + /** + * The content to be excluded. + */ + readonly requirement: TRequirement; +} +/** +* Excludes action interface. +*/ +interface ExcludesAction, TMessage extends ErrorMessage> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "excludes"; + /** + * The action reference. + */ + readonly reference: typeof excludes; + /** + * The expected property. + */ + readonly expects: string; + /** + * The content to be excluded. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an excludes validation action. +* +* @param requirement The content to be excluded. +* +* @returns An excludes action. +*/ +declare function excludes>(requirement: TRequirement): ExcludesAction; +/** +* Creates an excludes validation action. +* +* @param requirement The content to be excluded. +* @param message The error message. +* +* @returns An excludes action. +*/ +declare function excludes, const TMessage extends ErrorMessage> | undefined>(requirement: TRequirement, message: TMessage): ExcludesAction; +//#endregion +//#region src/actions/filterItems/filterItems.d.ts +/** +* Filter items action interface. +*/ +interface FilterItemsAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "filter_items"; + /** + * The action reference. + */ + readonly reference: typeof filterItems; + /** + * The filter items operation. + */ + readonly operation: ArrayRequirement; +} +/** +* Creates a filter items transformation action. +* +* @param operation The filter items operation. +* +* @returns A filter items action. +*/ +declare function filterItems(operation: ArrayRequirement): FilterItemsAction; +//#endregion +//#region src/actions/findItem/findItem.d.ts +/** +* Array requirement type. +*/ +type ArrayRequirement$1 = ((item: TInput$1[number], index: number, array: TInput$1) => item is TOuput) | ((item: TInput$1[number], index: number, array: TInput$1) => boolean); +/** +* Find item action interface. +*/ +interface FindItemAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "find_item"; + /** + * The action reference. + */ + readonly reference: typeof findItem; + /** + * The find item operation. + */ + readonly operation: ArrayRequirement$1; +} +/** +* Creates a find item transformation action. +* +* @param operation The find item operation. +* +* @returns A find item action. +*/ +declare function findItem(operation: ArrayRequirement$1): FindItemAction; +//#endregion +//#region src/actions/finite/finite.d.ts +/** +* Finite issue interface. +*/ +interface FiniteIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "finite"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The validation function. + */ + readonly requirement: (input: number) => boolean; +} +/** +* Finite action interface. +*/ +interface FiniteAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "finite"; + /** + * The action reference. + */ + readonly reference: typeof finite; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: number) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [finite](https://en.wikipedia.org/wiki/Finite) validation action. +* +* @returns A finite action. +*/ +declare function finite(): FiniteAction; +/** +* Creates a [finite](https://en.wikipedia.org/wiki/Finite) validation action. +* +* @param message The error message. +* +* @returns A finite action. +*/ +declare function finite> | undefined>(message: TMessage): FiniteAction; +//#endregion +//#region src/actions/flavor/flavor.d.ts +/** +* Flavor symbol. +* +* @beta +*/ +declare const FlavorSymbol: unique symbol; +/** +* Flavor name type. +* +* @beta +*/ +type FlavorName = string | number | symbol; +/** +* Flavor interface. +* +* @beta +*/ +interface Flavor { + [FlavorSymbol]?: { [TValue in TName]: TValue }; +} +/** +* Flavor action interface. +* +* @beta +*/ +interface FlavorAction extends BaseTransformation, never> { + /** + * The action type. + */ + readonly type: "flavor"; + /** + * The action reference. + */ + readonly reference: typeof flavor; + /** + * The flavor name. + */ + readonly name: TName; +} +/** +* Creates a flavor transformation action. +* +* @param name The flavor name. +* +* @returns A flavor action. +* +* @beta +*/ +declare function flavor(name: TName): FlavorAction; +//#endregion +//#region src/actions/graphemes/graphemes.d.ts +/** +* Graphemes issue interface. +*/ +interface GraphemesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "graphemes"; + /** + * The expected property. + */ + readonly expected: `${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The required graphemes. + */ + readonly requirement: TRequirement; +} +/** +* Graphemes action interface. +*/ +interface GraphemesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "graphemes"; + /** + * The action reference. + */ + readonly reference: typeof graphemes; + /** + * The expected property. + */ + readonly expects: `${TRequirement}`; + /** + * The required graphemes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a graphemes validation action. +* +* @param requirement The required graphemes. +* +* @returns A graphemes action. +*/ +declare function graphemes(requirement: TRequirement): GraphemesAction; +/** +* Creates a graphemes validation action. +* +* @param requirement The required graphemes. +* @param message The error message. +* +* @returns A graphemes action. +*/ +declare function graphemes> | undefined>(requirement: TRequirement, message: TMessage): GraphemesAction; +//#endregion +//#region src/actions/gtValue/gtValue.d.ts +/** +* Greater than value issue type. +*/ +interface GtValueIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "gt_value"; + /** + * The expected property. + */ + readonly expected: `>${string}`; + /** + * The greater than value. + */ + readonly requirement: TRequirement; +} +/** +* Greater than value action type. +*/ +interface GtValueAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "gt_value"; + /** + * The action reference. + */ + readonly reference: typeof gtValue; + /** + * The expected property. + */ + readonly expects: `>${string}`; + /** + * The greater than value. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a greater than value validation action. +* +* @param requirement The greater than value. +* +* @returns A greater than value action. +*/ +declare function gtValue(requirement: TRequirement): GtValueAction; +/** +* Creates a greater than value validation action. +* +* @param requirement The greater than value. +* @param message The error message. +* +* @returns A greater than value action. +*/ +declare function gtValue> | undefined>(requirement: TRequirement, message: TMessage): GtValueAction; +//#endregion +//#region src/actions/guard/guard.d.ts +/** +* Guard function type. +* +* @beta +*/ +type GuardFunction = (input: TInput$1) => input is any; +/** +* Infer guard output type. +* +* @beta +*/ +type InferGuardOutput> = TGuard extends ((input: any) => input is infer TOutput) ? TOutput : unknown; +/** +* Guard issue interface. +* +* @beta +*/ +interface GuardIssue> extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "guard"; + /** + * The guard function. + */ + readonly requirement: TGuard; +} +/** +* Guard action interface. +* +* @beta +*/ +interface GuardAction, TMessage extends ErrorMessage> | undefined> extends BaseTransformation, GuardIssue> { + /** + * The action type. + */ + readonly type: "guard"; + /** + * The action reference. + */ + readonly reference: typeof guard; + /** + * The guard function. + */ + readonly requirement: TGuard; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a guard transformation action. +* +* @param requirement The guard function. +* +* @returns A guard action. +* +* @beta +*/ +declare function guard>(requirement: TGuard): GuardAction; +/** +* Creates a guard transformation action. +* +* @param requirement The guard function. +* +* @returns A guard action. +* +* @beta +*/ +declare function guard>(requirement: TGuard): GuardAction[0], TGuard, undefined>; +/** +* Creates a guard transformation action. +* +* @param requirement The guard function. +* @param message The error message. +* +* @returns A guard action. +* +* @beta +*/ +declare function guard, const TMessage extends ErrorMessage> | undefined>(requirement: TGuard, message: TMessage): GuardAction; +/** +* Creates a guard transformation action. +* +* @param requirement The guard function. +* @param message The error message. +* +* @returns A guard action. +* +* @beta +*/ +declare function guard, const TMessage extends ErrorMessage[0], TGuard>> | undefined>(requirement: TGuard, message: TMessage): GuardAction[0], TGuard, TMessage>; +//#endregion +//#region src/actions/hash/hash.d.ts +/** +* Hash lengths object. +*/ +declare const HASH_LENGTHS: { + readonly md4: 32; + readonly md5: 32; + readonly sha1: 40; + readonly sha256: 64; + readonly sha384: 96; + readonly sha512: 128; + readonly ripemd128: 32; + readonly ripemd160: 40; + readonly tiger128: 32; + readonly tiger160: 40; + readonly tiger192: 48; + readonly crc32: 8; + readonly crc32b: 8; + readonly adler32: 8; +}; +/** +* Hash type type. +*/ +type HashType = keyof typeof HASH_LENGTHS; +/** +* Hash issue interface. +*/ +interface HashIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "hash"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The hash regex. + */ + readonly requirement: RegExp; +} +/** +* Hash action interface. +*/ +interface HashAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "hash"; + /** + * The action reference. + */ + readonly reference: typeof hash; + /** + * The expected property. + */ + readonly expects: null; + /** + * The hash regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [hash](https://en.wikipedia.org/wiki/Hash_function) validation action. +* +* @param types The hash types. +* +* @returns A hash action. +*/ +declare function hash(types: [HashType, ...HashType[]]): HashAction; +/** +* Creates a [hash](https://en.wikipedia.org/wiki/Hash_function) validation action. +* +* @param types The hash types. +* @param message The error message. +* +* @returns A hash action. +*/ +declare function hash> | undefined>(types: [HashType, ...HashType[]], message: TMessage): HashAction; +//#endregion +//#region src/actions/hexadecimal/hexadecimal.d.ts +/** +* Hexadecimal issue interface. +*/ +interface HexadecimalIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "hexadecimal"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The hexadecimal regex. + */ + readonly requirement: RegExp; +} +/** +* Hexadecimal action interface. +*/ +interface HexadecimalAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "hexadecimal"; + /** + * The action reference. + */ + readonly reference: typeof hexadecimal; + /** + * The expected property. + */ + readonly expects: null; + /** + * The hexadecimal regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) validation action. +* +* @returns A hexadecimal action. +*/ +declare function hexadecimal(): HexadecimalAction; +/** +* Creates a [hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) validation action. +* +* @param message The error message. +* +* @returns A hexadecimal action. +*/ +declare function hexadecimal> | undefined>(message: TMessage): HexadecimalAction; +//#endregion +//#region src/actions/hexColor/hexColor.d.ts +/** +* Hex color issue interface. +*/ +interface HexColorIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "hex_color"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The hex color regex. + */ + readonly requirement: RegExp; +} +/** +* Hex color action interface. +*/ +interface HexColorAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "hex_color"; + /** + * The action reference. + */ + readonly reference: typeof hexColor; + /** + * The expected property. + */ + readonly expects: null; + /** + * The hex color regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [hex color](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) validation action. +* +* @returns A hex color action. +*/ +declare function hexColor(): HexColorAction; +/** +* Creates a [hex color](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) validation action. +* +* @param message The error message. +* +* @returns A hex color action. +*/ +declare function hexColor> | undefined>(message: TMessage): HexColorAction; +//#endregion +//#region src/actions/imei/imei.d.ts +/** +* IMEI issue interface. +*/ +interface ImeiIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "imei"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; +} +/** +* IMEI action interface. +*/ +interface ImeiAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "imei"; + /** + * The action reference. + */ + readonly reference: typeof imei; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) validation action. +* +* Formats: +* - AABBBBBBCCCCCCD +* - AA-BBBBBB-CCCCCC-D +* +* @returns An IMEI action. +*/ +declare function imei(): ImeiAction; +/** +* Creates an [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) validation action. +* +* Formats: +* - AABBBBBBCCCCCCD +* - AA-BBBBBB-CCCCCC-D +* +* @param message The error message. +* +* @returns An IMEI action. +*/ +declare function imei> | undefined>(message: TMessage): ImeiAction; +//#endregion +//#region src/actions/includes/includes.d.ts +/** +* Includes issue interface. +*/ +interface IncludesIssue> extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "includes"; + /** + * The expected property. + */ + readonly expected: string; + /** + * The content to be included. + */ + readonly requirement: TRequirement; +} +/** +* Includes action interface. +*/ +interface IncludesAction, TMessage extends ErrorMessage> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "includes"; + /** + * The action reference. + */ + readonly reference: typeof includes; + /** + * The expected property. + */ + readonly expects: string; + /** + * The content to be included. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an includes validation action. +* +* @param requirement The content to be included. +* +* @returns An includes action. +*/ +declare function includes>(requirement: TRequirement): IncludesAction; +/** +* Creates an includes validation action. +* +* @param requirement The content to be included. +* @param message The error message. +* +* @returns An includes action. +*/ +declare function includes, const TMessage extends ErrorMessage> | undefined>(requirement: TRequirement, message: TMessage): IncludesAction; +//#endregion +//#region src/actions/integer/integer.d.ts +/** +* Integer issue interface. +*/ +interface IntegerIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "integer"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The validation function. + */ + readonly requirement: (input: number) => boolean; +} +/** +* Integer action interface. +*/ +interface IntegerAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "integer"; + /** + * The action reference. + */ + readonly reference: typeof integer; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: number) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [integer](https://en.wikipedia.org/wiki/Integer) validation action. +* +* @returns An integer action. +*/ +declare function integer(): IntegerAction; +/** +* Creates an [integer](https://en.wikipedia.org/wiki/Integer) validation action. +* +* @param message The error message. +* +* @returns An integer action. +*/ +declare function integer> | undefined>(message: TMessage): IntegerAction; +//#endregion +//#region src/actions/ip/ip.d.ts +/** +* IP issue interface. +*/ +interface IpIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "ip"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The IP regex. + */ + readonly requirement: RegExp; +} +/** +* IP action interface. +*/ +interface IpAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "ip"; + /** + * The action reference. + */ + readonly reference: typeof ip; + /** + * The expected property. + */ + readonly expects: null; + /** + * The IP regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [IP address](https://en.wikipedia.org/wiki/IP_address) validation action. +* +* @returns An IP action. +*/ +declare function ip(): IpAction; +/** +* Creates an [IP address](https://en.wikipedia.org/wiki/IP_address) validation action. +* +* @param message The error message. +* +* @returns An IP action. +*/ +declare function ip> | undefined>(message: TMessage): IpAction; +//#endregion +//#region src/actions/ipv4/ipv4.d.ts +/** +* IPv4 issue interface. +*/ +interface Ipv4Issue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "ipv4"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The IPv4 regex. + */ + readonly requirement: RegExp; +} +/** +* IPv4 action interface. +*/ +interface Ipv4Action> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "ipv4"; + /** + * The action reference. + */ + readonly reference: typeof ipv4; + /** + * The expected property. + */ + readonly expects: null; + /** + * The IPv4 regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [IPv4](https://en.wikipedia.org/wiki/IPv4) address validation action. +* +* @returns An IPv4 action. +*/ +declare function ipv4(): Ipv4Action; +/** +* Creates an [IPv4](https://en.wikipedia.org/wiki/IPv4) address validation action. +* +* @param message The error message. +* +* @returns An IPv4 action. +*/ +declare function ipv4> | undefined>(message: TMessage): Ipv4Action; +//#endregion +//#region src/actions/ipv6/ipv6.d.ts +/** +* IPv6 issue interface. +*/ +interface Ipv6Issue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "ipv6"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The IPv6 regex. + */ + readonly requirement: RegExp; +} +/** +* IPv6 action interface. +*/ +interface Ipv6Action> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "ipv6"; + /** + * The action reference. + */ + readonly reference: typeof ipv6; + /** + * The expected property. + */ + readonly expects: null; + /** + * The IPv6 regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [IPv6](https://en.wikipedia.org/wiki/IPv6) address validation action. +* +* @returns An IPv6 action. +*/ +declare function ipv6(): Ipv6Action; +/** +* Creates an [IPv6](https://en.wikipedia.org/wiki/IPv6) address validation action. +* +* @param message The error message. +* +* @returns An IPv6 action. +*/ +declare function ipv6> | undefined>(message: TMessage): Ipv6Action; +//#endregion +//#region src/actions/isbn/isbn.d.ts +/** +* ISBN issue interface. +*/ +interface IsbnIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "isbn"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; +} +/** +* ISBN action interface. +*/ +interface IsbnAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "isbn"; + /** + * The action reference. + */ + readonly reference: typeof isbn; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISBN](https://en.wikipedia.org/wiki/ISBN) action. +* +* @returns An ISBN action. +* +* @beta +*/ +declare function isbn(): IsbnAction; +/** +* Creates an [ISBN](https://en.wikipedia.org/wiki/ISBN) action. +* +* @param message The error message. +* +* @returns An ISBN action. +* +* @beta +*/ +declare function isbn> | undefined>(message: TMessage): IsbnAction; +//#endregion +//#region src/actions/isrc/isrc.d.ts +/** +* ISRC issue interface. +*/ +interface IsrcIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "isrc"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISRC regex. + */ + readonly requirement: RegExp; +} +/** +* ISRC action interface. +*/ +interface IsrcAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "isrc"; + /** + * The action reference. + */ + readonly reference: typeof isrc; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISRC regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) validation action. +* +* Formats: +* - CCXXXYYNNNNN +* - CC-XXX-YY-NNNNN +* +* @returns An ISRC action. +* +* @beta +*/ +declare function isrc(): IsrcAction; +/** +* Creates an [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) validation action. +* +* @param message The error message. +* +* @returns An ISRC action. +* +* @beta +*/ +declare function isrc> | undefined>(message: TMessage): IsrcAction; +//#endregion +//#region src/actions/isoDate/isoDate.d.ts +/** +* ISO date issue interface. +*/ +interface IsoDateIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_date"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO date regex. + */ + readonly requirement: RegExp; +} +/** +* ISO date action interface. +*/ +interface IsoDateAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_date"; + /** + * The action reference. + */ + readonly reference: typeof isoDate; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO date regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO date](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-mm-dd +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31" is valid although June has only +* 30 days. +* +* @returns An ISO date action. +*/ +declare function isoDate(): IsoDateAction; +/** +* Creates an [ISO date](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-mm-dd +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31" is valid although June has only +* 30 days. +* +* @param message The error message. +* +* @returns An ISO date action. +*/ +declare function isoDate> | undefined>(message: TMessage): IsoDateAction; +//#endregion +//#region src/actions/isoDateTime/isoDateTime.d.ts +/** +* ISO date time issue interface. +*/ +interface IsoDateTimeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_date_time"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO date time regex. + */ + readonly requirement: RegExp; +} +/** +* ISO date time action interface. +*/ +interface IsoDateTimeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_date_time"; + /** + * The action reference. + */ + readonly reference: typeof isoDateTime; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO date time regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO date time](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-mm-ddThh:mm +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31T00:00" is valid although June has only +* 30 days. +* +* Hint: The regex also allows a space as a separator between the date and time +* parts instead of the "T" character. +* +* @returns An ISO date time action. +*/ +declare function isoDateTime(): IsoDateTimeAction; +/** +* Creates an [ISO date time](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-mm-ddThh:mm +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31T00:00" is valid although June has only +* 30 days. +* +* Hint: The regex also allows a space as a separator between the date and time +* parts instead of the "T" character. +* +* @param message The error message. +* +* @returns An ISO date time action. +*/ +declare function isoDateTime> | undefined>(message: TMessage): IsoDateTimeAction; +//#endregion +//#region src/actions/isoDateTimeSecond/isoDateTimeSecond.d.ts +/** +* ISO date time second issue interface. +*/ +interface IsoDateTimeSecondIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_date_time_second"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO date time with seconds regex. + */ + readonly requirement: RegExp; +} +/** +* ISO date time second action interface. +*/ +interface IsoDateTimeSecondAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_date_time_second"; + /** + * The action reference. + */ + readonly reference: typeof isoDateTimeSecond; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO date time with seconds regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO date time second](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-mm-ddThh:mm:ss +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31T00:00:00" is valid although June has only +* 30 days. +* +* Hint: The regex also allows a space as a separator between the date and time +* parts instead of the "T" character. +* +* @returns An ISO date time second action. +*/ +declare function isoDateTimeSecond(): IsoDateTimeSecondAction; +/** +* Creates an [ISO date time second](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-mm-ddThh:mm:ss +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31T00:00:00" is valid although June has only +* 30 days. +* +* Hint: The regex also allows a space as a separator between the date and time +* parts instead of the "T" character. +* +* @param message The error message. +* +* @returns An ISO date time second action. +*/ +declare function isoDateTimeSecond> | undefined>(message: TMessage): IsoDateTimeSecondAction; +//#endregion +//#region src/actions/isoTime/isoTime.d.ts +/** +* ISO time issue interface. +*/ +interface IsoTimeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_time"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO time regex. + */ + readonly requirement: RegExp; +} +/** +* ISO time action interface. +*/ +interface IsoTimeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_time"; + /** + * The action reference. + */ + readonly reference: typeof isoTime; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO time regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO time](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: hh:mm +* +* @returns An ISO time action. +*/ +declare function isoTime(): IsoTimeAction; +/** +* Creates an [ISO time](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: hh:mm +* +* @param message The error message. +* +* @returns An ISO time action. +*/ +declare function isoTime> | undefined>(message: TMessage): IsoTimeAction; +//#endregion +//#region src/actions/isoTimeSecond/isoTimeSecond.d.ts +/** +* ISO time second issue interface. +*/ +interface IsoTimeSecondIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_time_second"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO time with seconds regex. + */ + readonly requirement: RegExp; +} +/** +* ISO time second action interface. +*/ +interface IsoTimeSecondAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_time_second"; + /** + * The action reference. + */ + readonly reference: typeof isoTimeSecond; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO time second regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO time second](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: hh:mm:ss +* +* @returns An ISO time second action. +*/ +declare function isoTimeSecond(): IsoTimeSecondAction; +/** +* Creates an [ISO time second](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: hh:mm:ss +* +* @param message The error message. +* +* @returns An ISO time second action. +*/ +declare function isoTimeSecond> | undefined>(message: TMessage): IsoTimeSecondAction; +//#endregion +//#region src/actions/isoTimestamp/isoTimestamp.d.ts +/** +* ISO timestamp issue interface. +*/ +interface IsoTimestampIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_timestamp"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO timestamp regex. + */ + readonly requirement: RegExp; +} +/** +* ISO timestamp action interface. +*/ +interface IsoTimestampAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_timestamp"; + /** + * The action reference. + */ + readonly reference: typeof isoTimestamp; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO timestamp regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO timestamp](https://en.wikipedia.org/wiki/ISO_8601) validation +* action. +* +* Formats: +* - yyyy-mm-ddThh:mm:ss.sssZ +* - yyyy-mm-ddThh:mm:ss.sss±hh:mm +* - yyyy-mm-ddThh:mm:ss.sss±hhmm +* +* Hint: To support timestamps with lower or higher accuracy, the millisecond +* specification can be removed or contain up to 9 digits. +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31T00:00:00.000Z" is valid although +* June has only 30 days. +* +* Hint: The regex also allows a space as a separator between the date and time +* parts instead of the "T" character. +* +* Hint: The regex also allows a space before the UTC offset (e.g., " +00:00") +* to support PostgreSQL's `timestamptz` output format. +* +* @returns An ISO timestamp action. +*/ +declare function isoTimestamp(): IsoTimestampAction; +/** +* Creates an [ISO timestamp](https://en.wikipedia.org/wiki/ISO_8601) validation +* action. +* +* Formats: +* - yyyy-mm-ddThh:mm:ss.sssZ +* - yyyy-mm-ddThh:mm:ss.sss±hh:mm +* - yyyy-mm-ddThh:mm:ss.sss±hhmm +* - yyyy-mm-ddThh:mm:ss.sss±hh +* +* Hint: To support timestamps with lower or higher accuracy, the millisecond +* specification can be removed or contain up to 9 digits. +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31T00:00:00.000Z" is valid although +* June has only 30 days. +* +* Hint: The regex also allows a space as a separator between the date and time +* parts instead of the "T" character. +* +* Hint: The regex also allows a space before the UTC offset (e.g., " +00:00") +* to support PostgreSQL's `timestamptz` output format. +* +* @param message The error message. +* +* @returns An ISO timestamp action. +*/ +declare function isoTimestamp> | undefined>(message: TMessage): IsoTimestampAction; +//#endregion +//#region src/actions/isoWeek/isoWeek.d.ts +/** +* ISO week issue interface. +*/ +interface IsoWeekIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_week"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO week regex. + */ + readonly requirement: RegExp; +} +/** +* ISO week action interface. +*/ +interface IsoWeekAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_week"; + /** + * The action reference. + */ + readonly reference: typeof isoWeek; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO week regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO week](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-Www +* +* Hint: The regex used cannot validate the maximum number of weeks based on +* the year. For example, "2021W53" is valid although 2021 has only 52 weeks. +* +* @returns An ISO week action. +*/ +declare function isoWeek(): IsoWeekAction; +/** +* Creates an [ISO week](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-Www +* +* Hint: The regex used cannot validate the maximum number of weeks based on +* the year. For example, "2021W53" is valid although 2021 has only 52 weeks. +* +* @param message The error message. +* +* @returns An ISO week action. +*/ +declare function isoWeek> | undefined>(message: TMessage): IsoWeekAction; +//#endregion +//#region src/actions/jwsCompact/jwsCompact.d.ts +/** +* JWS compact issue interface. +* +* @beta +*/ +interface JwsCompactIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "jws_compact"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The JWS compact regex. + */ + readonly requirement: RegExp; +} +/** +* JWS compact action interface. +* +* @beta +*/ +interface JwsCompactAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "jws_compact"; + /** + * The action reference. + */ + readonly reference: typeof jwsCompact; + /** + * The expected property. + */ + readonly expects: null; + /** + * The JWS compact regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [JWS compact serialization](https://datatracker.ietf.org/doc/html/rfc7515#section-3.1) +* validation action. +* +* Hint: This validation action only checks the three-part compact string shape +* with unpadded Base64URL-like segments. It does not decode the segments, +* verify the signature, or validate claims. +* +* @returns A JWS compact action. +* +* @beta +*/ +declare function jwsCompact(): JwsCompactAction; +/** +* Creates a [JWS compact serialization](https://datatracker.ietf.org/doc/html/rfc7515#section-3.1) +* validation action. +* +* Hint: This validation action only checks the three-part compact string shape +* with unpadded Base64URL-like segments. It does not decode the segments, +* verify the signature, or validate claims. +* +* @param message The error message. +* +* @returns A JWS compact action. +* +* @beta +*/ +declare function jwsCompact> | undefined>(message: TMessage): JwsCompactAction; +//#endregion +//#region src/actions/length/length.d.ts +/** +* Length issue interface. +*/ +interface LengthIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "length"; + /** + * The expected property. + */ + readonly expected: `${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The required length. + */ + readonly requirement: TRequirement; +} +/** +* Length action interface. +*/ +interface LengthAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "length"; + /** + * The action reference. + */ + readonly reference: typeof length; + /** + * The expected property. + */ + readonly expects: `${TRequirement}`; + /** + * The required length. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a length validation action. +* +* @param requirement The required length. +* +* @returns A length action. +*/ +declare function length(requirement: TRequirement): LengthAction; +/** +* Creates a length validation action. +* +* @param requirement The required length. +* @param message The error message. +* +* @returns A length action. +*/ +declare function length> | undefined>(requirement: TRequirement, message: TMessage): LengthAction; +//#endregion +//#region src/actions/ltValue/ltValue.d.ts +/** +* Less than value issue type. +*/ +interface LtValueIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "lt_value"; + /** + * The expected property. + */ + readonly expected: `<${string}`; + /** + * The less than value. + */ + readonly requirement: TRequirement; +} +/** +* Less than value action type. +*/ +interface LtValueAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "lt_value"; + /** + * The action reference. + */ + readonly reference: typeof ltValue; + /** + * The expected property. + */ + readonly expects: `<${string}`; + /** + * The less than value. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a less than value validation action. +* +* @param requirement The less than value. +* +* @returns A less than value action. +*/ +declare function ltValue(requirement: TRequirement): LtValueAction; +/** +* Creates a less than value validation action. +* +* @param requirement The less than value. +* @param message The error message. +* +* @returns A less than value action. +*/ +declare function ltValue> | undefined>(requirement: TRequirement, message: TMessage): LtValueAction; +//#endregion +//#region src/actions/mac/mac.d.ts +/** +* MAC issue interface. +*/ +interface MacIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "mac"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The MAC regex. + */ + readonly requirement: RegExp; +} +/** +* MAC action interface. +*/ +interface MacAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "mac"; + /** + * The action reference. + */ + readonly reference: typeof mac; + /** + * The expected property. + */ + readonly expects: null; + /** + * The MAC regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [MAC address](https://en.wikipedia.org/wiki/MAC_address) validation action. +* +* @returns A MAC action. +*/ +declare function mac(): MacAction; +/** +* Creates a [MAC address](https://en.wikipedia.org/wiki/MAC_address) validation action. +* +* @param message The error message. +* +* @returns A MAC action. +*/ +declare function mac> | undefined>(message: TMessage): MacAction; +//#endregion +//#region src/actions/mac48/mac48.d.ts +/** +* 48-bit MAC issue interface. +*/ +interface Mac48Issue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "mac48"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The 48-bit MAC regex. + */ + readonly requirement: RegExp; +} +/** +* 48-bit MAC action interface. +*/ +interface Mac48Action> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "mac48"; + /** + * The action reference. + */ + readonly reference: typeof mac48; + /** + * The expected property. + */ + readonly expects: null; + /** + * The 48-bit MAC regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a 48-bit [MAC address](https://en.wikipedia.org/wiki/MAC_address) validation action. +* +* @returns A 48-bit MAC action. +*/ +declare function mac48(): Mac48Action; +/** +* Creates a 48-bit [MAC address](https://en.wikipedia.org/wiki/MAC_address) validation action. +* +* @param message The error message. +* +* @returns A 48-bit MAC action. +*/ +declare function mac48> | undefined>(message: TMessage): Mac48Action; +//#endregion +//#region src/actions/mac64/mac64.d.ts +/** +* 64-bit MAC issue interface. +*/ +interface Mac64Issue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "mac64"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The 64-bit MAC regex. + */ + readonly requirement: RegExp; +} +/** +* 64-bit MAC action interface. +*/ +interface Mac64Action> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "mac64"; + /** + * The action reference. + */ + readonly reference: typeof mac64; + /** + * The expected property. + */ + readonly expects: null; + /** + * The 64-bit MAC regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a 64-bit [MAC address](https://en.wikipedia.org/wiki/MAC_address) validation action. +* +* @returns A 64-bit MAC action. +*/ +declare function mac64(): Mac64Action; +/** +* Creates a 64-bit [MAC address](https://en.wikipedia.org/wiki/MAC_address) validation action. +* +* @param message The error message. +* +* @returns A 64-bit MAC action. +*/ +declare function mac64> | undefined>(message: TMessage): Mac64Action; +//#endregion +//#region src/actions/mapItems/mapItems.d.ts +/** +* Array action type. +*/ +type ArrayAction$2 = (item: TInput$1[number], index: number, array: TInput$1) => TOutput$1; +/** +* Map items action interface. +*/ +interface MapItemsAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "map_items"; + /** + * The action reference. + */ + readonly reference: typeof mapItems; + /** + * The map items operation. + */ + readonly operation: ArrayAction$2; +} +/** +* Creates a map items transformation action. +* +* @param operation The map items operation. +* +* @returns A map items action. +*/ +declare function mapItems(operation: ArrayAction$2): MapItemsAction; +//#endregion +//#region src/actions/maxBytes/maxBytes.d.ts +/** +* Max bytes issue interface. +*/ +interface MaxBytesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_bytes"; + /** + * The expected property. + */ + readonly expected: `<=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The maximum bytes. + */ + readonly requirement: TRequirement; +} +/** +* Max bytes action interface. +*/ +interface MaxBytesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_bytes"; + /** + * The action reference. + */ + readonly reference: typeof maxBytes; + /** + * The expected property. + */ + readonly expects: `<=${TRequirement}`; + /** + * The maximum bytes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The maximum bytes. +* +* @returns A max bytes action. +*/ +declare function maxBytes(requirement: TRequirement): MaxBytesAction; +/** +* Creates a max [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The maximum bytes. +* @param message The error message. +* +* @returns A max bytes action. +*/ +declare function maxBytes> | undefined>(requirement: TRequirement, message: TMessage): MaxBytesAction; +//#endregion +//#region src/actions/maxEntries/maxEntries.d.ts +/** +* Max entries issue interface. +* +* @beta +*/ +interface MaxEntriesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_entries"; + /** + * The expected property. + */ + readonly expected: `<=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The maximum entries. + */ + readonly requirement: TRequirement; +} +/** +* Max entries action interface. +* +* @beta +*/ +interface MaxEntriesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_entries"; + /** + * The action reference. + */ + readonly reference: typeof maxEntries; + /** + * The expected property. + */ + readonly expects: `<=${TRequirement}`; + /** + * The maximum entries. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max entries validation action. +* +* @param requirement The maximum entries. +* +* @returns A max entries action. +* +* @beta +*/ +declare function maxEntries(requirement: TRequirement): MaxEntriesAction; +/** +* Creates a max entries validation action. +* +* @param requirement The maximum entries. +* @param message The error message. +* +* @returns A max entries action. +* +* @beta +*/ +declare function maxEntries> | undefined>(requirement: TRequirement, message: TMessage): MaxEntriesAction; +//#endregion +//#region src/actions/maxGraphemes/maxGraphemes.d.ts +/** +* Max graphemes issue interface. +*/ +interface MaxGraphemesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_graphemes"; + /** + * The expected property. + */ + readonly expected: `<=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The maximum graphemes. + */ + readonly requirement: TRequirement; +} +/** +* Max graphemes action interface. +*/ +interface MaxGraphemesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_graphemes"; + /** + * The action reference. + */ + readonly reference: typeof maxGraphemes; + /** + * The expected property. + */ + readonly expects: `<=${TRequirement}`; + /** + * The maximum graphemes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max graphemes validation action. +* +* @param requirement The maximum graphemes. +* +* @returns A max graphemes action. +*/ +declare function maxGraphemes(requirement: TRequirement): MaxGraphemesAction; +/** +* Creates a max graphemes validation action. +* +* @param requirement The maximum graphemes. +* @param message The error message. +* +* @returns A max graphemes action. +*/ +declare function maxGraphemes> | undefined>(requirement: TRequirement, message: TMessage): MaxGraphemesAction; +//#endregion +//#region src/actions/maxLength/maxLength.d.ts +/** +* Max length issue interface. +*/ +interface MaxLengthIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_length"; + /** + * The expected property. + */ + readonly expected: `<=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The maximum length. + */ + readonly requirement: TRequirement; +} +/** +* Max length action interface. +*/ +interface MaxLengthAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_length"; + /** + * The action reference. + */ + readonly reference: typeof maxLength; + /** + * The expected property. + */ + readonly expects: `<=${TRequirement}`; + /** + * The maximum length. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max length validation action. +* +* @param requirement The maximum length. +* +* @returns A max length action. +*/ +declare function maxLength(requirement: TRequirement): MaxLengthAction; +/** +* Creates a max length validation action. +* +* @param requirement The maximum length. +* @param message The error message. +* +* @returns A max length action. +*/ +declare function maxLength> | undefined>(requirement: TRequirement, message: TMessage): MaxLengthAction; +//#endregion +//#region src/actions/maxSize/maxSize.d.ts +/** +* Max size issue interface. +*/ +interface MaxSizeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_size"; + /** + * The expected property. + */ + readonly expected: `<=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The maximum size. + */ + readonly requirement: TRequirement; +} +/** +* Max size action interface. +*/ +interface MaxSizeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_size"; + /** + * The action reference. + */ + readonly reference: typeof maxSize; + /** + * The expected property. + */ + readonly expects: `<=${TRequirement}`; + /** + * The maximum size. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max size validation action. +* +* @param requirement The maximum size. +* +* @returns A max size action. +*/ +declare function maxSize(requirement: TRequirement): MaxSizeAction; +/** +* Creates a max size validation action. +* +* @param requirement The maximum size. +* @param message The error message. +* +* @returns A max size action. +*/ +declare function maxSize> | undefined>(requirement: TRequirement, message: TMessage): MaxSizeAction; +//#endregion +//#region src/actions/maxValue/maxValue.d.ts +/** +* Max value issue interface. +*/ +interface MaxValueIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_value"; + /** + * The expected property. + */ + readonly expected: `<=${string}`; + /** + * The maximum value. + */ + readonly requirement: TRequirement; +} +/** +* Max value action interface. +*/ +interface MaxValueAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_value"; + /** + * The action reference. + */ + readonly reference: typeof maxValue; + /** + * The expected property. + */ + readonly expects: `<=${string}`; + /** + * The maximum value. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max value validation action. +* +* @param requirement The maximum value. +* +* @returns A max value action. +*/ +declare function maxValue(requirement: TRequirement): MaxValueAction; +/** +* Creates a max value validation action. +* +* @param requirement The maximum value. +* @param message The error message. +* +* @returns A max value action. +*/ +declare function maxValue> | undefined>(requirement: TRequirement, message: TMessage): MaxValueAction; +//#endregion +//#region src/actions/maxWords/maxWords.d.ts +/** +* Max words issue interface. +*/ +interface MaxWordsIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_words"; + /** + * The expected property. + */ + readonly expected: `<=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The maximum words. + */ + readonly requirement: TRequirement; +} +/** +* Max words action interface. +*/ +interface MaxWordsAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_words"; + /** + * The action reference. + */ + readonly reference: typeof maxWords; + /** + * The expected property. + */ + readonly expects: `<=${TRequirement}`; + /** + * The locales to be used. + */ + readonly locales: TLocales; + /** + * The maximum words. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max words validation action. +* +* @param locales The locales to be used. +* @param requirement The maximum words. +* +* @returns A max words action. +*/ +declare function maxWords(locales: TLocales, requirement: TRequirement): MaxWordsAction; +/** +* Creates a max words validation action. +* +* @param locales The locales to be used. +* @param requirement The maximum words. +* @param message The error message. +* +* @returns A max words action. +*/ +declare function maxWords> | undefined>(locales: TLocales, requirement: TRequirement, message: TMessage): MaxWordsAction; +//#endregion +//#region src/actions/metadata/metadata.d.ts +/** +* Metadata action interface. +*/ +interface MetadataAction> extends BaseMetadata { + /** + * The action type. + */ + readonly type: "metadata"; + /** + * The action reference. + */ + readonly reference: typeof metadata; + /** + * The metadata object. + */ + readonly metadata: TMetadata; +} +/** +* Creates a custom metadata action. +* +* @param metadata_ The metadata object. +* +* @returns A metadata action. +*/ +declare function metadata>(metadata_: TMetadata): MetadataAction; +//#endregion +//#region src/actions/mimeType/mimeType.d.ts +/** +* Requirement type. +*/ +type Requirement = readonly `${string}/${string}`[]; +/** +* MIME type issue interface. +*/ +interface MimeTypeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "mime_type"; + /** + * The expected input. + */ + readonly expected: string; + /** + * The received input. + */ + readonly received: `"${string}"`; + /** + * The MIME types. + */ + readonly requirement: TRequirement; +} +/** +* MIME type action interface. +*/ +interface MimeTypeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "mime_type"; + /** + * The action reference. + */ + readonly reference: typeof mimeType; + /** + * The expected property. + */ + readonly expects: string; + /** + * The MIME types. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [MIME type](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types) validation action. +* +* @param requirement The MIME types. +* +* @returns A MIME type action. +*/ +declare function mimeType(requirement: TRequirement): MimeTypeAction; +/** +* Creates a [MIME type](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types) validation action. +* +* @param requirement The MIME types. +* @param message The error message. +* +* @returns A MIME type action. +*/ +declare function mimeType> | undefined>(requirement: TRequirement, message: TMessage): MimeTypeAction; +//#endregion +//#region src/actions/minBytes/minBytes.d.ts +/** +* Min bytes issue interface. +*/ +interface MinBytesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_bytes"; + /** + * The expected property. + */ + readonly expected: `>=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The minimum bytes. + */ + readonly requirement: TRequirement; +} +/** +* Min bytes action interface. +*/ +interface MinBytesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_bytes"; + /** + * The action reference. + */ + readonly reference: typeof minBytes; + /** + * The expected property. + */ + readonly expects: `>=${TRequirement}`; + /** + * The minimum bytes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The minimum bytes. +* +* @returns A min bytes action. +*/ +declare function minBytes(requirement: TRequirement): MinBytesAction; +/** +* Creates a min [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The minimum bytes. +* @param message The error message. +* +* @returns A min bytes action. +*/ +declare function minBytes> | undefined>(requirement: TRequirement, message: TMessage): MinBytesAction; +//#endregion +//#region src/actions/minEntries/minEntries.d.ts +/** +* Min entries issue interface. +* +* @beta +*/ +interface MinEntriesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_entries"; + /** + * The expected property. + */ + readonly expected: `>=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The minimum entries. + */ + readonly requirement: TRequirement; +} +/** +* Min entries action interface. +* +* @beta +*/ +interface MinEntriesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_entries"; + /** + * The action reference. + */ + readonly reference: typeof minEntries; + /** + * The expected property. + */ + readonly expects: `>=${TRequirement}`; + /** + * The minimum entries. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min entries validation action. +* +* @param requirement The minimum entries. +* +* @returns A min entries action. +* +* @beta +*/ +declare function minEntries(requirement: TRequirement): MinEntriesAction; +/** +* Creates a min entries validation action. +* +* @param requirement The minimum entries. +* @param message The error message. +* +* @returns A min entries action. +* +* @beta +*/ +declare function minEntries> | undefined>(requirement: TRequirement, message: TMessage): MinEntriesAction; +//#endregion +//#region src/actions/minGraphemes/minGraphemes.d.ts +/** +* Min graphemes issue interface. +*/ +interface MinGraphemesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_graphemes"; + /** + * The expected property. + */ + readonly expected: `>=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The minimum graphemes. + */ + readonly requirement: TRequirement; +} +/** +* Min graphemes action interface. +*/ +interface MinGraphemesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_graphemes"; + /** + * The action reference. + */ + readonly reference: typeof minGraphemes; + /** + * The expected property. + */ + readonly expects: `>=${TRequirement}`; + /** + * The minimum graphemes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min graphemes validation action. +* +* @param requirement The minimum graphemes. +* +* @returns A min graphemes action. +*/ +declare function minGraphemes(requirement: TRequirement): MinGraphemesAction; +/** +* Creates a min graphemes validation action. +* +* @param requirement The minimum graphemes. +* @param message The error message. +* +* @returns A min graphemes action. +*/ +declare function minGraphemes> | undefined>(requirement: TRequirement, message: TMessage): MinGraphemesAction; +//#endregion +//#region src/actions/minLength/minLength.d.ts +/** +* Min length issue interface. +*/ +interface MinLengthIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_length"; + /** + * The expected property. + */ + readonly expected: `>=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The minimum length. + */ + readonly requirement: TRequirement; +} +/** +* Min length action interface. +*/ +interface MinLengthAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_length"; + /** + * The action reference. + */ + readonly reference: typeof minLength; + /** + * The expected property. + */ + readonly expects: `>=${TRequirement}`; + /** + * The minimum length. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min length validation action. +* +* @param requirement The minimum length. +* +* @returns A min length action. +*/ +declare function minLength(requirement: TRequirement): MinLengthAction; +/** +* Creates a min length validation action. +* +* @param requirement The minimum length. +* @param message The error message. +* +* @returns A min length action. +*/ +declare function minLength> | undefined>(requirement: TRequirement, message: TMessage): MinLengthAction; +//#endregion +//#region src/actions/minSize/minSize.d.ts +/** +* Min size issue interface. +*/ +interface MinSizeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_size"; + /** + * The expected property. + */ + readonly expected: `>=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The minimum size. + */ + readonly requirement: TRequirement; +} +/** +* Min size action interface. +*/ +interface MinSizeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_size"; + /** + * The action reference. + */ + readonly reference: typeof minSize; + /** + * The expected property. + */ + readonly expects: `>=${TRequirement}`; + /** + * The minimum size. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min size validation action. +* +* @param requirement The minimum size. +* +* @returns A min size action. +*/ +declare function minSize(requirement: TRequirement): MinSizeAction; +/** +* Creates a min size validation action. +* +* @param requirement The minimum size. +* @param message The error message. +* +* @returns A min size action. +*/ +declare function minSize> | undefined>(requirement: TRequirement, message: TMessage): MinSizeAction; +//#endregion +//#region src/actions/minValue/minValue.d.ts +/** +* Min value issue interface. +*/ +interface MinValueIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_value"; + /** + * The expected property. + */ + readonly expected: `>=${string}`; + /** + * The minimum value. + */ + readonly requirement: TRequirement; +} +/** +* Min value action interface. +*/ +interface MinValueAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_value"; + /** + * The action reference. + */ + readonly reference: typeof minValue; + /** + * The expected property. + */ + readonly expects: `>=${string}`; + /** + * The minimum value. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min value validation action. +* +* @param requirement The minimum value. +* +* @returns A min value action. +*/ +declare function minValue(requirement: TRequirement): MinValueAction; +/** +* Creates a min value validation action. +* +* @param requirement The minimum value. +* @param message The error message. +* +* @returns A min value action. +*/ +declare function minValue> | undefined>(requirement: TRequirement, message: TMessage): MinValueAction; +//#endregion +//#region src/actions/minWords/minWords.d.ts +/** +* Min words issue interface. +*/ +interface MinWordsIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_words"; + /** + * The expected property. + */ + readonly expected: `>=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The minimum words. + */ + readonly requirement: TRequirement; +} +/** +* Min words action interface. +*/ +interface MinWordsAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_words"; + /** + * The action reference. + */ + readonly reference: typeof minWords; + /** + * The expected property. + */ + readonly expects: `>=${TRequirement}`; + /** + * The locales to be used. + */ + readonly locales: TLocales; + /** + * The minimum words. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min words validation action. +* +* @param locales The locales to be used. +* @param requirement The minimum words. +* +* @returns A min words action. +*/ +declare function minWords(locales: TLocales, requirement: TRequirement): MinWordsAction; +/** +* Creates a min words validation action. +* +* @param locales The locales to be used. +* @param requirement The minimum words. +* @param message The error message. +* +* @returns A min words action. +*/ +declare function minWords> | undefined>(locales: TLocales, requirement: TRequirement, message: TMessage): MinWordsAction; +//#endregion +//#region src/actions/multipleOf/multipleOf.d.ts +/** +* Input type +*/ +type Input = number | bigint; +/** +* Multiple of issue interface. +*/ +interface MultipleOfIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "multiple_of"; + /** + * The expected property. + */ + readonly expected: `%${TRequirement}`; + /** + * The received property. + */ + readonly received: `${TInput$1}`; + /** + * The divisor. + */ + readonly requirement: TRequirement; +} +/** +* Multiple of action interface. +*/ +interface MultipleOfAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "multiple_of"; + /** + * The action reference. + */ + readonly reference: typeof multipleOf; + /** + * The expected property. + */ + readonly expects: `%${TRequirement}`; + /** + * The divisor. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [multiple](https://en.wikipedia.org/wiki/Multiple_(mathematics)) of validation action. +* +* @param requirement The divisor. +* +* @returns A multiple of action. +*/ +declare function multipleOf(requirement: TRequirement): MultipleOfAction; +/** +* Creates a [multiple](https://en.wikipedia.org/wiki/Multiple_(mathematics)) of validation action. +* +* @param requirement The divisor. +* +* @returns A multiple of action. +*/ +declare function multipleOf(requirement: TRequirement): MultipleOfAction; +/** +* Creates a [multiple](https://en.wikipedia.org/wiki/Multiple_(mathematics)) of validation action. +* +* @param requirement The divisor. +* @param message The error message. +* +* @returns A multiple of action. +*/ +declare function multipleOf> | undefined>(requirement: TRequirement, message: TMessage): MultipleOfAction; +/** +* Creates a [multiple](https://en.wikipedia.org/wiki/Multiple_(mathematics)) of validation action. +* +* @param requirement The divisor. +* @param message The error message. +* +* @returns A multiple of action. +*/ +declare function multipleOf> | undefined>(requirement: TRequirement, message: TMessage): MultipleOfAction; +//#endregion +//#region src/actions/nanoid/nanoid.d.ts +/** +* Nano ID issue interface. +*/ +interface NanoIdIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "nanoid"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: string; + /** + * The Nano ID regex. + */ + readonly requirement: RegExp; +} +/** +* Nano ID issue type. +* +* @deprecated Use `NanoIdIssue` instead. +*/ +type NanoIDIssue = NanoIdIssue; +/** +* Nano ID action interface. +*/ +interface NanoIdAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "nanoid"; + /** + * The action reference. + */ + readonly reference: typeof nanoid; + /** + * The expected property. + */ + readonly expects: null; + /** + * The Nano ID regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Nano ID action type. +* +* @deprecated Use `NanoIdAction` instead. +*/ +type NanoIDAction> | undefined> = NanoIdAction; +/** +* Creates a [Nano ID](https://github.com/ai/nanoid) validation action. +* +* @returns A Nano ID action. +*/ +declare function nanoid(): NanoIdAction; +/** +* Creates a [Nano ID](https://github.com/ai/nanoid) validation action. +* +* @param message The error message. +* +* @returns A Nano ID action. +*/ +declare function nanoid> | undefined>(message: TMessage): NanoIdAction; +//#endregion +//#region src/actions/nonEmpty/nonEmpty.d.ts +/** +* Non empty issue interface. +*/ +interface NonEmptyIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "non_empty"; + /** + * The expected input. + */ + readonly expected: "!0"; + /** + * The received input. + */ + readonly received: "0"; +} +/** +* Non empty action interface. +*/ +interface NonEmptyAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "non_empty"; + /** + * The action reference. + */ + readonly reference: typeof nonEmpty; + /** + * The expected property. + */ + readonly expects: "!0"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non-empty validation action. +* +* @returns A non-empty action. +*/ +declare function nonEmpty(): NonEmptyAction; +/** +* Creates a non-empty validation action. +* +* @param message The error message. +* +* @returns A non-empty action. +*/ +declare function nonEmpty> | undefined>(message: TMessage): NonEmptyAction; +//#endregion +//#region src/actions/normalize/normalize.d.ts +/** +* Normalize form type. +*/ +type NormalizeForm = "NFC" | "NFD" | "NFKC" | "NFKD"; +/** +* Normalize action interface. +*/ +interface NormalizeAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "normalize"; + /** + * The action reference. + */ + readonly reference: typeof normalize; + /** + * The normalization form. + */ + readonly form: TForm; +} +/** +* Creates a normalize transformation action. +* +* @returns A normalize action. +*/ +declare function normalize(): NormalizeAction; +/** +* Creates a normalize transformation action. +* +* @param form The normalization form. +* +* @returns A normalize action. +*/ +declare function normalize(form: TForm): NormalizeAction; +//#endregion +//#region src/actions/notBytes/notBytes.d.ts +/** +* Not bytes issue interface. +*/ +interface NotBytesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_bytes"; + /** + * The expected property. + */ + readonly expected: `!${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The not required bytes. + */ + readonly requirement: TRequirement; +} +/** +* Not bytes action interface. +*/ +interface NotBytesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_bytes"; + /** + * The action reference. + */ + readonly reference: typeof notBytes; + /** + * The expected property. + */ + readonly expects: `!${TRequirement}`; + /** + * The not required bytes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The not required bytes. +* +* @returns A not bytes action. +*/ +declare function notBytes(requirement: TRequirement): NotBytesAction; +/** +* Creates a not [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The not required bytes. +* @param message The error message. +* +* @returns A not bytes action. +*/ +declare function notBytes> | undefined>(requirement: TRequirement, message: TMessage): NotBytesAction; +//#endregion +//#region src/actions/notEntries/notEntries.d.ts +/** +* Not entries issue interface. +* +* @beta +*/ +interface NotEntriesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_entries"; + /** + * The expected property. + */ + readonly expected: `!${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The not required entries. + */ + readonly requirement: TRequirement; +} +/** +* Not entries action interface. +* +* @beta +*/ +interface NotEntriesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_entries"; + /** + * The action reference. + */ + readonly reference: typeof notEntries; + /** + * The expected property. + */ + readonly expects: `!${TRequirement}`; + /** + * The not required entries. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not entries validation action. +* +* @param requirement The not required entries. +* +* @returns A not entries action. +* +* @beta +*/ +declare function notEntries(requirement: TRequirement): NotEntriesAction; +/** +* Creates a not entries validation action. +* +* @param requirement The not required entries. +* @param message The error message. +* +* @returns A not entries action. +* +* @beta +*/ +declare function notEntries> | undefined>(requirement: TRequirement, message: TMessage): NotEntriesAction; +//#endregion +//#region src/actions/notGraphemes/notGraphemes.d.ts +/** +* Not graphemes issue interface. +*/ +interface NotGraphemesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_graphemes"; + /** + * The expected property. + */ + readonly expected: `!${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The not required graphemes. + */ + readonly requirement: TRequirement; +} +/** +* Not graphemes action interface. +*/ +interface NotGraphemesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_graphemes"; + /** + * The action reference. + */ + readonly reference: typeof notGraphemes; + /** + * The expected property. + */ + readonly expects: `!${TRequirement}`; + /** + * The not required graphemes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not graphemes validation action. +* +* @param requirement The not required graphemes. +* +* @returns A not graphemes action. +*/ +declare function notGraphemes(requirement: TRequirement): NotGraphemesAction; +/** +* Creates a not graphemes validation action. +* +* @param requirement The not required graphemes. +* @param message The error message. +* +* @returns A not graphemes action. +*/ +declare function notGraphemes> | undefined>(requirement: TRequirement, message: TMessage): NotGraphemesAction; +//#endregion +//#region src/actions/notLength/notLength.d.ts +/** +* Not length issue interface. +*/ +interface NotLengthIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_length"; + /** + * The expected property. + */ + readonly expected: `!${TRequirement}`; + /** + * The received property. + */ + readonly received: `${TRequirement}`; + /** + * The not required length. + */ + readonly requirement: TRequirement; +} +/** +* Not length action interface. +*/ +interface NotLengthAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_length"; + /** + * The action reference. + */ + readonly reference: typeof notLength; + /** + * The expected property. + */ + readonly expects: `!${TRequirement}`; + /** + * The not required length. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not length validation action. +* +* @param requirement The not required length. +* +* @returns A not length action. +*/ +declare function notLength(requirement: TRequirement): NotLengthAction; +/** +* Creates a not length validation action. +* +* @param requirement The not required length. +* @param message The error message. +* +* @returns A not length action. +*/ +declare function notLength> | undefined>(requirement: TRequirement, message: TMessage): NotLengthAction; +//#endregion +//#region src/actions/notSize/notSize.d.ts +/** +* Not size issue interface. +*/ +interface NotSizeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_size"; + /** + * The expected property. + */ + readonly expected: `!${TRequirement}`; + /** + * The received property. + */ + readonly received: `${TRequirement}`; + /** + * The not required size. + */ + readonly requirement: TRequirement; +} +/** +* Not size action interface. +*/ +interface NotSizeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_size"; + /** + * The action reference. + */ + readonly reference: typeof notSize; + /** + * The expected property. + */ + readonly expects: `!${TRequirement}`; + /** + * The not required size. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not size validation action. +* +* @param requirement The not required size. +* +* @returns A not size action. +*/ +declare function notSize(requirement: TRequirement): NotSizeAction; +/** +* Creates a not size validation action. +* +* @param requirement The not required size. +* @param message The error message. +* +* @returns A not size action. +*/ +declare function notSize> | undefined>(requirement: TRequirement, message: TMessage): NotSizeAction; +//#endregion +//#region src/actions/notValue/notValue.d.ts +/** +* Not value issue interface. +*/ +interface NotValueIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_value"; + /** + * The expected property. + */ + readonly expected: `!${string}`; + /** + * The not required value. + */ + readonly requirement: TRequirement; +} +/** +* Not value action interface. +*/ +interface NotValueAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_value"; + /** + * The action reference. + */ + readonly reference: typeof notValue; + /** + * The expected property. + */ + readonly expects: `!${string}`; + /** + * The not required value. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not value validation action. +* +* @param requirement The not required value. +* +* @returns A not value action. +*/ +declare function notValue(requirement: TRequirement): NotValueAction; +/** +* Creates a not value validation action. +* +* @param requirement The not required value. +* @param message The error message. +* +* @returns A not value action. +*/ +declare function notValue> | undefined>(requirement: TRequirement, message: TMessage): NotValueAction; +//#endregion +//#region src/actions/notValues/notValues.d.ts +/** +* Not values issue type. +*/ +interface NotValuesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_values"; + /** + * The expected property. + */ + readonly expected: `!${string}`; + /** + * The not required values. + */ + readonly requirement: TRequirement; +} +/** +* Not values action type. +*/ +interface NotValuesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_values"; + /** + * The action reference. + */ + readonly reference: typeof notValues; + /** + * The expected property. + */ + readonly expects: `!${string}`; + /** + * The not required values. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not values validation action. +* +* @param requirement The not required values. +* +* @returns A not values action. +*/ +declare function notValues(requirement: TRequirement): NotValuesAction; +/** +* Creates a not values validation action. +* +* @param requirement The not required values. +* @param message The error message. +* +* @returns A not values action. +*/ +declare function notValues> | undefined>(requirement: TRequirement, message: TMessage): NotValuesAction; +//#endregion +//#region src/actions/notWords/notWords.d.ts +/** +* Not words issue interface. +*/ +interface NotWordsIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_words"; + /** + * The expected property. + */ + readonly expected: `!${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The not required words. + */ + readonly requirement: TRequirement; +} +/** +* Not words action interface. +*/ +interface NotWordsAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_words"; + /** + * The action reference. + */ + readonly reference: typeof notWords; + /** + * The expected property. + */ + readonly expects: `!${TRequirement}`; + /** + * The locales to be used. + */ + readonly locales: TLocales; + /** + * The not required words. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not words validation action. +* +* @param locales The locales to be used. +* @param requirement The not required words. +* +* @returns A not words action. +*/ +declare function notWords(locales: TLocales, requirement: TRequirement): NotWordsAction; +/** +* Creates a not words validation action. +* +* @param locales The locales to be used. +* @param requirement The not required words. +* @param message The error message. +* +* @returns A not words action. +*/ +declare function notWords> | undefined>(locales: TLocales, requirement: TRequirement, message: TMessage): NotWordsAction; +//#endregion +//#region src/actions/octal/octal.d.ts +/** +* Octal issue interface. +*/ +interface OctalIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "octal"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The octal regex. + */ + readonly requirement: RegExp; +} +/** +* Octal action interface. +*/ +interface OctalAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "octal"; + /** + * The action reference. + */ + readonly reference: typeof octal; + /** + * The expected property. + */ + readonly expects: null; + /** + * The octal regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [octal](https://en.wikipedia.org/wiki/Octal) validation action. +* +* @returns An octal action. +*/ +declare function octal(): OctalAction; +/** +* Creates an [octal](https://en.wikipedia.org/wiki/Octal) validation action. +* +* @param message The error message. +* +* @returns An octal action. +*/ +declare function octal> | undefined>(message: TMessage): OctalAction; +//#endregion +//#region src/actions/parseBoolean/parseBoolean.d.ts +/** +* Parse boolean config interface. +* +* @beta +*/ +interface ParseBooleanConfig { + /** + * The truthy values. + */ + truthy?: MaybeReadonly | undefined; + /** + * The falsy values. + */ + falsy?: MaybeReadonly | undefined; +} +/** +* Parse boolean issue interface. +* +* @beta +*/ +interface ParseBooleanIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "parse_boolean"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Parse boolean action interface. +* +* @beta +*/ +interface ParseBooleanAction> | undefined = undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "parse_boolean"; + /** + * The action reference. + */ + readonly reference: typeof parseBoolean; + /** + * The expected property. + */ + readonly expects: string; + /** + * The parse boolean config. + */ + readonly config: TConfig; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a parse boolean transformation action. +* +* @returns A parse boolean action. +* +* @beta +*/ +declare function parseBoolean(): ParseBooleanAction; +/** +* Creates a parse boolean transformation action. +* +* @param config The parse boolean config. +* +* @returns A parse boolean action. +* +* @beta +*/ +declare function parseBoolean(config: TConfig): ParseBooleanAction; +/** +* Creates a parse boolean transformation action. +* +* @param config The parse boolean config. +* @param message The error message. +* +* @returns A parse boolean action. +* +* @beta +*/ +declare function parseBoolean> | undefined>(config: TConfig, message: TMessage): ParseBooleanAction; +//#endregion +//#region src/actions/parseJson/parseJson.d.ts +/** +* Parse JSON config interface. +* +* @beta +*/ +interface ParseJsonConfig { + /** + * The JSON reviver function. + */ + reviver?: (this: any, key: string, value: any) => any; +} +/** +* Parse JSON issue interface. +* +* @beta +*/ +interface ParseJsonIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "parse_json"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; +} +/** +* Parse JSON action interface. +* +* @beta +*/ +interface ParseJsonAction> | undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "parse_json"; + /** + * The action reference. + */ + readonly reference: typeof parseJson; + /** + * The action config. + */ + readonly config: TConfig; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a parse JSON transformation action. +* +* @returns A parse JSON action. +* +* @beta +*/ +declare function parseJson(): ParseJsonAction; +/** +* Creates a parse JSON transformation action. +* +* @param config The action config. +* +* @returns A parse JSON action. +* +* @beta +*/ +declare function parseJson(config: TConfig): ParseJsonAction; +/** +* Creates a parse JSON transformation action. +* +* @param config The action config. +* @param message The error message. +* +* @returns A parse JSON action. +* +* @beta +*/ +declare function parseJson> | undefined>(config: TConfig, message: TMessage): ParseJsonAction; +//#endregion +//#region src/actions/partialCheck/types.d.ts +/** +* Partial input type. +*/ +type PartialInput = Record | ArrayLike; +/** +* Partial check issue interface. +*/ +interface PartialCheckIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "partial_check"; + /** + * The expected input. + */ + readonly expected: null; + /** + * The validation function. + */ + readonly requirement: (input: TInput$1) => MaybePromise; +} +/** +* Extracts the exact keys of a tuple, array or object. +*/ +type KeyOf = IsAny extends true ? never : TValue$1 extends readonly unknown[] ? number extends TValue$1["length"] ? "$" : { [TKey in keyof TValue$1]: TKey extends `${infer TIndex extends number}` ? TIndex : never }[number] : TValue$1 extends Record ? keyof TValue$1 & (string | number) : never; +/** +* Path type. +*/ +type Path = readonly (string | number)[]; +/** +* Required path type. +*/ +type RequiredPath = readonly [string | number, ...Path]; +/** +* Paths type. +*/ +type Paths = readonly RequiredPath[]; +/** +* Required paths type. +*/ +type RequiredPaths = readonly [RequiredPath, ...RequiredPath[]]; +/** +* Lazily evaluate only the first valid path segment based on the given value. +*/ +type LazyPath = TPathToCheck extends readonly [] ? TValidPath : TPathToCheck extends readonly [infer TFirstKey extends KeyOf, ...infer TPathRest extends Path] ? LazyPath : IsNever> extends false ? readonly [...TValidPath, KeyOf] : TValidPath; +/** +* Returns the path if valid, otherwise the first possible valid path based on +* the given value. +*/ +type ValidPath = TPath extends LazyPath ? TPath : LazyPath; +/** +* Returns a valid path for any given path based on the given value. +*/ +type ValidPaths = { [TKey in keyof TPaths]: ValidPath }; +/** +* Deeply picks specific keys. +* +* Hint: If this type is ever exported and accessible from the outside, it must +* be wrapped in `UnionToIntersect` to avoid invalid results. +*/ +type DeepPick = TPath extends readonly [infer TFirstKey extends string | number, ...infer TPathRest extends Path] ? TValue$1 extends readonly unknown[] ? number extends TValue$1["length"] ? TPathRest extends readonly [] ? TValue$1 : DeepPick[] : { [TKey in keyof TValue$1]: TKey extends `${TFirstKey}` ? TPathRest extends readonly [] ? TValue$1[TKey] : DeepPick : unknown } : { [TKey in keyof TValue$1 as TKey extends TFirstKey ? TKey : never]: TPathRest extends readonly [] ? TValue$1[TKey] : DeepPick } : never; +/** +* Deeply merges two types. +*/ +type DeepMerge = TValue1 extends readonly unknown[] ? TValue2 extends readonly unknown[] ? number extends TValue1["length"] | TValue2["length"] ? DeepMerge[] : { [TKey in keyof TValue1]: TKey extends keyof TValue2 ? unknown extends TValue1[TKey] ? TValue2[TKey] : TValue1[TKey] : never } : never : TValue1 extends Record ? TValue2 extends Record ? { [TKey in keyof (TValue1 & TValue2)]: TKey extends keyof TValue1 ? TKey extends keyof TValue2 ? DeepMerge : TValue1[TKey] : TKey extends keyof TValue2 ? TValue2[TKey] : never } : never : TValue1 & TValue2; +/** +* Deeply picks N specific keys. +*/ +type DeepPickN = TPaths extends readonly [infer TFirstPath extends Path, ...infer TRestPaths extends Paths] ? TRestPaths extends readonly [] ? DeepPick : DeepMerge, DeepPickN> : TInput$1; +//#endregion +//#region src/actions/partialCheck/partialCheck.d.ts +/** +* Partial check action interface. +*/ +interface PartialCheckAction, TMessage extends ErrorMessage> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "partial_check"; + /** + * The action reference. + */ + readonly reference: typeof partialCheck; + /** + * The expected property. + */ + readonly expects: null; + /** + * The selected paths. + */ + readonly paths: TPaths; + /** + * The validation function. + */ + readonly requirement: (input: TSelection) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a partial check validation action. +* +* @param paths The selected paths. +* @param requirement The validation function. +* +* @returns A partial check action. +*/ +declare function partialCheck>(paths: ValidPaths, requirement: (input: TSelection) => boolean): PartialCheckAction; +/** +* Creates a partial check validation action. +* +* @param paths The selected paths. +* @param requirement The validation function. +* @param message The error message. +* +* @returns A partial check action. +*/ +declare function partialCheck, const TMessage extends ErrorMessage> | undefined>(paths: ValidPaths, requirement: (input: TSelection) => boolean, message: TMessage): PartialCheckAction; +//#endregion +//#region src/actions/partialCheck/partialCheckAsync.d.ts +/** +* Partial check action async interface. +*/ +interface PartialCheckActionAsync, TMessage extends ErrorMessage> | undefined> extends BaseValidationAsync> { + /** + * The action type. + */ + readonly type: "partial_check"; + /** + * The action reference. + */ + readonly reference: typeof partialCheckAsync; + /** + * The expected property. + */ + readonly expects: null; + /** + * The selected paths. + */ + readonly paths: TPaths; + /** + * The validation function. + */ + readonly requirement: (input: TSelection) => MaybePromise; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a partial check validation action. +* +* @param paths The selected paths. +* @param requirement The validation function. +* +* @returns A partial check action. +*/ +declare function partialCheckAsync>(paths: ValidPaths, requirement: (input: TSelection) => MaybePromise): PartialCheckActionAsync; +/** +* Creates a partial check validation action. +* +* @param paths The selected paths. +* @param requirement The validation function. +* @param message The error message. +* +* @returns A partial check action. +*/ +declare function partialCheckAsync, const TMessage extends ErrorMessage> | undefined>(paths: ValidPaths, requirement: (input: TSelection) => MaybePromise, message: TMessage): PartialCheckActionAsync; +//#endregion +//#region src/actions/rawCheck/types.d.ts +/** +* Raw check issue interface. +*/ +interface RawCheckIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "raw_check"; +} +/** +* Raw check issue info interface. +*/ +interface RawCheckIssueInfo { + label?: string | undefined; + input?: unknown | undefined; + expected?: string | undefined; + received?: string | undefined; + message?: ErrorMessage> | undefined; + path?: [IssuePathItem, ...IssuePathItem[]] | undefined; +} +/** +* Raw check add issue type. +*/ +type RawCheckAddIssue = (info?: RawCheckIssueInfo) => void; +/** +* Raw check context interface. +*/ +interface RawCheckContext { + readonly dataset: OutputDataset>; + readonly config: Config>; + readonly addIssue: RawCheckAddIssue; +} +//#endregion +//#region src/actions/rawCheck/rawCheck.d.ts +/** +* Raw check action interface. +*/ +interface RawCheckAction extends BaseValidation> { + /** + * The action type. + */ + readonly type: "raw_check"; + /** + * The action reference. + */ + readonly reference: typeof rawCheck; + /** + * The expected property. + */ + readonly expects: null; +} +/** +* Creates a raw check validation action. +* +* @param action The validation action. +* +* @returns A raw check action. +*/ +declare function rawCheck(action: (context: RawCheckContext) => void): RawCheckAction; +//#endregion +//#region src/actions/rawCheck/rawCheckAsync.d.ts +/** +* Raw check action async interface. +*/ +interface RawCheckActionAsync extends BaseValidationAsync> { + /** + * The action type. + */ + readonly type: "raw_check"; + /** + * The action reference. + */ + readonly reference: typeof rawCheckAsync; + /** + * The expected property. + */ + readonly expects: null; +} +/** +* Creates a raw check validation action. +* +* @param action The validation action. +* +* @returns A raw check action. +*/ +declare function rawCheckAsync(action: (context: RawCheckContext) => MaybePromise): RawCheckActionAsync; +//#endregion +//#region src/actions/rawTransform/types.d.ts +/** +* Raw transform issue interface. +*/ +interface RawTransformIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "raw_transform"; +} +/** +* Raw transform issue info interface. +*/ +interface RawTransformIssueInfo { + label?: string | undefined; + input?: unknown | undefined; + expected?: string | undefined; + received?: string | undefined; + message?: ErrorMessage> | undefined; + path?: [IssuePathItem, ...IssuePathItem[]] | undefined; +} +/** +* Raw transform add issue type. +*/ +type RawTransformAddIssue = (info?: RawTransformIssueInfo) => void; +/** +* Raw transform context interface. +*/ +interface RawTransformContext { + readonly dataset: SuccessDataset; + readonly config: Config>; + readonly addIssue: RawTransformAddIssue; + readonly NEVER: never; +} +//#endregion +//#region src/actions/rawTransform/rawTransform.d.ts +/** +* Raw transform action interface. +*/ +interface RawTransformAction extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "raw_transform"; + /** + * The action reference. + */ + readonly reference: typeof rawTransform; +} +/** +* Creates a raw transformation action. +* +* @param action The transformation action. +* +* @returns A raw transform action. +*/ +declare function rawTransform(action: (context: RawTransformContext) => TOutput$1): RawTransformAction; +//#endregion +//#region src/actions/rawTransform/rawTransformAsync.d.ts +/** +* Raw transform action async interface. +*/ +interface RawTransformActionAsync extends BaseTransformationAsync> { + /** + * The action type. + */ + readonly type: "raw_transform"; + /** + * The action reference. + */ + readonly reference: typeof rawTransformAsync; +} +/** +* Creates a raw transformation action. +* +* @param action The transformation action. +* +* @returns A raw transform action. +*/ +declare function rawTransformAsync(action: (context: RawTransformContext) => MaybePromise): RawTransformActionAsync; +//#endregion +//#region src/actions/readonly/readonly.d.ts +/** +* Readonly output type. +*/ +type ReadonlyOutput = TInput$1 extends Map ? ReadonlyMap : TInput$1 extends Set ? ReadonlySet : Readonly; +/** +* Readonly action interface. +*/ +interface ReadonlyAction extends BaseTransformation, never> { + /** + * The action type. + */ + readonly type: "readonly"; + /** + * The action reference. + */ + readonly reference: typeof readonly; +} +/** +* Creates a readonly transformation action. +* +* @returns A readonly action. +*/ +declare function readonly(): ReadonlyAction; +//#endregion +//#region src/actions/reduceItems/reduceItems.d.ts +/** +* Array action type. +*/ +type ArrayAction$1 = (output: TOutput$1, item: TInput$1[number], index: number, array: TInput$1) => TOutput$1; +/** +* Reduce items action interface. +*/ +interface ReduceItemsAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "reduce_items"; + /** + * The action reference. + */ + readonly reference: typeof reduceItems; + /** + * The reduce items operation. + */ + readonly operation: ArrayAction$1; + /** + * The initial value. + */ + readonly initial: TOutput$1; +} +/** +* Creates a reduce items transformation action. +* +* @param operation The reduce items operation. +* @param initial The initial value. +* +* @returns A reduce items action. +*/ +declare function reduceItems(operation: ArrayAction$1, initial: TOutput$1): ReduceItemsAction; +//#endregion +//#region src/actions/regex/regex.d.ts +/** +* Regex issue interface. +*/ +interface RegexIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "regex"; + /** + * The expected input. + */ + readonly expected: string; + /** + * The received input. + */ + readonly received: `"${string}"`; + /** + * The regex pattern. + */ + readonly requirement: RegExp; +} +/** +* Regex action interface. +*/ +interface RegexAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "regex"; + /** + * The action reference. + */ + readonly reference: typeof regex; + /** + * The expected property. + */ + readonly expects: string; + /** + * The regex pattern. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [regex](https://en.wikipedia.org/wiki/Regular_expression) validation action. +* +* Hint: Be careful with the global flag `g` in your regex pattern, as it can lead to unexpected results. See [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test#using_test_on_a_regex_with_the_global_flag) for more information. +* +* @param requirement The regex pattern. +* +* @returns A regex action. +*/ +declare function regex(requirement: RegExp): RegexAction; +/** +* Creates a [regex](https://en.wikipedia.org/wiki/Regular_expression) validation action. +* +* Hint: Be careful with the global flag `g` in your regex pattern, as it can lead to unexpected results. See [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test#using_test_on_a_regex_with_the_global_flag) for more information. +* +* @param requirement The regex pattern. +* @param message The error message. +* +* @returns A regex action. +*/ +declare function regex> | undefined>(requirement: RegExp, message: TMessage): RegexAction; +//#endregion +//#region src/actions/returns/returns.d.ts +/** +* Returns action type. +*/ +interface ReturnsAction unknown, TSchema extends BaseSchema>> extends BaseTransformation) => InferOutput, never> { + /** + * The action type. + */ + readonly type: "returns"; + /** + * The action reference. + */ + readonly reference: typeof returns; + /** + * The arguments schema. + */ + readonly schema: TSchema; +} +/** +* Creates a function return transformation action. +* +* @param schema The arguments schema. +* +* @returns An returns action. +*/ +declare function returns unknown, TSchema extends BaseSchema>>(schema: TSchema): ReturnsAction; +//#endregion +//#region src/actions/returns/returnsAsync.d.ts +/** +* Returns action async type. +*/ +interface ReturnsActionAsync unknown, TSchema extends BaseSchema> | BaseSchemaAsync>> extends BaseTransformation) => Promise>>, never> { + /** + * The action type. + */ + readonly type: "returns"; + /** + * The action reference. + */ + readonly reference: typeof returnsAsync; + /** + * The arguments schema. + */ + readonly schema: TSchema; +} +/** +* Creates a function arguments transformation action. +* +* @param schema The arguments schema. +* +* @returns An returns action. +*/ +declare function returnsAsync unknown, TSchema extends BaseSchema> | BaseSchemaAsync>>(schema: TSchema): ReturnsActionAsync; +//#endregion +//#region src/actions/rfcEmail/rfcEmail.d.ts +/** +* RFC email issue interface. +*/ +interface RfcEmailIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "rfc_email"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The RFC email regex. + */ + readonly requirement: RegExp; +} +/** +* RFC email action interface. +*/ +interface RfcEmailAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "rfc_email"; + /** + * The action reference. + */ + readonly reference: typeof rfcEmail; + /** + * The expected property. + */ + readonly expects: null; + /** + * The RFC email regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [RFC email](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) +* validation action. +* +* Hint: This validation action uses the regex defined by the HTML Living +* Standard for ``, which covers most of RFC 5322 but +* not all of it. For example, quoted local parts and comments are not +* supported. If you are interested in an action that only validates common +* email addresses, please use the `email` action instead. +* +* @returns A RFC email action. +*/ +declare function rfcEmail(): RfcEmailAction; +/** +* Creates a [RFC email](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) +* validation action. +* +* Hint: This validation action uses the regex defined by the HTML Living +* Standard for ``, which covers most of RFC 5322 but +* not all of it. For example, quoted local parts and comments are not +* supported. If you are interested in an action that only validates common +* email addresses, please use the `email` action instead. +* +* @param message The error message. +* +* @returns A RFC email action. +*/ +declare function rfcEmail> | undefined>(message: TMessage): RfcEmailAction; +//#endregion +//#region src/actions/safeInteger/safeInteger.d.ts +/** +* Safe integer issue interface. +*/ +interface SafeIntegerIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "safe_integer"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The validation function. + */ + readonly requirement: (input: number) => boolean; +} +/** +* Safe integer action interface. +*/ +interface SafeIntegerAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "safe_integer"; + /** + * The action reference. + */ + readonly reference: typeof safeInteger; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: number) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a safe integer validation action. +* +* @returns A safe integer action. +*/ +declare function safeInteger(): SafeIntegerAction; +/** +* Creates a safe integer validation action. +* +* @param message The error message. +* +* @returns A safe integer action. +*/ +declare function safeInteger> | undefined>(message: TMessage): SafeIntegerAction; +//#endregion +//#region src/actions/size/size.d.ts +/** +* Size issue interface. +*/ +interface SizeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "size"; + /** + * The expected property. + */ + readonly expected: `${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The required size. + */ + readonly requirement: TRequirement; +} +/** +* Size action interface. +*/ +interface SizeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "size"; + /** + * The action reference. + */ + readonly reference: typeof size; + /** + * The expected property. + */ + readonly expects: `${TRequirement}`; + /** + * The required size. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a size validation action. +* +* @param requirement The required size. +* +* @returns A size action. +*/ +declare function size(requirement: TRequirement): SizeAction; +/** +* Creates a size validation action. +* +* @param requirement The required size. +* @param message The error message. +* +* @returns A size action. +*/ +declare function size> | undefined>(requirement: TRequirement, message: TMessage): SizeAction; +//#endregion +//#region src/actions/slug/slug.d.ts +/** +* Slug issue type. +*/ +interface SlugIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "slug"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The slug regex. + */ + readonly requirement: RegExp; +} +/** +* Slug action type. +*/ +interface SlugAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "slug"; + /** + * The action reference. + */ + readonly reference: typeof slug; + /** + * The expected property. + */ + readonly expects: null; + /** + * The slug regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [slug](https://en.wikipedia.org/wiki/Clean_URL#Slug) validation action. +* +* @returns A slug action. +*/ +declare function slug(): SlugAction; +/** +* Creates a [slug](https://en.wikipedia.org/wiki/Clean_URL#Slug) validation action. +* +* @param message The error message. +* +* @returns A slug action. +*/ +declare function slug> | undefined>(message: TMessage): SlugAction; +//#endregion +//#region src/actions/someItem/someItem.d.ts +/** +* Some item issue interface. +*/ +interface SomeItemIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "some_item"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirement; +} +/** +* Some item action interface. +*/ +interface SomeItemAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "some_item"; + /** + * The action reference. + */ + readonly reference: typeof someItem; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a some item validation action. +* +* @param requirement The validation function. +* +* @returns A some item action. +*/ +declare function someItem(requirement: ArrayRequirement): SomeItemAction; +/** +* Creates a some item validation action. +* +* @param requirement The validation function. +* @param message The error message. +* +* @returns A some item action. +*/ +declare function someItem> | undefined>(requirement: ArrayRequirement, message: TMessage): SomeItemAction; +//#endregion +//#region src/actions/sortItems/sortItems.d.ts +/** +* Array action type. +*/ +type ArrayAction = (itemA: TInput$1[number], itemB: TInput$1[number]) => number; +/** +* Sort items action interface. +*/ +interface SortItemsAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "sort_items"; + /** + * The action reference. + */ + readonly reference: typeof sortItems; + /** + * The sort items operation. + */ + readonly operation: ArrayAction | undefined; +} +/** +* Creates a sort items transformation action. +* +* @param operation The sort items operation. +* +* @returns A sort items action. +*/ +declare function sortItems(operation?: ArrayAction): SortItemsAction; +//#endregion +//#region src/actions/startsWith/startsWith.d.ts +/** +* Starts with issue interface. +*/ +interface StartsWithIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "starts_with"; + /** + * The expected property. + */ + readonly expected: `"${TRequirement}"`; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The start string. + */ + readonly requirement: TRequirement; +} +/** +* Starts with action interface. +*/ +interface StartsWithAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "starts_with"; + /** + * The action reference. + */ + readonly reference: typeof startsWith; + /** + * The expected property. + */ + readonly expects: `"${TRequirement}"`; + /** + * The start string. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a starts with validation action. +* +* @param requirement The start string. +* +* @returns A starts with action. +*/ +declare function startsWith(requirement: TRequirement): StartsWithAction; +/** +* Creates a starts with validation action. +* +* @param requirement The start string. +* @param message The error message. +* +* @returns A starts with action. +*/ +declare function startsWith> | undefined>(requirement: TRequirement, message: TMessage): StartsWithAction; +//#endregion +//#region src/actions/stringifyJson/stringifyJson.d.ts +/** +* Stringify JSON config interface. +* +* @beta +*/ +interface StringifyJsonConfig { + /** + * The JSON replacer function or array. + */ + replacer?: ((this: any, key: string, value: any) => any) | (number | string)[]; + /** + * The JSON space option. + */ + space?: string | number; +} +/** +* Stringify JSON issue interface. +* +* @beta +*/ +interface StringifyJsonIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "stringify_json"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; +} +/** +* Stringify JSON action interface. +* +* @beta +*/ +interface StringifyJsonAction> | undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "stringify_json"; + /** + * The action reference. + */ + readonly reference: typeof stringifyJson; + /** + * The action config. + */ + readonly config: TConfig; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a stringify JSON transformation action. +* +* @returns A stringify JSON action. +* +* @beta +*/ +declare function stringifyJson(): StringifyJsonAction; +/** +* Creates a stringify JSON transformation action. +* +* @param config The action config. +* +* @returns A stringify JSON action. +* +* @beta +*/ +declare function stringifyJson(config: TConfig): StringifyJsonAction; +/** +* Creates a stringify JSON transformation action. +* +* @param config The action config. +* @param message The error message. +* +* @returns A stringify JSON action. +* +* @beta +*/ +declare function stringifyJson> | undefined>(config: TConfig, message: TMessage): StringifyJsonAction; +//#endregion +//#region src/actions/toBigint/toBigint.d.ts +/** +* To bigint issue interface. +*/ +interface ToBigintIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "to_bigint"; + /** + * The expected property. + */ + readonly expected: null; +} +/** +* To bigint action interface. +*/ +interface ToBigintAction> | undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "to_bigint"; + /** + * The action reference. + */ + readonly reference: typeof toBigint; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a to bigint transformation action. +* +* @returns A to bigint action. +* +* @beta +*/ +declare function toBigint(): ToBigintAction; +/** +* Creates a to bigint transformation action. +* +* @param message The error message. +* +* @returns A to bigint action. +* +* @beta +*/ +declare function toBigint> | undefined>(message: TMessage): ToBigintAction; +//#endregion +//#region src/actions/toBoolean/toBoolean.d.ts +/** +* To boolean action interface. +*/ +interface ToBooleanAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_boolean"; + /** + * The action reference. + */ + readonly reference: typeof toBoolean; +} +/** +* Creates a to boolean transformation action. +* +* @returns A to boolean action. +* +* @beta +*/ +declare function toBoolean(): ToBooleanAction; +//#endregion +//#region src/actions/toCamelCase/toCamelCase.d.ts +/** +* To camel case action interface. +* +* @beta +*/ +interface ToCamelCaseAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_camel_case"; + /** + * The action reference. + */ + readonly reference: typeof toCamelCase; +} +/** +* Creates a to camel case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `parseUrlValue`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `item2Name`). +* +* @returns A to camel case action. +* +* @beta +*/ +declare function toCamelCase(): ToCamelCaseAction; +//#endregion +//#region src/actions/toDate/toDate.d.ts +/** +* To date issue interface. +*/ +interface ToDateIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "to_date"; + /** + * The expected property. + */ + readonly expected: null; +} +/** +* To date action interface. +*/ +interface ToDateAction> | undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "to_date"; + /** + * The action reference. + */ + readonly reference: typeof toDate; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a to date transformation action. +* +* @returns A to date action. +* +* @beta +*/ +declare function toDate(): ToDateAction; +/** +* Creates a to date transformation action. +* +* @param message The error message. +* +* @returns A to date action. +* +* @beta +*/ +declare function toDate> | undefined>(message: TMessage): ToDateAction; +//#endregion +//#region src/actions/toKebabCase/toKebabCase.d.ts +/** +* To kebab case action interface. +* +* @beta +*/ +interface ToKebabCaseAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_kebab_case"; + /** + * The action reference. + */ + readonly reference: typeof toKebabCase; +} +/** +* Creates a to kebab case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `parse-url-value`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `item2-name`). +* +* @returns A to kebab case action. +* +* @beta +*/ +declare function toKebabCase(): ToKebabCaseAction; +//#endregion +//#region src/actions/toLowerCase/toLowerCase.d.ts +/** +* To lower case action interface. +*/ +interface ToLowerCaseAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_lower_case"; + /** + * The action reference. + */ + readonly reference: typeof toLowerCase; +} +/** +* Creates a to lower case transformation action. +* +* @returns A to lower case action. +*/ +declare function toLowerCase(): ToLowerCaseAction; +//#endregion +//#region src/actions/toMaxValue/toMaxValue.d.ts +/** +* To max value action interface. +*/ +interface ToMaxValueAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_max_value"; + /** + * The action reference. + */ + readonly reference: typeof toMaxValue; + /** + * The maximum value. + */ + readonly requirement: TRequirement; +} +/** +* Creates a to max value transformation action. +* +* @param requirement The maximum value. +* +* @returns A to max value action. +*/ +declare function toMaxValue(requirement: TRequirement): ToMaxValueAction; +//#endregion +//#region src/actions/toMinValue/toMinValue.d.ts +/** +* To min value action interface. +*/ +interface ToMinValueAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_min_value"; + /** + * The action reference. + */ + readonly reference: typeof toMinValue; + /** + * The minimum value. + */ + readonly requirement: TRequirement; +} +/** +* Creates a to min value transformation action. +* +* @param requirement The minimum value. +* +* @returns A to min value action. +*/ +declare function toMinValue(requirement: TRequirement): ToMinValueAction; +//#endregion +//#region src/actions/toNumber/toNumber.d.ts +/** +* To number issue interface. +*/ +interface ToNumberIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "to_number"; + /** + * The expected property. + */ + readonly expected: null; +} +/** +* To number action interface. +*/ +interface ToNumberAction> | undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "to_number"; + /** + * The action reference. + */ + readonly reference: typeof toNumber; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a to number transformation action. +* +* @returns A to number action. +* +* @beta +*/ +declare function toNumber(): ToNumberAction; +/** +* Creates a to number transformation action. +* +* @param message The error message. +* +* @returns A to number action. +* +* @beta +*/ +declare function toNumber> | undefined>(message: TMessage): ToNumberAction; +//#endregion +//#region src/actions/toPascalCase/toPascalCase.d.ts +/** +* To pascal case action interface. +* +* @beta +*/ +interface ToPascalCaseAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_pascal_case"; + /** + * The action reference. + */ + readonly reference: typeof toPascalCase; +} +/** +* Creates a to pascal case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `ParseUrlValue`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `Item2Name`). +* +* @returns A to pascal case action. +* +* @beta +*/ +declare function toPascalCase(): ToPascalCaseAction; +//#endregion +//#region src/actions/toSnakeCase/toSnakeCase.d.ts +/** +* To snake case action interface. +* +* @beta +*/ +interface ToSnakeCaseAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_snake_case"; + /** + * The action reference. + */ + readonly reference: typeof toSnakeCase; +} +/** +* Creates a to snake case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `parse_url_value`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `item2_name`). +* +* @returns A to snake case action. +* +* @beta +*/ +declare function toSnakeCase(): ToSnakeCaseAction; +//#endregion +//#region src/actions/toString/toString.d.ts +/** +* To string issue interface. +*/ +interface ToStringIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "to_string"; + /** + * The expected property. + */ + readonly expected: null; +} +/** +* To string action interface. +*/ +interface ToStringAction> | undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "to_string"; + /** + * The action reference. + */ + readonly reference: typeof toString; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a to string transformation action. +* +* @returns A to string action. +* +* @beta +*/ +declare function toString(): ToStringAction; +/** +* Creates a to string transformation action. +* +* @param message The error message. +* +* @returns A to string action. +* +* @beta +*/ +declare function toString> | undefined>(message: TMessage): ToStringAction; +//#endregion +//#region src/actions/toUpperCase/toUpperCase.d.ts +/** +* To upper case action interface. +*/ +interface ToUpperCaseAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_upper_case"; + /** + * The action reference. + */ + readonly reference: typeof toUpperCase; +} +/** +* Creates a to upper case transformation action. +* +* @returns A to upper case action. +*/ +declare function toUpperCase(): ToUpperCaseAction; +//#endregion +//#region src/actions/transform/transform.d.ts +/** +* Transform action interface. +*/ +interface TransformAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "transform"; + /** + * The action reference. + */ + readonly reference: typeof transform; + /** + * The transformation operation. + */ + readonly operation: (input: TInput$1) => TOutput$1; +} +/** +* Creates a custom transformation action. +* +* @param operation The transformation operation. +* +* @returns A transform action. +*/ +declare function transform(operation: (input: TInput$1) => TOutput$1): TransformAction; +//#endregion +//#region src/actions/transform/transformAsync.d.ts +/** +* Transform action async interface. +*/ +interface TransformActionAsync extends BaseTransformationAsync { + /** + * The action type. + */ + readonly type: "transform"; + /** + * The action reference. + */ + readonly reference: typeof transformAsync; + /** + * The transformation operation. + */ + readonly operation: (input: TInput$1) => Promise; +} +/** +* Creates a custom transformation action. +* +* @param operation The transformation operation. +* +* @returns A transform action. +*/ +declare function transformAsync(operation: (input: TInput$1) => Promise): TransformActionAsync; +//#endregion +//#region src/actions/trim/trim.d.ts +/** +* Trim action interface. +*/ +interface TrimAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "trim"; + /** + * The action reference. + */ + readonly reference: typeof trim; +} +/** +* Creates a trim transformation action. +* +* @returns A trim action. +*/ +declare function trim(): TrimAction; +//#endregion +//#region src/actions/trimEnd/trimEnd.d.ts +/** +* Trim end action interface. +*/ +interface TrimEndAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "trim_end"; + /** + * The action reference. + */ + readonly reference: typeof trimEnd; +} +/** +* Creates a trim end transformation action. +* +* @returns A trim end action. +*/ +declare function trimEnd(): TrimEndAction; +//#endregion +//#region src/actions/trimStart/trimStart.d.ts +/** +* Trim start action interface. +*/ +interface TrimStartAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "trim_start"; + /** + * The action reference. + */ + readonly reference: typeof trimStart; +} +/** +* Creates a trim start transformation action. +* +* @returns A trim start action. +*/ +declare function trimStart(): TrimStartAction; +//#endregion +//#region src/actions/ulid/ulid.d.ts +/** +* ULID issue interface. +*/ +interface UlidIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "ulid"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ULID regex. + */ + readonly requirement: RegExp; +} +/** +* ULID action interface. +*/ +interface UlidAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "ulid"; + /** + * The action reference. + */ + readonly reference: typeof ulid; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ULID regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ULID](https://github.com/ulid/spec) validation action. +* +* @returns An ULID action. +*/ +declare function ulid(): UlidAction; +/** +* Creates an [ULID](https://github.com/ulid/spec) validation action. +* +* @param message The error message. +* +* @returns An ULID action. +*/ +declare function ulid> | undefined>(message: TMessage): UlidAction; +//#endregion +//#region src/actions/url/url.d.ts +/** +* URL issue interface. +*/ +interface UrlIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "url"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; +} +/** +* URL action interface. +*/ +interface UrlAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "url"; + /** + * The action reference. + */ + readonly reference: typeof url; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [URL](https://en.wikipedia.org/wiki/URL) validation action. +* +* Hint: The value is passed to the URL constructor to check if it is valid. +* This check is not perfect. For example, values like "abc:1234" are accepted. +* +* @returns An URL action. +*/ +declare function url(): UrlAction; +/** +* Creates an [URL](https://en.wikipedia.org/wiki/URL) validation action. +* +* Hint: The value is passed to the URL constructor to check if it is valid. +* This check is not perfect. For example, values like "abc:1234" are accepted. +* +* @param message The error message. +* +* @returns An URL action. +*/ +declare function url> | undefined>(message: TMessage): UrlAction; +//#endregion +//#region src/actions/uuid/uuid.d.ts +/** +* UUID issue interface. +*/ +interface UuidIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "uuid"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The UUID regex. + */ + readonly requirement: RegExp; +} +/** +* UUID action interface. +*/ +interface UuidAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "uuid"; + /** + * The action reference. + */ + readonly reference: typeof uuid; + /** + * The expected property. + */ + readonly expects: null; + /** + * The UUID regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) validation action. +* +* @returns An UUID action. +*/ +declare function uuid(): UuidAction; +/** +* Creates an [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) validation action. +* +* @param message The error message. +* +* @returns An UUID action. +*/ +declare function uuid> | undefined>(message: TMessage): UuidAction; +//#endregion +//#region src/actions/value/value.d.ts +/** +* Value issue interface. +*/ +interface ValueIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "value"; + /** + * The expected property. + */ + readonly expected: string; + /** + * The required value. + */ + readonly requirement: TRequirement; +} +/** +* Value action interface. +*/ +interface ValueAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "value"; + /** + * The action reference. + */ + readonly reference: typeof value; + /** + * The expected property. + */ + readonly expects: string; + /** + * The required value. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a value validation action. +* +* @param requirement The required value. +* +* @returns A value action. +*/ +declare function value(requirement: TRequirement): ValueAction; +/** +* Creates a value validation action. +* +* @param requirement The required value. +* @param message The error message. +* +* @returns A value action. +*/ +declare function value> | undefined>(requirement: TRequirement, message: TMessage): ValueAction; +//#endregion +//#region src/actions/values/values.d.ts +/** +* Values issue type. +*/ +interface ValuesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "values"; + /** + * The expected property. + */ + readonly expected: string; + /** + * The required values. + */ + readonly requirement: TRequirement; +} +/** +* Values action type. +*/ +interface ValuesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "values"; + /** + * The action reference. + */ + readonly reference: typeof values; + /** + * The expected property. + */ + readonly expects: string; + /** + * The required values. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a values validation action. +* +* @param requirement The required values. +* +* @returns A values action. +*/ +declare function values(requirement: TRequirement): ValuesAction; +/** +* Creates a values validation action. +* +* @param requirement The required values. +* @param message The error message. +* +* @returns A values action. +*/ +declare function values> | undefined>(requirement: TRequirement, message: TMessage): ValuesAction; +//#endregion +//#region src/actions/words/words.d.ts +/** +* Words issue interface. +*/ +interface WordsIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "words"; + /** + * The expected property. + */ + readonly expected: `${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The required words. + */ + readonly requirement: TRequirement; +} +/** +* Words action interface. +*/ +interface WordsAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "words"; + /** + * The action reference. + */ + readonly reference: typeof words; + /** + * The expected property. + */ + readonly expects: `${TRequirement}`; + /** + * The locales to be used. + */ + readonly locales: TLocales; + /** + * The required words. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a words validation action. +* +* @param locales The locales to be used. +* @param requirement The required words. +* +* @returns A words action. +*/ +declare function words(locales: TLocales, requirement: TRequirement): WordsAction; +/** +* Creates a words validation action. +* +* @param locales The locales to be used. +* @param requirement The required words. +* @param message The error message. +* +* @returns A words action. +*/ +declare function words> | undefined>(locales: TLocales, requirement: TRequirement, message: TMessage): WordsAction; +//#endregion +//#region src/regex.d.ts +/** +* [Base64](https://en.wikipedia.org/wiki/Base64) regex. +*/ +declare const BASE64_REGEX: RegExp; +/** +* [BIC](https://en.wikipedia.org/wiki/ISO_9362) regex. +*/ +declare const BIC_REGEX: RegExp; +/** +* [Cuid2](https://github.com/paralleldrive/cuid2) regex. +*/ +declare const CUID2_REGEX: RegExp; +/** +* [Decimal](https://en.wikipedia.org/wiki/Decimal) regex. +*/ +declare const DECIMAL_REGEX: RegExp; +/** +* [Digits](https://en.wikipedia.org/wiki/Numerical_digit) regex. +*/ +declare const DIGITS_REGEX: RegExp; +/** +* [Domain name](https://en.wikipedia.org/wiki/Domain_name) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +* ASCII-only validation. Internationalized domain names (IDNs) are not +* supported, including Punycode-encoded labels. +*/ +declare const DOMAIN_REGEX: RegExp; +/** +* [Email address](https://en.wikipedia.org/wiki/Email_address) regex. +*/ +declare const EMAIL_REGEX: RegExp; +/** +* Emoji regex from [emoji-regex-xs](https://github.com/slevithan/emoji-regex-xs) v1.0.0 (MIT license). +* +* Hint: We decided against the newer `/^\p{RGI_Emoji}+$/v` regex because it is +* not supported in older runtimes and does not match all emoji. +*/ +declare const EMOJI_REGEX: RegExp; +/** +* [Hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +declare const HEXADECIMAL_REGEX: RegExp; +/** +* [Hex color](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +declare const HEX_COLOR_REGEX: RegExp; +/** +* [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) regex. +*/ +declare const IMEI_REGEX: RegExp; +/** +* [IPv4](https://en.wikipedia.org/wiki/IPv4) regex. +*/ +declare const IPV4_REGEX: RegExp; +/** +* [IPv6](https://en.wikipedia.org/wiki/IPv6) regex. +*/ +declare const IPV6_REGEX: RegExp; +/** +* [IP](https://en.wikipedia.org/wiki/IP_address) regex. +*/ +declare const IP_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date regex. +*/ +declare const ISO_DATE_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time regex. +*/ +declare const ISO_DATE_TIME_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with seconds regex. +*/ +declare const ISO_DATE_TIME_SECOND_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time regex. +*/ +declare const ISO_TIME_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time with seconds regex. +*/ +declare const ISO_TIME_SECOND_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp regex. Allows a +* space as a date/time separator and an optional space before the UTC offset. +*/ +declare const ISO_TIMESTAMP_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) week regex. +*/ +declare const ISO_WEEK_REGEX: RegExp; +/** +* [JWS compact serialization](https://datatracker.ietf.org/doc/html/rfc7515#section-3.1) +* regex. +* +* Hint: Empty payload and signature segments are allowed because the +* Base64URL-encoded representation of an empty octet sequence is an empty +* string. +*/ +declare const JWS_COMPACT_REGEX: RegExp; +/** +* [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) regex. +*/ +declare const ISRC_REGEX: RegExp; +/** +* [MAC](https://en.wikipedia.org/wiki/MAC_address) 48 bit regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +declare const MAC48_REGEX: RegExp; +/** +* [MAC](https://en.wikipedia.org/wiki/MAC_address) 64 bit regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +declare const MAC64_REGEX: RegExp; +/** +* [MAC](https://en.wikipedia.org/wiki/MAC_address) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +declare const MAC_REGEX: RegExp; +/** +* [Nano ID](https://github.com/ai/nanoid) regex. +*/ +declare const NANO_ID_REGEX: RegExp; +/** +* [Octal](https://en.wikipedia.org/wiki/Octal) regex. +*/ +declare const OCTAL_REGEX: RegExp; +/** +* [RFC 5322 email address](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) regex. +* +* Hint: This regex was taken from the [HTML Living Standard Specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) and does not perfectly represent RFC 5322. +*/ +declare const RFC_EMAIL_REGEX: RegExp; +/** +* [Slug](https://en.wikipedia.org/wiki/Clean_URL#Slug) regex. +*/ +declare const SLUG_REGEX: RegExp; +/** +* [ULID](https://github.com/ulid/spec) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +declare const ULID_REGEX: RegExp; +/** +* [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) regex. +*/ +declare const UUID_REGEX: RegExp; +//#endregion +//#region src/storages/globalConfig/globalConfig.d.ts +/** +* The global config type. +*/ +type GlobalConfig = Omit, "message">; +/** +* Sets the global configuration. +* +* @param config The configuration. +*/ +declare function setGlobalConfig(config: GlobalConfig): void; +/** +* Returns the global configuration. +* +* @param config The config to merge. +* +* @returns The configuration. +*/ +declare function getGlobalConfig>(config?: Config): Config; +/** +* Deletes the global configuration. +*/ +declare function deleteGlobalConfig(): void; +//#endregion +//#region src/storages/globalMessage/globalMessage.d.ts +/** +* Sets a global error message. +* +* @param message The error message. +* @param lang The language of the message. +*/ +declare function setGlobalMessage(message: ErrorMessage>, lang?: string): void; +/** +* Returns a global error message. +* +* @param lang The language of the message. +* +* @returns The error message. +*/ +declare function getGlobalMessage(lang?: string): ErrorMessage> | undefined; +/** +* Deletes a global error message. +* +* @param lang The language of the message. +*/ +declare function deleteGlobalMessage(lang?: string): void; +//#endregion +//#region src/storages/schemaMessage/schemaMessage.d.ts +/** +* Sets a schema error message. +* +* @param message The error message. +* @param lang The language of the message. +*/ +declare function setSchemaMessage(message: ErrorMessage>, lang?: string): void; +/** +* Returns a schema error message. +* +* @param lang The language of the message. +* +* @returns The error message. +*/ +declare function getSchemaMessage(lang?: string): ErrorMessage> | undefined; +/** +* Deletes a schema error message. +* +* @param lang The language of the message. +*/ +declare function deleteSchemaMessage(lang?: string): void; +//#endregion +//#region src/storages/specificMessage/specificMessage.d.ts +/** +* Reference type. +*/ +type Reference = (...args: any[]) => BaseSchema> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync>; +/** +* Sets a specific error message. +* +* @param reference The identifier reference. +* @param message The error message. +* @param lang The language of the message. +*/ +declare function setSpecificMessage(reference: TReference, message: ErrorMessage>>, lang?: string): void; +/** +* Returns a specific error message. +* +* @param reference The identifier reference. +* @param lang The language of the message. +* +* @returns The error message. +*/ +declare function getSpecificMessage(reference: TReference, lang?: string): ErrorMessage>> | undefined; +/** +* Deletes a specific error message. +* +* @param reference The identifier reference. +* @param lang The language of the message. +*/ +declare function deleteSpecificMessage(reference: Reference, lang?: string): void; +//#endregion +//#region src/utils/_addIssue/_addIssue.d.ts +/** +* Context type. +*/ +type Context = BaseSchema> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync>; +/** +* Other interface. +*/ +interface Other { + input?: unknown | undefined; + expected?: string | undefined; + received?: string | undefined; + message?: ErrorMessage> | undefined; + path?: [IssuePathItem, ...IssuePathItem[]] | undefined; + issues?: [BaseIssue>, ...BaseIssue>[]] | undefined; +} +/** +* Adds an issue to the dataset. +* +* @param context The issue context. +* @param label The issue label. +* @param dataset The input dataset. +* @param config The configuration. +* @param other The optional props. +* +* @internal +*/ +declare function _addIssue(context: TContext & { + expects?: string | null; + requirement?: unknown; + message?: ErrorMessage, { + type: TContext["type"]; + }>> | undefined; +}, label: string, dataset: UnknownDataset | OutputDataset>, config: Config>, other?: Other): void; +//#endregion +//#region src/utils/_cloneDataset/_cloneDataset.d.ts +/** +* Creates a shallow copy of a dataset. +* +* Hint: The `value` is copied by reference, but the `issues` array is cloned +* to avoid reusing mutable dataset state across multiple runs. Mutating a +* returned object or array value can therefore affect later cache hits that +* reuse the same cached output. +* +* @param dataset The output dataset. +* +* @returns The copied output dataset. +*/ +declare function _cloneDataset>(dataset: OutputDataset): OutputDataset; +//#endregion +//#region src/utils/_formatCase/_formatCase.d.ts +/** +* Splits a string into lowercase words and rejoins them with the given +* separator and capitalization rules. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. Whether the first or subsequent words are +* capitalized is controlled by `capFirst` and `capRest`. +* +* Hint: Implemented in a single pass that emits directly to the result +* string to avoid an intermediate `string[]` allocation. ASCII chars are +* classified via char codes to skip `.toLowerCase()` and `.toUpperCase()` +* method calls in the common case. +* +* Hint: Digits are treated as a separate character class, so `item2Name` +* yields `item2` and `name` rather than `item`, `2` and `name`. +* +* @param input The input string. +* @param separator The string inserted between words. +* @param capFirst Whether to capitalize the first word. +* @param capRest Whether to capitalize subsequent words. +* +* @returns The formatted string. +* +* @internal +*/ +declare function _formatCase(input: string, separator: string, capFirst: boolean, capRest: boolean): string; +//#endregion +//#region src/utils/_getByteCount/_getByteCount.d.ts +/** +* Returns the byte count of the input. +* +* @param input The input to be measured. +* +* @returns The byte count. +* +* @internal +*/ +declare function _getByteCount(input: string): number; +//#endregion +//#region src/utils/_getGraphemeCount/_getGraphemeCount.d.ts +/** +* Returns the grapheme count of the input. +* +* @param input The input to be measured. +* +* @returns The grapheme count. +* +* @internal +*/ +declare function _getGraphemeCount(input: string): number; +//#endregion +//#region src/utils/_getLastMetadata/_getLastMetadata.d.ts +/** +* Metadata action type. +*/ +type MetadataAction$1 = TitleAction | DescriptionAction; +/** +* Schema type. +*/ +type Schema$1 = BaseSchema> | BaseSchemaAsync> | SchemaWithPipe>, ...(PipeItem> | MetadataAction$1)[]]> | SchemaWithPipeAsync> | BaseSchemaAsync>), ...(PipeItem> | PipeItemAsync> | MetadataAction$1)[]]>; +/** +* Returns the last top-level value of a given metadata type from a schema +* using a breadth-first search that starts with the last item in the pipeline. +* +* @param schema The schema to search. +* @param type The metadata type. +* +* @returns The value, if any. +* +* @internal +*/ +declare function _getLastMetadata(schema: Schema$1, type: "title" | "description"): string | undefined; +//#endregion +//#region src/utils/_getStandardProps/_getStandardProps.d.ts +/** +* Returns the Standard Schema properties. +* +* @param context The schema context. +* +* @returns The Standard Schema properties. +*/ +declare function _getStandardProps> | BaseSchemaAsync>>(context: TSchema): StandardProps, InferOutput>; +//#endregion +//#region src/utils/_getWordCount/_getWordCount.d.ts +/** +* Returns the word count of the input. +* +* @param locales The locales to be used. +* @param input The input to be measured. +* +* @returns The word count. +* +* @internal +*/ +declare function _getWordCount(locales: Intl.LocalesArgument, input: string): number; +//#endregion +//#region src/utils/_isLuhnAlgo/_isLuhnAlgo.d.ts +/** +* Checks whether a string with numbers corresponds to the luhn algorithm. +* +* @param input The input to be checked. +* +* @returns Whether input is valid. +* +* @internal +*/ +declare function _isLuhnAlgo(input: string): boolean; +//#endregion +//#region src/utils/_isValidObjectKey/_isValidObjectKey.d.ts +/** +* Disallows inherited object properties and prevents object prototype +* pollution by disallowing certain keys. +* +* @param object The object to check. +* @param key The key to check. +* +* @returns Whether the key is allowed. +* +* @internal +*/ +declare function _isValidObjectKey(object: object, key: string): boolean; +//#endregion +//#region src/utils/_joinExpects/_joinExpects.d.ts +/** +* Joins multiple `expects` values with the given separator. +* +* @param values The `expects` values. +* @param separator The separator. +* +* @returns The joined `expects` property. +* +* @internal +*/ +declare function _joinExpects(values: string[], separator: "&" | "|"): string; +//#endregion +//#region src/utils/_stringify/_stringify.d.ts +/** +* Stringifies an unknown input to a literal or type string. +* +* @param input The unknown input. +* +* @returns A literal or type string. +* +* @internal +*/ +declare function _stringify(input: unknown): string; +//#endregion +//#region src/utils/entriesFromList/entriesFromList.d.ts +/** +* Creates an object entries definition from a list of keys and a schema. +* +* @param list A list of keys. +* @param schema The schema of the keys. +* +* @returns The object entries. +*/ +declare function entriesFromList> | BaseSchemaAsync>>(list: TList, schema: TSchema): Record; +//#endregion +//#region src/utils/entriesFromObjects/entriesFromObjects.d.ts +/** +* Schema type. +*/ +type Schema = LooseObjectSchema | undefined> | LooseObjectSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined>; +/** +* Recursive merge type. +*/ +type RecursiveMerge = TSchemas extends readonly [infer TFirstSchema extends Schema] ? TFirstSchema["entries"] : TSchemas extends readonly [infer TFirstSchema extends Schema, ...infer TRestSchemas extends readonly [Schema, ...Schema[]]] ? Merge> : never; +/** +* Merged entries types. +*/ +type MergedEntries = Prettify>; +/** +* Creates a new object entries definition from existing object schemas. +* +* @param schemas The schemas to merge the entries from. +* +* @returns The object entries from the schemas. +*/ +declare function entriesFromObjects(schemas: TSchemas): MergedEntries; +//#endregion +//#region src/utils/getDotPath/getDotPath.d.ts +/** +* Creates and returns the dot path of an issue if possible. +* +* @param issue The issue to get the dot path from. +* +* @returns The dot path or null. +*/ +declare function getDotPath(issue: BaseIssue): string | null; +/** +* Creates and returns the dot path of an issue if possible. +* +* @param issue The issue to get the dot path from. +* +* @returns The dot path or null. +*/ +declare function getDotPath> | BaseSchemaAsync>>(issue: InferIssue): IssueDotPath | null; +//#endregion +//#region src/utils/isOfKind/isOfKind.d.ts +/** +* A generic type guard to check the kind of an object. +* +* @param kind The kind to check for. +* @param object The object to check. +* +* @returns Whether it matches. +*/ +declare function isOfKind(kind: TKind, object: TObject): object is Extract; +//#endregion +//#region src/utils/isOfType/isOfType.d.ts +/** +* A generic type guard to check the type of an object. +* +* @param type The type to check for. +* @param object The object to check. +* +* @returns Whether it matches. +*/ +declare function isOfType(type: TType, object: TObject): object is Extract; +//#endregion +//#region src/utils/isValiError/isValiError.d.ts +/** +* A type guard to check if an error is a ValiError. +* +* @param error The error to check. +* +* @returns Whether its a ValiError. +*/ +declare function isValiError> | BaseSchemaAsync>>(error: unknown): error is ValiError; +//#endregion +//#region src/utils/ValiError/ValiError.d.ts +/** +* A Valibot error with useful information. +*/ +declare class ValiError> | BaseSchemaAsync>> extends Error { + /** + * The error issues. + */ + readonly issues: [InferIssue, ...InferIssue[]]; + /** + * Creates a Valibot error with useful information. + * + * @param issues The error issues. + */ + constructor(issues: [InferIssue, ...InferIssue[]]); +} +//#endregion +export { AnySchema, ArgsAction, ArgsActionAsync, ArrayInput, ArrayIssue, type ArrayPathItem, ArrayRequirement, ArrayRequirementAsync, ArraySchema, ArraySchemaAsync, AwaitActionAsync, BASE64_REGEX, BIC_REGEX, Base64Action, Base64Issue, type BaseIssue, type BaseMetadata, type BaseSchema, type BaseSchemaAsync, type BaseTransformation, type BaseTransformationAsync, type BaseValidation, type BaseValidationAsync, BicAction, BicIssue, BigintIssue, BigintSchema, BlobIssue, BlobSchema, BooleanIssue, BooleanSchema, Brand, BrandAction, BrandName, BrandSymbol, BytesAction, BytesIssue, CUID2_REGEX, Cache, CacheConfig, CheckAction, CheckActionAsync, CheckIssue, CheckItemsAction, CheckItemsActionAsync, CheckItemsIssue, Class, type Config, ContentInput, ContentRequirement, CreditCardAction, CreditCardIssue, Cuid2Action, Cuid2Issue, CustomIssue, CustomSchema, CustomSchemaAsync, DECIMAL_REGEX, DIGITS_REGEX, DOMAIN_REGEX, DateIssue, DateSchema, DecimalAction, DecimalIssue, type Default, type DefaultAsync, type DefaultValue, DescriptionAction, DigitsAction, DigitsIssue, DomainAction, DomainIssue, EMAIL_REGEX, EMOJI_REGEX, EmailAction, EmailIssue, EmojiAction, EmojiIssue, EmptyAction, EmptyIssue, EndsWithAction, EndsWithIssue, EntriesAction, EntriesInput, EntriesIssue, Enum, EnumIssue, EnumSchema, EnumValues, type ErrorMessage, EveryItemAction, EveryItemIssue, ExactOptionalSchema, ExactOptionalSchemaAsync, ExamplesAction, ExcludesAction, ExcludesIssue, type FailureDataset, Fallback, FallbackAsync, FileIssue, FileSchema, FilterItemsAction, FindItemAction, FiniteAction, FiniteIssue, FlatErrors, Flavor, FlavorAction, FlavorName, FlavorSymbol, FunctionIssue, FunctionSchema, type GenericIssue, type GenericMetadata, type GenericPipeAction, type GenericPipeActionAsync, type GenericPipeItem, type GenericPipeItemAsync, type GenericSchema, type GenericSchemaAsync, type GenericTransformation, type GenericTransformationAsync, type GenericValidation, type GenericValidationAsync, GlobalConfig, GraphemesAction, GraphemesIssue, GtValueAction, GtValueIssue, GuardAction, GuardFunction, GuardIssue, HEXADECIMAL_REGEX, HEX_COLOR_REGEX, HashAction, HashIssue, HashType, HexColorAction, HexColorIssue, HexadecimalAction, HexadecimalIssue, IMEI_REGEX, IPV4_REGEX, IPV6_REGEX, IP_REGEX, ISO_DATE_REGEX, ISO_DATE_TIME_REGEX, ISO_DATE_TIME_SECOND_REGEX, ISO_TIMESTAMP_REGEX, ISO_TIME_REGEX, ISO_TIME_SECOND_REGEX, ISO_WEEK_REGEX, ISRC_REGEX, ImeiAction, ImeiIssue, IncludesAction, IncludesIssue, InferDefault, InferDefaults, InferExamples, InferFallback, InferFallbacks, InferGuardOutput, type InferInput, type InferIssue, InferMetadata, type InferOutput, InstanceIssue, InstanceSchema, IntegerAction, IntegerIssue, IntersectIssue, IntersectOptions, IntersectOptionsAsync, IntersectSchema, IntersectSchemaAsync, IpAction, IpIssue, Ipv4Action, Ipv4Issue, Ipv6Action, Ipv6Issue, IsbnAction, IsbnIssue, IsoDateAction, IsoDateIssue, IsoDateTimeAction, IsoDateTimeIssue, IsoDateTimeSecondAction, IsoDateTimeSecondIssue, IsoTimeAction, IsoTimeIssue, IsoTimeSecondAction, IsoTimeSecondIssue, IsoTimestampAction, IsoTimestampIssue, IsoWeekAction, IsoWeekIssue, IsrcAction, IsrcIssue, type IssueDotPath, type IssuePathItem, JWS_COMPACT_REGEX, JwsCompactAction, JwsCompactIssue, LazySchema, LazySchemaAsync, LengthAction, LengthInput, LengthIssue, Literal, LiteralIssue, LiteralSchema, LooseObjectIssue, LooseObjectSchema, LooseObjectSchemaAsync, LooseTupleIssue, LooseTupleSchema, LooseTupleSchemaAsync, LtValueAction, LtValueIssue, MAC48_REGEX, MAC64_REGEX, MAC_REGEX, Mac48Action, Mac48Issue, Mac64Action, Mac64Issue, MacAction, MacIssue, MapIssue, MapItemsAction, type MapPathItem, MapSchema, MapSchemaAsync, MaxBytesAction, MaxBytesIssue, MaxEntriesAction, MaxEntriesIssue, MaxGraphemesAction, MaxGraphemesIssue, MaxLengthAction, MaxLengthIssue, MaxSizeAction, MaxSizeIssue, MaxValueAction, MaxValueIssue, MaxWordsAction, MaxWordsIssue, MetadataAction, MimeTypeAction, MimeTypeIssue, MinBytesAction, MinBytesIssue, MinEntriesAction, MinEntriesIssue, MinGraphemesAction, MinGraphemesIssue, MinLengthAction, MinLengthIssue, MinSizeAction, MinSizeIssue, MinValueAction, MinValueIssue, MinWordsAction, MinWordsIssue, MultipleOfAction, MultipleOfIssue, NANO_ID_REGEX, NanIssue, NanSchema, NanoIDAction, NanoIDIssue, NanoIdAction, NanoIdIssue, NeverIssue, NeverSchema, NonEmptyAction, NonEmptyIssue, NonNullableIssue, NonNullableSchema, NonNullableSchemaAsync, NonNullishIssue, NonNullishSchema, NonNullishSchemaAsync, NonOptionalIssue, NonOptionalSchema, NonOptionalSchemaAsync, NormalizeAction, NormalizeForm, NotBytesAction, NotBytesIssue, NotEntriesAction, NotEntriesIssue, NotGraphemesAction, NotGraphemesIssue, NotLengthAction, NotLengthIssue, NotSizeAction, NotSizeIssue, NotValueAction, NotValueIssue, NotValuesAction, NotValuesIssue, NotWordsAction, NotWordsIssue, NullIssue, NullSchema, NullableSchema, NullableSchemaAsync, NullishSchema, NullishSchemaAsync, NumberIssue, NumberSchema, OCTAL_REGEX, type ObjectEntries, type ObjectEntriesAsync, ObjectIssue, type ObjectKeys, type ObjectPathItem, ObjectSchema, ObjectSchemaAsync, ObjectWithRestIssue, ObjectWithRestSchema, ObjectWithRestSchemaAsync, OctalAction, OctalIssue, OptionalSchema, OptionalSchemaAsync, type OutputDataset, ParseBooleanAction, ParseBooleanConfig, ParseBooleanIssue, ParseJsonAction, ParseJsonConfig, ParseJsonIssue, Parser, ParserAsync, PartialCheckAction, PartialCheckActionAsync, PartialCheckIssue, type PartialDataset, PicklistIssue, PicklistOptions, PicklistSchema, type PipeAction, type PipeActionAsync, type PipeItem, type PipeItemAsync, PromiseIssue, PromiseSchema, RFC_EMAIL_REGEX, RawCheckAction, RawCheckActionAsync, RawCheckAddIssue, RawCheckContext, RawCheckIssue, RawCheckIssueInfo, RawTransformAction, RawTransformActionAsync, RawTransformAddIssue, RawTransformContext, RawTransformIssue, RawTransformIssueInfo, ReadonlyAction, RecordIssue, RecordSchema, RecordSchemaAsync, ReduceItemsAction, RegexAction, RegexIssue, ReturnsAction, ReturnsActionAsync, RfcEmailAction, RfcEmailIssue, SLUG_REGEX, SafeIntegerAction, SafeIntegerIssue, SafeParseResult, SafeParser, SafeParserAsync, SchemaWithCache, SchemaWithCacheAsync, SchemaWithFallback, SchemaWithFallbackAsync, SchemaWithOmit, SchemaWithPartial, SchemaWithPartialAsync, SchemaWithPick, SchemaWithPipe, SchemaWithPipeAsync, SchemaWithRequired, SchemaWithRequiredAsync, type SchemaWithoutPipe, SetIssue, type SetPathItem, SetSchema, SetSchemaAsync, SizeAction, SizeInput, SizeIssue, SlugAction, SlugIssue, SomeItemAction, SomeItemIssue, SortItemsAction, type StandardProps, StartsWithAction, StartsWithIssue, StrictObjectIssue, StrictObjectSchema, StrictObjectSchemaAsync, StrictTupleIssue, StrictTupleSchema, StrictTupleSchemaAsync, StringIssue, StringSchema, StringifyJsonAction, StringifyJsonConfig, StringifyJsonIssue, type SuccessDataset, SymbolIssue, SymbolSchema, TitleAction, ToBigintAction, ToBigintIssue, ToBooleanAction, ToCamelCaseAction, ToDateAction, ToDateIssue, ToKebabCaseAction, ToLowerCaseAction, ToMaxValueAction, ToMinValueAction, ToNumberAction, ToNumberIssue, ToPascalCaseAction, ToSnakeCaseAction, ToStringAction, ToStringIssue, ToUpperCaseAction, TransformAction, TransformActionAsync, TrimAction, TrimEndAction, TrimStartAction, TupleIssue, type TupleItems, type TupleItemsAsync, TupleSchema, TupleSchemaAsync, TupleWithRestIssue, TupleWithRestSchema, TupleWithRestSchemaAsync, ULID_REGEX, UUID_REGEX, UlidAction, UlidIssue, UndefinedIssue, UndefinedSchema, UndefinedableSchema, UndefinedableSchemaAsync, UnionIssue, UnionOptions, UnionOptionsAsync, UnionSchema, UnionSchemaAsync, type UnknownDataset, type UnknownPathItem, UnknownSchema, UrlAction, UrlIssue, UuidAction, UuidIssue, ValiError, ValueAction, ValueInput, ValueIssue, ValuesAction, ValuesIssue, VariantIssue, VariantOptions, VariantOptionsAsync, VariantSchema, VariantSchemaAsync, VoidIssue, VoidSchema, WordsAction, WordsIssue, _addIssue, _cloneDataset, _formatCase, _getByteCount, _getGraphemeCount, _getLastMetadata, _getStandardProps, _getWordCount, _isLuhnAlgo, _isValidObjectKey, _joinExpects, _stringify, any, args, argsAsync, array, arrayAsync, assert, awaitAsync, base64, bic, bigint, blob, boolean, brand, bytes, cache, cacheAsync, check, checkAsync, checkItems, checkItemsAsync, config, creditCard, cuid2, custom, customAsync, date, decimal, deleteGlobalConfig, deleteGlobalMessage, deleteSchemaMessage, deleteSpecificMessage, description, digits, domain, email, emoji, empty, endsWith, entries, entriesFromList, entriesFromObjects, enum_ as enum, enum_, everyItem, exactOptional, exactOptionalAsync, examples, excludes, fallback, fallbackAsync, file, filterItems, findItem, finite, flatten, flavor, forward, forwardAsync, function_ as function, function_, getDefault, getDefaults, getDefaultsAsync, getDescription, getDotPath, getExamples, getFallback, getFallbacks, getFallbacksAsync, getGlobalConfig, getGlobalMessage, getMetadata, getSchemaMessage, getSpecificMessage, getTitle, graphemes, gtValue, guard, hash, hexColor, hexadecimal, imei, includes, instance, integer, intersect, intersectAsync, ip, ipv4, ipv6, is, isOfKind, isOfType, isValiError, isbn, isoDate, isoDateTime, isoDateTimeSecond, isoTime, isoTimeSecond, isoTimestamp, isoWeek, isrc, jwsCompact, keyof, lazy, lazyAsync, length, literal, looseObject, looseObjectAsync, looseTuple, looseTupleAsync, ltValue, mac, mac48, mac64, map, mapAsync, mapItems, maxBytes, maxEntries, maxGraphemes, maxLength, maxSize, maxValue, maxWords, message, metadata, mimeType, minBytes, minEntries, minGraphemes, minLength, minSize, minValue, minWords, multipleOf, nan, nanoid, never, nonEmpty, nonNullable, nonNullableAsync, nonNullish, nonNullishAsync, nonOptional, nonOptionalAsync, normalize, notBytes, notEntries, notGraphemes, notLength, notSize, notValue, notValues, notWords, null_ as null, null_, nullable, nullableAsync, nullish, nullishAsync, number, object, objectAsync, objectWithRest, objectWithRestAsync, octal, omit, optional, optionalAsync, parse, parseAsync, parseBoolean, parseJson, parser, parserAsync, partial, partialAsync, partialCheck, partialCheckAsync, pick, picklist, pipe, pipeAsync, promise, rawCheck, rawCheckAsync, rawTransform, rawTransformAsync, readonly, record, recordAsync, reduceItems, regex, required, requiredAsync, returns, returnsAsync, rfcEmail, safeInteger, safeParse, safeParseAsync, safeParser, safeParserAsync, set, setAsync, setGlobalConfig, setGlobalMessage, setSchemaMessage, setSpecificMessage, size, slug, someItem, sortItems, startsWith, strictObject, strictObjectAsync, strictTuple, strictTupleAsync, string, stringifyJson, summarize, symbol, title, toBigint, toBoolean, toCamelCase, toDate, toKebabCase, toLowerCase, toMaxValue, toMinValue, toNumber, toPascalCase, toSnakeCase, toString, toUpperCase, transform, transformAsync, trim, trimEnd, trimStart, tuple, tupleAsync, tupleWithRest, tupleWithRestAsync, ulid, undefined_ as undefined, undefined_, undefinedable, undefinedableAsync, union, unionAsync, unknown, unwrap, url, uuid, value, values, variant, variantAsync, void_ as void, void_, words }; \ No newline at end of file diff --git a/tools/ui/node_modules/valibot/dist/index.d.mts b/tools/ui/node_modules/valibot/dist/index.d.mts new file mode 100644 index 0000000000000000000000000000000000000000..f6978d3acc62dc8521242602e1c4ae791f62cb5c --- /dev/null +++ b/tools/ui/node_modules/valibot/dist/index.d.mts @@ -0,0 +1,16184 @@ +//#region src/methods/assert/assert.d.ts +/** +* Checks if the input matches the schema. As this is an assertion function, it +* can be used as a type guard. +* +* @param schema The schema to be used. +* @param input The input to be tested. +*/ +declare function assert>>(schema: TSchema, input: unknown): asserts input is InferInput; +//#endregion +//#region src/methods/cache/types.d.ts +/** +* Cache interface type. +* +* @beta +*/ +interface Cache { + /** + * Creates a cache key from input and config. + * + * Hint: Primitive inputs are keyed by value. Object and function inputs are + * keyed by reference identity. + */ + key(input: unknown, config?: Config>): string; + /** + * Gets a value from the cache by key. + */ + get(key: string): TValue$1 | undefined; + /** + * Sets a value in the cache by key. + */ + set(key: string, value: TValue$1): void; + /** + * Clears all entries from the cache. + */ + clear(): void; +} +/** +* Cache config type. +* +* @beta +*/ +interface CacheConfig { + /** + * The maximum number of items to cache. + * + * @default 1000 + */ + maxSize?: number; + /** + * The maximum age of a cache entry in milliseconds. + * + * @default Infinity + */ + maxAge?: number; +} +//#endregion +//#region src/methods/cache/cache.d.ts +/** +* Schema with cache type. +* +* @beta +*/ +type SchemaWithCache>, TCacheConfig extends CacheConfig | undefined> = TSchema & { + /** + * The cache config. + */ + readonly cacheConfig: TCacheConfig; + /** + * The cache instance. + */ + readonly cache: Cache, InferIssue>>; +}; +/** +* Caches the output of a schema. +* +* Hint: Primitive inputs are cached by value. Object and function inputs are +* cached by reference identity, so mutating input objects and reusing the same +* reference can return a stale cached dataset. Returned objects are also +* reused by reference, so mutating cached output can affect later cache hits. +* +* @param schema The schema to cache. +* +* @returns The cached schema. +* +* @beta +*/ +declare function cache>>(schema: TSchema): SchemaWithCache; +/** +* Caches the output of a schema. +* +* Hint: Primitive inputs are cached by value. Object and function inputs are +* cached by reference identity, so mutating input objects and reusing the same +* reference can return a stale cached dataset. Returned objects are also +* reused by reference, so mutating cached output can affect later cache hits. +* +* @param schema The schema to cache. +* @param config The cache config. +* +* @returns The cached schema. +* +* @beta +*/ +declare function cache>, const TCacheConfig extends CacheConfig | undefined>(schema: TSchema, config: TCacheConfig): SchemaWithCache; +//#endregion +//#region src/methods/cache/cacheAsync.d.ts +/** +* Schema with cache async type. +* +* @beta +*/ +type SchemaWithCacheAsync> | BaseSchemaAsync>, TCacheConfig extends CacheConfig | undefined> = Omit & { + /** + * Whether it's async. + */ + readonly async: true; + /** + * The cache config. + */ + readonly cacheConfig: TCacheConfig; + /** + * The cache instance. + */ + readonly cache: Cache, InferIssue>>; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps, InferOutput>; + /** + * Parses unknown input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise, InferIssue>>; +}; +/** +* Caches the output of a schema. +* +* Hint: Primitive inputs are cached by value. Object and function inputs are +* cached by reference identity, so mutating input objects and reusing the same +* reference can return a stale cached dataset. Returned objects are also +* reused by reference, so mutating cached output can affect later cache hits. +* +* @param schema The schema to cache. +* +* @returns The cached schema. +* +* @beta +*/ +declare function cacheAsync> | BaseSchemaAsync>>(schema: TSchema): SchemaWithCacheAsync; +/** +* Caches the output of a schema. +* +* Hint: Primitive inputs are cached by value. Object and function inputs are +* cached by reference identity, so mutating input objects and reusing the same +* reference can return a stale cached dataset. Returned objects are also +* reused by reference, so mutating cached output can affect later cache hits. +* +* @param schema The schema to cache. +* @param config The cache config. +* +* @returns The cached schema. +* +* @beta +*/ +declare function cacheAsync> | BaseSchemaAsync>, const TCacheConfig extends CacheConfig | undefined>(schema: TSchema, config: TCacheConfig): SchemaWithCacheAsync; +//#endregion +//#region src/methods/config/config.d.ts +/** +* Changes the local configuration of a schema. +* +* @param schema The schema to configure. +* @param config The parse configuration. +* +* @returns The configured schema. +*/ +declare function config> | BaseSchemaAsync>>(schema: TSchema, config: Config>): TSchema; +//#endregion +//#region src/methods/fallback/fallback.d.ts +/** +* Fallback type. +*/ +type Fallback>> = MaybeDeepReadonly> | ((dataset?: OutputDataset, InferIssue>, config?: Config>) => MaybeDeepReadonly>); +/** +* Schema with fallback type. +*/ +type SchemaWithFallback>, TFallback$1 extends Fallback> = TSchema & { + /** + * The fallback value. + */ + readonly fallback: TFallback$1; +}; +/** +* Returns a fallback value as output if the input does not match the schema. +* +* @param schema The schema to catch. +* @param fallback The fallback value. +* +* @returns The passed schema. +*/ +declare function fallback>, const TFallback$1 extends Fallback>(schema: TSchema, fallback: TFallback$1): SchemaWithFallback; +//#endregion +//#region src/methods/fallback/fallbackAsync.d.ts +/** +* Fallback async type. +*/ +type FallbackAsync> | BaseSchemaAsync>> = MaybeDeepReadonly> | ((dataset?: OutputDataset, InferIssue>, config?: Config>) => MaybePromise>>); +/** +* Schema with fallback async type. +*/ +type SchemaWithFallbackAsync> | BaseSchemaAsync>, TFallback$1 extends FallbackAsync> = Omit & { + /** + * The fallback value. + */ + readonly fallback: TFallback$1; + /** + * Whether it's async. + */ + readonly async: true; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps, InferOutput>; + /** + * Parses unknown input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise, InferIssue>>; +}; +/** +* Returns a fallback value as output if the input does not match the schema. +* +* @param schema The schema to catch. +* @param fallback The fallback value. +* +* @returns The passed schema. +*/ +declare function fallbackAsync> | BaseSchemaAsync>, const TFallback$1 extends FallbackAsync>(schema: TSchema, fallback: TFallback$1): SchemaWithFallbackAsync; +//#endregion +//#region src/methods/flatten/flatten.d.ts +/** +* Flat errors type. +*/ +type FlatErrors> | BaseSchemaAsync> | undefined> = Prettify<{ + /** + * The root errors. + * + * Hint: The error messages of issues without a path that belong to the root + * of the schema are added to this key. + */ + readonly root?: [string, ...string[]]; + /** + * The nested errors. + * + * Hint: The error messages of issues with a path that belong to the nested + * parts of the schema and can be converted to a dot path are added to this + * key. + */ + readonly nested?: Prettify> | BaseSchemaAsync> ? IssueDotPath : string, [string, ...string[]]>>>>; + /** + * The other errors. + * + * Hint: Some issue paths, for example for complex data types like `Set` and + * `Map`, have no key or a key that cannot be converted to a dot path. These + * error messages are added to this key. + */ + readonly other?: [string, ...string[]]; +}>; +/** +* Flatten the error messages of issues. +* +* @param issues The list of issues. +* +* @returns A flat error object. +*/ +declare function flatten(issues: readonly [BaseIssue, ...BaseIssue[]]): FlatErrors; +/** +* Flatten the error messages of issues. +* +* @param issues The list of issues. +* +* @returns A flat error object. +*/ +declare function flatten> | BaseSchemaAsync>>(issues: readonly [InferIssue, ...InferIssue[]]): FlatErrors; +//#endregion +//#region src/methods/forward/types.d.ts +/** +* Extracts the exact keys of a tuple, array or object. +*/ +type KeyOf$1 = IsAny extends true ? never : TValue$1 extends readonly unknown[] ? number extends TValue$1["length"] ? number : { [TKey in keyof TValue$1]: TKey extends `${infer TIndex extends number}` ? TIndex : never }[number] : TValue$1 extends Record ? keyof TValue$1 & (string | number) : never; +/** +* Path type. +*/ +type Path$1 = readonly (string | number)[]; +/** +* Required path type. +*/ +type RequiredPath$1 = readonly [string | number, ...Path$1]; +/** +* Lazily evaluate only the first valid path segment based on the given value. +*/ +type LazyPath$1 = TPathToCheck extends readonly [] ? TValidPath : TPathToCheck extends readonly [infer TFirstKey extends KeyOf$1 & keyof TValue$1, ...infer TPathRest extends Path$1] ? LazyPath$1 : IsNever> extends false ? readonly [...TValidPath, KeyOf$1] : TValidPath; +/** +* Returns the path if valid, otherwise the first possible valid path based on +* the given value. +*/ +type ValidPath$1 | ArrayLike, TPath extends RequiredPath$1> = TPath extends LazyPath$1 ? TPath : LazyPath$1; +//#endregion +//#region src/methods/forward/forward.d.ts +/** +* Forwards the issues of the passed validation action. +* +* @param action The validation action. +* @param path The path to forward the issues to. +* +* @returns The modified action. +*/ +declare function forward | ArrayLike, TIssue extends BaseIssue, const TPath extends RequiredPath$1>(action: BaseValidation, path: ValidPath$1): BaseValidation; +//#endregion +//#region src/methods/forward/forwardAsync.d.ts +/** +* Forwards the issues of the passed validation action. +* +* @param action The validation action. +* @param path The path to forward the issues to. +* +* @returns The modified action. +*/ +declare function forwardAsync | ArrayLike, TIssue extends BaseIssue, const TPath extends RequiredPath$1>(action: BaseValidation | BaseValidationAsync, path: ValidPath$1): BaseValidationAsync; +//#endregion +//#region src/methods/getDefault/getDefault.d.ts +/** +* Schema with default type. +*/ +type SchemaWithDefault = ExactOptionalSchema>, unknown> | NullableSchema>, unknown> | NullishSchema>, unknown> | OptionalSchema>, unknown> | UndefinedableSchema>, unknown>; +/** +* Schema with default async type. +*/ +type SchemaWithDefaultAsync = ExactOptionalSchemaAsync> | BaseSchemaAsync>, unknown> | NullableSchemaAsync> | BaseSchemaAsync>, unknown> | NullishSchemaAsync> | BaseSchemaAsync>, unknown> | OptionalSchemaAsync> | BaseSchemaAsync>, unknown> | UndefinedableSchemaAsync> | BaseSchemaAsync>, unknown>; +/** +* Infer default type. +*/ +type InferDefault> | BaseSchemaAsync> | SchemaWithDefault | SchemaWithDefaultAsync> = TSchema extends SchemaWithDefault | SchemaWithDefaultAsync ? TSchema["default"] extends ((...args: any) => any) ? ReturnType : TSchema["default"] : undefined; +/** +* Returns the default value of the schema. +* +* @param schema The schema to get it from. +* @param dataset The input dataset if available. +* @param config The config if available. +* +* @returns The default value. +*/ +declare function getDefault> | BaseSchemaAsync>>(schema: TSchema, dataset?: UnknownDataset, config?: Config>): InferDefault; +//#endregion +//#region src/methods/getDefaults/types.d.ts +/** +* Infer defaults type. +*/ +type InferDefaults> | BaseSchemaAsync>> = TSchema extends LooseObjectSchema | undefined> | ObjectSchema | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | StrictObjectSchema | undefined> ? { -readonly [TKey in keyof TEntries]: InferDefaults } : TSchema extends LooseObjectSchemaAsync | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchemaAsync | undefined> ? { -readonly [TKey in keyof TEntries]: InferDefaults } : TSchema extends LooseTupleSchema | undefined> | StrictTupleSchema | undefined> | TupleSchema | undefined> | TupleWithRestSchema>, ErrorMessage | undefined> ? { -readonly [TKey in keyof TItems]: InferDefaults } : TSchema extends LooseTupleSchemaAsync | undefined> | StrictTupleSchemaAsync | undefined> | TupleSchemaAsync | undefined> | TupleWithRestSchemaAsync>, ErrorMessage | undefined> ? { -readonly [TKey in keyof TItems]: InferDefaults } : Awaited>; +//#endregion +//#region src/methods/getDefaults/getDefaults.d.ts +/** +* Returns the default values of the schema. +* +* Hint: The difference to `getDefault` is that for object and tuple schemas +* this function recursively returns the default values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The default values. +*/ +declare function getDefaults> | LooseObjectSchema | undefined> | LooseTupleSchema | undefined> | ObjectSchema | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictTupleSchema | undefined> | TupleSchema | undefined> | TupleWithRestSchema>, ErrorMessage | undefined>>(schema: TSchema): InferDefaults; +//#endregion +//#region src/methods/getDefaults/getDefaultsAsync.d.ts +/** +* Returns the default values of the schema. +* +* Hint: The difference to `getDefault` is that for object and tuple schemas +* this function recursively returns the default values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The default values. +*/ +declare function getDefaultsAsync> | BaseSchemaAsync> | LooseObjectSchema | undefined> | LooseObjectSchemaAsync | undefined> | LooseTupleSchema | undefined> | LooseTupleSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined> | StrictTupleSchema | undefined> | StrictTupleSchemaAsync | undefined> | TupleSchema | undefined> | TupleSchemaAsync | undefined> | TupleWithRestSchema>, ErrorMessage | undefined> | TupleWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined>>(schema: TSchema): Promise>; +//#endregion +//#region src/methods/getDescription/getDescription.d.ts +/** +* Schema type. +*/ +type Schema$14 = BaseSchema> | BaseSchemaAsync> | SchemaWithPipe>, ...(PipeItem> | DescriptionAction)[]]> | SchemaWithPipeAsync> | BaseSchemaAsync>), ...(PipeItem> | PipeItemAsync> | DescriptionAction)[]]>; +/** +* Returns the description of the schema. +* +* If multiple descriptions are defined, the last one of the highest level is +* returned. If no description is defined, `undefined` is returned. +* +* @param schema The schema to get the description from. +* +* @returns The description, if any. +* +* @beta +*/ +declare function getDescription(schema: Schema$14): string | undefined; +//#endregion +//#region src/methods/getExamples/getExamples.d.ts +/** +* Schema type. +*/ +type Schema$13 = BaseSchema> | BaseSchemaAsync> | SchemaWithPipe>, ...(PipeItem> | ExamplesAction)[]]> | SchemaWithPipeAsync> | BaseSchemaAsync>), ...(PipeItem> | PipeItemAsync> | ExamplesAction)[]]>; +/** +* Recursively concat type. +*/ +type RecursiveConcat> | PipeItemAsync>)[], TCollectedExamples extends unknown[] = []> = TRootPipe extends readonly [infer TFirstItem, ...infer TPipeRest extends readonly (PipeItem> | PipeItemAsync>)[]] ? TFirstItem extends SchemaWithPipe | SchemaWithPipeAsync ? RecursiveConcat> : TFirstItem extends ExamplesAction ? RecursiveConcat : RecursiveConcat : TCollectedExamples; +/** +* Infer examples type. +*/ +type InferExamples = TSchema extends SchemaWithPipe | SchemaWithPipeAsync ? Readonly> : []; +/** +* Returns the examples of a schema. +* +* If multiple examples are defined, it concatenates them using depth-first +* search. If no examples are defined, an empty array is returned. +* +* @param schema The schema to get the examples from. +* +* @returns The examples, if any. +* +* @beta +*/ +declare function getExamples(schema: TSchema): InferExamples; +//#endregion +//#region src/methods/getFallback/getFallback.d.ts +/** +* Infer fallback type. +*/ +type InferFallback> | BaseSchemaAsync>> = TSchema extends SchemaWithFallback>, infer TFallback> | SchemaWithFallbackAsync> | BaseSchemaAsync>, infer TFallback> ? TFallback extends MaybeDeepReadonly> ? TFallback : TFallback extends (() => MaybePromise>>) ? ReturnType : never : undefined; +/** +* Returns the fallback value of the schema. +* +* @param schema The schema to get it from. +* @param dataset The output dataset if available. +* @param config The config if available. +* +* @returns The fallback value. +*/ +declare function getFallback> | BaseSchemaAsync>>(schema: TSchema, dataset?: OutputDataset, InferIssue>, config?: Config>): InferFallback; +//#endregion +//#region src/methods/getFallbacks/types.d.ts +/** +* Infer fallbacks type. +*/ +type InferFallbacks> | BaseSchemaAsync>> = TSchema extends LooseObjectSchema | undefined> | ObjectSchema | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | StrictObjectSchema | undefined> ? { -readonly [TKey in keyof TEntries]: InferFallbacks } : TSchema extends LooseObjectSchemaAsync | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchemaAsync | undefined> ? { -readonly [TKey in keyof TEntries]: InferFallbacks } : TSchema extends LooseTupleSchema | undefined> | StrictTupleSchema | undefined> | TupleSchema | undefined> | TupleWithRestSchema>, ErrorMessage | undefined> ? { -readonly [TKey in keyof TItems]: InferFallbacks } : TSchema extends LooseTupleSchemaAsync | undefined> | StrictTupleSchemaAsync | undefined> | TupleSchemaAsync | undefined> | TupleWithRestSchemaAsync>, ErrorMessage | undefined> ? { -readonly [TKey in keyof TItems]: InferFallbacks } : Awaited>; +//#endregion +//#region src/methods/getFallbacks/getFallbacks.d.ts +/** +* Returns the fallback values of the schema. +* +* Hint: The difference to `getFallback` is that for object and tuple schemas +* this function recursively returns the fallback values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The fallback values. +*/ +declare function getFallbacks> | LooseObjectSchema | undefined> | LooseTupleSchema | undefined> | ObjectSchema | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictTupleSchema | undefined> | TupleSchema | undefined> | TupleWithRestSchema>, ErrorMessage | undefined>>(schema: TSchema): InferFallbacks; +//#endregion +//#region src/methods/getFallbacks/getFallbacksAsync.d.ts +/** +* Returns the fallback values of the schema. +* +* Hint: The difference to `getFallback` is that for object and tuple schemas +* this function recursively returns the fallback values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The fallback values. +*/ +declare function getFallbacksAsync> | BaseSchemaAsync> | LooseObjectSchema | undefined> | LooseObjectSchemaAsync | undefined> | LooseTupleSchema | undefined> | LooseTupleSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined> | StrictTupleSchema | undefined> | StrictTupleSchemaAsync | undefined> | TupleSchema | undefined> | TupleSchemaAsync | undefined> | TupleWithRestSchema>, ErrorMessage | undefined> | TupleWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined>>(schema: TSchema): Promise>; +//#endregion +//#region src/methods/pipe/pipe.d.ts +/** +* Schema with pipe type. +*/ +type SchemaWithPipe>, ...PipeItem>[]]> = Omit, "pipe" | "~standard" | "~run" | "~types"> & { + /** + * The pipe items. + */ + readonly pipe: TPipe$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferOutput>>; + /** + * Parses unknown input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset>, InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferInput>; + readonly output: InferOutput>; + readonly issue: InferIssue; + } | undefined; +}; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* @param item17 The seventeenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue>, const TItem17 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue>, item17: TItem17 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* @param item17 The seventeenth pipe item. +* @param item18 The eighteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue>, const TItem17 extends PipeItem, unknown, BaseIssue>, const TItem18 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue>, item17: TItem17 | PipeAction, InferOutput, InferIssue>, item18: TItem18 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* @param item17 The seventeenth pipe item. +* @param item18 The eighteenth pipe item. +* @param item19 The nineteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItem1 extends PipeItem, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue>, const TItem17 extends PipeItem, unknown, BaseIssue>, const TItem18 extends PipeItem, unknown, BaseIssue>, const TItem19 extends PipeItem, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue>, item17: TItem17 | PipeAction, InferOutput, InferIssue>, item18: TItem18 | PipeAction, InferOutput, InferIssue>, item19: TItem19 | PipeAction, InferOutput, InferIssue>): SchemaWithPipe; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param items The pipe items. +* +* @returns A schema with a pipeline. +*/ +declare function pipe>, const TItems$1 extends readonly PipeItem, InferOutput, BaseIssue>[]>(schema: TSchema, ...items: TItems$1): SchemaWithPipe; +//#endregion +//#region src/methods/pipe/pipeAsync.d.ts +/** +* Schema with pipe async type. +*/ +type SchemaWithPipeAsync> | BaseSchemaAsync>), ...(PipeItem> | PipeItemAsync>)[]]> = Omit, "async" | "pipe" | "~standard" | "~run" | "~types"> & { + /** + * The pipe items. + */ + readonly pipe: TPipe$1; + /** + * Whether it's async. + */ + readonly async: true; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferOutput>>; + /** + * Parses unknown input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>, InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferInput>; + readonly output: InferOutput>; + readonly issue: InferIssue; + } | undefined; +}; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* @param item17 The seventeenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem17 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item17: TItem17 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* @param item17 The seventeenth pipe item. +* @param item18 The eighteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem17 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem18 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item17: TItem17 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item18: TItem18 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param item1 The first pipe item. +* @param item2 The second pipe item. +* @param item3 The third pipe item. +* @param item4 The fourth pipe item. +* @param item5 The fifth pipe item. +* @param item6 The sixth pipe item. +* @param item7 The seventh pipe item. +* @param item8 The eighth pipe item. +* @param item9 The ninth pipe item. +* @param item10 The tenth pipe item. +* @param item11 The eleventh pipe item. +* @param item12 The twelfth pipe item. +* @param item13 The thirteenth pipe item. +* @param item14 The fourteenth pipe item. +* @param item15 The fifteenth pipe item. +* @param item16 The sixteenth pipe item. +* @param item17 The seventeenth pipe item. +* @param item18 The eighteenth pipe item. +* @param item19 The nineteenth pipe item. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItem1 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem2 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem3 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem4 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem5 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem6 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem7 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem8 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem9 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem10 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem11 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem12 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem13 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem14 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem15 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem16 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem17 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem18 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>, const TItem19 extends PipeItem, unknown, BaseIssue> | PipeItemAsync, unknown, BaseIssue>>(schema: TSchema, item1: TItem1 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item2: TItem2 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item3: TItem3 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item4: TItem4 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item5: TItem5 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item6: TItem6 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item7: TItem7 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item8: TItem8 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item9: TItem9 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item10: TItem10 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item11: TItem11 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item12: TItem12 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item13: TItem13 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item14: TItem14 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item15: TItem15 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item16: TItem16 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item17: TItem17 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item18: TItem18 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>, item19: TItem19 | PipeAction, InferOutput, InferIssue> | PipeActionAsync, InferOutput, InferIssue>): SchemaWithPipeAsync; +/** +* Adds a pipeline to a schema, that can validate and transform its input. +* +* @param schema The root schema. +* @param items The pipe items. +* +* @returns A schema with a pipeline. +*/ +declare function pipeAsync> | BaseSchemaAsync>, const TItems$1 extends readonly (PipeItem, InferOutput, BaseIssue> | PipeItemAsync, InferOutput, BaseIssue>)[]>(schema: TSchema, ...items: TItems$1): SchemaWithPipeAsync; +//#endregion +//#region src/methods/getMetadata/getMetadata.d.ts +/** +* Schema type. +*/ +type Schema$12 = BaseSchema> | BaseSchemaAsync> | SchemaWithPipe>, ...(PipeItem> | MetadataAction>)[]]> | SchemaWithPipeAsync> | BaseSchemaAsync>), ...(PipeItem> | PipeItemAsync> | MetadataAction>)[]]>; +/** +* Basic pipe item type. +*/ +type BasicPipeItem = PipeItem> | PipeItemAsync> | MetadataAction>; +/** +* Recursive merge type. +*/ +type RecursiveMerge$1 = {}> = TRootPipe extends readonly [infer TFirstItem, ...infer TPipeRest extends readonly BasicPipeItem[]] ? TFirstItem extends SchemaWithPipe | SchemaWithPipeAsync ? RecursiveMerge$1> : TFirstItem extends MetadataAction ? RecursiveMerge$1> : RecursiveMerge$1 : TCollectedMetadata; +/** +* Infer metadata type. +* +* @beta +*/ +type InferMetadata = BaseSchema extends TSchema ? Record : BaseSchemaAsync extends TSchema ? Record : TSchema extends SchemaWithPipe | SchemaWithPipeAsync ? Prettify> : {}; +/** +* Returns the metadata of a schema. +* +* If multiple metadata are defined, it shallowly merges them using depth-first +* search. If no metadata is defined, an empty object is returned. +* +* @param schema Schema to get the metadata from. +* +* @returns The metadata, if any. +* +* @beta +*/ +declare function getMetadata(schema: TSchema): InferMetadata; +//#endregion +//#region src/actions/title/title.d.ts +/** +* Title action interface. +*/ +interface TitleAction extends BaseMetadata { + /** + * The action type. + */ + readonly type: "title"; + /** + * The action reference. + */ + readonly reference: typeof title; + /** + * The title text. + */ + readonly title: TTitle; +} +/** +* Creates a title metadata action. +* +* @param title_ The title text. +* +* @returns A title action. +*/ +declare function title(title_: TTitle): TitleAction; +//#endregion +//#region src/methods/getTitle/getTitle.d.ts +/** +* Schema type. +*/ +type Schema$11 = BaseSchema> | BaseSchemaAsync> | SchemaWithPipe>, ...(PipeItem> | TitleAction)[]]> | SchemaWithPipeAsync> | BaseSchemaAsync>), ...(PipeItem> | PipeItemAsync> | TitleAction)[]]>; +/** +* Returns the title of the schema. +* +* If multiple titles are defined, the last one of the highest level is +* returned. If no title is defined, `undefined` is returned. +* +* @param schema The schema to get the title from. +* +* @returns The title, if any. +* +* @beta +*/ +declare function getTitle(schema: Schema$11): string | undefined; +//#endregion +//#region src/methods/is/is.d.ts +/** +* Checks if the input matches the schema. By using a type predicate, this +* function can be used as a type guard. +* +* @param schema The schema to be used. +* @param input The input to be tested. +* +* @returns Whether the input matches the schema. +*/ +declare function is>>(schema: TSchema, input: unknown): input is InferInput; +//#endregion +//#region src/methods/keyof/keyof.d.ts +/** +* Schema type. +*/ +type Schema$10 = LooseObjectSchema | undefined> | LooseObjectSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined>; +/** +* Force tuple type. +*/ +type ForceTuple = T extends [string, ...string[]] ? T : []; +/** +* Object keys type. +*/ +type ObjectKeys$1 = ForceTuple>; +/** +* Creates a picklist schema of object keys. +* +* @param schema The object schema. +* +* @returns A picklist schema. +*/ +declare function keyof(schema: TSchema): PicklistSchema, undefined>; +/** +* Creates a picklist schema of object keys. +* +* @param schema The object schema. +* @param message The error message. +* +* @returns A picklist schema. +*/ +declare function keyof | undefined>(schema: TSchema, message: TMessage): PicklistSchema, TMessage>; +//#endregion +//#region src/methods/message/message.d.ts +/** +* Changes the local message configuration of a schema. +* +* @param schema The schema to configure. +* @param message_ The error message. +* +* @returns The configured schema. +*/ +declare function message> | BaseSchemaAsync>>(schema: TSchema, message_: ErrorMessage>): TSchema; +//#endregion +//#region src/methods/omit/omit.d.ts +/** +* Schema type. +*/ +type Schema$9 = SchemaWithoutPipe | undefined> | LooseObjectSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined>>; +/** +* Schema with omit type. +*/ +type SchemaWithOmit> = TSchema extends ObjectSchema | undefined> | StrictObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Omit; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset>, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends ObjectSchemaAsync | undefined> | StrictObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Omit; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends LooseObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Omit; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectInput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: unknown; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends LooseObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Omit; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectInput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: unknown; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends ObjectWithRestSchema>, ErrorMessage | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Omit; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: InferOutput; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue; + } | undefined; +} : TSchema extends ObjectWithRestSchemaAsync>, ErrorMessage | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Omit; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: InferOutput; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue; + } | undefined; +} : never; +/** +* Creates a modified copy of an object schema that does not contain the +* selected entries. +* +* @param schema The schema to omit from. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +declare function omit>(schema: TSchema, keys: TKeys): SchemaWithOmit; +//#endregion +//#region src/methods/parse/parse.d.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parsed input. +*/ +declare function parse>>(schema: TSchema, input: unknown, config?: Config>): InferOutput; +//#endregion +//#region src/methods/parse/parseAsync.d.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parsed input. +*/ +declare function parseAsync> | BaseSchemaAsync>>(schema: TSchema, input: unknown, config?: Config>): Promise>; +//#endregion +//#region src/methods/parser/parser.d.ts +/** +* The parser interface. +*/ +interface Parser>, TConfig extends Config> | undefined> { + /** + * Parses an unknown input based on the schema. + */ + (input: unknown): InferOutput; + /** + * The schema to be used. + */ + readonly schema: TSchema; + /** + * The parser configuration. + */ + readonly config: TConfig; +} +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* +* @returns The parser function. +*/ +declare function parser>>(schema: TSchema): Parser; +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param config The parser configuration. +* +* @returns The parser function. +*/ +declare function parser>, const TConfig extends Config> | undefined>(schema: TSchema, config: TConfig): Parser; +//#endregion +//#region src/methods/parser/parserAsync.d.ts +/** +* The parser async interface. +*/ +interface ParserAsync> | BaseSchemaAsync>, TConfig extends Config> | undefined> { + /** + * Parses an unknown input based on the schema. + */ + (input: unknown): Promise>; + /** + * The schema to be used. + */ + readonly schema: TSchema; + /** + * The parser configuration. + */ + readonly config: TConfig; +} +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* +* @returns The parser function. +*/ +declare function parserAsync> | BaseSchemaAsync>>(schema: TSchema): ParserAsync; +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param config The parser configuration. +* +* @returns The parser function. +*/ +declare function parserAsync> | BaseSchemaAsync>, const TConfig extends Config> | undefined>(schema: TSchema, config: TConfig): ParserAsync; +//#endregion +//#region src/methods/partial/partial.d.ts +/** +* Schema type. +*/ +type Schema$8 = SchemaWithoutPipe | undefined> | ObjectSchema | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | StrictObjectSchema | undefined>>; +/** +* Partial entries type. +*/ +type PartialEntries$1 = { [TKey in keyof TEntries$1]: TKeys extends readonly (keyof TEntries$1)[] ? TKey extends TKeys[number] ? OptionalSchema : TEntries$1[TKey] : OptionalSchema }; +/** +* Schema with partial type. +*/ +type SchemaWithPartial | undefined> = TSchema extends ObjectSchema | undefined> | StrictObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: PartialEntries$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset>, InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: InferIssue; + } | undefined; +} : TSchema extends LooseObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: PartialEntries$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectOutput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: unknown; + }, InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: InferIssue; + } | undefined; +} : TSchema extends ObjectWithRestSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: PartialEntries$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: InferOutput; + }, InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: InferIssue; + } | undefined; +} : never; +/** +* Creates a modified copy of an object schema that marks all entries as optional. +* +* @param schema The schema to modify. +* +* @returns An object schema. +*/ +declare function partial(schema: TSchema): SchemaWithPartial; +/** +* Creates a modified copy of an object schema that marks the selected entries +* as optional. +* +* @param schema The schema to modify. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +declare function partial>(schema: TSchema, keys: TKeys): SchemaWithPartial; +//#endregion +//#region src/methods/partial/partialAsync.d.ts +/** +* Schema type. +*/ +type Schema$7 = SchemaWithoutPipe | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchemaAsync | undefined>>; +/** +* Partial entries type. +*/ +type PartialEntries = { [TKey in keyof TEntries$1]: TKeys extends readonly (keyof TEntries$1)[] ? TKey extends TKeys[number] ? OptionalSchemaAsync : TEntries$1[TKey] : OptionalSchemaAsync }; +/** +* Schema with partial type. +*/ +type SchemaWithPartialAsync | undefined> = TSchema extends ObjectSchemaAsync | undefined> | StrictObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: PartialEntries; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>, InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: InferIssue; + } | undefined; +} : TSchema extends LooseObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: PartialEntries; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectOutput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: unknown; + }, InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: InferIssue; + } | undefined; +} : TSchema extends ObjectWithRestSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: PartialEntries; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: InferOutput; + }, InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: InferIssue; + } | undefined; +} : never; +/** +* Creates a modified copy of an object schema that marks all entries as optional. +* +* @param schema The schema to modify. +* +* @returns An object schema. +*/ +declare function partialAsync(schema: TSchema): SchemaWithPartialAsync; +/** +* Creates a modified copy of an object schema that marks the selected entries +* as optional. +* +* @param schema The schema to modify. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +declare function partialAsync>(schema: TSchema, keys: TKeys): SchemaWithPartialAsync; +//#endregion +//#region src/methods/pick/pick.d.ts +/** +* The schema type. +*/ +type Schema$6 = SchemaWithoutPipe | undefined> | LooseObjectSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined>>; +/** +* Schema with pick type. +*/ +type SchemaWithPick> = TSchema extends ObjectSchema | undefined> | StrictObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Pick; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset>, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends ObjectSchemaAsync | undefined> | StrictObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Pick; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends LooseObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Pick; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectOutput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: unknown; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends LooseObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Pick; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectOutput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: unknown; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue>; + } | undefined; +} : TSchema extends ObjectWithRestSchema>, ErrorMessage | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Pick; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: InferOutput; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue; + } | undefined; +} : TSchema extends ObjectWithRestSchemaAsync>, ErrorMessage | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: Pick; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: InferOutput; + }, Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: Extract, { + type: TSchema["type"]; + }> | InferObjectIssue> | InferIssue; + } | undefined; +} : never; +/** +* Creates a modified copy of an object schema that contains only the selected +* entries. +* +* @param schema The schema to pick from. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +declare function pick>(schema: TSchema, keys: TKeys): SchemaWithPick; +//#endregion +//#region src/methods/required/required.d.ts +/** +* Schema type. +*/ +type Schema$5 = SchemaWithoutPipe | undefined> | ObjectSchema | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | StrictObjectSchema | undefined>>; +/** +* Required entries type. +*/ +type RequiredEntries$1 | undefined> = { [TKey in keyof TEntries$1]: TKeys extends readonly (keyof TEntries$1)[] ? TKey extends TKeys[number] ? NonOptionalSchema : TEntries$1[TKey] : NonOptionalSchema }; +/** +* Schema with required type. +*/ +type SchemaWithRequired | undefined, TMessage extends ErrorMessage | undefined> = TSchema extends ObjectSchema | undefined> | StrictObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: RequiredEntries$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset>, NonOptionalIssue | InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: NonOptionalIssue | InferIssue; + } | undefined; +} : TSchema extends LooseObjectSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: RequiredEntries$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectOutput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: unknown; + }, NonOptionalIssue | InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: NonOptionalIssue | InferIssue; + } | undefined; +} : TSchema extends ObjectWithRestSchema | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: RequiredEntries$1; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset> & { + [key: string]: InferOutput; + }, NonOptionalIssue | InferIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: NonOptionalIssue | InferIssue; + } | undefined; +} : never; +/** +* Creates a modified copy of an object schema that marks all entries as required. +* +* @param schema The schema to modify. +* +* @returns An object schema. +*/ +declare function required(schema: TSchema): SchemaWithRequired; +/** +* Creates a modified copy of an object schema that marks all entries as required. +* +* @param schema The schema to modify. +* @param message The error message. +* +* @returns An object schema. +*/ +declare function required | undefined>(schema: TSchema, message: TMessage): SchemaWithRequired; +/** +* Creates a modified copy of an object schema that marks the selected entries +* as required. +* +* @param schema The schema to modify. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +declare function required>(schema: TSchema, keys: TKeys): SchemaWithRequired; +/** +* Creates a modified copy of an object schema that marks the selected entries +* as required. +* +* @param schema The schema to modify. +* @param keys The selected entries. +* @param message The error message. +* +* @returns An object schema. +*/ +declare function required, const TMessage extends ErrorMessage | undefined>(schema: TSchema, keys: TKeys, message: TMessage): SchemaWithRequired; +//#endregion +//#region src/methods/required/requiredAsync.d.ts +/** +* Schema type. +*/ +type Schema$4 = SchemaWithoutPipe | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchemaAsync | undefined>>; +/** +* Required entries type. +*/ +type RequiredEntries | undefined> = { [TKey in keyof TEntries$1]: TKeys extends readonly (keyof TEntries$1)[] ? TKey extends TKeys[number] ? NonOptionalSchemaAsync : TEntries$1[TKey] : NonOptionalSchemaAsync }; +/** +* Schema with required type. +*/ +type SchemaWithRequiredAsync | undefined, TMessage extends ErrorMessage | undefined> = TSchema extends ObjectSchemaAsync | undefined> | StrictObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: RequiredEntries; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps>, InferObjectOutput>>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>, NonOptionalIssue | InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput>; + readonly output: InferObjectOutput>; + readonly issue: NonOptionalIssue | InferIssue; + } | undefined; +} : TSchema extends LooseObjectSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: RequiredEntries; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: unknown; + }, InferObjectOutput> & { + [key: string]: unknown; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: unknown; + }, NonOptionalIssue | InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: unknown; + }; + readonly output: InferObjectOutput> & { + [key: string]: unknown; + }; + readonly issue: NonOptionalIssue | InferIssue; + } | undefined; +} : TSchema extends ObjectWithRestSchemaAsync | undefined> ? Omit & { + /** + * The object entries. + */ + readonly entries: RequiredEntries; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps> & { + [key: string]: InferInput; + }, InferObjectOutput> & { + [key: string]: InferOutput; + }>; + /** + * Parses unknown input. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise> & { + [key: string]: InferOutput; + }, NonOptionalIssue | InferIssue>>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: InferObjectInput> & { + [key: string]: InferInput; + }; + readonly output: InferObjectOutput> & { + [key: string]: InferOutput; + }; + readonly issue: NonOptionalIssue | InferIssue; + } | undefined; +} : never; +/** +* Creates a modified copy of an object schema that marks all entries as required. +* +* @param schema The schema to modify. +* +* @returns An object schema. +*/ +declare function requiredAsync(schema: TSchema): SchemaWithRequiredAsync; +/** +* Creates a modified copy of an object schema that marks all entries as required. +* +* @param schema The schema to modify. +* @param message The error message. +* +* @returns An object schema. +*/ +declare function requiredAsync | undefined>(schema: TSchema, message: TMessage): SchemaWithRequiredAsync; +/** +* Creates a modified copy of an object schema that marks the selected entries +* as required. +* +* @param schema The schema to modify. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +declare function requiredAsync>(schema: TSchema, keys: TKeys): SchemaWithRequiredAsync; +/** +* Creates a modified copy of an object schema that marks the selected entries +* as required. +* +* @param schema The schema to modify. +* @param keys The selected entries. +* @param message The error message. +* +* @returns An object schema. +*/ +declare function requiredAsync, const TMessage extends ErrorMessage | undefined>(schema: TSchema, keys: TKeys, message: TMessage): SchemaWithRequiredAsync; +//#endregion +//#region src/methods/safeParse/types.d.ts +/** +* Safe parse result type. +*/ +type SafeParseResult> | BaseSchemaAsync>> = { + /** + * Whether is's typed. + */ + readonly typed: true; + /** + * Whether it's successful. + */ + readonly success: true; + /** + * The output value. + */ + readonly output: InferOutput; + /** + * The issues, if any. + */ + readonly issues: undefined; +} | { + readonly typed: true; + readonly success: false; + readonly output: InferOutput; + readonly issues: [InferIssue, ...InferIssue[]]; +} | { + readonly typed: false; + readonly success: false; + readonly output: unknown; + readonly issues: [InferIssue, ...InferIssue[]]; +}; +//#endregion +//#region src/methods/safeParse/safeParse.d.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parse result. +*/ +declare function safeParse>>(schema: TSchema, input: unknown, config?: Config>): SafeParseResult; +//#endregion +//#region src/methods/safeParse/safeParseAsync.d.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parse result. +*/ +declare function safeParseAsync> | BaseSchemaAsync>>(schema: TSchema, input: unknown, config?: Config>): Promise>; +//#endregion +//#region src/methods/safeParser/safeParser.d.ts +/** +* The safe parser interface. +*/ +interface SafeParser>, TConfig extends Config> | undefined> { + /** + * Parses an unknown input based on the schema. + */ + (input: unknown): SafeParseResult; + /** + * The schema to be used. + */ + readonly schema: TSchema; + /** + * The parser configuration. + */ + readonly config: TConfig; +} +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* +* @returns The parser function. +*/ +declare function safeParser>>(schema: TSchema): SafeParser; +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param config The parser configuration. +* +* @returns The parser function. +*/ +declare function safeParser>, const TConfig extends Config> | undefined>(schema: TSchema, config: TConfig): SafeParser; +//#endregion +//#region src/methods/safeParser/safeParserAsync.d.ts +/** +* The safe parser async interface. +*/ +interface SafeParserAsync> | BaseSchemaAsync>, TConfig extends Config> | undefined> { + /** + * Parses an unknown input based on the schema. + */ + (input: unknown): Promise>; + /** + * The schema to be used. + */ + readonly schema: TSchema; + /** + * The parser configuration. + */ + readonly config: TConfig; +} +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* +* @returns The parser function. +*/ +declare function safeParserAsync> | BaseSchemaAsync>>(schema: TSchema): SafeParserAsync; +/** +* Returns a function that parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param config The parser configuration. +* +* @returns The parser function. +*/ +declare function safeParserAsync> | BaseSchemaAsync>, const TConfig extends Config> | undefined>(schema: TSchema, config: TConfig): SafeParserAsync; +//#endregion +//#region src/methods/summarize/summarize.d.ts +/** +* Summarize the error messages of issues in a pretty-printable multi-line string. +* +* @param issues The list of issues. +* +* @returns A summary of the issues. +* +* @beta +*/ +declare function summarize(issues: [BaseIssue, ...BaseIssue[]]): string; +//#endregion +//#region src/methods/unwrap/unwrap.d.ts +/** +* Unwraps the wrapped schema. +* +* @param schema The schema to be unwrapped. +* +* @returns The unwrapped schema. +*/ +declare function unwrap>, unknown> | ExactOptionalSchemaAsync> | BaseSchemaAsync>, unknown> | NonNullableSchema>, ErrorMessage | undefined> | NonNullableSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | NonNullishSchema>, ErrorMessage | undefined> | NonNullishSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | NonOptionalSchema>, ErrorMessage | undefined> | NonOptionalSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | NullableSchema>, unknown> | NullableSchemaAsync> | BaseSchemaAsync>, unknown> | NullishSchema>, unknown> | NullishSchemaAsync> | BaseSchemaAsync>, unknown> | OptionalSchema>, unknown> | OptionalSchemaAsync> | BaseSchemaAsync>, unknown> | UndefinedableSchema>, unknown> | UndefinedableSchemaAsync> | BaseSchemaAsync>, unknown>>(schema: TSchema): TSchema["wrapped"]; +//#endregion +//#region src/types/metadata.d.ts +/** +* Base metadata interface. +*/ +interface BaseMetadata { + /** + * The object kind. + */ + readonly kind: "metadata"; + /** + * The metadata type. + */ + readonly type: string; + /** + * The metadata reference. + */ + readonly reference: (...args: any[]) => BaseMetadata; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: TInput$1; + readonly output: TInput$1; + readonly issue: never; + } | undefined; +} +/** +* Generic metadata type. +*/ +type GenericMetadata = BaseMetadata; +//#endregion +//#region src/types/dataset.d.ts +/** +* Unknown dataset interface. +*/ +interface UnknownDataset { + /** + * Whether is's typed. + */ + typed?: false; + /** + * The dataset value. + */ + value: unknown; + /** + * The dataset issues. + */ + issues?: undefined; +} +/** +* Success dataset interface. +*/ +interface SuccessDataset { + /** + * Whether is's typed. + */ + typed: true; + /** + * The dataset value. + */ + value: TValue$1; + /** + * The dataset issues. + */ + issues?: undefined; +} +/** +* Partial dataset interface. +*/ +interface PartialDataset> { + /** + * Whether is's typed. + */ + typed: true; + /** + * The dataset value. + */ + value: TValue$1; + /** + * The dataset issues. + */ + issues: [TIssue, ...TIssue[]]; +} +/** +* Failure dataset interface. +*/ +interface FailureDataset> { + /** + * Whether is's typed. + */ + typed: false; + /** + * The dataset value. + */ + value: unknown; + /** + * The dataset issues. + */ + issues: [TIssue, ...TIssue[]]; +} +/** +* Output dataset type. +*/ +type OutputDataset> = SuccessDataset | PartialDataset | FailureDataset; +//#endregion +//#region src/types/standard.d.ts +/** +* The Standard Schema properties interface. +*/ +interface StandardProps { + /** + * The version number of the standard. + */ + readonly version: 1; + /** + * The vendor name of the schema library. + */ + readonly vendor: "valibot"; + /** + * Validates unknown input values. + */ + readonly validate: (value: unknown) => StandardResult | Promise>; + /** + * Inferred types associated with the schema. + */ + readonly types?: StandardTypes | undefined; +} +/** +* The result interface of the validate function. +*/ +type StandardResult = StandardSuccessResult | StandardFailureResult; +/** +* The result interface if validation succeeds. +*/ +interface StandardSuccessResult { + /** + * The typed output value. + */ + readonly value: TOutput$1; + /** + * The non-existent issues. + */ + readonly issues?: undefined; +} +/** +* The result interface if validation fails. +*/ +interface StandardFailureResult { + /** + * The issues of failed validation. + */ + readonly issues: readonly StandardIssue[]; +} +/** +* The issue interface of the failure output. +*/ +interface StandardIssue { + /** + * The error message of the issue. + */ + readonly message: string; + /** + * The path of the issue, if any. + */ + readonly path?: readonly (PropertyKey | StandardPathItem)[] | undefined; +} +/** +* The path item interface of the issue. +*/ +interface StandardPathItem { + /** + * The key of the path item. + */ + readonly key: PropertyKey; +} +/** +* The Standard Schema types interface. +*/ +interface StandardTypes { + /** + * The input type of the schema. + */ + readonly input: TInput$1; + /** + * The output type of the schema. + */ + readonly output: TOutput$1; +} +//#endregion +//#region src/types/schema.d.ts +/** +* Base schema interface. +*/ +interface BaseSchema> { + /** + * The object kind. + */ + readonly kind: "schema"; + /** + * The schema type. + */ + readonly type: string; + /** + * The schema reference. + */ + readonly reference: (...args: any[]) => BaseSchema>; + /** + * The expected property. + */ + readonly expects: string; + /** + * Whether it's async. + */ + readonly async: false; + /** + * The Standard Schema properties. + * + * @internal + */ + readonly "~standard": StandardProps; + /** + * Parses unknown input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => OutputDataset; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: TInput$1; + readonly output: TOutput$1; + readonly issue: TIssue; + } | undefined; +} +/** +* Base schema async interface. +*/ +interface BaseSchemaAsync> extends Omit, "reference" | "async" | "~run"> { + /** + * The schema reference. + */ + readonly reference: (...args: any[]) => BaseSchema> | BaseSchemaAsync>; + /** + * Whether it's async. + */ + readonly async: true; + /** + * Parses unknown input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: UnknownDataset, config: Config>) => Promise>; +} +/** +* Generic schema type. +*/ +type GenericSchema = BaseIssue> = BaseSchema; +/** +* Generic schema async type. +*/ +type GenericSchemaAsync = BaseIssue> = BaseSchemaAsync; +//#endregion +//#region src/types/transformation.d.ts +/** +* Base transformation interface. +*/ +interface BaseTransformation> { + /** + * The object kind. + */ + readonly kind: "transformation"; + /** + * The transformation type. + */ + readonly type: string; + /** + * The transformation reference. + */ + readonly reference: (...args: any[]) => BaseTransformation>; + /** + * Whether it's async. + */ + readonly async: false; + /** + * Transforms known input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: SuccessDataset, config: Config>) => OutputDataset | TIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: TInput$1; + readonly output: TOutput$1; + readonly issue: TIssue; + } | undefined; +} +/** +* Base transformation async interface. +*/ +interface BaseTransformationAsync> extends Omit, "reference" | "async" | "~run"> { + /** + * The transformation reference. + */ + readonly reference: (...args: any[]) => BaseTransformation> | BaseTransformationAsync>; + /** + * Whether it's async. + */ + readonly async: true; + /** + * Transforms known input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: SuccessDataset, config: Config>) => Promise | TIssue>>; +} +/** +* Generic transformation type. +*/ +type GenericTransformation = BaseIssue> = BaseTransformation; +/** +* Generic transformation async type. +*/ +type GenericTransformationAsync = BaseIssue> = BaseTransformationAsync; +//#endregion +//#region src/types/validation.d.ts +/** +* Base validation interface. +*/ +interface BaseValidation> { + /** + * The object kind. + */ + readonly kind: "validation"; + /** + * The validation type. + */ + readonly type: string; + /** + * The validation reference. + */ + readonly reference: (...args: any[]) => BaseValidation>; + /** + * The expected property. + */ + readonly expects: string | null; + /** + * Whether it's async. + */ + readonly async: false; + /** + * Validates known input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: OutputDataset>, config: Config>) => OutputDataset | TIssue>; + /** + * The input, output and issue type. + * + * @internal + */ + readonly "~types"?: { + readonly input: TInput$1; + readonly output: TOutput$1; + readonly issue: TIssue; + } | undefined; +} +/** +* Base validation async interface. +*/ +interface BaseValidationAsync> extends Omit, "reference" | "async" | "~run"> { + /** + * The validation reference. + */ + readonly reference: (...args: any[]) => BaseValidation> | BaseValidationAsync>; + /** + * Whether it's async. + */ + readonly async: true; + /** + * Validates known input values. + * + * @param dataset The input dataset. + * @param config The configuration. + * + * @returns The output dataset. + * + * @internal + */ + readonly "~run": (dataset: OutputDataset>, config: Config>) => Promise | TIssue>>; +} +/** +* Generic validation type. +*/ +type GenericValidation = BaseIssue> = BaseValidation; +/** +* Generic validation async type. +*/ +type GenericValidationAsync = BaseIssue> = BaseValidationAsync; +//#endregion +//#region src/types/infer.d.ts +/** +* Infer input type. +*/ +type InferInput> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync> | BaseMetadata> = NonNullable["input"]; +/** +* Infer output type. +*/ +type InferOutput> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync> | BaseMetadata> = NonNullable["output"]; +/** +* Infer issue type. +*/ +type InferIssue> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync> | BaseMetadata> = NonNullable["issue"]; +//#endregion +//#region src/types/utils.d.ts +/** +* Checks if a type is `any`. +*/ +type IsAny = 0 extends 1 & Type ? true : false; +/** +* Checks if a type is `never`. +*/ +type IsNever = [Type] extends [never] ? true : false; +/** +* Extracts `null` from a type. +*/ +type NonNullable$1 = TValue$1 extends null ? never : TValue$1; +/** +* Extracts `null` and `undefined` from a type. +*/ +type NonNullish = TValue$1 extends null | undefined ? never : TValue$1; +/** +* Extracts `undefined` from a type. +*/ +type NonOptional = TValue$1 extends undefined ? never : TValue$1; +/** +* Constructs a type that is maybe readonly. +*/ +type MaybeReadonly = TValue$1 | Readonly; +/** +* Constructs a type that is deeply readonly. +*/ +type DeepReadonly = TValue$1 extends Record | readonly unknown[] ? { readonly [TKey in keyof TValue$1]: DeepReadonly } : TValue$1; +/** +* Constructs a type that is maybe deeply readonly. +*/ +type MaybeDeepReadonly = TValue$1 | DeepReadonly; +/** +* Constructs a type that is maybe a promise. +*/ +type MaybePromise = TValue$1 | Promise; +/** +* Prettifies a type for better readability. +* +* Hint: This type has no effect and is only used so that TypeScript displays +* the final type in the preview instead of the utility types used. +*/ +type Prettify = { [TKey in keyof TObject]: TObject[TKey] } & {}; +/** +* Marks specific keys as optional. +*/ +type MarkOptional = { [TKey in keyof TObject]?: unknown } & Omit & Partial>; +/** +* Merges two objects. Overlapping entries from the second object overwrite +* properties from the first object. +*/ +type Merge = Omit & TSecondObject; +/** +* Extracts first tuple item. +*/ +type FirstTupleItem = TTuple[0]; +/** +* Extracts last tuple item. +*/ +type LastTupleItem = TTuple[TTuple extends readonly [unknown, ...infer TRest] ? TRest["length"] : never]; +/** +* Converts union to intersection type. +*/ +type UnionToIntersect = (TUnion extends any ? (arg: TUnion) => void : never) extends ((arg: infer Intersect) => void) ? Intersect : never; +/** +* Converts union to tuple type using an accumulator. +* +* For more information: {@link https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#tail-recursion-elimination-on-conditional-types} +*/ +type UnionToTupleHelper = UnionToIntersect TUnion> extends (() => infer TLast) ? UnionToTupleHelper, [TLast, ...TResult]> : TResult; +/** +* Converts union to tuple type. +*/ +type UnionToTuple = UnionToTupleHelper; +//#endregion +//#region src/types/other.d.ts +/** +* Error message type. +*/ +type ErrorMessage> = ((issue: TIssue) => string) | string; +/** +* Default type. +*/ +type Default>, TInput$1 extends null | undefined> = MaybeDeepReadonly | TInput$1> | ((dataset?: UnknownDataset, config?: Config>) => MaybeDeepReadonly | TInput$1>) | undefined; +/** +* Default async type. +*/ +type DefaultAsync> | BaseSchemaAsync>, TInput$1 extends null | undefined> = MaybeDeepReadonly | TInput$1> | ((dataset?: UnknownDataset, config?: Config>) => MaybePromise | TInput$1>>) | undefined; +/** +* Default value type. +*/ +type DefaultValue>, null | undefined> | DefaultAsync> | BaseSchemaAsync>, null | undefined>> = TDefault extends DefaultAsync> | BaseSchemaAsync>, infer TInput> ? TDefault extends ((dataset?: UnknownDataset, config?: Config>) => MaybePromise | TInput>>) ? Awaited> : TDefault : never; +//#endregion +//#region src/types/object.d.ts +/** +* Optional entry schema type. +*/ +type OptionalEntrySchema = ExactOptionalSchema>, unknown> | NullishSchema>, unknown> | OptionalSchema>, unknown>; +/** +* Optional entry schema async type. +*/ +type OptionalEntrySchemaAsync = ExactOptionalSchemaAsync> | BaseSchemaAsync>, unknown> | NullishSchemaAsync> | BaseSchemaAsync>, unknown> | OptionalSchemaAsync> | BaseSchemaAsync>, unknown>; +/** +* Object entries interface. +*/ +interface ObjectEntries { + [key: string]: BaseSchema> | SchemaWithFallback>, unknown> | OptionalEntrySchema; +} +/** +* Object entries async interface. +*/ +interface ObjectEntriesAsync { + [key: string]: BaseSchema> | BaseSchemaAsync> | SchemaWithFallback>, unknown> | SchemaWithFallbackAsync> | BaseSchemaAsync>, unknown> | OptionalEntrySchema | OptionalEntrySchemaAsync; +} +/** +* Object keys type. +*/ +type ObjectKeys | undefined> | LooseObjectSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined>> = MaybeReadonly<[keyof TSchema["entries"], ...(keyof TSchema["entries"])[]]>; +/** +* Infer entries input type. +*/ +type InferEntriesInput = { -readonly [TKey in keyof TEntries$1]: InferInput }; +/** +* Infer entries output type. +*/ +type InferEntriesOutput = { -readonly [TKey in keyof TEntries$1]: InferOutput }; +/** +* Optional input keys type. +*/ +type OptionalInputKeys = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? TKey : never }[keyof TEntries$1]; +/** +* Optional output keys type. +*/ +type OptionalOutputKeys = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends OptionalEntrySchema | OptionalEntrySchemaAsync ? undefined extends TEntries$1[TKey]["default"] ? TKey : never : never }[keyof TEntries$1]; +/** +* Input with question marks type. +*/ +type InputWithQuestionMarks> = MarkOptional>; +/** +* Output with question marks type. +*/ +type OutputWithQuestionMarks> = MarkOptional>; +/** +* Readonly output keys type. +*/ +type ReadonlyOutputKeys = { [TKey in keyof TEntries$1]: TEntries$1[TKey] extends { + readonly pipe: readonly unknown[]; +} ? ReadonlyAction extends TEntries$1[TKey]["pipe"][number] ? TKey : never : never }[keyof TEntries$1]; +/** +* Output with readonly type. +*/ +type OutputWithReadonly>> = ReadonlyOutputKeys extends never ? TObject : Readonly & Pick>>; +/** +* Infer object input type. +*/ +type InferObjectInput = Prettify>>; +/** +* Infer object output type. +*/ +type InferObjectOutput = Prettify>>>; +/** +* Infer object issue type. +*/ +type InferObjectIssue = InferIssue; +//#endregion +//#region src/types/tuple.d.ts +/** +* Tuple items type. +*/ +type TupleItems = MaybeReadonly>[]>; +/** +* Tuple items async type. +*/ +type TupleItemsAsync = MaybeReadonly<(BaseSchema> | BaseSchemaAsync>)[]>; +/** +* Infer tuple input type. +*/ +type InferTupleInput = { -readonly [TKey in keyof TItems$1]: InferInput }; +/** +* Infer tuple output type. +*/ +type InferTupleOutput = { -readonly [TKey in keyof TItems$1]: InferOutput }; +/** +* Infer tuple issue type. +*/ +type InferTupleIssue = InferIssue; +//#endregion +//#region src/types/issue.d.ts +/** +* Array path item interface. +*/ +interface ArrayPathItem { + /** + * The path item type. + */ + readonly type: "array"; + /** + * The path item origin. + */ + readonly origin: "value"; + /** + * The path item input. + */ + readonly input: MaybeReadonly; + /** + * The path item key. + */ + readonly key: number; + /** + * The path item value. + */ + readonly value: unknown; +} +/** +* Map path item interface. +*/ +interface MapPathItem { + /** + * The path item type. + */ + readonly type: "map"; + /** + * The path item origin. + */ + readonly origin: "key" | "value"; + /** + * The path item input. + */ + readonly input: Map; + /** + * The path item key. + */ + readonly key: unknown; + /** + * The path item value. + */ + readonly value: unknown; +} +/** +* Object path item interface. +*/ +interface ObjectPathItem { + /** + * The path item type. + */ + readonly type: "object"; + /** + * The path item origin. + */ + readonly origin: "key" | "value"; + /** + * The path item input. + */ + readonly input: Record; + /** + * The path item key. + */ + readonly key: string; + /** + * The path item value. + */ + readonly value: unknown; +} +/** +* Set path item interface. +*/ +interface SetPathItem { + /** + * The path item type. + */ + readonly type: "set"; + /** + * The path item origin. + */ + readonly origin: "value"; + /** + * The path item input. + */ + readonly input: Set; + /** + * The path item key. + */ + readonly key: null; + /** + * The path item key. + */ + readonly value: unknown; +} +/** +* Unknown path item interface. +*/ +interface UnknownPathItem { + /** + * The path item type. + */ + readonly type: "unknown"; + /** + * The path item origin. + */ + readonly origin: "key" | "value"; + /** + * The path item input. + */ + readonly input: unknown; + /** + * The path item key. + */ + readonly key: unknown; + /** + * The path item value. + */ + readonly value: unknown; +} +/** +* Issue path item type. +*/ +type IssuePathItem = ArrayPathItem | MapPathItem | ObjectPathItem | SetPathItem | UnknownPathItem; +/** +* Base issue interface. +*/ +interface BaseIssue extends Config> { + /** + * The issue kind. + */ + readonly kind: "schema" | "validation" | "transformation"; + /** + * The issue type. + */ + readonly type: string; + /** + * The raw input data. + */ + readonly input: TInput$1; + /** + * The expected property. + */ + readonly expected: string | null; + /** + * The received property. + */ + readonly received: string; + /** + * The error message. + */ + readonly message: string; + /** + * The input requirement. + */ + readonly requirement?: unknown | undefined; + /** + * The issue path. + */ + readonly path?: [IssuePathItem, ...IssuePathItem[]] | undefined; + /** + * The sub issues. + */ + readonly issues?: [BaseIssue, ...BaseIssue[]] | undefined; +} +/** +* Generic issue type. +*/ +type GenericIssue = BaseIssue; +/** +* Dot path type. +*/ +type DotPath> | BaseSchemaAsync>> = TKey$1 extends string | number ? `${TKey$1}` | `${TKey$1}.${IssueDotPath}` : never; +/** +* Object path type. +*/ +type ObjectPath = { [TKey in keyof TEntries$1]: DotPath }[keyof TEntries$1]; +/** +* Tuple keys type. +*/ +type TupleKeys = Exclude; +/** +* Tuple path type. +*/ +type TuplePath = { [TKey in TupleKeys]: TItems$1[TKey] extends BaseSchema> | BaseSchemaAsync> ? DotPath : never }[TupleKeys]; +/** +* Issue dot path type. +*/ +type IssueDotPath> | BaseSchemaAsync>> = TSchema extends SchemaWithPipe ? IssueDotPath> : TSchema extends SchemaWithPipeAsync ? IssueDotPath> : TSchema extends ArraySchema | undefined> ? DotPath : TSchema extends ArraySchemaAsync | undefined> ? DotPath : TSchema extends IntersectSchema | undefined> | UnionSchema>> | undefined> | VariantSchema | undefined> ? IssueDotPath : TSchema extends IntersectSchemaAsync | undefined> | UnionSchemaAsync>> | undefined> | VariantSchemaAsync | undefined> ? IssueDotPath : TSchema extends MapSchema | undefined> | RecordSchema | undefined> ? DotPath, TValue> : TSchema extends MapSchemaAsync | undefined> | RecordSchemaAsync | undefined> ? DotPath, TValue> : TSchema extends LooseObjectSchema | undefined> | ObjectSchema | undefined> | StrictObjectSchema | undefined> ? ObjectPath : TSchema extends LooseObjectSchemaAsync | undefined> | ObjectSchemaAsync | undefined> | StrictObjectSchemaAsync | undefined> ? ObjectPath : TSchema extends ObjectWithRestSchema>, ErrorMessage | undefined> ? string : TSchema extends ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> ? string : TSchema extends SetSchema | undefined> ? DotPath : TSchema extends SetSchemaAsync | undefined> ? DotPath : TSchema extends LooseTupleSchema | undefined> | StrictTupleSchema | undefined> | TupleSchema | undefined> ? TuplePath : TSchema extends LooseTupleSchemaAsync | undefined> | StrictTupleSchemaAsync | undefined> | TupleSchemaAsync | undefined> ? TuplePath : TSchema extends TupleWithRestSchema | undefined> ? TuplePath | DotPath : TSchema extends TupleWithRestSchemaAsync | undefined> ? TuplePath | DotPath : TSchema extends ExactOptionalSchema>, never>> | LazySchema | NonNullableSchema | undefined> | NonNullishSchema | undefined> | NonOptionalSchema | undefined> | NullableSchema>, null>> | NullishSchema>, null | undefined>> | OptionalSchema>, undefined>> | UndefinedableSchema>, undefined>> ? IssueDotPath : TSchema extends ExactOptionalSchemaAsync> | BaseSchemaAsync>, never>> | LazySchemaAsync | NonNullableSchemaAsync | undefined> | NonNullishSchemaAsync | undefined> | NonOptionalSchemaAsync | undefined> | NullableSchemaAsync> | BaseSchemaAsync>, null>> | NullishSchemaAsync> | BaseSchemaAsync>, null | undefined>> | OptionalSchemaAsync> | BaseSchemaAsync>, undefined>> | UndefinedableSchemaAsync> | BaseSchemaAsync>, undefined>> ? IssueDotPath : never; +//#endregion +//#region src/types/config.d.ts +/** +* Config interface. +*/ +interface Config> { + /** + * The selected language. + */ + readonly lang?: string | undefined; + /** + * The error message. + */ + readonly message?: ErrorMessage | undefined; + /** + * Whether it should be aborted early. + */ + readonly abortEarly?: boolean | undefined; + /** + * Whether a pipe should be aborted early. + */ + readonly abortPipeEarly?: boolean | undefined; +} +//#endregion +//#region src/types/pipe.d.ts +/** +* Pipe action type. +*/ +type PipeAction> = BaseValidation | BaseTransformation | BaseMetadata; +/** +* Pipe action async type. +*/ +type PipeActionAsync> = BaseValidationAsync | BaseTransformationAsync; +/** +* Pipe item type. +*/ +type PipeItem> = BaseSchema | PipeAction; +/** +* Pipe item async type. +*/ +type PipeItemAsync> = BaseSchemaAsync | PipeActionAsync; +/** +* Schema without pipe type. +*/ +type SchemaWithoutPipe> | BaseSchemaAsync>> = TSchema & { + pipe?: never; +}; +/** +* Generic pipe action type. +*/ +type GenericPipeAction = BaseIssue> = PipeAction; +/** +* Generic pipe action async type. +*/ +type GenericPipeActionAsync = BaseIssue> = PipeActionAsync; +/** +* Generic pipe item type. +*/ +type GenericPipeItem = BaseIssue> = PipeItem; +/** +* Generic pipe item async type. +*/ +type GenericPipeItemAsync = BaseIssue> = PipeItemAsync; +//#endregion +//#region src/schemas/any/any.d.ts +/** +* Any schema interface. +*/ +interface AnySchema extends BaseSchema { + /** + * The schema type. + */ + readonly type: "any"; + /** + * The schema reference. + */ + readonly reference: typeof any; + /** + * The expected property. + */ + readonly expects: "any"; +} +/** +* Creates an any schema. +* +* Hint: This schema function exists only for completeness and is not +* recommended in practice. Instead, `unknown` should be used to accept +* unknown data. +* +* @returns An any schema. +*/ +declare function any(): AnySchema; +//#endregion +//#region src/schemas/array/types.d.ts +/** +* Array issue interface. +*/ +interface ArrayIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "array"; + /** + * The expected property. + */ + readonly expected: "Array"; +} +//#endregion +//#region src/schemas/array/array.d.ts +/** +* Array schema interface. +*/ +interface ArraySchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema[], InferOutput[], ArrayIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "array"; + /** + * The schema reference. + */ + readonly reference: typeof array; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The array item schema. + */ + readonly item: TItem$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an array schema. +* +* @param item The item schema. +* +* @returns An array schema. +*/ +declare function array>>(item: TItem$1): ArraySchema; +/** +* Creates an array schema. +* +* @param item The item schema. +* @param message The error message. +* +* @returns An array schema. +*/ +declare function array>, const TMessage extends ErrorMessage | undefined>(item: TItem$1, message: TMessage): ArraySchema; +//#endregion +//#region src/schemas/array/arrayAsync.d.ts +/** +* Array schema interface. +*/ +interface ArraySchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync[], InferOutput[], ArrayIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "array"; + /** + * The schema reference. + */ + readonly reference: typeof array | typeof arrayAsync; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The array item schema. + */ + readonly item: TItem$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an array schema. +* +* @param item The item schema. +* +* @returns An array schema. +*/ +declare function arrayAsync> | BaseSchemaAsync>>(item: TItem$1): ArraySchemaAsync; +/** +* Creates an array schema. +* +* @param item The item schema. +* @param message The error message. +* +* @returns An array schema. +*/ +declare function arrayAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(item: TItem$1, message: TMessage): ArraySchemaAsync; +//#endregion +//#region src/schemas/bigint/bigint.d.ts +/** +* Bigint issue interface. +*/ +interface BigintIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "bigint"; + /** + * The expected property. + */ + readonly expected: "bigint"; +} +/** +* Bigint schema interface. +*/ +interface BigintSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "bigint"; + /** + * The schema reference. + */ + readonly reference: typeof bigint; + /** + * The expected property. + */ + readonly expects: "bigint"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a bigint schema. +* +* @returns A bigint schema. +*/ +declare function bigint(): BigintSchema; +/** +* Creates a bigint schema. +* +* @param message The error message. +* +* @returns A bigint schema. +*/ +declare function bigint | undefined>(message: TMessage): BigintSchema; +//#endregion +//#region src/schemas/blob/blob.d.ts +/** +* Blob issue interface. +*/ +interface BlobIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "blob"; + /** + * The expected property. + */ + readonly expected: "Blob"; +} +/** +* Blob schema interface. +*/ +interface BlobSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "blob"; + /** + * The schema reference. + */ + readonly reference: typeof blob; + /** + * The expected property. + */ + readonly expects: "Blob"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a blob schema. +* +* @returns A blob schema. +*/ +declare function blob(): BlobSchema; +/** +* Creates a blob schema. +* +* @param message The error message. +* +* @returns A blob schema. +*/ +declare function blob | undefined>(message: TMessage): BlobSchema; +//#endregion +//#region src/schemas/boolean/boolean.d.ts +/** +* Boolean issue interface. +*/ +interface BooleanIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "boolean"; + /** + * The expected property. + */ + readonly expected: "boolean"; +} +/** +* Boolean schema interface. +*/ +interface BooleanSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "boolean"; + /** + * The schema reference. + */ + readonly reference: typeof boolean; + /** + * The expected property. + */ + readonly expects: "boolean"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a boolean schema. +* +* @returns A boolean schema. +*/ +declare function boolean(): BooleanSchema; +/** +* Creates a boolean schema. +* +* @param message The error message. +* +* @returns A boolean schema. +*/ +declare function boolean | undefined>(message: TMessage): BooleanSchema; +//#endregion +//#region src/schemas/custom/types.d.ts +/** +* Custom issue interface. +*/ +interface CustomIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "custom"; + /** + * The expected property. + */ + readonly expected: "unknown"; +} +//#endregion +//#region src/schemas/custom/custom.d.ts +/** +* Check type. +*/ +type Check = (input: unknown) => boolean; +/** +* Custom schema interface. +*/ +interface CustomSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "custom"; + /** + * The schema reference. + */ + readonly reference: typeof custom; + /** + * The expected property. + */ + readonly expects: "unknown"; + /** + * The type check function. + */ + readonly check: Check; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a custom schema. +* +* @param check The type check function. +* +* @returns A custom schema. +*/ +declare function custom(check: Check): CustomSchema; +/** +* Creates a custom schema. +* +* @param check The type check function. +* @param message The error message. +* +* @returns A custom schema. +*/ +declare function custom | undefined = ErrorMessage | undefined>(check: Check, message: TMessage): CustomSchema; +//#endregion +//#region src/schemas/custom/customAsync.d.ts +/** +* Check async type. +*/ +type CheckAsync = (input: unknown) => MaybePromise; +/** +* Custom schema async interface. +*/ +interface CustomSchemaAsync | undefined> extends BaseSchemaAsync { + /** + * The schema type. + */ + readonly type: "custom"; + /** + * The schema reference. + */ + readonly reference: typeof custom | typeof customAsync; + /** + * The expected property. + */ + readonly expects: "unknown"; + /** + * The type check function. + */ + readonly check: CheckAsync; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a custom schema. +* +* @param check The type check function. +* +* @returns A custom schema. +*/ +declare function customAsync(check: CheckAsync): CustomSchemaAsync; +/** +* Creates a custom schema. +* +* @param check The type check function. +* @param message The error message. +* +* @returns A custom schema. +*/ +declare function customAsync | undefined = ErrorMessage | undefined>(check: CheckAsync, message: TMessage): CustomSchemaAsync; +//#endregion +//#region src/schemas/date/date.d.ts +/** +* Date issue interface. +*/ +interface DateIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "date"; + /** + * The expected property. + */ + readonly expected: "Date"; +} +/** +* Date schema interface. +*/ +interface DateSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "date"; + /** + * The schema reference. + */ + readonly reference: typeof date; + /** + * The expected property. + */ + readonly expects: "Date"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a date schema. +* +* @returns A date schema. +*/ +declare function date(): DateSchema; +/** +* Creates a date schema. +* +* @param message The error message. +* +* @returns A date schema. +*/ +declare function date | undefined>(message: TMessage): DateSchema; +//#endregion +//#region src/schemas/enum/enum.d.ts +/** +* Enum interface. +*/ +interface Enum { + [key: string]: string | number; +} +/** +* Enum values type. +*/ +type EnumValues = { [TKey in keyof TEnum]: TKey extends number ? TEnum[TKey] extends string ? TEnum[TEnum[TKey]] extends TKey ? never : TEnum[TKey] : TEnum[TKey] : TKey extends "NaN" | "Infinity" | "-Infinity" ? TEnum[TKey] extends string ? TEnum[TEnum[TKey]] extends number ? never : TEnum[TKey] : TEnum[TKey] : TKey extends `+${number}` ? TEnum[TKey] : TKey extends `${infer TNumber extends number}` ? TEnum[TKey] extends string ? TEnum[TEnum[TKey]] extends TNumber ? never : TEnum[TKey] : TEnum[TKey] : TEnum[TKey] }[keyof TEnum]; +/** +* Enum issue interface. +*/ +interface EnumIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "enum"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Enum schema interface. +*/ +interface EnumSchema | undefined> extends BaseSchema, EnumValues, EnumIssue> { + /** + * The schema type. + */ + readonly type: "enum"; + /** + * The schema reference. + */ + readonly reference: typeof enum_; + /** + * The enum object. + */ + readonly enum: TEnum; + /** + * The enum options. + */ + readonly options: EnumValues[]; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an enum schema. +* +* @param enum__ The enum object. +* +* @returns An enum schema. +*/ +declare function enum_(enum__: TEnum): EnumSchema; +/** +* Creates an enum schema. +* +* @param enum__ The enum object. +* @param message The error message. +* +* @returns An enum schema. +*/ +declare function enum_ | undefined>(enum__: TEnum, message: TMessage): EnumSchema; +//#endregion +//#region src/schemas/exactOptional/exactOptional.d.ts +/** +* Exact optional schema interface. +*/ +interface ExactOptionalSchema>, TDefault extends Default> extends BaseSchema, InferOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "exact_optional"; + /** + * The schema reference. + */ + readonly reference: typeof exactOptional; + /** + * The expected property. + */ + readonly expects: TWrapped$1["expects"]; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates an exact optional schema. +* +* @param wrapped The wrapped schema. +* +* @returns An exact optional schema. +*/ +declare function exactOptional>>(wrapped: TWrapped$1): ExactOptionalSchema; +/** +* Creates an exact optional schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns An exact optional schema. +*/ +declare function exactOptional>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): ExactOptionalSchema; +//#endregion +//#region src/schemas/exactOptional/exactOptionalAsync.d.ts +/** +* Exact optional schema async interface. +*/ +interface ExactOptionalSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync, InferOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "exact_optional"; + /** + * The schema reference. + */ + readonly reference: typeof exactOptional | typeof exactOptionalAsync; + /** + * The expected property. + */ + readonly expects: TWrapped$1["expects"]; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates an exact optional schema. +* +* @param wrapped The wrapped schema. +* +* @returns An exact optional schema. +*/ +declare function exactOptionalAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): ExactOptionalSchemaAsync; +/** +* Creates an exact optional schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns An exact optional schema. +*/ +declare function exactOptionalAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): ExactOptionalSchemaAsync; +//#endregion +//#region src/schemas/file/file.d.ts +/** +* File issue interface. +*/ +interface FileIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "file"; + /** + * The expected property. + */ + readonly expected: "File"; +} +/** +* File schema interface. +*/ +interface FileSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "file"; + /** + * The schema reference. + */ + readonly reference: typeof file; + /** + * The expected property. + */ + readonly expects: "File"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a file schema. +* +* @returns A file schema. +*/ +declare function file(): FileSchema; +/** +* Creates a file schema. +* +* @param message The error message. +* +* @returns A file schema. +*/ +declare function file | undefined>(message: TMessage): FileSchema; +//#endregion +//#region src/schemas/function/function.d.ts +/** +* Function issue interface. +*/ +interface FunctionIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "function"; + /** + * The expected property. + */ + readonly expected: "Function"; +} +/** +* Function schema interface. +*/ +interface FunctionSchema | undefined> extends BaseSchema<(...args: unknown[]) => unknown, (...args: unknown[]) => unknown, FunctionIssue> { + /** + * The schema type. + */ + readonly type: "function"; + /** + * The schema reference. + */ + readonly reference: typeof function_; + /** + * The expected property. + */ + readonly expects: "Function"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a function schema. +* +* @returns A function schema. +*/ +declare function function_(): FunctionSchema; +/** +* Creates a function schema. +* +* @param message The error message. +* +* @returns A function schema. +*/ +declare function function_ | undefined>(message: TMessage): FunctionSchema; +//#endregion +//#region src/schemas/instance/instance.d.ts +/** +* Class type. +*/ +type Class = new (...args: any[]) => any; +/** +* Instance issue interface. +*/ +interface InstanceIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "instance"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Instance schema interface. +*/ +interface InstanceSchema | undefined> extends BaseSchema, InstanceType, InstanceIssue> { + /** + * The schema type. + */ + readonly type: "instance"; + /** + * The schema reference. + */ + readonly reference: typeof instance; + /** + * The class of the instance. + */ + readonly class: TClass; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an instance schema. +* +* @param class_ The class of the instance. +* +* @returns An instance schema. +*/ +declare function instance(class_: TClass): InstanceSchema; +/** +* Creates an instance schema. +* +* @param class_ The class of the instance. +* @param message The error message. +* +* @returns An instance schema. +*/ +declare function instance | undefined>(class_: TClass, message: TMessage): InstanceSchema; +//#endregion +//#region src/schemas/intersect/types.d.ts +/** +* Intersect issue interface. +*/ +interface IntersectIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "intersect"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Intersect options type. +*/ +type IntersectOptions = MaybeReadonly>[]>; +/** +* Intersect options async type. +*/ +type IntersectOptionsAsync = MaybeReadonly<(BaseSchema> | BaseSchemaAsync>)[]>; +/** +* Infer option type. +*/ +type InferOption = BaseSchema> | BaseSchemaAsync>; +/** +* Infer intersect input type. +*/ +type InferIntersectInput = TOptions$1 extends readonly [InferOption, ...infer TRest] ? TRest extends readonly [InferOption, ...InferOption[]] ? TInput & InferIntersectInput : TInput : IsNever extends true ? never : UnionToIntersect>; +/** +* Infer intersect output type. +*/ +type InferIntersectOutput = TOptions$1 extends readonly [InferOption, ...infer TRest] ? TRest extends readonly [InferOption, ...InferOption[]] ? TOutput & InferIntersectOutput : TOutput : IsNever extends true ? never : UnionToIntersect>; +//#endregion +//#region src/schemas/intersect/intersect.d.ts +/** +* Intersect schema interface. +*/ +interface IntersectSchema | undefined> extends BaseSchema, InferIntersectOutput, IntersectIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "intersect"; + /** + * The schema reference. + */ + readonly reference: typeof intersect; + /** + * The intersect options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an intersect schema. +* +* @param options The intersect options. +* +* @returns An intersect schema. +*/ +declare function intersect(options: TOptions$1): IntersectSchema; +/** +* Creates an intersect schema. +* +* @param options The intersect options. +* @param message The error message. +* +* @returns An intersect schema. +*/ +declare function intersect | undefined>(options: TOptions$1, message: TMessage): IntersectSchema; +//#endregion +//#region src/schemas/intersect/intersectAsync.d.ts +/** +* Intersect schema async interface. +*/ +interface IntersectSchemaAsync | undefined> extends BaseSchemaAsync, InferIntersectOutput, IntersectIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "intersect"; + /** + * The schema reference. + */ + readonly reference: typeof intersect | typeof intersectAsync; + /** + * The intersect options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an intersect schema. +* +* @param options The intersect options. +* +* @returns An intersect schema. +*/ +declare function intersectAsync(options: TOptions$1): IntersectSchemaAsync; +/** +* Creates an intersect schema. +* +* @param options The intersect options. +* @param message The error message. +* +* @returns An intersect schema. +*/ +declare function intersectAsync | undefined>(options: TOptions$1, message: TMessage): IntersectSchemaAsync; +//#endregion +//#region src/schemas/lazy/lazy.d.ts +/** +* Lazy schema interface. +*/ +interface LazySchema>> extends BaseSchema, InferOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "lazy"; + /** + * The schema reference. + */ + readonly reference: typeof lazy; + /** + * The expected property. + */ + readonly expects: "unknown"; + /** + * The schema getter. + */ + readonly getter: (input: unknown) => TWrapped$1; +} +/** +* Creates a lazy schema. +* +* @param getter The schema getter. +* +* @returns A lazy schema. +*/ +declare function lazy>>(getter: (input: unknown) => TWrapped$1): LazySchema; +//#endregion +//#region src/schemas/lazy/lazyAsync.d.ts +/** +* Lazy schema async interface. +*/ +interface LazySchemaAsync> | BaseSchemaAsync>> extends BaseSchemaAsync, InferOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "lazy"; + /** + * The schema reference. + */ + readonly reference: typeof lazy | typeof lazyAsync; + /** + * The expected property. + */ + readonly expects: "unknown"; + /** + * The schema getter. + */ + readonly getter: (input: unknown) => MaybePromise; +} +/** +* Creates a lazy schema. +* +* @param getter The schema getter. +* +* @returns A lazy schema. +*/ +declare function lazyAsync> | BaseSchemaAsync>>(getter: (input: unknown) => MaybePromise): LazySchemaAsync; +//#endregion +//#region src/schemas/literal/literal.d.ts +/** +* Literal type. +*/ +type Literal = bigint | boolean | number | string | symbol; +/** +* Literal issue interface. +*/ +interface LiteralIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "literal"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Literal schema interface. +*/ +interface LiteralSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "literal"; + /** + * The schema reference. + */ + readonly reference: typeof literal; + /** + * The literal value. + */ + readonly literal: TLiteral; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a literal schema. +* +* @param literal_ The literal value. +* +* @returns A literal schema. +*/ +declare function literal(literal_: TLiteral): LiteralSchema; +/** +* Creates a literal schema. +* +* @param literal_ The literal value. +* @param message The error message. +* +* @returns A literal schema. +*/ +declare function literal | undefined>(literal_: TLiteral, message: TMessage): LiteralSchema; +//#endregion +//#region src/schemas/looseObject/types.d.ts +/** +* Loose object issue interface. +*/ +interface LooseObjectIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "loose_object"; + /** + * The expected property. + */ + readonly expected: "Object" | `"${string}"`; +} +//#endregion +//#region src/schemas/looseObject/looseObject.d.ts +/** +* Loose object schema interface. +*/ +interface LooseObjectSchema | undefined> extends BaseSchema & { + [key: string]: unknown; +}, InferObjectOutput & { + [key: string]: unknown; +}, LooseObjectIssue | InferObjectIssue> { + /** + * The schema type. + */ + readonly type: "loose_object"; + /** + * The schema reference. + */ + readonly reference: typeof looseObject; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a loose object schema. +* +* @param entries The entries schema. +* +* @returns A loose object schema. +*/ +declare function looseObject(entries: TEntries$1): LooseObjectSchema; +/** +* Creates a loose object schema. +* +* @param entries The entries schema. +* @param message The error message. +* +* @returns A loose object schema. +*/ +declare function looseObject | undefined>(entries: TEntries$1, message: TMessage): LooseObjectSchema; +//#endregion +//#region src/schemas/looseObject/looseObjectAsync.d.ts +/** +* Object schema async interface. +*/ +interface LooseObjectSchemaAsync | undefined> extends BaseSchemaAsync & { + [key: string]: unknown; +}, InferObjectOutput & { + [key: string]: unknown; +}, LooseObjectIssue | InferObjectIssue> { + /** + * The schema type. + */ + readonly type: "loose_object"; + /** + * The schema reference. + */ + readonly reference: typeof looseObject | typeof looseObjectAsync; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a loose object schema. +* +* @param entries The entries schema. +* +* @returns A loose object schema. +*/ +declare function looseObjectAsync(entries: TEntries$1): LooseObjectSchemaAsync; +/** +* Creates a loose object schema. +* +* @param entries The entries schema. +* @param message The error message. +* +* @returns A loose object schema. +*/ +declare function looseObjectAsync | undefined>(entries: TEntries$1, message: TMessage): LooseObjectSchemaAsync; +//#endregion +//#region src/schemas/looseTuple/types.d.ts +/** +* Loose tuple issue interface. +*/ +interface LooseTupleIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "loose_tuple"; + /** + * The expected property. + */ + readonly expected: "Array"; +} +//#endregion +//#region src/schemas/looseTuple/looseTuple.d.ts +/** +* Loose tuple schema interface. +*/ +interface LooseTupleSchema | undefined> extends BaseSchema<[...InferTupleInput, ...unknown[]], [...InferTupleOutput, ...unknown[]], LooseTupleIssue | InferTupleIssue> { + /** + * The schema type. + */ + readonly type: "loose_tuple"; + /** + * The schema reference. + */ + readonly reference: typeof looseTuple; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a loose tuple schema. +* +* @param items The items schema. +* +* @returns A loose tuple schema. +*/ +declare function looseTuple(items: TItems$1): LooseTupleSchema; +/** +* Creates a loose tuple schema. +* +* @param items The items schema. +* @param message The error message. +* +* @returns A loose tuple schema. +*/ +declare function looseTuple | undefined>(items: TItems$1, message: TMessage): LooseTupleSchema; +//#endregion +//#region src/schemas/looseTuple/looseTupleAsync.d.ts +/** +* Loose tuple schema async interface. +*/ +interface LooseTupleSchemaAsync | undefined> extends BaseSchemaAsync<[...InferTupleInput, ...unknown[]], [...InferTupleOutput, ...unknown[]], LooseTupleIssue | InferTupleIssue> { + /** + * The schema type. + */ + readonly type: "loose_tuple"; + /** + * The schema reference. + */ + readonly reference: typeof looseTuple | typeof looseTupleAsync; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a loose tuple schema. +* +* @param items The items schema. +* +* @returns A loose tuple schema. +*/ +declare function looseTupleAsync(items: TItems$1): LooseTupleSchemaAsync; +/** +* Creates a loose tuple schema. +* +* @param items The items schema. +* @param message The error message. +* +* @returns A loose tuple schema. +*/ +declare function looseTupleAsync | undefined>(items: TItems$1, message: TMessage): LooseTupleSchemaAsync; +//#endregion +//#region src/schemas/map/types.d.ts +/** +* Map issue interface. +*/ +interface MapIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "map"; + /** + * The expected property. + */ + readonly expected: "Map"; +} +/** +* Infer map input type. +*/ +type InferMapInput> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>> = Map, InferInput>; +/** +* Infer map output type. +*/ +type InferMapOutput> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>> = Map, InferOutput>; +//#endregion +//#region src/schemas/map/map.d.ts +/** +* Map schema interface. +*/ +interface MapSchema>, TValue$1 extends BaseSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferMapOutput, MapIssue | InferIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "map"; + /** + * The schema reference. + */ + readonly reference: typeof map; + /** + * The expected property. + */ + readonly expects: "Map"; + /** + * The map key schema. + */ + readonly key: TKey$1; + /** + * The map value schema. + */ + readonly value: TValue$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a map schema. +* +* @param key The key schema. +* @param value The value schema. +* +* @returns A map schema. +*/ +declare function map>, const TValue$1 extends BaseSchema>>(key: TKey$1, value: TValue$1): MapSchema; +/** +* Creates a map schema. +* +* @param key The key schema. +* @param value The value schema. +* @param message The error message. +* +* @returns A map schema. +*/ +declare function map>, const TValue$1 extends BaseSchema>, const TMessage extends ErrorMessage | undefined>(key: TKey$1, value: TValue$1, message: TMessage): MapSchema; +//#endregion +//#region src/schemas/map/mapAsync.d.ts +/** +* Map schema async interface. +*/ +interface MapSchemaAsync> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferMapOutput, MapIssue | InferIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "map"; + /** + * The schema reference. + */ + readonly reference: typeof map | typeof mapAsync; + /** + * The expected property. + */ + readonly expects: "Map"; + /** + * The map key schema. + */ + readonly key: TKey$1; + /** + * The map value schema. + */ + readonly value: TValue$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a map schema. +* +* @param key The key schema. +* @param value The value schema. +* +* @returns A map schema. +*/ +declare function mapAsync> | BaseSchemaAsync>, const TValue$1 extends BaseSchema> | BaseSchemaAsync>>(key: TKey$1, value: TValue$1): MapSchemaAsync; +/** +* Creates a map schema. +* +* @param key The key schema. +* @param value The value schema. +* @param message The error message. +* +* @returns A map schema. +*/ +declare function mapAsync> | BaseSchemaAsync>, const TValue$1 extends BaseSchema> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(key: TKey$1, value: TValue$1, message: TMessage): MapSchemaAsync; +//#endregion +//#region src/schemas/nan/nan.d.ts +/** +* NaN issue interface. +*/ +interface NanIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "nan"; + /** + * The expected property. + */ + readonly expected: "NaN"; +} +/** +* NaN schema interface. +*/ +interface NanSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "nan"; + /** + * The schema reference. + */ + readonly reference: typeof nan; + /** + * The expected property. + */ + readonly expects: "NaN"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a NaN schema. +* +* @returns A NaN schema. +*/ +declare function nan(): NanSchema; +/** +* Creates a NaN schema. +* +* @param message The error message. +* +* @returns A NaN schema. +*/ +declare function nan | undefined>(message: TMessage): NanSchema; +//#endregion +//#region src/schemas/never/never.d.ts +/** +* Never issue interface. +*/ +interface NeverIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "never"; + /** + * The expected property. + */ + readonly expected: "never"; +} +/** +* Never schema interface. +*/ +interface NeverSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "never"; + /** + * The schema reference. + */ + readonly reference: typeof never; + /** + * The expected property. + */ + readonly expects: "never"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a never schema. +* +* @returns A never schema. +*/ +declare function never(): NeverSchema; +/** +* Creates a never schema. +* +* @param message The error message. +* +* @returns A never schema. +*/ +declare function never | undefined>(message: TMessage): NeverSchema; +//#endregion +//#region src/schemas/union/types.d.ts +/** +* Union issue interface. +*/ +interface UnionIssue> extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "union"; + /** + * The expected property. + */ + readonly expected: string; + /** + * The sub issues. + */ + readonly issues?: [TSubIssue, ...TSubIssue[]]; +} +//#endregion +//#region src/schemas/union/union.d.ts +/** +* Union options type. +*/ +type UnionOptions = MaybeReadonly>[]>; +/** +* Union schema interface. +*/ +interface UnionSchema>> | undefined> extends BaseSchema, InferOutput, UnionIssue> | InferIssue> { + /** + * The schema type. + */ + readonly type: "union"; + /** + * The schema reference. + */ + readonly reference: typeof union; + /** + * The union options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an union schema. +* +* @param options The union options. +* +* @returns An union schema. +*/ +declare function union(options: TOptions$1): UnionSchema; +/** +* Creates an union schema. +* +* @param options The union options. +* @param message The error message. +* +* @returns An union schema. +*/ +declare function union>> | undefined>(options: TOptions$1, message: TMessage): UnionSchema; +//#endregion +//#region src/schemas/union/unionAsync.d.ts +/** +* Union options async type. +*/ +type UnionOptionsAsync = MaybeReadonly<(BaseSchema> | BaseSchemaAsync>)[]>; +/** +* Union schema async interface. +*/ +interface UnionSchemaAsync>> | undefined> extends BaseSchemaAsync, InferOutput, UnionIssue> | InferIssue> { + /** + * The schema type. + */ + readonly type: "union"; + /** + * The schema reference. + */ + readonly reference: typeof union | typeof unionAsync; + /** + * The union options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an union schema. +* +* @param options The union options. +* +* @returns An union schema. +*/ +declare function unionAsync(options: TOptions$1): UnionSchemaAsync; +/** +* Creates an union schema. +* +* @param options The union options. +* @param message The error message. +* +* @returns An union schema. +*/ +declare function unionAsync>> | undefined>(options: TOptions$1, message: TMessage): UnionSchemaAsync; +//#endregion +//#region src/schemas/nonNullable/types.d.ts +/** +* Non nullable issue interface. +*/ +interface NonNullableIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "non_nullable"; + /** + * The expected property. + */ + readonly expected: "!null"; +} +/** +* Infer non nullable input type. +*/ +type InferNonNullableInput> | BaseSchemaAsync>> = NonNullable$1>; +/** +* Infer non nullable output type. +*/ +type InferNonNullableOutput> | BaseSchemaAsync>> = NonNullable$1>; +/** +* Infer non nullable issue type. +*/ +type InferNonNullableIssue> | BaseSchemaAsync>> = TWrapped$1 extends UnionSchema>> | undefined> | UnionSchemaAsync>> | undefined> ? Exclude, { + type: "null" | "union"; +}> | UnionIssue> : Exclude, { + type: "null"; +}>; +//#endregion +//#region src/schemas/nonNullable/nonNullable.d.ts +/** +* Non nullable schema interface. +*/ +interface NonNullableSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferNonNullableOutput, NonNullableIssue | InferNonNullableIssue> { + /** + * The schema type. + */ + readonly type: "non_nullable"; + /** + * The schema reference. + */ + readonly reference: typeof nonNullable; + /** + * The expected property. + */ + readonly expects: "!null"; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non nullable schema. +* +* @param wrapped The wrapped schema. +* +* @returns A non nullable schema. +*/ +declare function nonNullable>>(wrapped: TWrapped$1): NonNullableSchema; +/** +* Creates a non nullable schema. +* +* @param wrapped The wrapped schema. +* @param message The error message. +* +* @returns A non nullable schema. +*/ +declare function nonNullable>, const TMessage extends ErrorMessage | undefined>(wrapped: TWrapped$1, message: TMessage): NonNullableSchema; +//#endregion +//#region src/schemas/nonNullable/nonNullableAsync.d.ts +/** +* Non nullable schema async interface. +*/ +interface NonNullableSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferNonNullableOutput, NonNullableIssue | InferNonNullableIssue> { + /** + * The schema type. + */ + readonly type: "non_nullable"; + /** + * The schema reference. + */ + readonly reference: typeof nonNullable | typeof nonNullableAsync; + /** + * The expected property. + */ + readonly expects: "!null"; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non nullable schema. +* +* @param wrapped The wrapped schema. +* +* @returns A non nullable schema. +*/ +declare function nonNullableAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): NonNullableSchemaAsync; +/** +* Creates a non nullable schema. +* +* @param wrapped The wrapped schema. +* @param message The error message. +* +* @returns A non nullable schema. +*/ +declare function nonNullableAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(wrapped: TWrapped$1, message: TMessage): NonNullableSchemaAsync; +//#endregion +//#region src/schemas/nonNullish/types.d.ts +/** +* Non nullish issue interface. +*/ +interface NonNullishIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "non_nullish"; + /** + * The expected property. + */ + readonly expected: "(!null & !undefined)"; +} +/** +* Infer non nullish input type. +*/ +type InferNonNullishInput> | BaseSchemaAsync>> = NonNullish>; +/** +* Infer non nullish output type. +*/ +type InferNonNullishOutput> | BaseSchemaAsync>> = NonNullish>; +/** +* Infer non nullish issue type. +*/ +type InferNonNullishIssue> | BaseSchemaAsync>> = TWrapped$1 extends UnionSchema>> | undefined> | UnionSchemaAsync>> | undefined> ? Exclude, { + type: "null" | "undefined" | "union"; +}> | UnionIssue> : Exclude, { + type: "null" | "undefined"; +}>; +//#endregion +//#region src/schemas/nonNullish/nonNullish.d.ts +/** +* Non nullish schema interface. +*/ +interface NonNullishSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferNonNullishOutput, NonNullishIssue | InferNonNullishIssue> { + /** + * The schema type. + */ + readonly type: "non_nullish"; + /** + * The schema reference. + */ + readonly reference: typeof nonNullish; + /** + * The expected property. + */ + readonly expects: "(!null & !undefined)"; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non nullish schema. +* +* @param wrapped The wrapped schema. +* +* @returns A non nullish schema. +*/ +declare function nonNullish>>(wrapped: TWrapped$1): NonNullishSchema; +/** +* Creates a non nullish schema. +* +* @param wrapped The wrapped schema. +* @param message The error message. +* +* @returns A non nullish schema. +*/ +declare function nonNullish>, const TMessage extends ErrorMessage | undefined>(wrapped: TWrapped$1, message: TMessage): NonNullishSchema; +//#endregion +//#region src/schemas/nonNullish/nonNullishAsync.d.ts +/** +* Non nullish schema async interface. +*/ +interface NonNullishSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferNonNullishOutput, NonNullishIssue | InferNonNullishIssue> { + /** + * The schema type. + */ + readonly type: "non_nullish"; + /** + * The schema reference. + */ + readonly reference: typeof nonNullish | typeof nonNullishAsync; + /** + * The expected property. + */ + readonly expects: "(!null & !undefined)"; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non nullish schema. +* +* @param wrapped The wrapped schema. +* +* @returns A non nullish schema. +*/ +declare function nonNullishAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): NonNullishSchemaAsync; +/** +* Creates a non nullish schema. +* +* @param wrapped The wrapped schema. +* @param message The error message. +* +* @returns A non nullish schema. +*/ +declare function nonNullishAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(wrapped: TWrapped$1, message: TMessage): NonNullishSchemaAsync; +//#endregion +//#region src/schemas/nonOptional/types.d.ts +/** +* Non optional issue interface. +*/ +interface NonOptionalIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "non_optional"; + /** + * The expected property. + */ + readonly expected: "!undefined"; +} +/** +* Infer non optional input type. +*/ +type InferNonOptionalInput> | BaseSchemaAsync>> = NonOptional>; +/** +* Infer non optional output type. +*/ +type InferNonOptionalOutput> | BaseSchemaAsync>> = NonOptional>; +/** +* Infer non optional issue type. +*/ +type InferNonOptionalIssue> | BaseSchemaAsync>> = TWrapped$1 extends UnionSchema>> | undefined> | UnionSchemaAsync>> | undefined> ? Exclude, { + type: "undefined" | "union"; +}> | UnionIssue> : Exclude, { + type: "undefined"; +}>; +//#endregion +//#region src/schemas/nonOptional/nonOptional.d.ts +/** +* Non optional schema interface. +*/ +interface NonOptionalSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferNonOptionalOutput, NonOptionalIssue | InferNonOptionalIssue> { + /** + * The schema type. + */ + readonly type: "non_optional"; + /** + * The schema reference. + */ + readonly reference: typeof nonOptional; + /** + * The expected property. + */ + readonly expects: "!undefined"; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non optional schema. +* +* @param wrapped The wrapped schema. +* +* @returns A non optional schema. +*/ +declare function nonOptional>>(wrapped: TWrapped$1): NonOptionalSchema; +/** +* Creates a non optional schema. +* +* @param wrapped The wrapped schema. +* @param message The error message. +* +* @returns A non optional schema. +*/ +declare function nonOptional>, const TMessage extends ErrorMessage | undefined>(wrapped: TWrapped$1, message: TMessage): NonOptionalSchema; +//#endregion +//#region src/schemas/nonOptional/nonOptionalAsync.d.ts +/** +* Non optional schema async interface. +*/ +interface NonOptionalSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferNonOptionalOutput, NonOptionalIssue | InferNonOptionalIssue> { + /** + * The schema type. + */ + readonly type: "non_optional"; + /** + * The schema reference. + */ + readonly reference: typeof nonOptional | typeof nonOptionalAsync; + /** + * The expected property. + */ + readonly expects: "!undefined"; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non optional schema. +* +* @param wrapped The wrapped schema. +* +* @returns A non optional schema. +*/ +declare function nonOptionalAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): NonOptionalSchemaAsync; +/** +* Creates a non optional schema. +* +* @param wrapped The wrapped schema. +* @param message The error message. +* +* @returns A non optional schema. +*/ +declare function nonOptionalAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(wrapped: TWrapped$1, message: TMessage): NonOptionalSchemaAsync; +//#endregion +//#region src/schemas/null/null.d.ts +/** +* Null issue interface. +*/ +interface NullIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "null"; + /** + * The expected property. + */ + readonly expected: "null"; +} +/** +* Null schema interface. +*/ +interface NullSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "null"; + /** + * The schema reference. + */ + readonly reference: typeof null_; + /** + * The expected property. + */ + readonly expects: "null"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a null schema. +* +* @returns A null schema. +*/ +declare function null_(): NullSchema; +/** +* Creates a null schema. +* +* @param message The error message. +* +* @returns A null schema. +*/ +declare function null_ | undefined>(message: TMessage): NullSchema; +//#endregion +//#region src/schemas/nullable/types.d.ts +/** +* Infer nullable output type. +*/ +type InferNullableOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | null : InferOutput | Extract, null>; +//#endregion +//#region src/schemas/nullable/nullable.d.ts +/** +* Nullable schema interface. +*/ +interface NullableSchema>, TDefault extends Default> extends BaseSchema | null, InferNullableOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "nullable"; + /** + * The schema reference. + */ + readonly reference: typeof nullable; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | null)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates a nullable schema. +* +* @param wrapped The wrapped schema. +* +* @returns A nullable schema. +*/ +declare function nullable>>(wrapped: TWrapped$1): NullableSchema; +/** +* Creates a nullable schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns A nullable schema. +*/ +declare function nullable>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): NullableSchema; +//#endregion +//#region src/schemas/nullable/nullableAsync.d.ts +/** +* Nullable schema async interface. +*/ +interface NullableSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync | null, InferNullableOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "nullable"; + /** + * The schema reference. + */ + readonly reference: typeof nullable | typeof nullableAsync; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | null)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates a nullable schema. +* +* @param wrapped The wrapped schema. +* +* @returns A nullable schema. +*/ +declare function nullableAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): NullableSchemaAsync; +/** +* Creates a nullable schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns A nullable schema. +*/ +declare function nullableAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): NullableSchemaAsync; +//#endregion +//#region src/schemas/nullish/types.d.ts +/** +* Infer nullish output type. +*/ +type InferNullishOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | null | undefined : InferOutput | Extract, null | undefined>; +//#endregion +//#region src/schemas/nullish/nullish.d.ts +/** +* Nullish schema interface. +*/ +interface NullishSchema>, TDefault extends Default> extends BaseSchema | null | undefined, InferNullishOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "nullish"; + /** + * The schema reference. + */ + readonly reference: typeof nullish; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | null | undefined)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates a nullish schema. +* +* @param wrapped The wrapped schema. +* +* @returns A nullish schema. +*/ +declare function nullish>>(wrapped: TWrapped$1): NullishSchema; +/** +* Creates a nullish schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns A nullish schema. +*/ +declare function nullish>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): NullishSchema; +//#endregion +//#region src/schemas/nullish/nullishAsync.d.ts +/** +* Nullish schema async interface. +*/ +interface NullishSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync | null | undefined, InferNullishOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "nullish"; + /** + * The schema reference. + */ + readonly reference: typeof nullish | typeof nullishAsync; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | null | undefined)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates a nullish schema. +* +* @param wrapped The wrapped schema. +* +* @returns A nullish schema. +*/ +declare function nullishAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): NullishSchemaAsync; +/** +* Creates a nullish schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns A nullish schema. +*/ +declare function nullishAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): NullishSchemaAsync; +//#endregion +//#region src/schemas/number/number.d.ts +/** +* Number issue interface. +*/ +interface NumberIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "number"; + /** + * The expected property. + */ + readonly expected: "number"; +} +/** +* Number schema interface. +*/ +interface NumberSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "number"; + /** + * The schema reference. + */ + readonly reference: typeof number; + /** + * The expected property. + */ + readonly expects: "number"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a number schema. +* +* @returns A number schema. +*/ +declare function number(): NumberSchema; +/** +* Creates a number schema. +* +* @param message The error message. +* +* @returns A number schema. +*/ +declare function number | undefined>(message: TMessage): NumberSchema; +//#endregion +//#region src/schemas/object/types.d.ts +/** +* Object issue interface. +*/ +interface ObjectIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "object"; + /** + * The expected property. + */ + readonly expected: "Object" | `"${string}"`; +} +//#endregion +//#region src/schemas/object/object.d.ts +/** +* Object schema interface. +*/ +interface ObjectSchema | undefined> extends BaseSchema, InferObjectOutput, ObjectIssue | InferObjectIssue> { + /** + * The schema type. + */ + readonly type: "object"; + /** + * The schema reference. + */ + readonly reference: typeof object; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an object schema. +* +* Hint: This schema removes unknown entries. The output will only include the +* entries you specify. To include unknown entries, use `looseObject`. To +* return an issue for unknown entries, use `strictObject`. To include and +* validate unknown entries, use `objectWithRest`. +* +* @param entries The entries schema. +* +* @returns An object schema. +*/ +declare function object(entries: TEntries$1): ObjectSchema; +/** +* Creates an object schema. +* +* Hint: This schema removes unknown entries. The output will only include the +* entries you specify. To include unknown entries, use `looseObject`. To +* return an issue for unknown entries, use `strictObject`. To include and +* validate unknown entries, use `objectWithRest`. +* +* @param entries The entries schema. +* @param message The error message. +* +* @returns An object schema. +*/ +declare function object | undefined>(entries: TEntries$1, message: TMessage): ObjectSchema; +//#endregion +//#region src/schemas/object/objectAsync.d.ts +/** +* Object schema async interface. +*/ +interface ObjectSchemaAsync | undefined> extends BaseSchemaAsync, InferObjectOutput, ObjectIssue | InferObjectIssue> { + /** + * The schema type. + */ + readonly type: "object"; + /** + * The schema reference. + */ + readonly reference: typeof object | typeof objectAsync; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an object schema. +* +* Hint: This schema removes unknown entries. The output will only include the +* entries you specify. To include unknown entries, use `looseObjectAsync`. To +* return an issue for unknown entries, use `strictObjectAsync`. To include and +* validate unknown entries, use `objectWithRestAsync`. +* +* @param entries The entries schema. +* +* @returns An object schema. +*/ +declare function objectAsync(entries: TEntries$1): ObjectSchemaAsync; +/** +* Creates an object schema. +* +* Hint: This schema removes unknown entries. The output will only include the +* entries you specify. To include unknown entries, use `looseObjectAsync`. To +* return an issue for unknown entries, use `strictObjectAsync`. To include and +* validate unknown entries, use `objectWithRestAsync`. +* +* @param entries The entries schema. +* @param message The error message. +* +* @returns An object schema. +*/ +declare function objectAsync | undefined>(entries: TEntries$1, message: TMessage): ObjectSchemaAsync; +//#endregion +//#region src/schemas/objectWithRest/types.d.ts +/** +* Object with rest issue interface. +*/ +interface ObjectWithRestIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "object_with_rest"; + /** + * The expected property. + */ + readonly expected: "Object" | `"${string}"`; +} +//#endregion +//#region src/schemas/objectWithRest/objectWithRest.d.ts +/** +* Object with rest schema interface. +*/ +interface ObjectWithRestSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema & { + [key: string]: InferInput; +}, InferObjectOutput & { + [key: string]: InferOutput; +}, ObjectWithRestIssue | InferObjectIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "object_with_rest"; + /** + * The schema reference. + */ + readonly reference: typeof objectWithRest; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The rest schema. + */ + readonly rest: TRest$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an object with rest schema. +* +* @param entries The entries schema. +* @param rest The rest schema. +* +* @returns An object with rest schema. +*/ +declare function objectWithRest>>(entries: TEntries$1, rest: TRest$1): ObjectWithRestSchema; +/** +* Creates an object with rest schema. +* +* @param entries The entries schema. +* @param rest The rest schema. +* @param message The error message. +* +* @returns An object with rest schema. +*/ +declare function objectWithRest>, const TMessage extends ErrorMessage | undefined>(entries: TEntries$1, rest: TRest$1, message: TMessage): ObjectWithRestSchema; +//#endregion +//#region src/schemas/objectWithRest/objectWithRestAsync.d.ts +/** +* Object schema async interface. +*/ +interface ObjectWithRestSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync & { + [key: string]: InferInput; +}, InferObjectOutput & { + [key: string]: InferOutput; +}, ObjectWithRestIssue | InferObjectIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "object_with_rest"; + /** + * The schema reference. + */ + readonly reference: typeof objectWithRest | typeof objectWithRestAsync; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The rest schema. + */ + readonly rest: TRest$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an object with rest schema. +* +* @param entries The entries schema. +* @param rest The rest schema. +* +* @returns An object with rest schema. +*/ +declare function objectWithRestAsync> | BaseSchemaAsync>>(entries: TEntries$1, rest: TRest$1): ObjectWithRestSchemaAsync; +/** +* Creates an object with rest schema. +* +* @param entries The entries schema. +* @param rest The rest schema. +* @param message The error message. +* +* @returns An object with rest schema. +*/ +declare function objectWithRestAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(entries: TEntries$1, rest: TRest$1, message: TMessage): ObjectWithRestSchemaAsync; +//#endregion +//#region src/schemas/optional/types.d.ts +/** +* Infer optional output type. +*/ +type InferOptionalOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | undefined : InferOutput | Extract, undefined>; +//#endregion +//#region src/schemas/optional/optional.d.ts +/** +* Optional schema interface. +*/ +interface OptionalSchema>, TDefault extends Default> extends BaseSchema | undefined, InferOptionalOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "optional"; + /** + * The schema reference. + */ + readonly reference: typeof optional; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | undefined)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates an optional schema. +* +* @param wrapped The wrapped schema. +* +* @returns An optional schema. +*/ +declare function optional>>(wrapped: TWrapped$1): OptionalSchema; +/** +* Creates an optional schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns An optional schema. +*/ +declare function optional>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): OptionalSchema; +//#endregion +//#region src/schemas/optional/optionalAsync.d.ts +/** +* Optional schema async interface. +*/ +interface OptionalSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync | undefined, InferOptionalOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "optional"; + /** + * The schema reference. + */ + readonly reference: typeof optional | typeof optionalAsync; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | undefined)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates an optional schema. +* +* @param wrapped The wrapped schema. +* +* @returns An optional schema. +*/ +declare function optionalAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): OptionalSchemaAsync; +/** +* Creates an optional schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns An optional schema. +*/ +declare function optionalAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): OptionalSchemaAsync; +//#endregion +//#region src/schemas/picklist/picklist.d.ts +/** +* Picklist options type. +*/ +type PicklistOptions = MaybeReadonly<(string | number | bigint)[]>; +/** +* Picklist issue interface. +*/ +interface PicklistIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "picklist"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Picklist schema interface. +*/ +interface PicklistSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "picklist"; + /** + * The schema reference. + */ + readonly reference: typeof picklist; + /** + * The picklist options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a picklist schema. +* +* @param options The picklist options. +* +* @returns A picklist schema. +*/ +declare function picklist(options: TOptions$1): PicklistSchema; +/** +* Creates a picklist schema. +* +* @param options The picklist options. +* @param message The error message. +* +* @returns A picklist schema. +*/ +declare function picklist | undefined>(options: TOptions$1, message: TMessage): PicklistSchema; +//#endregion +//#region src/schemas/promise/promise.d.ts +/** +* Promise issue interface. +*/ +interface PromiseIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "promise"; + /** + * The expected property. + */ + readonly expected: "Promise"; +} +/** +* Promise schema interface. +*/ +interface PromiseSchema | undefined> extends BaseSchema, Promise, PromiseIssue> { + /** + * The schema type. + */ + readonly type: "promise"; + /** + * The schema reference. + */ + readonly reference: typeof promise; + /** + * The expected property. + */ + readonly expects: "Promise"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a promise schema. +* +* @returns A promise schema. +*/ +declare function promise(): PromiseSchema; +/** +* Creates a promise schema. +* +* @param message The error message. +* +* @returns A promise schema. +*/ +declare function promise | undefined>(message: TMessage): PromiseSchema; +//#endregion +//#region src/schemas/record/types.d.ts +/** +* Record issue interface. +*/ +interface RecordIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "record"; + /** + * The expected property. + */ + readonly expected: "Object"; +} +/** +* Is literal type. +*/ +type IsLiteral = string extends TKey$1 ? false : number extends TKey$1 ? false : symbol extends TKey$1 ? false : TKey$1 extends Brand ? false : true; +/** +* Optional keys type. +*/ +type OptionalKeys> = { [TKey in keyof TObject]: IsLiteral extends true ? TKey : never }[keyof TObject]; +/** +* With question marks type. +* +* Hint: We mark an entry as optional if we detect that its key is a literal +* type. The reason for this is that it is not technically possible to detect +* missing literal keys without restricting the key schema to `string`, `enum` +* and `picklist`. However, if `enum` and `picklist` are used, it is better to +* use `object` with `entriesFromList` because it already covers the needed +* functionality. This decision also reduces the bundle size of `record`, +* because it only needs to check the entries of the input and not any missing +* keys. +*/ +type WithQuestionMarks> = MarkOptional>; +/** +* With readonly type. +*/ +type WithReadonly> | BaseSchemaAsync>, TObject extends WithQuestionMarks>> = TValue$1 extends { + readonly pipe: readonly unknown[]; +} ? ReadonlyAction extends TValue$1["pipe"][number] ? Readonly : TObject : TObject; +/** +* Infer record input type. +*/ +type InferRecordInput> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>> = Prettify, InferInput>>>; +/** +* Infer record output type. +*/ +type InferRecordOutput> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>> = Prettify, InferOutput>>>>; +//#endregion +//#region src/schemas/record/record.d.ts +/** +* Record schema interface. +*/ +interface RecordSchema>, TValue$1 extends BaseSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferRecordOutput, RecordIssue | InferIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "record"; + /** + * The schema reference. + */ + readonly reference: typeof record; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The record key schema. + */ + readonly key: TKey$1; + /** + * The record value schema. + */ + readonly value: TValue$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a record schema. +* +* @param key The key schema. +* @param value The value schema. +* +* @returns A record schema. +*/ +declare function record>, const TValue$1 extends BaseSchema>>(key: TKey$1, value: TValue$1): RecordSchema; +/** +* Creates a record schema. +* +* @param key The key schema. +* @param value The value schema. +* @param message The error message. +* +* @returns A record schema. +*/ +declare function record>, const TValue$1 extends BaseSchema>, const TMessage extends ErrorMessage | undefined>(key: TKey$1, value: TValue$1, message: TMessage): RecordSchema; +//#endregion +//#region src/schemas/record/recordAsync.d.ts +/** +* Record schema async interface. +*/ +interface RecordSchemaAsync> | BaseSchemaAsync>, TValue$1 extends BaseSchema> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferRecordOutput, RecordIssue | InferIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "record"; + /** + * The schema reference. + */ + readonly reference: typeof record | typeof recordAsync; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The record key schema. + */ + readonly key: TKey$1; + /** + * The record value schema. + */ + readonly value: TValue$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a record schema. +* +* @param key The key schema. +* @param value The value schema. +* +* @returns A record schema. +*/ +declare function recordAsync> | BaseSchemaAsync>, const TValue$1 extends BaseSchema> | BaseSchemaAsync>>(key: TKey$1, value: TValue$1): RecordSchemaAsync; +/** +* Creates a record schema. +* +* @param key The key schema. +* @param value The value schema. +* @param message The error message. +* +* @returns A record schema. +*/ +declare function recordAsync> | BaseSchemaAsync>, const TValue$1 extends BaseSchema> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(key: TKey$1, value: TValue$1, message: TMessage): RecordSchemaAsync; +//#endregion +//#region src/schemas/set/types.d.ts +/** +* Set issue interface. +*/ +interface SetIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "set"; + /** + * The expected property. + */ + readonly expected: "Set"; +} +/** +* Infer set input type. +*/ +type InferSetInput> | BaseSchemaAsync>> = Set>; +/** +* Infer set output type. +*/ +type InferSetOutput> | BaseSchemaAsync>> = Set>; +//#endregion +//#region src/schemas/set/set.d.ts +/** +* Set schema interface. +*/ +interface SetSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferSetOutput, SetIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "set"; + /** + * The schema reference. + */ + readonly reference: typeof set; + /** + * The expected property. + */ + readonly expects: "Set"; + /** + * The set value schema. + */ + readonly value: TValue$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a set schema. +* +* @param value The value schema. +* +* @returns A set schema. +*/ +declare function set>>(value: TValue$1): SetSchema; +/** +* Creates a set schema. +* +* @param value The value schema. +* @param message The error message. +* +* @returns A set schema. +*/ +declare function set>, const TMessage extends ErrorMessage | undefined>(value: TValue$1, message: TMessage): SetSchema; +//#endregion +//#region src/schemas/set/setAsync.d.ts +/** +* Set schema async interface. +*/ +interface SetSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferSetOutput, SetIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "set"; + /** + * The schema reference. + */ + readonly reference: typeof set | typeof setAsync; + /** + * The expected property. + */ + readonly expects: "Set"; + /** + * The set value schema. + */ + readonly value: TValue$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a set schema. +* +* @param value The value schema. +* +* @returns A set schema. +*/ +declare function setAsync> | BaseSchemaAsync>>(value: TValue$1): SetSchemaAsync; +/** +* Creates a set schema. +* +* @param value The value schema. +* @param message The error message. +* +* @returns A set schema. +*/ +declare function setAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(value: TValue$1, message: TMessage): SetSchemaAsync; +//#endregion +//#region src/schemas/strictObject/types.d.ts +/** +* Strict object issue interface. +*/ +interface StrictObjectIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "strict_object"; + /** + * The expected property. + */ + readonly expected: "Object" | `"${string}"` | "never"; +} +//#endregion +//#region src/schemas/strictObject/strictObject.d.ts +/** +* Strict object schema interface. +*/ +interface StrictObjectSchema | undefined> extends BaseSchema, InferObjectOutput, StrictObjectIssue | InferObjectIssue> { + /** + * The schema type. + */ + readonly type: "strict_object"; + /** + * The schema reference. + */ + readonly reference: typeof strictObject; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a strict object schema. +* +* @param entries The entries schema. +* +* @returns A strict object schema. +*/ +declare function strictObject(entries: TEntries$1): StrictObjectSchema; +/** +* Creates a strict object schema. +* +* @param entries The entries schema. +* @param message The error message. +* +* @returns A strict object schema. +*/ +declare function strictObject | undefined>(entries: TEntries$1, message: TMessage): StrictObjectSchema; +//#endregion +//#region src/schemas/strictObject/strictObjectAsync.d.ts +/** +* Strict object schema async interface. +*/ +interface StrictObjectSchemaAsync | undefined> extends BaseSchemaAsync, InferObjectOutput, StrictObjectIssue | InferObjectIssue> { + /** + * The schema type. + */ + readonly type: "strict_object"; + /** + * The schema reference. + */ + readonly reference: typeof strictObject | typeof strictObjectAsync; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The entries schema. + */ + readonly entries: TEntries$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a strict object schema. +* +* @param entries The entries schema. +* +* @returns A strict object schema. +*/ +declare function strictObjectAsync(entries: TEntries$1): StrictObjectSchemaAsync; +/** +* Creates a strict object schema. +* +* @param entries The entries schema. +* @param message The error message. +* +* @returns A strict object schema. +*/ +declare function strictObjectAsync | undefined>(entries: TEntries$1, message: TMessage): StrictObjectSchemaAsync; +//#endregion +//#region src/schemas/strictTuple/types.d.ts +/** +* Strict tuple issue interface. +*/ +interface StrictTupleIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "strict_tuple"; + /** + * The expected property. + */ + readonly expected: "Array" | "never"; +} +//#endregion +//#region src/schemas/strictTuple/strictTuple.d.ts +/** +* Strict tuple schema interface. +*/ +interface StrictTupleSchema | undefined> extends BaseSchema, InferTupleOutput, StrictTupleIssue | InferTupleIssue> { + /** + * The schema type. + */ + readonly type: "strict_tuple"; + /** + * The schema reference. + */ + readonly reference: typeof strictTuple; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a strict tuple schema. +* +* @param items The items schema. +* +* @returns A strict tuple schema. +*/ +declare function strictTuple(items: TItems$1): StrictTupleSchema; +/** +* Creates a strict tuple schema. +* +* @param items The items schema. +* @param message The error message. +* +* @returns A strict tuple schema. +*/ +declare function strictTuple | undefined>(items: TItems$1, message: TMessage): StrictTupleSchema; +//#endregion +//#region src/schemas/strictTuple/strictTupleAsync.d.ts +/** +* Strict tuple schema async interface. +*/ +interface StrictTupleSchemaAsync | undefined> extends BaseSchemaAsync, InferTupleOutput, StrictTupleIssue | InferTupleIssue> { + /** + * The schema type. + */ + readonly type: "strict_tuple"; + /** + * The schema reference. + */ + readonly reference: typeof strictTuple | typeof strictTupleAsync; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a strict tuple schema. +* +* @param items The items schema. +* +* @returns A strict tuple schema. +*/ +declare function strictTupleAsync(items: TItems$1): StrictTupleSchemaAsync; +/** +* Creates a strict tuple schema. +* +* @param items The items schema. +* @param message The error message. +* +* @returns A strict tuple schema. +*/ +declare function strictTupleAsync | undefined>(items: TItems$1, message: TMessage): StrictTupleSchemaAsync; +//#endregion +//#region src/schemas/string/string.d.ts +/** +* String issue interface. +*/ +interface StringIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "string"; + /** + * The expected property. + */ + readonly expected: "string"; +} +/** +* String schema interface. +*/ +interface StringSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "string"; + /** + * The schema reference. + */ + readonly reference: typeof string; + /** + * The expected property. + */ + readonly expects: "string"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a string schema. +* +* @returns A string schema. +*/ +declare function string(): StringSchema; +/** +* Creates a string schema. +* +* @param message The error message. +* +* @returns A string schema. +*/ +declare function string | undefined>(message: TMessage): StringSchema; +//#endregion +//#region src/schemas/symbol/symbol.d.ts +/** +* Symbol issue interface. +*/ +interface SymbolIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "symbol"; + /** + * The expected property. + */ + readonly expected: "symbol"; +} +/** +* Symbol schema interface. +*/ +interface SymbolSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "symbol"; + /** + * The schema reference. + */ + readonly reference: typeof symbol; + /** + * The expected property. + */ + readonly expects: "symbol"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a symbol schema. +* +* @returns A symbol schema. +*/ +declare function symbol(): SymbolSchema; +/** +* Creates a symbol schema. +* +* @param message The error message. +* +* @returns A symbol schema. +*/ +declare function symbol | undefined>(message: TMessage): SymbolSchema; +//#endregion +//#region src/schemas/tuple/types.d.ts +/** +* Tuple issue interface. +*/ +interface TupleIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "tuple"; + /** + * The expected property. + */ + readonly expected: "Array"; +} +//#endregion +//#region src/schemas/tuple/tuple.d.ts +/** +* Tuple schema interface. +*/ +interface TupleSchema | undefined> extends BaseSchema, InferTupleOutput, TupleIssue | InferTupleIssue> { + /** + * The schema type. + */ + readonly type: "tuple"; + /** + * The schema reference. + */ + readonly reference: typeof tuple; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a tuple schema. +* +* Hint: This schema removes unknown items. The output will only include the +* items you specify. To include unknown items, use `looseTuple`. To +* return an issue for unknown items, use `strictTuple`. To include and +* validate unknown items, use `tupleWithRest`. +* +* @param items The items schema. +* +* @returns A tuple schema. +*/ +declare function tuple(items: TItems$1): TupleSchema; +/** +* Creates a tuple schema. +* +* Hint: This schema removes unknown items. The output will only include the +* items you specify. To include unknown items, use `looseTuple`. To +* return an issue for unknown items, use `strictTuple`. To include and +* validate unknown items, use `tupleWithRest`. +* +* @param items The items schema. +* @param message The error message. +* +* @returns A tuple schema. +*/ +declare function tuple | undefined>(items: TItems$1, message: TMessage): TupleSchema; +//#endregion +//#region src/schemas/tuple/tupleAsync.d.ts +/** +* Tuple schema async interface. +*/ +interface TupleSchemaAsync | undefined> extends BaseSchemaAsync, InferTupleOutput, TupleIssue | InferTupleIssue> { + /** + * The schema type. + */ + readonly type: "tuple"; + /** + * The schema reference. + */ + readonly reference: typeof tuple | typeof tupleAsync; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a tuple schema. +* +* Hint: This schema removes unknown items. The output will only include the +* items you specify. To include unknown items, use `looseTupleAsync`. To +* return an issue for unknown items, use `strictTupleAsync`. To include and +* validate unknown items, use `tupleWithRestAsync`. +* +* @param items The items schema. +* +* @returns A tuple schema. +*/ +declare function tupleAsync(items: TItems$1): TupleSchemaAsync; +/** +* Creates a tuple schema. +* +* Hint: This schema removes unknown items. The output will only include the +* items you specify. To include unknown items, use `looseTupleAsync`. To +* return an issue for unknown items, use `strictTupleAsync`. To include and +* validate unknown items, use `tupleWithRestAsync`. +* +* @param items The items schema. +* @param message The error message. +* +* @returns A tuple schema. +*/ +declare function tupleAsync | undefined>(items: TItems$1, message: TMessage): TupleSchemaAsync; +//#endregion +//#region src/schemas/tupleWithRest/types.d.ts +/** +* Tuple with rest issue interface. +*/ +interface TupleWithRestIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "tuple_with_rest"; + /** + * The expected property. + */ + readonly expected: "Array"; +} +//#endregion +//#region src/schemas/tupleWithRest/tupleWithRest.d.ts +/** +* Tuple with rest schema interface. +*/ +interface TupleWithRestSchema>, TMessage extends ErrorMessage | undefined> extends BaseSchema<[...InferTupleInput, ...InferInput[]], [...InferTupleOutput, ...InferOutput[]], TupleWithRestIssue | InferTupleIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "tuple_with_rest"; + /** + * The schema reference. + */ + readonly reference: typeof tupleWithRest; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The rest schema. + */ + readonly rest: TRest$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a tuple with rest schema. +* +* @param items The items schema. +* @param rest The rest schema. +* +* @returns A tuple with rest schema. +*/ +declare function tupleWithRest>>(items: TItems$1, rest: TRest$1): TupleWithRestSchema; +/** +* Creates a tuple with rest schema. +* +* @param items The items schema. +* @param rest The rest schema. +* @param message The error message. +* +* @returns A tuple with rest schema. +*/ +declare function tupleWithRest>, const TMessage extends ErrorMessage | undefined>(items: TItems$1, rest: TRest$1, message: TMessage): TupleWithRestSchema; +//#endregion +//#region src/schemas/tupleWithRest/tupleWithRestAsync.d.ts +/** +* Tuple with rest schema async interface. +*/ +interface TupleWithRestSchemaAsync> | BaseSchemaAsync>, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync<[...InferTupleInput, ...InferInput[]], [...InferTupleOutput, ...InferOutput[]], TupleWithRestIssue | InferTupleIssue | InferIssue> { + /** + * The schema type. + */ + readonly type: "tuple_with_rest"; + /** + * The schema reference. + */ + readonly reference: typeof tupleWithRest | typeof tupleWithRestAsync; + /** + * The expected property. + */ + readonly expects: "Array"; + /** + * The items schema. + */ + readonly items: TItems$1; + /** + * The rest schema. + */ + readonly rest: TRest$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a tuple with rest schema. +* +* @param items The items schema. +* @param rest The rest schema. +* +* @returns A tuple with rest schema. +*/ +declare function tupleWithRestAsync> | BaseSchemaAsync>>(items: TItems$1, rest: TRest$1): TupleWithRestSchemaAsync; +/** +* Creates a tuple with rest schema. +* +* @param items The items schema. +* @param rest The rest schema. +* @param message The error message. +* +* @returns A tuple with rest schema. +*/ +declare function tupleWithRestAsync> | BaseSchemaAsync>, const TMessage extends ErrorMessage | undefined>(items: TItems$1, rest: TRest$1, message: TMessage): TupleWithRestSchemaAsync; +//#endregion +//#region src/schemas/undefined/undefined.d.ts +/** +* Undefined issue interface. +*/ +interface UndefinedIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "undefined"; + /** + * The expected property. + */ + readonly expected: "undefined"; +} +/** +* Undefined schema interface. +*/ +interface UndefinedSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "undefined"; + /** + * The schema reference. + */ + readonly reference: typeof undefined_; + /** + * The expected property. + */ + readonly expects: "undefined"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an undefined schema. +* +* @returns An undefined schema. +*/ +declare function undefined_(): UndefinedSchema; +/** +* Creates an undefined schema. +* +* @param message The error message. +* +* @returns An undefined schema. +*/ +declare function undefined_ | undefined>(message: TMessage): UndefinedSchema; +//#endregion +//#region src/schemas/undefinedable/types.d.ts +/** +* Infer undefinedable output type. +*/ +type InferUndefinedableOutput> | BaseSchemaAsync>, TDefault extends DefaultAsync> = undefined extends TDefault ? InferOutput | undefined : InferOutput | Extract, undefined>; +//#endregion +//#region src/schemas/undefinedable/undefinedable.d.ts +/** +* Undefinedable schema interface. +*/ +interface UndefinedableSchema>, TDefault extends Default> extends BaseSchema | undefined, InferUndefinedableOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "undefinedable"; + /** + * The schema reference. + */ + readonly reference: typeof undefinedable; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | undefined)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates an undefinedable schema. +* +* @param wrapped The wrapped schema. +* +* @returns An undefinedable schema. +*/ +declare function undefinedable>>(wrapped: TWrapped$1): UndefinedableSchema; +/** +* Creates an undefinedable schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns An undefinedable schema. +*/ +declare function undefinedable>, const TDefault extends Default>(wrapped: TWrapped$1, default_: TDefault): UndefinedableSchema; +//#endregion +//#region src/schemas/undefinedable/undefinedableAsync.d.ts +/** +* Undefinedable schema async interface. +*/ +interface UndefinedableSchemaAsync> | BaseSchemaAsync>, TDefault extends DefaultAsync> extends BaseSchemaAsync | undefined, InferUndefinedableOutput, InferIssue> { + /** + * The schema type. + */ + readonly type: "undefinedable"; + /** + * The schema reference. + */ + readonly reference: typeof undefinedable | typeof undefinedableAsync; + /** + * The expected property. + */ + readonly expects: `(${TWrapped$1["expects"]} | undefined)`; + /** + * The wrapped schema. + */ + readonly wrapped: TWrapped$1; + /** + * The default value. + */ + readonly default: TDefault; +} +/** +* Creates an undefinedable schema. +* +* @param wrapped The wrapped schema. +* +* @returns An undefinedable schema. +*/ +declare function undefinedableAsync> | BaseSchemaAsync>>(wrapped: TWrapped$1): UndefinedableSchemaAsync; +/** +* Creates an undefinedable schema. +* +* @param wrapped The wrapped schema. +* @param default_ The default value. +* +* @returns An undefinedable schema. +*/ +declare function undefinedableAsync> | BaseSchemaAsync>, const TDefault extends DefaultAsync>(wrapped: TWrapped$1, default_: TDefault): UndefinedableSchemaAsync; +//#endregion +//#region src/schemas/unknown/unknown.d.ts +/** +* Unknown schema interface. +*/ +interface UnknownSchema extends BaseSchema { + /** + * The schema type. + */ + readonly type: "unknown"; + /** + * The schema reference. + */ + readonly reference: typeof unknown; + /** + * The expected property. + */ + readonly expects: "unknown"; +} +/** +* Creates a unknown schema. +* +* @returns A unknown schema. +*/ +declare function unknown(): UnknownSchema; +//#endregion +//#region src/schemas/variant/variant.d.ts +/** +* Variant schema interface. +*/ +interface VariantSchema, TMessage extends ErrorMessage | undefined> extends BaseSchema, InferOutput, VariantIssue | InferVariantIssue> { + /** + * The schema type. + */ + readonly type: "variant"; + /** + * The schema reference. + */ + readonly reference: typeof variant; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The discriminator key. + */ + readonly key: TKey$1; + /** + * The variant options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a variant schema. +* +* @param key The discriminator key. +* @param options The variant options. +* +* @returns A variant schema. +*/ +declare function variant>(key: TKey$1, options: TOptions$1): VariantSchema; +/** +* Creates a variant schema. +* +* @param key The discriminator key. +* @param options The variant options. +* @param message The error message. +* +* @returns An variant schema. +*/ +declare function variant, const TMessage extends ErrorMessage | undefined>(key: TKey$1, options: TOptions$1, message: TMessage): VariantSchema; +//#endregion +//#region src/schemas/variant/variantAsync.d.ts +/** +* Variant schema async interface. +*/ +interface VariantSchemaAsync, TMessage extends ErrorMessage | undefined> extends BaseSchemaAsync, InferOutput, VariantIssue | InferVariantIssue> { + /** + * The schema type. + */ + readonly type: "variant"; + /** + * The schema reference. + */ + readonly reference: typeof variant | typeof variantAsync; + /** + * The expected property. + */ + readonly expects: "Object"; + /** + * The discriminator key. + */ + readonly key: TKey$1; + /** + * The variant options. + */ + readonly options: TOptions$1; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a variant schema. +* +* @param key The discriminator key. +* @param options The variant options. +* +* @returns A variant schema. +*/ +declare function variantAsync>(key: TKey$1, options: TOptions$1): VariantSchemaAsync; +/** +* Creates a variant schema. +* +* @param key The discriminator key. +* @param options The variant options. +* @param message The error message. +* +* @returns An variant schema. +*/ +declare function variantAsync, const TMessage extends ErrorMessage | undefined>(key: TKey$1, options: TOptions$1, message: TMessage): VariantSchemaAsync; +//#endregion +//#region src/schemas/variant/types.d.ts +/** +* Variant issue interface. +*/ +interface VariantIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "variant"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Variant option schema interface. +*/ +interface VariantOptionSchema extends BaseSchema> { + readonly type: "variant"; + readonly reference: typeof variant; + readonly key: string; + readonly options: VariantOptions; + readonly message: ErrorMessage | undefined; +} +/** +* Variant option schema async interface. +*/ +interface VariantOptionSchemaAsync extends BaseSchemaAsync> { + readonly type: "variant"; + readonly reference: typeof variant | typeof variantAsync; + readonly key: string; + readonly options: VariantOptionsAsync; + readonly message: ErrorMessage | undefined; +} +/** +* Variant object entries type. +*/ +type VariantObjectEntries = Record> | OptionalEntrySchema> & ObjectEntries; +/** +* Variant object entries async type. +*/ +type VariantObjectEntriesAsync = Record> | BaseSchemaAsync> | OptionalEntrySchema | OptionalEntrySchemaAsync> & ObjectEntriesAsync; +/** +* Variant option type. +*/ +type VariantOption = LooseObjectSchema, ErrorMessage | undefined> | ObjectSchema, ErrorMessage | undefined> | ObjectWithRestSchema, BaseSchema>, ErrorMessage | undefined> | StrictObjectSchema, ErrorMessage | undefined> | VariantOptionSchema; +/** +* Variant option async type. +*/ +type VariantOptionAsync = LooseObjectSchemaAsync, ErrorMessage | undefined> | ObjectSchemaAsync, ErrorMessage | undefined> | ObjectWithRestSchemaAsync, BaseSchema> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchemaAsync, ErrorMessage | undefined> | VariantOptionSchemaAsync; +/** +* Variant options type. +*/ +type VariantOptions = MaybeReadonly[]>; +/** +* Variant options async type. +*/ +type VariantOptionsAsync = MaybeReadonly<(VariantOption | VariantOptionAsync)[]>; +/** +* Infer variant issue type. +*/ +type InferVariantIssue | VariantOptionsAsync> = Exclude, { + type: "loose_object" | "object" | "object_with_rest"; +}>; +//#endregion +//#region src/schemas/void/void.d.ts +/** +* Void issue interface. +*/ +interface VoidIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "schema"; + /** + * The issue type. + */ + readonly type: "void"; + /** + * The expected property. + */ + readonly expected: "void"; +} +/** +* Void schema interface. +*/ +interface VoidSchema | undefined> extends BaseSchema { + /** + * The schema type. + */ + readonly type: "void"; + /** + * The schema reference. + */ + readonly reference: typeof void_; + /** + * The expected property. + */ + readonly expects: "void"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a void schema. +* +* @returns A void schema. +*/ +declare function void_(): VoidSchema; +/** +* Creates a void schema. +* +* @param message The error message. +* +* @returns A void schema. +*/ +declare function void_ | undefined>(message: TMessage): VoidSchema; +//#endregion +//#region src/actions/args/args.d.ts +/** +* Schema type. +*/ +type Schema$3 = LooseTupleSchema | undefined> | StrictTupleSchema | undefined> | TupleSchema | undefined> | TupleWithRestSchema>, ErrorMessage | undefined>; +/** +* Args action type. +*/ +interface ArgsAction unknown, TSchema extends Schema$3> extends BaseTransformation) => ReturnType, never> { + /** + * The action type. + */ + readonly type: "args"; + /** + * The action reference. + */ + readonly reference: typeof args; + /** + * The arguments schema. + */ + readonly schema: TSchema; +} +/** +* Creates a function arguments transformation action. +* +* @param schema The arguments schema. +* +* @returns An args action. +*/ +declare function args unknown, TSchema extends Schema$3>(schema: TSchema): ArgsAction; +//#endregion +//#region src/actions/args/argsAsync.d.ts +/** +* Schema type. +*/ +type Schema$2 = LooseTupleSchema | undefined> | LooseTupleSchemaAsync | undefined> | StrictTupleSchema | undefined> | StrictTupleSchemaAsync | undefined> | TupleSchema | undefined> | TupleSchemaAsync | undefined> | TupleWithRestSchema>, ErrorMessage | undefined> | TupleWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined>; +/** +* Args action async type. +*/ +interface ArgsActionAsync unknown, TSchema extends Schema$2> extends BaseTransformation) => Promise>>, never> { + /** + * The action type. + */ + readonly type: "args"; + /** + * The action reference. + */ + readonly reference: typeof argsAsync; + /** + * The arguments schema. + */ + readonly schema: TSchema; +} +/** +* Creates a function arguments transformation action. +* +* @param schema The arguments schema. +* +* @returns An args action. +*/ +declare function argsAsync unknown, TSchema extends Schema$2>(schema: TSchema): ArgsActionAsync; +//#endregion +//#region src/actions/await/awaitAsync.d.ts +/** +* Await action async interface. +*/ +interface AwaitActionAsync> extends BaseTransformationAsync, never> { + /** + * The action type. + */ + readonly type: "await"; + /** + * The action reference. + */ + readonly reference: typeof awaitAsync; +} +/** +* Creates an await transformation action. +* +* @returns An await action. +*/ +declare function awaitAsync>(): AwaitActionAsync; +//#endregion +//#region src/actions/base64/base64.d.ts +/** +* Base64 issue interface. +*/ +interface Base64Issue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "base64"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The Base64 regex. + */ + readonly requirement: RegExp; +} +/** +* Base64 action interface. +*/ +interface Base64Action> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "base64"; + /** + * The action reference. + */ + readonly reference: typeof base64; + /** + * The expected property. + */ + readonly expects: null; + /** + * The Base64 regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [Base64](https://en.wikipedia.org/wiki/Base64) validation action. +* +* @returns A Base64 action. +*/ +declare function base64(): Base64Action; +/** +* Creates a [Base64](https://en.wikipedia.org/wiki/Base64) validation action. +* +* @param message The error message. +* +* @returns A Base64 action. +*/ +declare function base64> | undefined>(message: TMessage): Base64Action; +//#endregion +//#region src/actions/bic/bic.d.ts +/** +* BIC issue interface. +*/ +interface BicIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "bic"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The BIC regex. + */ + readonly requirement: RegExp; +} +/** +* BIC action interface. +*/ +interface BicAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "bic"; + /** + * The action reference. + */ + readonly reference: typeof bic; + /** + * The expected property. + */ + readonly expects: null; + /** + * The BIC regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [BIC](https://en.wikipedia.org/wiki/ISO_9362) validation action. +* +* @returns A BIC action. +*/ +declare function bic(): BicAction; +/** +* Creates a [BIC](https://en.wikipedia.org/wiki/ISO_9362) validation action. +* +* @param message The error message. +* +* @returns A BIC action. +*/ +declare function bic> | undefined>(message: TMessage): BicAction; +//#endregion +//#region src/actions/brand/brand.d.ts +/** +* Brand symbol. +*/ +declare const BrandSymbol: unique symbol; +/** +* Brand name type. +*/ +type BrandName = string | number | symbol; +/** +* Brand interface. +*/ +interface Brand { + [BrandSymbol]: { [TValue in TName]: TValue }; +} +/** +* Brand action interface. +*/ +interface BrandAction extends BaseTransformation, never> { + /** + * The action type. + */ + readonly type: "brand"; + /** + * The action reference. + */ + readonly reference: typeof brand; + /** + * The brand name. + */ + readonly name: TName; +} +/** +* Creates a brand transformation action. +* +* @param name The brand name. +* +* @returns A brand action. +*/ +declare function brand(name: TName): BrandAction; +//#endregion +//#region src/actions/bytes/bytes.d.ts +/** +* Bytes issue interface. +*/ +interface BytesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "bytes"; + /** + * The expected property. + */ + readonly expected: `${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The required bytes. + */ + readonly requirement: TRequirement; +} +/** +* Bytes action interface. +*/ +interface BytesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "bytes"; + /** + * The action reference. + */ + readonly reference: typeof bytes; + /** + * The expected property. + */ + readonly expects: `${TRequirement}`; + /** + * The required bytes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The required bytes. +* +* @returns A bytes action. +*/ +declare function bytes(requirement: TRequirement): BytesAction; +/** +* Creates a [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The required bytes. +* @param message The error message. +* +* @returns A bytes action. +*/ +declare function bytes> | undefined>(requirement: TRequirement, message: TMessage): BytesAction; +//#endregion +//#region src/actions/check/types.d.ts +/** +* Check issue interface. +*/ +interface CheckIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "check"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The validation function. + */ + readonly requirement: (input: TInput$1) => MaybePromise; +} +//#endregion +//#region src/actions/check/check.d.ts +/** +* Check action interface. +*/ +interface CheckAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "check"; + /** + * The action reference. + */ + readonly reference: typeof check; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: TInput$1) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a check validation action. +* +* @param requirement The validation function. +* +* @returns A check action. +*/ +declare function check(requirement: (input: TInput$1) => boolean): CheckAction; +/** +* Creates a check validation action. +* +* @param requirement The validation function. +* @param message The error message. +* +* @returns A check action. +*/ +declare function check> | undefined>(requirement: (input: TInput$1) => boolean, message: TMessage): CheckAction; +//#endregion +//#region src/actions/check/checkAsync.d.ts +/** +* Check action async interface. +*/ +interface CheckActionAsync> | undefined> extends BaseValidationAsync> { + /** + * The action type. + */ + readonly type: "check"; + /** + * The action reference. + */ + readonly reference: typeof checkAsync; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: TInput$1) => MaybePromise; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a check validation action. +* +* @param requirement The validation function. +* +* @returns A check action. +*/ +declare function checkAsync(requirement: (input: TInput$1) => MaybePromise): CheckActionAsync; +/** +* Creates a check validation action. +* +* @param requirement The validation function. +* @param message The error message. +* +* @returns A check action. +*/ +declare function checkAsync> | undefined>(requirement: (input: TInput$1) => MaybePromise, message: TMessage): CheckActionAsync; +//#endregion +//#region src/actions/types.d.ts +/** +* Array input type. +*/ +type ArrayInput = MaybeReadonly; +/** +* Array requirement type. +*/ +type ArrayRequirement = (item: TInput$1[number], index: number, array: TInput$1) => boolean; +/** +* Array requirement async type. +*/ +type ArrayRequirementAsync = (item: TInput$1[number], index: number, array: TInput$1) => MaybePromise; +/** +* Content input type. +*/ +type ContentInput = string | MaybeReadonly; +/** +* Content requirement type. +*/ +type ContentRequirement = TInput$1 extends readonly unknown[] ? TInput$1[number] : TInput$1; +/** +* Entries input type. +*/ +type EntriesInput = Record; +/** +* Length input type. +*/ +type LengthInput = string | ArrayLike; +/** +* Size input type. +*/ +type SizeInput = Blob | Map | Set; +/** +* Value input type. +*/ +type ValueInput = string | number | bigint | boolean | Date; +//#endregion +//#region src/actions/checkItems/types.d.ts +/** +* Check items issue interface. +*/ +interface CheckItemsIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "check_items"; + /** + * The expected input. + */ + readonly expected: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirementAsync; +} +//#endregion +//#region src/actions/checkItems/checkItems.d.ts +/** +* Check items action interface. +*/ +interface CheckItemsAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "check_items"; + /** + * The action reference. + */ + readonly reference: typeof checkItems; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an check items validation action. +* +* @param requirement The validation function. +* +* @returns An check items action. +*/ +declare function checkItems(requirement: ArrayRequirement): CheckItemsAction; +/** +* Creates an check items validation action. +* +* @param requirement The validation function. +* @param message The error message. +* +* @returns An check items action. +*/ +declare function checkItems> | undefined>(requirement: ArrayRequirement, message: TMessage): CheckItemsAction; +//#endregion +//#region src/actions/checkItems/checkItemsAsync.d.ts +/** +* Check items action async interface. +*/ +interface CheckItemsActionAsync> | undefined> extends BaseValidationAsync> { + /** + * The action type. + */ + readonly type: "check_items"; + /** + * The action reference. + */ + readonly reference: typeof checkItemsAsync; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirementAsync; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a check items validation action. +* +* @param requirement The validation function. +* +* @returns A check items action. +*/ +declare function checkItemsAsync(requirement: ArrayRequirementAsync): CheckItemsActionAsync; +/** +* Creates a check items validation action. +* +* @param requirement The validation function. +* @param message The error message. +* +* @returns A check items action. +*/ +declare function checkItemsAsync> | undefined>(requirement: ArrayRequirementAsync, message: TMessage): CheckItemsActionAsync; +//#endregion +//#region src/actions/creditCard/creditCard.d.ts +/** +* Credit card issue interface. +*/ +interface CreditCardIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "credit_card"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; +} +/** +* Credit card action interface. +*/ +interface CreditCardAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "credit_card"; + /** + * The action reference. + */ + readonly reference: typeof creditCard; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [credit card](https://en.wikipedia.org/wiki/Payment_card_number) validation action. +* +* @returns A Credit card action. +*/ +declare function creditCard(): CreditCardAction; +/** +* Creates a [credit card](https://en.wikipedia.org/wiki/Payment_card_number) validation action. +* +* @param message The error message. +* +* @returns A credit card action. +*/ +declare function creditCard> | undefined>(message: TMessage): CreditCardAction; +//#endregion +//#region src/actions/cuid2/cuid2.d.ts +/** +* Cuid2 issue interface. +*/ +interface Cuid2Issue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "cuid2"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The Cuid2 regex. + */ + readonly requirement: RegExp; +} +/** +* Cuid2 action interface. +*/ +interface Cuid2Action> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "cuid2"; + /** + * The action reference. + */ + readonly reference: typeof cuid2; + /** + * The expected property. + */ + readonly expects: null; + /** + * The Cuid2 regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [Cuid2](https://github.com/paralleldrive/cuid2) validation action. +* +* @returns A Cuid2 action. +*/ +declare function cuid2(): Cuid2Action; +/** +* Creates a [Cuid2](https://github.com/paralleldrive/cuid2) validation action. +* +* @param message The error message. +* +* @returns A Cuid2 action. +*/ +declare function cuid2> | undefined>(message: TMessage): Cuid2Action; +//#endregion +//#region src/actions/decimal/decimal.d.ts +/** +* Decimal issue interface. +*/ +interface DecimalIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "decimal"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The decimal regex. + */ + readonly requirement: RegExp; +} +/** +* Decimal action interface. +*/ +interface DecimalAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "decimal"; + /** + * The action reference. + */ + readonly reference: typeof decimal; + /** + * The expected property. + */ + readonly expects: null; + /** + * The decimal regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [decimal](https://en.wikipedia.org/wiki/Decimal) validation action. +* +* The difference between `decimal` and `digits` is that `decimal` accepts +* floating point numbers and negative numbers, while `digits` accepts only the +* digits 0-9. +* +* @returns An decimal action. +*/ +declare function decimal(): DecimalAction; +/** +* Creates a [decimal](https://en.wikipedia.org/wiki/Decimal) validation action. +* +* The difference between `decimal` and `digits` is that `decimal` accepts +* floating point numbers and negative numbers, while `digits` accepts only the +* digits 0-9. +* +* @param message The error message. +* +* @returns An decimal action. +*/ +declare function decimal> | undefined>(message: TMessage): DecimalAction; +//#endregion +//#region src/actions/description/description.d.ts +/** +* Description action interface. +*/ +interface DescriptionAction extends BaseMetadata { + /** + * The action type. + */ + readonly type: "description"; + /** + * The action reference. + */ + readonly reference: typeof description; + /** + * The description text. + */ + readonly description: TDescription; +} +/** +* Creates a description metadata action. +* +* @param description_ The description text. +* +* @returns A description action. +*/ +declare function description(description_: TDescription): DescriptionAction; +//#endregion +//#region src/actions/digits/digits.d.ts +/** +* Digits issue interface. +*/ +interface DigitsIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "digits"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The digits regex. + */ + readonly requirement: RegExp; +} +/** +* Digits action interface. +*/ +interface DigitsAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "digits"; + /** + * The action reference. + */ + readonly reference: typeof digits; + /** + * The expected property. + */ + readonly expects: null; + /** + * The digits regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [digits](https://en.wikipedia.org/wiki/Numerical_digit) validation action. +* +* The difference between `digits` and `decimal` is that `digits` accepts only +* the digits 0-9, while `decimal` accepts floating point numbers and negative +* numbers. +* +* @returns An digits action. +*/ +declare function digits(): DigitsAction; +/** +* Creates a [digits](https://en.wikipedia.org/wiki/Numerical_digit) validation action. +* +* The difference between `digits` and `decimal` is that `digits` accepts only +* the digits 0-9, while `decimal` accepts floating point numbers and negative +* numbers. +* +* @param message The error message. +* +* @returns An digits action. +*/ +declare function digits> | undefined>(message: TMessage): DigitsAction; +//#endregion +//#region src/actions/domain/domain.d.ts +/** +* Domain issue interface. +* +* @beta +*/ +interface DomainIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "domain"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The domain regex. + */ + readonly requirement: RegExp; +} +/** +* Domain action interface. +* +* @beta +*/ +interface DomainAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "domain"; + /** + * The action reference. + */ + readonly reference: typeof domain; + /** + * The expected property. + */ + readonly expects: null; + /** + * The domain regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [domain name](https://en.wikipedia.org/wiki/Domain_name) validation +* action. +* +* Hint: ASCII-only validation. Internationalized domain names (IDNs) are not +* supported, including Punycode-encoded labels. +* +* @returns A domain action. +* +* @beta +*/ +declare function domain(): DomainAction; +/** +* Creates a [domain name](https://en.wikipedia.org/wiki/Domain_name) validation +* action. +* +* Hint: ASCII-only validation. Internationalized domain names (IDNs) are not +* supported, including Punycode-encoded labels. +* +* @param message The error message. +* +* @returns A domain action. +* +* @beta +*/ +declare function domain> | undefined>(message: TMessage): DomainAction; +//#endregion +//#region src/actions/email/email.d.ts +/** +* Email issue interface. +*/ +interface EmailIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "email"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The email regex. + */ + readonly requirement: RegExp; +} +/** +* Email action interface. +*/ +interface EmailAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "email"; + /** + * The action reference. + */ + readonly reference: typeof email; + /** + * The expected property. + */ + readonly expects: null; + /** + * The email regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [email](https://en.wikipedia.org/wiki/Email_address) validation +* action. +* +* Hint: This validation action intentionally only validates common email +* addresses. If you are interested in an action that covers a broader +* subset of RFC 5322 addresses, please use the `rfcEmail` action instead. +* +* @returns An email action. +*/ +declare function email(): EmailAction; +/** +* Creates an [email](https://en.wikipedia.org/wiki/Email_address) validation +* action. +* +* Hint: This validation action intentionally only validates common email +* addresses. If you are interested in an action that covers a broader +* subset of RFC 5322 addresses, please use the `rfcEmail` action instead. +* +* @param message The error message. +* +* @returns An email action. +*/ +declare function email> | undefined>(message: TMessage): EmailAction; +//#endregion +//#region src/actions/emoji/emoji.d.ts +/** +* Emoji issue interface. +*/ +interface EmojiIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "emoji"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The emoji regex. + */ + readonly requirement: RegExp; +} +/** +* Emoji action interface. +*/ +interface EmojiAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "emoji"; + /** + * The action reference. + */ + readonly reference: typeof emoji; + /** + * The expected property. + */ + readonly expects: null; + /** + * The emoji regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [emoji](https://en.wikipedia.org/wiki/Emoji) validation action. +* +* @returns An emoji action. +*/ +declare function emoji(): EmojiAction; +/** +* Creates an [emoji](https://en.wikipedia.org/wiki/Emoji) validation action. +* +* @param message The error message. +* +* @returns An emoji action. +*/ +declare function emoji> | undefined>(message: TMessage): EmojiAction; +//#endregion +//#region src/actions/empty/empty.d.ts +/** +* Empty issue interface. +*/ +interface EmptyIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "empty"; + /** + * The expected input. + */ + readonly expected: "0"; + /** + * The received input. + */ + readonly received: `${number}`; +} +/** +* Empty action interface. +*/ +interface EmptyAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "empty"; + /** + * The action reference. + */ + readonly reference: typeof empty; + /** + * The expected property. + */ + readonly expects: "0"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an empty validation action. +* +* @returns An empty action. +*/ +declare function empty(): EmptyAction; +/** +* Creates an empty validation action. +* +* @param message The error message. +* +* @returns An empty action. +*/ +declare function empty> | undefined>(message: TMessage): EmptyAction; +//#endregion +//#region src/actions/endsWith/endsWith.d.ts +/** +* Ends with issue interface. +*/ +interface EndsWithIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "ends_with"; + /** + * The expected property. + */ + readonly expected: `"${TRequirement}"`; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The end string. + */ + readonly requirement: TRequirement; +} +/** +* Ends with action interface. +*/ +interface EndsWithAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "ends_with"; + /** + * The action reference. + */ + readonly reference: typeof endsWith; + /** + * The expected property. + */ + readonly expects: `"${TRequirement}"`; + /** + * The end string. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an ends with validation action. +* +* @param requirement The end string. +* +* @returns An ends with action. +*/ +declare function endsWith(requirement: TRequirement): EndsWithAction; +/** +* Creates an ends with validation action. +* +* @param requirement The end string. +* @param message The error message. +* +* @returns An ends with action. +*/ +declare function endsWith> | undefined>(requirement: TRequirement, message: TMessage): EndsWithAction; +//#endregion +//#region src/actions/entries/entries.d.ts +/** +* Entries issue interface. +* +* @beta +*/ +interface EntriesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "entries"; + /** + * The expected property. + */ + readonly expected: `${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The required entries. + */ + readonly requirement: TRequirement; +} +/** +* Entries action interface. +* +* @beta +*/ +interface EntriesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "entries"; + /** + * The action reference. + */ + readonly reference: typeof entries; + /** + * The expected property. + */ + readonly expects: `${TRequirement}`; + /** + * The required entries. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an entries validation action. +* +* @param requirement The required entries. +* +* @returns An entries action. +* +* @beta +*/ +declare function entries(requirement: TRequirement): EntriesAction; +/** +* Creates an entries validation action. +* +* @param requirement The required entries. +* @param message The error message. +* +* @returns An entries action. +* +* @beta +*/ +declare function entries> | undefined>(requirement: TRequirement, message: TMessage): EntriesAction; +//#endregion +//#region src/actions/everyItem/everyItem.d.ts +/** +* Every item issue interface. +*/ +interface EveryItemIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "every_item"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirement; +} +/** +* Every item action interface. +*/ +interface EveryItemAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "every_item"; + /** + * The action reference. + */ + readonly reference: typeof everyItem; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an every item validation action. +* +* @param requirement The validation function. +* +* @returns An every item action. +*/ +declare function everyItem(requirement: ArrayRequirement): EveryItemAction; +/** +* Creates an every item validation action. +* +* @param requirement The validation function. +* @param message The error message. +* +* @returns An every item action. +*/ +declare function everyItem> | undefined>(requirement: ArrayRequirement, message: TMessage): EveryItemAction; +//#endregion +//#region src/actions/examples/examples.d.ts +/** +* Examples action interface. +*/ +interface ExamplesAction extends BaseMetadata { + /** + * The action type. + */ + readonly type: "examples"; + /** + * The action reference. + */ + readonly reference: typeof examples; + /** + * The examples. + */ + readonly examples: TExamples; +} +/** +* Creates an examples metadata action. +* +* @param examples_ The examples. +* +* @returns An examples action. +* +* @beta +*/ +declare function examples(examples_: TExamples): ExamplesAction; +//#endregion +//#region src/actions/excludes/excludes.d.ts +/** +* Excludes issue interface. +*/ +interface ExcludesIssue> extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "excludes"; + /** + * The expected property. + */ + readonly expected: string; + /** + * The content to be excluded. + */ + readonly requirement: TRequirement; +} +/** +* Excludes action interface. +*/ +interface ExcludesAction, TMessage extends ErrorMessage> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "excludes"; + /** + * The action reference. + */ + readonly reference: typeof excludes; + /** + * The expected property. + */ + readonly expects: string; + /** + * The content to be excluded. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an excludes validation action. +* +* @param requirement The content to be excluded. +* +* @returns An excludes action. +*/ +declare function excludes>(requirement: TRequirement): ExcludesAction; +/** +* Creates an excludes validation action. +* +* @param requirement The content to be excluded. +* @param message The error message. +* +* @returns An excludes action. +*/ +declare function excludes, const TMessage extends ErrorMessage> | undefined>(requirement: TRequirement, message: TMessage): ExcludesAction; +//#endregion +//#region src/actions/filterItems/filterItems.d.ts +/** +* Filter items action interface. +*/ +interface FilterItemsAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "filter_items"; + /** + * The action reference. + */ + readonly reference: typeof filterItems; + /** + * The filter items operation. + */ + readonly operation: ArrayRequirement; +} +/** +* Creates a filter items transformation action. +* +* @param operation The filter items operation. +* +* @returns A filter items action. +*/ +declare function filterItems(operation: ArrayRequirement): FilterItemsAction; +//#endregion +//#region src/actions/findItem/findItem.d.ts +/** +* Array requirement type. +*/ +type ArrayRequirement$1 = ((item: TInput$1[number], index: number, array: TInput$1) => item is TOuput) | ((item: TInput$1[number], index: number, array: TInput$1) => boolean); +/** +* Find item action interface. +*/ +interface FindItemAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "find_item"; + /** + * The action reference. + */ + readonly reference: typeof findItem; + /** + * The find item operation. + */ + readonly operation: ArrayRequirement$1; +} +/** +* Creates a find item transformation action. +* +* @param operation The find item operation. +* +* @returns A find item action. +*/ +declare function findItem(operation: ArrayRequirement$1): FindItemAction; +//#endregion +//#region src/actions/finite/finite.d.ts +/** +* Finite issue interface. +*/ +interface FiniteIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "finite"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The validation function. + */ + readonly requirement: (input: number) => boolean; +} +/** +* Finite action interface. +*/ +interface FiniteAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "finite"; + /** + * The action reference. + */ + readonly reference: typeof finite; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: number) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [finite](https://en.wikipedia.org/wiki/Finite) validation action. +* +* @returns A finite action. +*/ +declare function finite(): FiniteAction; +/** +* Creates a [finite](https://en.wikipedia.org/wiki/Finite) validation action. +* +* @param message The error message. +* +* @returns A finite action. +*/ +declare function finite> | undefined>(message: TMessage): FiniteAction; +//#endregion +//#region src/actions/flavor/flavor.d.ts +/** +* Flavor symbol. +* +* @beta +*/ +declare const FlavorSymbol: unique symbol; +/** +* Flavor name type. +* +* @beta +*/ +type FlavorName = string | number | symbol; +/** +* Flavor interface. +* +* @beta +*/ +interface Flavor { + [FlavorSymbol]?: { [TValue in TName]: TValue }; +} +/** +* Flavor action interface. +* +* @beta +*/ +interface FlavorAction extends BaseTransformation, never> { + /** + * The action type. + */ + readonly type: "flavor"; + /** + * The action reference. + */ + readonly reference: typeof flavor; + /** + * The flavor name. + */ + readonly name: TName; +} +/** +* Creates a flavor transformation action. +* +* @param name The flavor name. +* +* @returns A flavor action. +* +* @beta +*/ +declare function flavor(name: TName): FlavorAction; +//#endregion +//#region src/actions/graphemes/graphemes.d.ts +/** +* Graphemes issue interface. +*/ +interface GraphemesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "graphemes"; + /** + * The expected property. + */ + readonly expected: `${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The required graphemes. + */ + readonly requirement: TRequirement; +} +/** +* Graphemes action interface. +*/ +interface GraphemesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "graphemes"; + /** + * The action reference. + */ + readonly reference: typeof graphemes; + /** + * The expected property. + */ + readonly expects: `${TRequirement}`; + /** + * The required graphemes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a graphemes validation action. +* +* @param requirement The required graphemes. +* +* @returns A graphemes action. +*/ +declare function graphemes(requirement: TRequirement): GraphemesAction; +/** +* Creates a graphemes validation action. +* +* @param requirement The required graphemes. +* @param message The error message. +* +* @returns A graphemes action. +*/ +declare function graphemes> | undefined>(requirement: TRequirement, message: TMessage): GraphemesAction; +//#endregion +//#region src/actions/gtValue/gtValue.d.ts +/** +* Greater than value issue type. +*/ +interface GtValueIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "gt_value"; + /** + * The expected property. + */ + readonly expected: `>${string}`; + /** + * The greater than value. + */ + readonly requirement: TRequirement; +} +/** +* Greater than value action type. +*/ +interface GtValueAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "gt_value"; + /** + * The action reference. + */ + readonly reference: typeof gtValue; + /** + * The expected property. + */ + readonly expects: `>${string}`; + /** + * The greater than value. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a greater than value validation action. +* +* @param requirement The greater than value. +* +* @returns A greater than value action. +*/ +declare function gtValue(requirement: TRequirement): GtValueAction; +/** +* Creates a greater than value validation action. +* +* @param requirement The greater than value. +* @param message The error message. +* +* @returns A greater than value action. +*/ +declare function gtValue> | undefined>(requirement: TRequirement, message: TMessage): GtValueAction; +//#endregion +//#region src/actions/guard/guard.d.ts +/** +* Guard function type. +* +* @beta +*/ +type GuardFunction = (input: TInput$1) => input is any; +/** +* Infer guard output type. +* +* @beta +*/ +type InferGuardOutput> = TGuard extends ((input: any) => input is infer TOutput) ? TOutput : unknown; +/** +* Guard issue interface. +* +* @beta +*/ +interface GuardIssue> extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "guard"; + /** + * The guard function. + */ + readonly requirement: TGuard; +} +/** +* Guard action interface. +* +* @beta +*/ +interface GuardAction, TMessage extends ErrorMessage> | undefined> extends BaseTransformation, GuardIssue> { + /** + * The action type. + */ + readonly type: "guard"; + /** + * The action reference. + */ + readonly reference: typeof guard; + /** + * The guard function. + */ + readonly requirement: TGuard; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a guard transformation action. +* +* @param requirement The guard function. +* +* @returns A guard action. +* +* @beta +*/ +declare function guard>(requirement: TGuard): GuardAction; +/** +* Creates a guard transformation action. +* +* @param requirement The guard function. +* +* @returns A guard action. +* +* @beta +*/ +declare function guard>(requirement: TGuard): GuardAction[0], TGuard, undefined>; +/** +* Creates a guard transformation action. +* +* @param requirement The guard function. +* @param message The error message. +* +* @returns A guard action. +* +* @beta +*/ +declare function guard, const TMessage extends ErrorMessage> | undefined>(requirement: TGuard, message: TMessage): GuardAction; +/** +* Creates a guard transformation action. +* +* @param requirement The guard function. +* @param message The error message. +* +* @returns A guard action. +* +* @beta +*/ +declare function guard, const TMessage extends ErrorMessage[0], TGuard>> | undefined>(requirement: TGuard, message: TMessage): GuardAction[0], TGuard, TMessage>; +//#endregion +//#region src/actions/hash/hash.d.ts +/** +* Hash lengths object. +*/ +declare const HASH_LENGTHS: { + readonly md4: 32; + readonly md5: 32; + readonly sha1: 40; + readonly sha256: 64; + readonly sha384: 96; + readonly sha512: 128; + readonly ripemd128: 32; + readonly ripemd160: 40; + readonly tiger128: 32; + readonly tiger160: 40; + readonly tiger192: 48; + readonly crc32: 8; + readonly crc32b: 8; + readonly adler32: 8; +}; +/** +* Hash type type. +*/ +type HashType = keyof typeof HASH_LENGTHS; +/** +* Hash issue interface. +*/ +interface HashIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "hash"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The hash regex. + */ + readonly requirement: RegExp; +} +/** +* Hash action interface. +*/ +interface HashAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "hash"; + /** + * The action reference. + */ + readonly reference: typeof hash; + /** + * The expected property. + */ + readonly expects: null; + /** + * The hash regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [hash](https://en.wikipedia.org/wiki/Hash_function) validation action. +* +* @param types The hash types. +* +* @returns A hash action. +*/ +declare function hash(types: [HashType, ...HashType[]]): HashAction; +/** +* Creates a [hash](https://en.wikipedia.org/wiki/Hash_function) validation action. +* +* @param types The hash types. +* @param message The error message. +* +* @returns A hash action. +*/ +declare function hash> | undefined>(types: [HashType, ...HashType[]], message: TMessage): HashAction; +//#endregion +//#region src/actions/hexadecimal/hexadecimal.d.ts +/** +* Hexadecimal issue interface. +*/ +interface HexadecimalIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "hexadecimal"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The hexadecimal regex. + */ + readonly requirement: RegExp; +} +/** +* Hexadecimal action interface. +*/ +interface HexadecimalAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "hexadecimal"; + /** + * The action reference. + */ + readonly reference: typeof hexadecimal; + /** + * The expected property. + */ + readonly expects: null; + /** + * The hexadecimal regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) validation action. +* +* @returns A hexadecimal action. +*/ +declare function hexadecimal(): HexadecimalAction; +/** +* Creates a [hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) validation action. +* +* @param message The error message. +* +* @returns A hexadecimal action. +*/ +declare function hexadecimal> | undefined>(message: TMessage): HexadecimalAction; +//#endregion +//#region src/actions/hexColor/hexColor.d.ts +/** +* Hex color issue interface. +*/ +interface HexColorIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "hex_color"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The hex color regex. + */ + readonly requirement: RegExp; +} +/** +* Hex color action interface. +*/ +interface HexColorAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "hex_color"; + /** + * The action reference. + */ + readonly reference: typeof hexColor; + /** + * The expected property. + */ + readonly expects: null; + /** + * The hex color regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [hex color](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) validation action. +* +* @returns A hex color action. +*/ +declare function hexColor(): HexColorAction; +/** +* Creates a [hex color](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) validation action. +* +* @param message The error message. +* +* @returns A hex color action. +*/ +declare function hexColor> | undefined>(message: TMessage): HexColorAction; +//#endregion +//#region src/actions/imei/imei.d.ts +/** +* IMEI issue interface. +*/ +interface ImeiIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "imei"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; +} +/** +* IMEI action interface. +*/ +interface ImeiAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "imei"; + /** + * The action reference. + */ + readonly reference: typeof imei; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) validation action. +* +* Formats: +* - AABBBBBBCCCCCCD +* - AA-BBBBBB-CCCCCC-D +* +* @returns An IMEI action. +*/ +declare function imei(): ImeiAction; +/** +* Creates an [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) validation action. +* +* Formats: +* - AABBBBBBCCCCCCD +* - AA-BBBBBB-CCCCCC-D +* +* @param message The error message. +* +* @returns An IMEI action. +*/ +declare function imei> | undefined>(message: TMessage): ImeiAction; +//#endregion +//#region src/actions/includes/includes.d.ts +/** +* Includes issue interface. +*/ +interface IncludesIssue> extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "includes"; + /** + * The expected property. + */ + readonly expected: string; + /** + * The content to be included. + */ + readonly requirement: TRequirement; +} +/** +* Includes action interface. +*/ +interface IncludesAction, TMessage extends ErrorMessage> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "includes"; + /** + * The action reference. + */ + readonly reference: typeof includes; + /** + * The expected property. + */ + readonly expects: string; + /** + * The content to be included. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an includes validation action. +* +* @param requirement The content to be included. +* +* @returns An includes action. +*/ +declare function includes>(requirement: TRequirement): IncludesAction; +/** +* Creates an includes validation action. +* +* @param requirement The content to be included. +* @param message The error message. +* +* @returns An includes action. +*/ +declare function includes, const TMessage extends ErrorMessage> | undefined>(requirement: TRequirement, message: TMessage): IncludesAction; +//#endregion +//#region src/actions/integer/integer.d.ts +/** +* Integer issue interface. +*/ +interface IntegerIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "integer"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The validation function. + */ + readonly requirement: (input: number) => boolean; +} +/** +* Integer action interface. +*/ +interface IntegerAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "integer"; + /** + * The action reference. + */ + readonly reference: typeof integer; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: number) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [integer](https://en.wikipedia.org/wiki/Integer) validation action. +* +* @returns An integer action. +*/ +declare function integer(): IntegerAction; +/** +* Creates an [integer](https://en.wikipedia.org/wiki/Integer) validation action. +* +* @param message The error message. +* +* @returns An integer action. +*/ +declare function integer> | undefined>(message: TMessage): IntegerAction; +//#endregion +//#region src/actions/ip/ip.d.ts +/** +* IP issue interface. +*/ +interface IpIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "ip"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The IP regex. + */ + readonly requirement: RegExp; +} +/** +* IP action interface. +*/ +interface IpAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "ip"; + /** + * The action reference. + */ + readonly reference: typeof ip; + /** + * The expected property. + */ + readonly expects: null; + /** + * The IP regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [IP address](https://en.wikipedia.org/wiki/IP_address) validation action. +* +* @returns An IP action. +*/ +declare function ip(): IpAction; +/** +* Creates an [IP address](https://en.wikipedia.org/wiki/IP_address) validation action. +* +* @param message The error message. +* +* @returns An IP action. +*/ +declare function ip> | undefined>(message: TMessage): IpAction; +//#endregion +//#region src/actions/ipv4/ipv4.d.ts +/** +* IPv4 issue interface. +*/ +interface Ipv4Issue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "ipv4"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The IPv4 regex. + */ + readonly requirement: RegExp; +} +/** +* IPv4 action interface. +*/ +interface Ipv4Action> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "ipv4"; + /** + * The action reference. + */ + readonly reference: typeof ipv4; + /** + * The expected property. + */ + readonly expects: null; + /** + * The IPv4 regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [IPv4](https://en.wikipedia.org/wiki/IPv4) address validation action. +* +* @returns An IPv4 action. +*/ +declare function ipv4(): Ipv4Action; +/** +* Creates an [IPv4](https://en.wikipedia.org/wiki/IPv4) address validation action. +* +* @param message The error message. +* +* @returns An IPv4 action. +*/ +declare function ipv4> | undefined>(message: TMessage): Ipv4Action; +//#endregion +//#region src/actions/ipv6/ipv6.d.ts +/** +* IPv6 issue interface. +*/ +interface Ipv6Issue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "ipv6"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The IPv6 regex. + */ + readonly requirement: RegExp; +} +/** +* IPv6 action interface. +*/ +interface Ipv6Action> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "ipv6"; + /** + * The action reference. + */ + readonly reference: typeof ipv6; + /** + * The expected property. + */ + readonly expects: null; + /** + * The IPv6 regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [IPv6](https://en.wikipedia.org/wiki/IPv6) address validation action. +* +* @returns An IPv6 action. +*/ +declare function ipv6(): Ipv6Action; +/** +* Creates an [IPv6](https://en.wikipedia.org/wiki/IPv6) address validation action. +* +* @param message The error message. +* +* @returns An IPv6 action. +*/ +declare function ipv6> | undefined>(message: TMessage): Ipv6Action; +//#endregion +//#region src/actions/isbn/isbn.d.ts +/** +* ISBN issue interface. +*/ +interface IsbnIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "isbn"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; +} +/** +* ISBN action interface. +*/ +interface IsbnAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "isbn"; + /** + * The action reference. + */ + readonly reference: typeof isbn; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISBN](https://en.wikipedia.org/wiki/ISBN) action. +* +* @returns An ISBN action. +* +* @beta +*/ +declare function isbn(): IsbnAction; +/** +* Creates an [ISBN](https://en.wikipedia.org/wiki/ISBN) action. +* +* @param message The error message. +* +* @returns An ISBN action. +* +* @beta +*/ +declare function isbn> | undefined>(message: TMessage): IsbnAction; +//#endregion +//#region src/actions/isrc/isrc.d.ts +/** +* ISRC issue interface. +*/ +interface IsrcIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "isrc"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISRC regex. + */ + readonly requirement: RegExp; +} +/** +* ISRC action interface. +*/ +interface IsrcAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "isrc"; + /** + * The action reference. + */ + readonly reference: typeof isrc; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISRC regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) validation action. +* +* Formats: +* - CCXXXYYNNNNN +* - CC-XXX-YY-NNNNN +* +* @returns An ISRC action. +* +* @beta +*/ +declare function isrc(): IsrcAction; +/** +* Creates an [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) validation action. +* +* @param message The error message. +* +* @returns An ISRC action. +* +* @beta +*/ +declare function isrc> | undefined>(message: TMessage): IsrcAction; +//#endregion +//#region src/actions/isoDate/isoDate.d.ts +/** +* ISO date issue interface. +*/ +interface IsoDateIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_date"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO date regex. + */ + readonly requirement: RegExp; +} +/** +* ISO date action interface. +*/ +interface IsoDateAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_date"; + /** + * The action reference. + */ + readonly reference: typeof isoDate; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO date regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO date](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-mm-dd +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31" is valid although June has only +* 30 days. +* +* @returns An ISO date action. +*/ +declare function isoDate(): IsoDateAction; +/** +* Creates an [ISO date](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-mm-dd +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31" is valid although June has only +* 30 days. +* +* @param message The error message. +* +* @returns An ISO date action. +*/ +declare function isoDate> | undefined>(message: TMessage): IsoDateAction; +//#endregion +//#region src/actions/isoDateTime/isoDateTime.d.ts +/** +* ISO date time issue interface. +*/ +interface IsoDateTimeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_date_time"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO date time regex. + */ + readonly requirement: RegExp; +} +/** +* ISO date time action interface. +*/ +interface IsoDateTimeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_date_time"; + /** + * The action reference. + */ + readonly reference: typeof isoDateTime; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO date time regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO date time](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-mm-ddThh:mm +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31T00:00" is valid although June has only +* 30 days. +* +* Hint: The regex also allows a space as a separator between the date and time +* parts instead of the "T" character. +* +* @returns An ISO date time action. +*/ +declare function isoDateTime(): IsoDateTimeAction; +/** +* Creates an [ISO date time](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-mm-ddThh:mm +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31T00:00" is valid although June has only +* 30 days. +* +* Hint: The regex also allows a space as a separator between the date and time +* parts instead of the "T" character. +* +* @param message The error message. +* +* @returns An ISO date time action. +*/ +declare function isoDateTime> | undefined>(message: TMessage): IsoDateTimeAction; +//#endregion +//#region src/actions/isoDateTimeSecond/isoDateTimeSecond.d.ts +/** +* ISO date time second issue interface. +*/ +interface IsoDateTimeSecondIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_date_time_second"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO date time with seconds regex. + */ + readonly requirement: RegExp; +} +/** +* ISO date time second action interface. +*/ +interface IsoDateTimeSecondAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_date_time_second"; + /** + * The action reference. + */ + readonly reference: typeof isoDateTimeSecond; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO date time with seconds regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO date time second](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-mm-ddThh:mm:ss +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31T00:00:00" is valid although June has only +* 30 days. +* +* Hint: The regex also allows a space as a separator between the date and time +* parts instead of the "T" character. +* +* @returns An ISO date time second action. +*/ +declare function isoDateTimeSecond(): IsoDateTimeSecondAction; +/** +* Creates an [ISO date time second](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-mm-ddThh:mm:ss +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31T00:00:00" is valid although June has only +* 30 days. +* +* Hint: The regex also allows a space as a separator between the date and time +* parts instead of the "T" character. +* +* @param message The error message. +* +* @returns An ISO date time second action. +*/ +declare function isoDateTimeSecond> | undefined>(message: TMessage): IsoDateTimeSecondAction; +//#endregion +//#region src/actions/isoTime/isoTime.d.ts +/** +* ISO time issue interface. +*/ +interface IsoTimeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_time"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO time regex. + */ + readonly requirement: RegExp; +} +/** +* ISO time action interface. +*/ +interface IsoTimeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_time"; + /** + * The action reference. + */ + readonly reference: typeof isoTime; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO time regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO time](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: hh:mm +* +* @returns An ISO time action. +*/ +declare function isoTime(): IsoTimeAction; +/** +* Creates an [ISO time](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: hh:mm +* +* @param message The error message. +* +* @returns An ISO time action. +*/ +declare function isoTime> | undefined>(message: TMessage): IsoTimeAction; +//#endregion +//#region src/actions/isoTimeSecond/isoTimeSecond.d.ts +/** +* ISO time second issue interface. +*/ +interface IsoTimeSecondIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_time_second"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO time with seconds regex. + */ + readonly requirement: RegExp; +} +/** +* ISO time second action interface. +*/ +interface IsoTimeSecondAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_time_second"; + /** + * The action reference. + */ + readonly reference: typeof isoTimeSecond; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO time second regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO time second](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: hh:mm:ss +* +* @returns An ISO time second action. +*/ +declare function isoTimeSecond(): IsoTimeSecondAction; +/** +* Creates an [ISO time second](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: hh:mm:ss +* +* @param message The error message. +* +* @returns An ISO time second action. +*/ +declare function isoTimeSecond> | undefined>(message: TMessage): IsoTimeSecondAction; +//#endregion +//#region src/actions/isoTimestamp/isoTimestamp.d.ts +/** +* ISO timestamp issue interface. +*/ +interface IsoTimestampIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_timestamp"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO timestamp regex. + */ + readonly requirement: RegExp; +} +/** +* ISO timestamp action interface. +*/ +interface IsoTimestampAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_timestamp"; + /** + * The action reference. + */ + readonly reference: typeof isoTimestamp; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO timestamp regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO timestamp](https://en.wikipedia.org/wiki/ISO_8601) validation +* action. +* +* Formats: +* - yyyy-mm-ddThh:mm:ss.sssZ +* - yyyy-mm-ddThh:mm:ss.sss±hh:mm +* - yyyy-mm-ddThh:mm:ss.sss±hhmm +* +* Hint: To support timestamps with lower or higher accuracy, the millisecond +* specification can be removed or contain up to 9 digits. +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31T00:00:00.000Z" is valid although +* June has only 30 days. +* +* Hint: The regex also allows a space as a separator between the date and time +* parts instead of the "T" character. +* +* Hint: The regex also allows a space before the UTC offset (e.g., " +00:00") +* to support PostgreSQL's `timestamptz` output format. +* +* @returns An ISO timestamp action. +*/ +declare function isoTimestamp(): IsoTimestampAction; +/** +* Creates an [ISO timestamp](https://en.wikipedia.org/wiki/ISO_8601) validation +* action. +* +* Formats: +* - yyyy-mm-ddThh:mm:ss.sssZ +* - yyyy-mm-ddThh:mm:ss.sss±hh:mm +* - yyyy-mm-ddThh:mm:ss.sss±hhmm +* - yyyy-mm-ddThh:mm:ss.sss±hh +* +* Hint: To support timestamps with lower or higher accuracy, the millisecond +* specification can be removed or contain up to 9 digits. +* +* Hint: The regex used cannot validate the maximum number of days based on +* year and month. For example, "2023-06-31T00:00:00.000Z" is valid although +* June has only 30 days. +* +* Hint: The regex also allows a space as a separator between the date and time +* parts instead of the "T" character. +* +* Hint: The regex also allows a space before the UTC offset (e.g., " +00:00") +* to support PostgreSQL's `timestamptz` output format. +* +* @param message The error message. +* +* @returns An ISO timestamp action. +*/ +declare function isoTimestamp> | undefined>(message: TMessage): IsoTimestampAction; +//#endregion +//#region src/actions/isoWeek/isoWeek.d.ts +/** +* ISO week issue interface. +*/ +interface IsoWeekIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "iso_week"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ISO week regex. + */ + readonly requirement: RegExp; +} +/** +* ISO week action interface. +*/ +interface IsoWeekAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "iso_week"; + /** + * The action reference. + */ + readonly reference: typeof isoWeek; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ISO week regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ISO week](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-Www +* +* Hint: The regex used cannot validate the maximum number of weeks based on +* the year. For example, "2021W53" is valid although 2021 has only 52 weeks. +* +* @returns An ISO week action. +*/ +declare function isoWeek(): IsoWeekAction; +/** +* Creates an [ISO week](https://en.wikipedia.org/wiki/ISO_8601) validation action. +* +* Format: yyyy-Www +* +* Hint: The regex used cannot validate the maximum number of weeks based on +* the year. For example, "2021W53" is valid although 2021 has only 52 weeks. +* +* @param message The error message. +* +* @returns An ISO week action. +*/ +declare function isoWeek> | undefined>(message: TMessage): IsoWeekAction; +//#endregion +//#region src/actions/jwsCompact/jwsCompact.d.ts +/** +* JWS compact issue interface. +* +* @beta +*/ +interface JwsCompactIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "jws_compact"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The JWS compact regex. + */ + readonly requirement: RegExp; +} +/** +* JWS compact action interface. +* +* @beta +*/ +interface JwsCompactAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "jws_compact"; + /** + * The action reference. + */ + readonly reference: typeof jwsCompact; + /** + * The expected property. + */ + readonly expects: null; + /** + * The JWS compact regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [JWS compact serialization](https://datatracker.ietf.org/doc/html/rfc7515#section-3.1) +* validation action. +* +* Hint: This validation action only checks the three-part compact string shape +* with unpadded Base64URL-like segments. It does not decode the segments, +* verify the signature, or validate claims. +* +* @returns A JWS compact action. +* +* @beta +*/ +declare function jwsCompact(): JwsCompactAction; +/** +* Creates a [JWS compact serialization](https://datatracker.ietf.org/doc/html/rfc7515#section-3.1) +* validation action. +* +* Hint: This validation action only checks the three-part compact string shape +* with unpadded Base64URL-like segments. It does not decode the segments, +* verify the signature, or validate claims. +* +* @param message The error message. +* +* @returns A JWS compact action. +* +* @beta +*/ +declare function jwsCompact> | undefined>(message: TMessage): JwsCompactAction; +//#endregion +//#region src/actions/length/length.d.ts +/** +* Length issue interface. +*/ +interface LengthIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "length"; + /** + * The expected property. + */ + readonly expected: `${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The required length. + */ + readonly requirement: TRequirement; +} +/** +* Length action interface. +*/ +interface LengthAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "length"; + /** + * The action reference. + */ + readonly reference: typeof length; + /** + * The expected property. + */ + readonly expects: `${TRequirement}`; + /** + * The required length. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a length validation action. +* +* @param requirement The required length. +* +* @returns A length action. +*/ +declare function length(requirement: TRequirement): LengthAction; +/** +* Creates a length validation action. +* +* @param requirement The required length. +* @param message The error message. +* +* @returns A length action. +*/ +declare function length> | undefined>(requirement: TRequirement, message: TMessage): LengthAction; +//#endregion +//#region src/actions/ltValue/ltValue.d.ts +/** +* Less than value issue type. +*/ +interface LtValueIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "lt_value"; + /** + * The expected property. + */ + readonly expected: `<${string}`; + /** + * The less than value. + */ + readonly requirement: TRequirement; +} +/** +* Less than value action type. +*/ +interface LtValueAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "lt_value"; + /** + * The action reference. + */ + readonly reference: typeof ltValue; + /** + * The expected property. + */ + readonly expects: `<${string}`; + /** + * The less than value. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a less than value validation action. +* +* @param requirement The less than value. +* +* @returns A less than value action. +*/ +declare function ltValue(requirement: TRequirement): LtValueAction; +/** +* Creates a less than value validation action. +* +* @param requirement The less than value. +* @param message The error message. +* +* @returns A less than value action. +*/ +declare function ltValue> | undefined>(requirement: TRequirement, message: TMessage): LtValueAction; +//#endregion +//#region src/actions/mac/mac.d.ts +/** +* MAC issue interface. +*/ +interface MacIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "mac"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The MAC regex. + */ + readonly requirement: RegExp; +} +/** +* MAC action interface. +*/ +interface MacAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "mac"; + /** + * The action reference. + */ + readonly reference: typeof mac; + /** + * The expected property. + */ + readonly expects: null; + /** + * The MAC regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [MAC address](https://en.wikipedia.org/wiki/MAC_address) validation action. +* +* @returns A MAC action. +*/ +declare function mac(): MacAction; +/** +* Creates a [MAC address](https://en.wikipedia.org/wiki/MAC_address) validation action. +* +* @param message The error message. +* +* @returns A MAC action. +*/ +declare function mac> | undefined>(message: TMessage): MacAction; +//#endregion +//#region src/actions/mac48/mac48.d.ts +/** +* 48-bit MAC issue interface. +*/ +interface Mac48Issue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "mac48"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The 48-bit MAC regex. + */ + readonly requirement: RegExp; +} +/** +* 48-bit MAC action interface. +*/ +interface Mac48Action> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "mac48"; + /** + * The action reference. + */ + readonly reference: typeof mac48; + /** + * The expected property. + */ + readonly expects: null; + /** + * The 48-bit MAC regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a 48-bit [MAC address](https://en.wikipedia.org/wiki/MAC_address) validation action. +* +* @returns A 48-bit MAC action. +*/ +declare function mac48(): Mac48Action; +/** +* Creates a 48-bit [MAC address](https://en.wikipedia.org/wiki/MAC_address) validation action. +* +* @param message The error message. +* +* @returns A 48-bit MAC action. +*/ +declare function mac48> | undefined>(message: TMessage): Mac48Action; +//#endregion +//#region src/actions/mac64/mac64.d.ts +/** +* 64-bit MAC issue interface. +*/ +interface Mac64Issue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "mac64"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The 64-bit MAC regex. + */ + readonly requirement: RegExp; +} +/** +* 64-bit MAC action interface. +*/ +interface Mac64Action> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "mac64"; + /** + * The action reference. + */ + readonly reference: typeof mac64; + /** + * The expected property. + */ + readonly expects: null; + /** + * The 64-bit MAC regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a 64-bit [MAC address](https://en.wikipedia.org/wiki/MAC_address) validation action. +* +* @returns A 64-bit MAC action. +*/ +declare function mac64(): Mac64Action; +/** +* Creates a 64-bit [MAC address](https://en.wikipedia.org/wiki/MAC_address) validation action. +* +* @param message The error message. +* +* @returns A 64-bit MAC action. +*/ +declare function mac64> | undefined>(message: TMessage): Mac64Action; +//#endregion +//#region src/actions/mapItems/mapItems.d.ts +/** +* Array action type. +*/ +type ArrayAction$2 = (item: TInput$1[number], index: number, array: TInput$1) => TOutput$1; +/** +* Map items action interface. +*/ +interface MapItemsAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "map_items"; + /** + * The action reference. + */ + readonly reference: typeof mapItems; + /** + * The map items operation. + */ + readonly operation: ArrayAction$2; +} +/** +* Creates a map items transformation action. +* +* @param operation The map items operation. +* +* @returns A map items action. +*/ +declare function mapItems(operation: ArrayAction$2): MapItemsAction; +//#endregion +//#region src/actions/maxBytes/maxBytes.d.ts +/** +* Max bytes issue interface. +*/ +interface MaxBytesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_bytes"; + /** + * The expected property. + */ + readonly expected: `<=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The maximum bytes. + */ + readonly requirement: TRequirement; +} +/** +* Max bytes action interface. +*/ +interface MaxBytesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_bytes"; + /** + * The action reference. + */ + readonly reference: typeof maxBytes; + /** + * The expected property. + */ + readonly expects: `<=${TRequirement}`; + /** + * The maximum bytes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The maximum bytes. +* +* @returns A max bytes action. +*/ +declare function maxBytes(requirement: TRequirement): MaxBytesAction; +/** +* Creates a max [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The maximum bytes. +* @param message The error message. +* +* @returns A max bytes action. +*/ +declare function maxBytes> | undefined>(requirement: TRequirement, message: TMessage): MaxBytesAction; +//#endregion +//#region src/actions/maxEntries/maxEntries.d.ts +/** +* Max entries issue interface. +* +* @beta +*/ +interface MaxEntriesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_entries"; + /** + * The expected property. + */ + readonly expected: `<=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The maximum entries. + */ + readonly requirement: TRequirement; +} +/** +* Max entries action interface. +* +* @beta +*/ +interface MaxEntriesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_entries"; + /** + * The action reference. + */ + readonly reference: typeof maxEntries; + /** + * The expected property. + */ + readonly expects: `<=${TRequirement}`; + /** + * The maximum entries. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max entries validation action. +* +* @param requirement The maximum entries. +* +* @returns A max entries action. +* +* @beta +*/ +declare function maxEntries(requirement: TRequirement): MaxEntriesAction; +/** +* Creates a max entries validation action. +* +* @param requirement The maximum entries. +* @param message The error message. +* +* @returns A max entries action. +* +* @beta +*/ +declare function maxEntries> | undefined>(requirement: TRequirement, message: TMessage): MaxEntriesAction; +//#endregion +//#region src/actions/maxGraphemes/maxGraphemes.d.ts +/** +* Max graphemes issue interface. +*/ +interface MaxGraphemesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_graphemes"; + /** + * The expected property. + */ + readonly expected: `<=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The maximum graphemes. + */ + readonly requirement: TRequirement; +} +/** +* Max graphemes action interface. +*/ +interface MaxGraphemesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_graphemes"; + /** + * The action reference. + */ + readonly reference: typeof maxGraphemes; + /** + * The expected property. + */ + readonly expects: `<=${TRequirement}`; + /** + * The maximum graphemes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max graphemes validation action. +* +* @param requirement The maximum graphemes. +* +* @returns A max graphemes action. +*/ +declare function maxGraphemes(requirement: TRequirement): MaxGraphemesAction; +/** +* Creates a max graphemes validation action. +* +* @param requirement The maximum graphemes. +* @param message The error message. +* +* @returns A max graphemes action. +*/ +declare function maxGraphemes> | undefined>(requirement: TRequirement, message: TMessage): MaxGraphemesAction; +//#endregion +//#region src/actions/maxLength/maxLength.d.ts +/** +* Max length issue interface. +*/ +interface MaxLengthIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_length"; + /** + * The expected property. + */ + readonly expected: `<=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The maximum length. + */ + readonly requirement: TRequirement; +} +/** +* Max length action interface. +*/ +interface MaxLengthAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_length"; + /** + * The action reference. + */ + readonly reference: typeof maxLength; + /** + * The expected property. + */ + readonly expects: `<=${TRequirement}`; + /** + * The maximum length. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max length validation action. +* +* @param requirement The maximum length. +* +* @returns A max length action. +*/ +declare function maxLength(requirement: TRequirement): MaxLengthAction; +/** +* Creates a max length validation action. +* +* @param requirement The maximum length. +* @param message The error message. +* +* @returns A max length action. +*/ +declare function maxLength> | undefined>(requirement: TRequirement, message: TMessage): MaxLengthAction; +//#endregion +//#region src/actions/maxSize/maxSize.d.ts +/** +* Max size issue interface. +*/ +interface MaxSizeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_size"; + /** + * The expected property. + */ + readonly expected: `<=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The maximum size. + */ + readonly requirement: TRequirement; +} +/** +* Max size action interface. +*/ +interface MaxSizeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_size"; + /** + * The action reference. + */ + readonly reference: typeof maxSize; + /** + * The expected property. + */ + readonly expects: `<=${TRequirement}`; + /** + * The maximum size. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max size validation action. +* +* @param requirement The maximum size. +* +* @returns A max size action. +*/ +declare function maxSize(requirement: TRequirement): MaxSizeAction; +/** +* Creates a max size validation action. +* +* @param requirement The maximum size. +* @param message The error message. +* +* @returns A max size action. +*/ +declare function maxSize> | undefined>(requirement: TRequirement, message: TMessage): MaxSizeAction; +//#endregion +//#region src/actions/maxValue/maxValue.d.ts +/** +* Max value issue interface. +*/ +interface MaxValueIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_value"; + /** + * The expected property. + */ + readonly expected: `<=${string}`; + /** + * The maximum value. + */ + readonly requirement: TRequirement; +} +/** +* Max value action interface. +*/ +interface MaxValueAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_value"; + /** + * The action reference. + */ + readonly reference: typeof maxValue; + /** + * The expected property. + */ + readonly expects: `<=${string}`; + /** + * The maximum value. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max value validation action. +* +* @param requirement The maximum value. +* +* @returns A max value action. +*/ +declare function maxValue(requirement: TRequirement): MaxValueAction; +/** +* Creates a max value validation action. +* +* @param requirement The maximum value. +* @param message The error message. +* +* @returns A max value action. +*/ +declare function maxValue> | undefined>(requirement: TRequirement, message: TMessage): MaxValueAction; +//#endregion +//#region src/actions/maxWords/maxWords.d.ts +/** +* Max words issue interface. +*/ +interface MaxWordsIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "max_words"; + /** + * The expected property. + */ + readonly expected: `<=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The maximum words. + */ + readonly requirement: TRequirement; +} +/** +* Max words action interface. +*/ +interface MaxWordsAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "max_words"; + /** + * The action reference. + */ + readonly reference: typeof maxWords; + /** + * The expected property. + */ + readonly expects: `<=${TRequirement}`; + /** + * The locales to be used. + */ + readonly locales: TLocales; + /** + * The maximum words. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a max words validation action. +* +* @param locales The locales to be used. +* @param requirement The maximum words. +* +* @returns A max words action. +*/ +declare function maxWords(locales: TLocales, requirement: TRequirement): MaxWordsAction; +/** +* Creates a max words validation action. +* +* @param locales The locales to be used. +* @param requirement The maximum words. +* @param message The error message. +* +* @returns A max words action. +*/ +declare function maxWords> | undefined>(locales: TLocales, requirement: TRequirement, message: TMessage): MaxWordsAction; +//#endregion +//#region src/actions/metadata/metadata.d.ts +/** +* Metadata action interface. +*/ +interface MetadataAction> extends BaseMetadata { + /** + * The action type. + */ + readonly type: "metadata"; + /** + * The action reference. + */ + readonly reference: typeof metadata; + /** + * The metadata object. + */ + readonly metadata: TMetadata; +} +/** +* Creates a custom metadata action. +* +* @param metadata_ The metadata object. +* +* @returns A metadata action. +*/ +declare function metadata>(metadata_: TMetadata): MetadataAction; +//#endregion +//#region src/actions/mimeType/mimeType.d.ts +/** +* Requirement type. +*/ +type Requirement = readonly `${string}/${string}`[]; +/** +* MIME type issue interface. +*/ +interface MimeTypeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "mime_type"; + /** + * The expected input. + */ + readonly expected: string; + /** + * The received input. + */ + readonly received: `"${string}"`; + /** + * The MIME types. + */ + readonly requirement: TRequirement; +} +/** +* MIME type action interface. +*/ +interface MimeTypeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "mime_type"; + /** + * The action reference. + */ + readonly reference: typeof mimeType; + /** + * The expected property. + */ + readonly expects: string; + /** + * The MIME types. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [MIME type](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types) validation action. +* +* @param requirement The MIME types. +* +* @returns A MIME type action. +*/ +declare function mimeType(requirement: TRequirement): MimeTypeAction; +/** +* Creates a [MIME type](https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types) validation action. +* +* @param requirement The MIME types. +* @param message The error message. +* +* @returns A MIME type action. +*/ +declare function mimeType> | undefined>(requirement: TRequirement, message: TMessage): MimeTypeAction; +//#endregion +//#region src/actions/minBytes/minBytes.d.ts +/** +* Min bytes issue interface. +*/ +interface MinBytesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_bytes"; + /** + * The expected property. + */ + readonly expected: `>=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The minimum bytes. + */ + readonly requirement: TRequirement; +} +/** +* Min bytes action interface. +*/ +interface MinBytesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_bytes"; + /** + * The action reference. + */ + readonly reference: typeof minBytes; + /** + * The expected property. + */ + readonly expects: `>=${TRequirement}`; + /** + * The minimum bytes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The minimum bytes. +* +* @returns A min bytes action. +*/ +declare function minBytes(requirement: TRequirement): MinBytesAction; +/** +* Creates a min [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The minimum bytes. +* @param message The error message. +* +* @returns A min bytes action. +*/ +declare function minBytes> | undefined>(requirement: TRequirement, message: TMessage): MinBytesAction; +//#endregion +//#region src/actions/minEntries/minEntries.d.ts +/** +* Min entries issue interface. +* +* @beta +*/ +interface MinEntriesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_entries"; + /** + * The expected property. + */ + readonly expected: `>=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The minimum entries. + */ + readonly requirement: TRequirement; +} +/** +* Min entries action interface. +* +* @beta +*/ +interface MinEntriesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_entries"; + /** + * The action reference. + */ + readonly reference: typeof minEntries; + /** + * The expected property. + */ + readonly expects: `>=${TRequirement}`; + /** + * The minimum entries. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min entries validation action. +* +* @param requirement The minimum entries. +* +* @returns A min entries action. +* +* @beta +*/ +declare function minEntries(requirement: TRequirement): MinEntriesAction; +/** +* Creates a min entries validation action. +* +* @param requirement The minimum entries. +* @param message The error message. +* +* @returns A min entries action. +* +* @beta +*/ +declare function minEntries> | undefined>(requirement: TRequirement, message: TMessage): MinEntriesAction; +//#endregion +//#region src/actions/minGraphemes/minGraphemes.d.ts +/** +* Min graphemes issue interface. +*/ +interface MinGraphemesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_graphemes"; + /** + * The expected property. + */ + readonly expected: `>=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The minimum graphemes. + */ + readonly requirement: TRequirement; +} +/** +* Min graphemes action interface. +*/ +interface MinGraphemesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_graphemes"; + /** + * The action reference. + */ + readonly reference: typeof minGraphemes; + /** + * The expected property. + */ + readonly expects: `>=${TRequirement}`; + /** + * The minimum graphemes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min graphemes validation action. +* +* @param requirement The minimum graphemes. +* +* @returns A min graphemes action. +*/ +declare function minGraphemes(requirement: TRequirement): MinGraphemesAction; +/** +* Creates a min graphemes validation action. +* +* @param requirement The minimum graphemes. +* @param message The error message. +* +* @returns A min graphemes action. +*/ +declare function minGraphemes> | undefined>(requirement: TRequirement, message: TMessage): MinGraphemesAction; +//#endregion +//#region src/actions/minLength/minLength.d.ts +/** +* Min length issue interface. +*/ +interface MinLengthIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_length"; + /** + * The expected property. + */ + readonly expected: `>=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The minimum length. + */ + readonly requirement: TRequirement; +} +/** +* Min length action interface. +*/ +interface MinLengthAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_length"; + /** + * The action reference. + */ + readonly reference: typeof minLength; + /** + * The expected property. + */ + readonly expects: `>=${TRequirement}`; + /** + * The minimum length. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min length validation action. +* +* @param requirement The minimum length. +* +* @returns A min length action. +*/ +declare function minLength(requirement: TRequirement): MinLengthAction; +/** +* Creates a min length validation action. +* +* @param requirement The minimum length. +* @param message The error message. +* +* @returns A min length action. +*/ +declare function minLength> | undefined>(requirement: TRequirement, message: TMessage): MinLengthAction; +//#endregion +//#region src/actions/minSize/minSize.d.ts +/** +* Min size issue interface. +*/ +interface MinSizeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_size"; + /** + * The expected property. + */ + readonly expected: `>=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The minimum size. + */ + readonly requirement: TRequirement; +} +/** +* Min size action interface. +*/ +interface MinSizeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_size"; + /** + * The action reference. + */ + readonly reference: typeof minSize; + /** + * The expected property. + */ + readonly expects: `>=${TRequirement}`; + /** + * The minimum size. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min size validation action. +* +* @param requirement The minimum size. +* +* @returns A min size action. +*/ +declare function minSize(requirement: TRequirement): MinSizeAction; +/** +* Creates a min size validation action. +* +* @param requirement The minimum size. +* @param message The error message. +* +* @returns A min size action. +*/ +declare function minSize> | undefined>(requirement: TRequirement, message: TMessage): MinSizeAction; +//#endregion +//#region src/actions/minValue/minValue.d.ts +/** +* Min value issue interface. +*/ +interface MinValueIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_value"; + /** + * The expected property. + */ + readonly expected: `>=${string}`; + /** + * The minimum value. + */ + readonly requirement: TRequirement; +} +/** +* Min value action interface. +*/ +interface MinValueAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_value"; + /** + * The action reference. + */ + readonly reference: typeof minValue; + /** + * The expected property. + */ + readonly expects: `>=${string}`; + /** + * The minimum value. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min value validation action. +* +* @param requirement The minimum value. +* +* @returns A min value action. +*/ +declare function minValue(requirement: TRequirement): MinValueAction; +/** +* Creates a min value validation action. +* +* @param requirement The minimum value. +* @param message The error message. +* +* @returns A min value action. +*/ +declare function minValue> | undefined>(requirement: TRequirement, message: TMessage): MinValueAction; +//#endregion +//#region src/actions/minWords/minWords.d.ts +/** +* Min words issue interface. +*/ +interface MinWordsIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "min_words"; + /** + * The expected property. + */ + readonly expected: `>=${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The minimum words. + */ + readonly requirement: TRequirement; +} +/** +* Min words action interface. +*/ +interface MinWordsAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "min_words"; + /** + * The action reference. + */ + readonly reference: typeof minWords; + /** + * The expected property. + */ + readonly expects: `>=${TRequirement}`; + /** + * The locales to be used. + */ + readonly locales: TLocales; + /** + * The minimum words. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a min words validation action. +* +* @param locales The locales to be used. +* @param requirement The minimum words. +* +* @returns A min words action. +*/ +declare function minWords(locales: TLocales, requirement: TRequirement): MinWordsAction; +/** +* Creates a min words validation action. +* +* @param locales The locales to be used. +* @param requirement The minimum words. +* @param message The error message. +* +* @returns A min words action. +*/ +declare function minWords> | undefined>(locales: TLocales, requirement: TRequirement, message: TMessage): MinWordsAction; +//#endregion +//#region src/actions/multipleOf/multipleOf.d.ts +/** +* Input type +*/ +type Input = number | bigint; +/** +* Multiple of issue interface. +*/ +interface MultipleOfIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "multiple_of"; + /** + * The expected property. + */ + readonly expected: `%${TRequirement}`; + /** + * The received property. + */ + readonly received: `${TInput$1}`; + /** + * The divisor. + */ + readonly requirement: TRequirement; +} +/** +* Multiple of action interface. +*/ +interface MultipleOfAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "multiple_of"; + /** + * The action reference. + */ + readonly reference: typeof multipleOf; + /** + * The expected property. + */ + readonly expects: `%${TRequirement}`; + /** + * The divisor. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [multiple](https://en.wikipedia.org/wiki/Multiple_(mathematics)) of validation action. +* +* @param requirement The divisor. +* +* @returns A multiple of action. +*/ +declare function multipleOf(requirement: TRequirement): MultipleOfAction; +/** +* Creates a [multiple](https://en.wikipedia.org/wiki/Multiple_(mathematics)) of validation action. +* +* @param requirement The divisor. +* +* @returns A multiple of action. +*/ +declare function multipleOf(requirement: TRequirement): MultipleOfAction; +/** +* Creates a [multiple](https://en.wikipedia.org/wiki/Multiple_(mathematics)) of validation action. +* +* @param requirement The divisor. +* @param message The error message. +* +* @returns A multiple of action. +*/ +declare function multipleOf> | undefined>(requirement: TRequirement, message: TMessage): MultipleOfAction; +/** +* Creates a [multiple](https://en.wikipedia.org/wiki/Multiple_(mathematics)) of validation action. +* +* @param requirement The divisor. +* @param message The error message. +* +* @returns A multiple of action. +*/ +declare function multipleOf> | undefined>(requirement: TRequirement, message: TMessage): MultipleOfAction; +//#endregion +//#region src/actions/nanoid/nanoid.d.ts +/** +* Nano ID issue interface. +*/ +interface NanoIdIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "nanoid"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: string; + /** + * The Nano ID regex. + */ + readonly requirement: RegExp; +} +/** +* Nano ID issue type. +* +* @deprecated Use `NanoIdIssue` instead. +*/ +type NanoIDIssue = NanoIdIssue; +/** +* Nano ID action interface. +*/ +interface NanoIdAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "nanoid"; + /** + * The action reference. + */ + readonly reference: typeof nanoid; + /** + * The expected property. + */ + readonly expects: null; + /** + * The Nano ID regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Nano ID action type. +* +* @deprecated Use `NanoIdAction` instead. +*/ +type NanoIDAction> | undefined> = NanoIdAction; +/** +* Creates a [Nano ID](https://github.com/ai/nanoid) validation action. +* +* @returns A Nano ID action. +*/ +declare function nanoid(): NanoIdAction; +/** +* Creates a [Nano ID](https://github.com/ai/nanoid) validation action. +* +* @param message The error message. +* +* @returns A Nano ID action. +*/ +declare function nanoid> | undefined>(message: TMessage): NanoIdAction; +//#endregion +//#region src/actions/nonEmpty/nonEmpty.d.ts +/** +* Non empty issue interface. +*/ +interface NonEmptyIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "non_empty"; + /** + * The expected input. + */ + readonly expected: "!0"; + /** + * The received input. + */ + readonly received: "0"; +} +/** +* Non empty action interface. +*/ +interface NonEmptyAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "non_empty"; + /** + * The action reference. + */ + readonly reference: typeof nonEmpty; + /** + * The expected property. + */ + readonly expects: "!0"; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a non-empty validation action. +* +* @returns A non-empty action. +*/ +declare function nonEmpty(): NonEmptyAction; +/** +* Creates a non-empty validation action. +* +* @param message The error message. +* +* @returns A non-empty action. +*/ +declare function nonEmpty> | undefined>(message: TMessage): NonEmptyAction; +//#endregion +//#region src/actions/normalize/normalize.d.ts +/** +* Normalize form type. +*/ +type NormalizeForm = "NFC" | "NFD" | "NFKC" | "NFKD"; +/** +* Normalize action interface. +*/ +interface NormalizeAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "normalize"; + /** + * The action reference. + */ + readonly reference: typeof normalize; + /** + * The normalization form. + */ + readonly form: TForm; +} +/** +* Creates a normalize transformation action. +* +* @returns A normalize action. +*/ +declare function normalize(): NormalizeAction; +/** +* Creates a normalize transformation action. +* +* @param form The normalization form. +* +* @returns A normalize action. +*/ +declare function normalize(form: TForm): NormalizeAction; +//#endregion +//#region src/actions/notBytes/notBytes.d.ts +/** +* Not bytes issue interface. +*/ +interface NotBytesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_bytes"; + /** + * The expected property. + */ + readonly expected: `!${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The not required bytes. + */ + readonly requirement: TRequirement; +} +/** +* Not bytes action interface. +*/ +interface NotBytesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_bytes"; + /** + * The action reference. + */ + readonly reference: typeof notBytes; + /** + * The expected property. + */ + readonly expects: `!${TRequirement}`; + /** + * The not required bytes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The not required bytes. +* +* @returns A not bytes action. +*/ +declare function notBytes(requirement: TRequirement): NotBytesAction; +/** +* Creates a not [bytes](https://en.wikipedia.org/wiki/Byte) validation action. +* +* @param requirement The not required bytes. +* @param message The error message. +* +* @returns A not bytes action. +*/ +declare function notBytes> | undefined>(requirement: TRequirement, message: TMessage): NotBytesAction; +//#endregion +//#region src/actions/notEntries/notEntries.d.ts +/** +* Not entries issue interface. +* +* @beta +*/ +interface NotEntriesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_entries"; + /** + * The expected property. + */ + readonly expected: `!${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The not required entries. + */ + readonly requirement: TRequirement; +} +/** +* Not entries action interface. +* +* @beta +*/ +interface NotEntriesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_entries"; + /** + * The action reference. + */ + readonly reference: typeof notEntries; + /** + * The expected property. + */ + readonly expects: `!${TRequirement}`; + /** + * The not required entries. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not entries validation action. +* +* @param requirement The not required entries. +* +* @returns A not entries action. +* +* @beta +*/ +declare function notEntries(requirement: TRequirement): NotEntriesAction; +/** +* Creates a not entries validation action. +* +* @param requirement The not required entries. +* @param message The error message. +* +* @returns A not entries action. +* +* @beta +*/ +declare function notEntries> | undefined>(requirement: TRequirement, message: TMessage): NotEntriesAction; +//#endregion +//#region src/actions/notGraphemes/notGraphemes.d.ts +/** +* Not graphemes issue interface. +*/ +interface NotGraphemesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_graphemes"; + /** + * The expected property. + */ + readonly expected: `!${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The not required graphemes. + */ + readonly requirement: TRequirement; +} +/** +* Not graphemes action interface. +*/ +interface NotGraphemesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_graphemes"; + /** + * The action reference. + */ + readonly reference: typeof notGraphemes; + /** + * The expected property. + */ + readonly expects: `!${TRequirement}`; + /** + * The not required graphemes. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not graphemes validation action. +* +* @param requirement The not required graphemes. +* +* @returns A not graphemes action. +*/ +declare function notGraphemes(requirement: TRequirement): NotGraphemesAction; +/** +* Creates a not graphemes validation action. +* +* @param requirement The not required graphemes. +* @param message The error message. +* +* @returns A not graphemes action. +*/ +declare function notGraphemes> | undefined>(requirement: TRequirement, message: TMessage): NotGraphemesAction; +//#endregion +//#region src/actions/notLength/notLength.d.ts +/** +* Not length issue interface. +*/ +interface NotLengthIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_length"; + /** + * The expected property. + */ + readonly expected: `!${TRequirement}`; + /** + * The received property. + */ + readonly received: `${TRequirement}`; + /** + * The not required length. + */ + readonly requirement: TRequirement; +} +/** +* Not length action interface. +*/ +interface NotLengthAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_length"; + /** + * The action reference. + */ + readonly reference: typeof notLength; + /** + * The expected property. + */ + readonly expects: `!${TRequirement}`; + /** + * The not required length. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not length validation action. +* +* @param requirement The not required length. +* +* @returns A not length action. +*/ +declare function notLength(requirement: TRequirement): NotLengthAction; +/** +* Creates a not length validation action. +* +* @param requirement The not required length. +* @param message The error message. +* +* @returns A not length action. +*/ +declare function notLength> | undefined>(requirement: TRequirement, message: TMessage): NotLengthAction; +//#endregion +//#region src/actions/notSize/notSize.d.ts +/** +* Not size issue interface. +*/ +interface NotSizeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_size"; + /** + * The expected property. + */ + readonly expected: `!${TRequirement}`; + /** + * The received property. + */ + readonly received: `${TRequirement}`; + /** + * The not required size. + */ + readonly requirement: TRequirement; +} +/** +* Not size action interface. +*/ +interface NotSizeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_size"; + /** + * The action reference. + */ + readonly reference: typeof notSize; + /** + * The expected property. + */ + readonly expects: `!${TRequirement}`; + /** + * The not required size. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not size validation action. +* +* @param requirement The not required size. +* +* @returns A not size action. +*/ +declare function notSize(requirement: TRequirement): NotSizeAction; +/** +* Creates a not size validation action. +* +* @param requirement The not required size. +* @param message The error message. +* +* @returns A not size action. +*/ +declare function notSize> | undefined>(requirement: TRequirement, message: TMessage): NotSizeAction; +//#endregion +//#region src/actions/notValue/notValue.d.ts +/** +* Not value issue interface. +*/ +interface NotValueIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_value"; + /** + * The expected property. + */ + readonly expected: `!${string}`; + /** + * The not required value. + */ + readonly requirement: TRequirement; +} +/** +* Not value action interface. +*/ +interface NotValueAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_value"; + /** + * The action reference. + */ + readonly reference: typeof notValue; + /** + * The expected property. + */ + readonly expects: `!${string}`; + /** + * The not required value. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not value validation action. +* +* @param requirement The not required value. +* +* @returns A not value action. +*/ +declare function notValue(requirement: TRequirement): NotValueAction; +/** +* Creates a not value validation action. +* +* @param requirement The not required value. +* @param message The error message. +* +* @returns A not value action. +*/ +declare function notValue> | undefined>(requirement: TRequirement, message: TMessage): NotValueAction; +//#endregion +//#region src/actions/notValues/notValues.d.ts +/** +* Not values issue type. +*/ +interface NotValuesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_values"; + /** + * The expected property. + */ + readonly expected: `!${string}`; + /** + * The not required values. + */ + readonly requirement: TRequirement; +} +/** +* Not values action type. +*/ +interface NotValuesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_values"; + /** + * The action reference. + */ + readonly reference: typeof notValues; + /** + * The expected property. + */ + readonly expects: `!${string}`; + /** + * The not required values. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not values validation action. +* +* @param requirement The not required values. +* +* @returns A not values action. +*/ +declare function notValues(requirement: TRequirement): NotValuesAction; +/** +* Creates a not values validation action. +* +* @param requirement The not required values. +* @param message The error message. +* +* @returns A not values action. +*/ +declare function notValues> | undefined>(requirement: TRequirement, message: TMessage): NotValuesAction; +//#endregion +//#region src/actions/notWords/notWords.d.ts +/** +* Not words issue interface. +*/ +interface NotWordsIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "not_words"; + /** + * The expected property. + */ + readonly expected: `!${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The not required words. + */ + readonly requirement: TRequirement; +} +/** +* Not words action interface. +*/ +interface NotWordsAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "not_words"; + /** + * The action reference. + */ + readonly reference: typeof notWords; + /** + * The expected property. + */ + readonly expects: `!${TRequirement}`; + /** + * The locales to be used. + */ + readonly locales: TLocales; + /** + * The not required words. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a not words validation action. +* +* @param locales The locales to be used. +* @param requirement The not required words. +* +* @returns A not words action. +*/ +declare function notWords(locales: TLocales, requirement: TRequirement): NotWordsAction; +/** +* Creates a not words validation action. +* +* @param locales The locales to be used. +* @param requirement The not required words. +* @param message The error message. +* +* @returns A not words action. +*/ +declare function notWords> | undefined>(locales: TLocales, requirement: TRequirement, message: TMessage): NotWordsAction; +//#endregion +//#region src/actions/octal/octal.d.ts +/** +* Octal issue interface. +*/ +interface OctalIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "octal"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The octal regex. + */ + readonly requirement: RegExp; +} +/** +* Octal action interface. +*/ +interface OctalAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "octal"; + /** + * The action reference. + */ + readonly reference: typeof octal; + /** + * The expected property. + */ + readonly expects: null; + /** + * The octal regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [octal](https://en.wikipedia.org/wiki/Octal) validation action. +* +* @returns An octal action. +*/ +declare function octal(): OctalAction; +/** +* Creates an [octal](https://en.wikipedia.org/wiki/Octal) validation action. +* +* @param message The error message. +* +* @returns An octal action. +*/ +declare function octal> | undefined>(message: TMessage): OctalAction; +//#endregion +//#region src/actions/parseBoolean/parseBoolean.d.ts +/** +* Parse boolean config interface. +* +* @beta +*/ +interface ParseBooleanConfig { + /** + * The truthy values. + */ + truthy?: MaybeReadonly | undefined; + /** + * The falsy values. + */ + falsy?: MaybeReadonly | undefined; +} +/** +* Parse boolean issue interface. +* +* @beta +*/ +interface ParseBooleanIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "parse_boolean"; + /** + * The expected property. + */ + readonly expected: string; +} +/** +* Parse boolean action interface. +* +* @beta +*/ +interface ParseBooleanAction> | undefined = undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "parse_boolean"; + /** + * The action reference. + */ + readonly reference: typeof parseBoolean; + /** + * The expected property. + */ + readonly expects: string; + /** + * The parse boolean config. + */ + readonly config: TConfig; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a parse boolean transformation action. +* +* @returns A parse boolean action. +* +* @beta +*/ +declare function parseBoolean(): ParseBooleanAction; +/** +* Creates a parse boolean transformation action. +* +* @param config The parse boolean config. +* +* @returns A parse boolean action. +* +* @beta +*/ +declare function parseBoolean(config: TConfig): ParseBooleanAction; +/** +* Creates a parse boolean transformation action. +* +* @param config The parse boolean config. +* @param message The error message. +* +* @returns A parse boolean action. +* +* @beta +*/ +declare function parseBoolean> | undefined>(config: TConfig, message: TMessage): ParseBooleanAction; +//#endregion +//#region src/actions/parseJson/parseJson.d.ts +/** +* Parse JSON config interface. +* +* @beta +*/ +interface ParseJsonConfig { + /** + * The JSON reviver function. + */ + reviver?: (this: any, key: string, value: any) => any; +} +/** +* Parse JSON issue interface. +* +* @beta +*/ +interface ParseJsonIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "parse_json"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; +} +/** +* Parse JSON action interface. +* +* @beta +*/ +interface ParseJsonAction> | undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "parse_json"; + /** + * The action reference. + */ + readonly reference: typeof parseJson; + /** + * The action config. + */ + readonly config: TConfig; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a parse JSON transformation action. +* +* @returns A parse JSON action. +* +* @beta +*/ +declare function parseJson(): ParseJsonAction; +/** +* Creates a parse JSON transformation action. +* +* @param config The action config. +* +* @returns A parse JSON action. +* +* @beta +*/ +declare function parseJson(config: TConfig): ParseJsonAction; +/** +* Creates a parse JSON transformation action. +* +* @param config The action config. +* @param message The error message. +* +* @returns A parse JSON action. +* +* @beta +*/ +declare function parseJson> | undefined>(config: TConfig, message: TMessage): ParseJsonAction; +//#endregion +//#region src/actions/partialCheck/types.d.ts +/** +* Partial input type. +*/ +type PartialInput = Record | ArrayLike; +/** +* Partial check issue interface. +*/ +interface PartialCheckIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "partial_check"; + /** + * The expected input. + */ + readonly expected: null; + /** + * The validation function. + */ + readonly requirement: (input: TInput$1) => MaybePromise; +} +/** +* Extracts the exact keys of a tuple, array or object. +*/ +type KeyOf = IsAny extends true ? never : TValue$1 extends readonly unknown[] ? number extends TValue$1["length"] ? "$" : { [TKey in keyof TValue$1]: TKey extends `${infer TIndex extends number}` ? TIndex : never }[number] : TValue$1 extends Record ? keyof TValue$1 & (string | number) : never; +/** +* Path type. +*/ +type Path = readonly (string | number)[]; +/** +* Required path type. +*/ +type RequiredPath = readonly [string | number, ...Path]; +/** +* Paths type. +*/ +type Paths = readonly RequiredPath[]; +/** +* Required paths type. +*/ +type RequiredPaths = readonly [RequiredPath, ...RequiredPath[]]; +/** +* Lazily evaluate only the first valid path segment based on the given value. +*/ +type LazyPath = TPathToCheck extends readonly [] ? TValidPath : TPathToCheck extends readonly [infer TFirstKey extends KeyOf, ...infer TPathRest extends Path] ? LazyPath : IsNever> extends false ? readonly [...TValidPath, KeyOf] : TValidPath; +/** +* Returns the path if valid, otherwise the first possible valid path based on +* the given value. +*/ +type ValidPath = TPath extends LazyPath ? TPath : LazyPath; +/** +* Returns a valid path for any given path based on the given value. +*/ +type ValidPaths = { [TKey in keyof TPaths]: ValidPath }; +/** +* Deeply picks specific keys. +* +* Hint: If this type is ever exported and accessible from the outside, it must +* be wrapped in `UnionToIntersect` to avoid invalid results. +*/ +type DeepPick = TPath extends readonly [infer TFirstKey extends string | number, ...infer TPathRest extends Path] ? TValue$1 extends readonly unknown[] ? number extends TValue$1["length"] ? TPathRest extends readonly [] ? TValue$1 : DeepPick[] : { [TKey in keyof TValue$1]: TKey extends `${TFirstKey}` ? TPathRest extends readonly [] ? TValue$1[TKey] : DeepPick : unknown } : { [TKey in keyof TValue$1 as TKey extends TFirstKey ? TKey : never]: TPathRest extends readonly [] ? TValue$1[TKey] : DeepPick } : never; +/** +* Deeply merges two types. +*/ +type DeepMerge = TValue1 extends readonly unknown[] ? TValue2 extends readonly unknown[] ? number extends TValue1["length"] | TValue2["length"] ? DeepMerge[] : { [TKey in keyof TValue1]: TKey extends keyof TValue2 ? unknown extends TValue1[TKey] ? TValue2[TKey] : TValue1[TKey] : never } : never : TValue1 extends Record ? TValue2 extends Record ? { [TKey in keyof (TValue1 & TValue2)]: TKey extends keyof TValue1 ? TKey extends keyof TValue2 ? DeepMerge : TValue1[TKey] : TKey extends keyof TValue2 ? TValue2[TKey] : never } : never : TValue1 & TValue2; +/** +* Deeply picks N specific keys. +*/ +type DeepPickN = TPaths extends readonly [infer TFirstPath extends Path, ...infer TRestPaths extends Paths] ? TRestPaths extends readonly [] ? DeepPick : DeepMerge, DeepPickN> : TInput$1; +//#endregion +//#region src/actions/partialCheck/partialCheck.d.ts +/** +* Partial check action interface. +*/ +interface PartialCheckAction, TMessage extends ErrorMessage> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "partial_check"; + /** + * The action reference. + */ + readonly reference: typeof partialCheck; + /** + * The expected property. + */ + readonly expects: null; + /** + * The selected paths. + */ + readonly paths: TPaths; + /** + * The validation function. + */ + readonly requirement: (input: TSelection) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a partial check validation action. +* +* @param paths The selected paths. +* @param requirement The validation function. +* +* @returns A partial check action. +*/ +declare function partialCheck>(paths: ValidPaths, requirement: (input: TSelection) => boolean): PartialCheckAction; +/** +* Creates a partial check validation action. +* +* @param paths The selected paths. +* @param requirement The validation function. +* @param message The error message. +* +* @returns A partial check action. +*/ +declare function partialCheck, const TMessage extends ErrorMessage> | undefined>(paths: ValidPaths, requirement: (input: TSelection) => boolean, message: TMessage): PartialCheckAction; +//#endregion +//#region src/actions/partialCheck/partialCheckAsync.d.ts +/** +* Partial check action async interface. +*/ +interface PartialCheckActionAsync, TMessage extends ErrorMessage> | undefined> extends BaseValidationAsync> { + /** + * The action type. + */ + readonly type: "partial_check"; + /** + * The action reference. + */ + readonly reference: typeof partialCheckAsync; + /** + * The expected property. + */ + readonly expects: null; + /** + * The selected paths. + */ + readonly paths: TPaths; + /** + * The validation function. + */ + readonly requirement: (input: TSelection) => MaybePromise; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a partial check validation action. +* +* @param paths The selected paths. +* @param requirement The validation function. +* +* @returns A partial check action. +*/ +declare function partialCheckAsync>(paths: ValidPaths, requirement: (input: TSelection) => MaybePromise): PartialCheckActionAsync; +/** +* Creates a partial check validation action. +* +* @param paths The selected paths. +* @param requirement The validation function. +* @param message The error message. +* +* @returns A partial check action. +*/ +declare function partialCheckAsync, const TMessage extends ErrorMessage> | undefined>(paths: ValidPaths, requirement: (input: TSelection) => MaybePromise, message: TMessage): PartialCheckActionAsync; +//#endregion +//#region src/actions/rawCheck/types.d.ts +/** +* Raw check issue interface. +*/ +interface RawCheckIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "raw_check"; +} +/** +* Raw check issue info interface. +*/ +interface RawCheckIssueInfo { + label?: string | undefined; + input?: unknown | undefined; + expected?: string | undefined; + received?: string | undefined; + message?: ErrorMessage> | undefined; + path?: [IssuePathItem, ...IssuePathItem[]] | undefined; +} +/** +* Raw check add issue type. +*/ +type RawCheckAddIssue = (info?: RawCheckIssueInfo) => void; +/** +* Raw check context interface. +*/ +interface RawCheckContext { + readonly dataset: OutputDataset>; + readonly config: Config>; + readonly addIssue: RawCheckAddIssue; +} +//#endregion +//#region src/actions/rawCheck/rawCheck.d.ts +/** +* Raw check action interface. +*/ +interface RawCheckAction extends BaseValidation> { + /** + * The action type. + */ + readonly type: "raw_check"; + /** + * The action reference. + */ + readonly reference: typeof rawCheck; + /** + * The expected property. + */ + readonly expects: null; +} +/** +* Creates a raw check validation action. +* +* @param action The validation action. +* +* @returns A raw check action. +*/ +declare function rawCheck(action: (context: RawCheckContext) => void): RawCheckAction; +//#endregion +//#region src/actions/rawCheck/rawCheckAsync.d.ts +/** +* Raw check action async interface. +*/ +interface RawCheckActionAsync extends BaseValidationAsync> { + /** + * The action type. + */ + readonly type: "raw_check"; + /** + * The action reference. + */ + readonly reference: typeof rawCheckAsync; + /** + * The expected property. + */ + readonly expects: null; +} +/** +* Creates a raw check validation action. +* +* @param action The validation action. +* +* @returns A raw check action. +*/ +declare function rawCheckAsync(action: (context: RawCheckContext) => MaybePromise): RawCheckActionAsync; +//#endregion +//#region src/actions/rawTransform/types.d.ts +/** +* Raw transform issue interface. +*/ +interface RawTransformIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "raw_transform"; +} +/** +* Raw transform issue info interface. +*/ +interface RawTransformIssueInfo { + label?: string | undefined; + input?: unknown | undefined; + expected?: string | undefined; + received?: string | undefined; + message?: ErrorMessage> | undefined; + path?: [IssuePathItem, ...IssuePathItem[]] | undefined; +} +/** +* Raw transform add issue type. +*/ +type RawTransformAddIssue = (info?: RawTransformIssueInfo) => void; +/** +* Raw transform context interface. +*/ +interface RawTransformContext { + readonly dataset: SuccessDataset; + readonly config: Config>; + readonly addIssue: RawTransformAddIssue; + readonly NEVER: never; +} +//#endregion +//#region src/actions/rawTransform/rawTransform.d.ts +/** +* Raw transform action interface. +*/ +interface RawTransformAction extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "raw_transform"; + /** + * The action reference. + */ + readonly reference: typeof rawTransform; +} +/** +* Creates a raw transformation action. +* +* @param action The transformation action. +* +* @returns A raw transform action. +*/ +declare function rawTransform(action: (context: RawTransformContext) => TOutput$1): RawTransformAction; +//#endregion +//#region src/actions/rawTransform/rawTransformAsync.d.ts +/** +* Raw transform action async interface. +*/ +interface RawTransformActionAsync extends BaseTransformationAsync> { + /** + * The action type. + */ + readonly type: "raw_transform"; + /** + * The action reference. + */ + readonly reference: typeof rawTransformAsync; +} +/** +* Creates a raw transformation action. +* +* @param action The transformation action. +* +* @returns A raw transform action. +*/ +declare function rawTransformAsync(action: (context: RawTransformContext) => MaybePromise): RawTransformActionAsync; +//#endregion +//#region src/actions/readonly/readonly.d.ts +/** +* Readonly output type. +*/ +type ReadonlyOutput = TInput$1 extends Map ? ReadonlyMap : TInput$1 extends Set ? ReadonlySet : Readonly; +/** +* Readonly action interface. +*/ +interface ReadonlyAction extends BaseTransformation, never> { + /** + * The action type. + */ + readonly type: "readonly"; + /** + * The action reference. + */ + readonly reference: typeof readonly; +} +/** +* Creates a readonly transformation action. +* +* @returns A readonly action. +*/ +declare function readonly(): ReadonlyAction; +//#endregion +//#region src/actions/reduceItems/reduceItems.d.ts +/** +* Array action type. +*/ +type ArrayAction$1 = (output: TOutput$1, item: TInput$1[number], index: number, array: TInput$1) => TOutput$1; +/** +* Reduce items action interface. +*/ +interface ReduceItemsAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "reduce_items"; + /** + * The action reference. + */ + readonly reference: typeof reduceItems; + /** + * The reduce items operation. + */ + readonly operation: ArrayAction$1; + /** + * The initial value. + */ + readonly initial: TOutput$1; +} +/** +* Creates a reduce items transformation action. +* +* @param operation The reduce items operation. +* @param initial The initial value. +* +* @returns A reduce items action. +*/ +declare function reduceItems(operation: ArrayAction$1, initial: TOutput$1): ReduceItemsAction; +//#endregion +//#region src/actions/regex/regex.d.ts +/** +* Regex issue interface. +*/ +interface RegexIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "regex"; + /** + * The expected input. + */ + readonly expected: string; + /** + * The received input. + */ + readonly received: `"${string}"`; + /** + * The regex pattern. + */ + readonly requirement: RegExp; +} +/** +* Regex action interface. +*/ +interface RegexAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "regex"; + /** + * The action reference. + */ + readonly reference: typeof regex; + /** + * The expected property. + */ + readonly expects: string; + /** + * The regex pattern. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [regex](https://en.wikipedia.org/wiki/Regular_expression) validation action. +* +* Hint: Be careful with the global flag `g` in your regex pattern, as it can lead to unexpected results. See [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test#using_test_on_a_regex_with_the_global_flag) for more information. +* +* @param requirement The regex pattern. +* +* @returns A regex action. +*/ +declare function regex(requirement: RegExp): RegexAction; +/** +* Creates a [regex](https://en.wikipedia.org/wiki/Regular_expression) validation action. +* +* Hint: Be careful with the global flag `g` in your regex pattern, as it can lead to unexpected results. See [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/test#using_test_on_a_regex_with_the_global_flag) for more information. +* +* @param requirement The regex pattern. +* @param message The error message. +* +* @returns A regex action. +*/ +declare function regex> | undefined>(requirement: RegExp, message: TMessage): RegexAction; +//#endregion +//#region src/actions/returns/returns.d.ts +/** +* Returns action type. +*/ +interface ReturnsAction unknown, TSchema extends BaseSchema>> extends BaseTransformation) => InferOutput, never> { + /** + * The action type. + */ + readonly type: "returns"; + /** + * The action reference. + */ + readonly reference: typeof returns; + /** + * The arguments schema. + */ + readonly schema: TSchema; +} +/** +* Creates a function return transformation action. +* +* @param schema The arguments schema. +* +* @returns An returns action. +*/ +declare function returns unknown, TSchema extends BaseSchema>>(schema: TSchema): ReturnsAction; +//#endregion +//#region src/actions/returns/returnsAsync.d.ts +/** +* Returns action async type. +*/ +interface ReturnsActionAsync unknown, TSchema extends BaseSchema> | BaseSchemaAsync>> extends BaseTransformation) => Promise>>, never> { + /** + * The action type. + */ + readonly type: "returns"; + /** + * The action reference. + */ + readonly reference: typeof returnsAsync; + /** + * The arguments schema. + */ + readonly schema: TSchema; +} +/** +* Creates a function arguments transformation action. +* +* @param schema The arguments schema. +* +* @returns An returns action. +*/ +declare function returnsAsync unknown, TSchema extends BaseSchema> | BaseSchemaAsync>>(schema: TSchema): ReturnsActionAsync; +//#endregion +//#region src/actions/rfcEmail/rfcEmail.d.ts +/** +* RFC email issue interface. +*/ +interface RfcEmailIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "rfc_email"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The RFC email regex. + */ + readonly requirement: RegExp; +} +/** +* RFC email action interface. +*/ +interface RfcEmailAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "rfc_email"; + /** + * The action reference. + */ + readonly reference: typeof rfcEmail; + /** + * The expected property. + */ + readonly expects: null; + /** + * The RFC email regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [RFC email](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) +* validation action. +* +* Hint: This validation action uses the regex defined by the HTML Living +* Standard for ``, which covers most of RFC 5322 but +* not all of it. For example, quoted local parts and comments are not +* supported. If you are interested in an action that only validates common +* email addresses, please use the `email` action instead. +* +* @returns A RFC email action. +*/ +declare function rfcEmail(): RfcEmailAction; +/** +* Creates a [RFC email](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) +* validation action. +* +* Hint: This validation action uses the regex defined by the HTML Living +* Standard for ``, which covers most of RFC 5322 but +* not all of it. For example, quoted local parts and comments are not +* supported. If you are interested in an action that only validates common +* email addresses, please use the `email` action instead. +* +* @param message The error message. +* +* @returns A RFC email action. +*/ +declare function rfcEmail> | undefined>(message: TMessage): RfcEmailAction; +//#endregion +//#region src/actions/safeInteger/safeInteger.d.ts +/** +* Safe integer issue interface. +*/ +interface SafeIntegerIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "safe_integer"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The validation function. + */ + readonly requirement: (input: number) => boolean; +} +/** +* Safe integer action interface. +*/ +interface SafeIntegerAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "safe_integer"; + /** + * The action reference. + */ + readonly reference: typeof safeInteger; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: number) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a safe integer validation action. +* +* @returns A safe integer action. +*/ +declare function safeInteger(): SafeIntegerAction; +/** +* Creates a safe integer validation action. +* +* @param message The error message. +* +* @returns A safe integer action. +*/ +declare function safeInteger> | undefined>(message: TMessage): SafeIntegerAction; +//#endregion +//#region src/actions/size/size.d.ts +/** +* Size issue interface. +*/ +interface SizeIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "size"; + /** + * The expected property. + */ + readonly expected: `${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The required size. + */ + readonly requirement: TRequirement; +} +/** +* Size action interface. +*/ +interface SizeAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "size"; + /** + * The action reference. + */ + readonly reference: typeof size; + /** + * The expected property. + */ + readonly expects: `${TRequirement}`; + /** + * The required size. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a size validation action. +* +* @param requirement The required size. +* +* @returns A size action. +*/ +declare function size(requirement: TRequirement): SizeAction; +/** +* Creates a size validation action. +* +* @param requirement The required size. +* @param message The error message. +* +* @returns A size action. +*/ +declare function size> | undefined>(requirement: TRequirement, message: TMessage): SizeAction; +//#endregion +//#region src/actions/slug/slug.d.ts +/** +* Slug issue type. +*/ +interface SlugIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "slug"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The slug regex. + */ + readonly requirement: RegExp; +} +/** +* Slug action type. +*/ +interface SlugAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "slug"; + /** + * The action reference. + */ + readonly reference: typeof slug; + /** + * The expected property. + */ + readonly expects: null; + /** + * The slug regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a [slug](https://en.wikipedia.org/wiki/Clean_URL#Slug) validation action. +* +* @returns A slug action. +*/ +declare function slug(): SlugAction; +/** +* Creates a [slug](https://en.wikipedia.org/wiki/Clean_URL#Slug) validation action. +* +* @param message The error message. +* +* @returns A slug action. +*/ +declare function slug> | undefined>(message: TMessage): SlugAction; +//#endregion +//#region src/actions/someItem/someItem.d.ts +/** +* Some item issue interface. +*/ +interface SomeItemIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "some_item"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirement; +} +/** +* Some item action interface. +*/ +interface SomeItemAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "some_item"; + /** + * The action reference. + */ + readonly reference: typeof someItem; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: ArrayRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a some item validation action. +* +* @param requirement The validation function. +* +* @returns A some item action. +*/ +declare function someItem(requirement: ArrayRequirement): SomeItemAction; +/** +* Creates a some item validation action. +* +* @param requirement The validation function. +* @param message The error message. +* +* @returns A some item action. +*/ +declare function someItem> | undefined>(requirement: ArrayRequirement, message: TMessage): SomeItemAction; +//#endregion +//#region src/actions/sortItems/sortItems.d.ts +/** +* Array action type. +*/ +type ArrayAction = (itemA: TInput$1[number], itemB: TInput$1[number]) => number; +/** +* Sort items action interface. +*/ +interface SortItemsAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "sort_items"; + /** + * The action reference. + */ + readonly reference: typeof sortItems; + /** + * The sort items operation. + */ + readonly operation: ArrayAction | undefined; +} +/** +* Creates a sort items transformation action. +* +* @param operation The sort items operation. +* +* @returns A sort items action. +*/ +declare function sortItems(operation?: ArrayAction): SortItemsAction; +//#endregion +//#region src/actions/startsWith/startsWith.d.ts +/** +* Starts with issue interface. +*/ +interface StartsWithIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "starts_with"; + /** + * The expected property. + */ + readonly expected: `"${TRequirement}"`; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The start string. + */ + readonly requirement: TRequirement; +} +/** +* Starts with action interface. +*/ +interface StartsWithAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "starts_with"; + /** + * The action reference. + */ + readonly reference: typeof startsWith; + /** + * The expected property. + */ + readonly expects: `"${TRequirement}"`; + /** + * The start string. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a starts with validation action. +* +* @param requirement The start string. +* +* @returns A starts with action. +*/ +declare function startsWith(requirement: TRequirement): StartsWithAction; +/** +* Creates a starts with validation action. +* +* @param requirement The start string. +* @param message The error message. +* +* @returns A starts with action. +*/ +declare function startsWith> | undefined>(requirement: TRequirement, message: TMessage): StartsWithAction; +//#endregion +//#region src/actions/stringifyJson/stringifyJson.d.ts +/** +* Stringify JSON config interface. +* +* @beta +*/ +interface StringifyJsonConfig { + /** + * The JSON replacer function or array. + */ + replacer?: ((this: any, key: string, value: any) => any) | (number | string)[]; + /** + * The JSON space option. + */ + space?: string | number; +} +/** +* Stringify JSON issue interface. +* +* @beta +*/ +interface StringifyJsonIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "stringify_json"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; +} +/** +* Stringify JSON action interface. +* +* @beta +*/ +interface StringifyJsonAction> | undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "stringify_json"; + /** + * The action reference. + */ + readonly reference: typeof stringifyJson; + /** + * The action config. + */ + readonly config: TConfig; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a stringify JSON transformation action. +* +* @returns A stringify JSON action. +* +* @beta +*/ +declare function stringifyJson(): StringifyJsonAction; +/** +* Creates a stringify JSON transformation action. +* +* @param config The action config. +* +* @returns A stringify JSON action. +* +* @beta +*/ +declare function stringifyJson(config: TConfig): StringifyJsonAction; +/** +* Creates a stringify JSON transformation action. +* +* @param config The action config. +* @param message The error message. +* +* @returns A stringify JSON action. +* +* @beta +*/ +declare function stringifyJson> | undefined>(config: TConfig, message: TMessage): StringifyJsonAction; +//#endregion +//#region src/actions/toBigint/toBigint.d.ts +/** +* To bigint issue interface. +*/ +interface ToBigintIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "to_bigint"; + /** + * The expected property. + */ + readonly expected: null; +} +/** +* To bigint action interface. +*/ +interface ToBigintAction> | undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "to_bigint"; + /** + * The action reference. + */ + readonly reference: typeof toBigint; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a to bigint transformation action. +* +* @returns A to bigint action. +* +* @beta +*/ +declare function toBigint(): ToBigintAction; +/** +* Creates a to bigint transformation action. +* +* @param message The error message. +* +* @returns A to bigint action. +* +* @beta +*/ +declare function toBigint> | undefined>(message: TMessage): ToBigintAction; +//#endregion +//#region src/actions/toBoolean/toBoolean.d.ts +/** +* To boolean action interface. +*/ +interface ToBooleanAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_boolean"; + /** + * The action reference. + */ + readonly reference: typeof toBoolean; +} +/** +* Creates a to boolean transformation action. +* +* @returns A to boolean action. +* +* @beta +*/ +declare function toBoolean(): ToBooleanAction; +//#endregion +//#region src/actions/toCamelCase/toCamelCase.d.ts +/** +* To camel case action interface. +* +* @beta +*/ +interface ToCamelCaseAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_camel_case"; + /** + * The action reference. + */ + readonly reference: typeof toCamelCase; +} +/** +* Creates a to camel case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `parseUrlValue`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `item2Name`). +* +* @returns A to camel case action. +* +* @beta +*/ +declare function toCamelCase(): ToCamelCaseAction; +//#endregion +//#region src/actions/toDate/toDate.d.ts +/** +* To date issue interface. +*/ +interface ToDateIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "to_date"; + /** + * The expected property. + */ + readonly expected: null; +} +/** +* To date action interface. +*/ +interface ToDateAction> | undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "to_date"; + /** + * The action reference. + */ + readonly reference: typeof toDate; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a to date transformation action. +* +* @returns A to date action. +* +* @beta +*/ +declare function toDate(): ToDateAction; +/** +* Creates a to date transformation action. +* +* @param message The error message. +* +* @returns A to date action. +* +* @beta +*/ +declare function toDate> | undefined>(message: TMessage): ToDateAction; +//#endregion +//#region src/actions/toKebabCase/toKebabCase.d.ts +/** +* To kebab case action interface. +* +* @beta +*/ +interface ToKebabCaseAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_kebab_case"; + /** + * The action reference. + */ + readonly reference: typeof toKebabCase; +} +/** +* Creates a to kebab case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `parse-url-value`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `item2-name`). +* +* @returns A to kebab case action. +* +* @beta +*/ +declare function toKebabCase(): ToKebabCaseAction; +//#endregion +//#region src/actions/toLowerCase/toLowerCase.d.ts +/** +* To lower case action interface. +*/ +interface ToLowerCaseAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_lower_case"; + /** + * The action reference. + */ + readonly reference: typeof toLowerCase; +} +/** +* Creates a to lower case transformation action. +* +* @returns A to lower case action. +*/ +declare function toLowerCase(): ToLowerCaseAction; +//#endregion +//#region src/actions/toMaxValue/toMaxValue.d.ts +/** +* To max value action interface. +*/ +interface ToMaxValueAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_max_value"; + /** + * The action reference. + */ + readonly reference: typeof toMaxValue; + /** + * The maximum value. + */ + readonly requirement: TRequirement; +} +/** +* Creates a to max value transformation action. +* +* @param requirement The maximum value. +* +* @returns A to max value action. +*/ +declare function toMaxValue(requirement: TRequirement): ToMaxValueAction; +//#endregion +//#region src/actions/toMinValue/toMinValue.d.ts +/** +* To min value action interface. +*/ +interface ToMinValueAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_min_value"; + /** + * The action reference. + */ + readonly reference: typeof toMinValue; + /** + * The minimum value. + */ + readonly requirement: TRequirement; +} +/** +* Creates a to min value transformation action. +* +* @param requirement The minimum value. +* +* @returns A to min value action. +*/ +declare function toMinValue(requirement: TRequirement): ToMinValueAction; +//#endregion +//#region src/actions/toNumber/toNumber.d.ts +/** +* To number issue interface. +*/ +interface ToNumberIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "to_number"; + /** + * The expected property. + */ + readonly expected: null; +} +/** +* To number action interface. +*/ +interface ToNumberAction> | undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "to_number"; + /** + * The action reference. + */ + readonly reference: typeof toNumber; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a to number transformation action. +* +* @returns A to number action. +* +* @beta +*/ +declare function toNumber(): ToNumberAction; +/** +* Creates a to number transformation action. +* +* @param message The error message. +* +* @returns A to number action. +* +* @beta +*/ +declare function toNumber> | undefined>(message: TMessage): ToNumberAction; +//#endregion +//#region src/actions/toPascalCase/toPascalCase.d.ts +/** +* To pascal case action interface. +* +* @beta +*/ +interface ToPascalCaseAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_pascal_case"; + /** + * The action reference. + */ + readonly reference: typeof toPascalCase; +} +/** +* Creates a to pascal case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `ParseUrlValue`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `Item2Name`). +* +* @returns A to pascal case action. +* +* @beta +*/ +declare function toPascalCase(): ToPascalCaseAction; +//#endregion +//#region src/actions/toSnakeCase/toSnakeCase.d.ts +/** +* To snake case action interface. +* +* @beta +*/ +interface ToSnakeCaseAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_snake_case"; + /** + * The action reference. + */ + readonly reference: typeof toSnakeCase; +} +/** +* Creates a to snake case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `parse_url_value`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `item2_name`). +* +* @returns A to snake case action. +* +* @beta +*/ +declare function toSnakeCase(): ToSnakeCaseAction; +//#endregion +//#region src/actions/toString/toString.d.ts +/** +* To string issue interface. +*/ +interface ToStringIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "transformation"; + /** + * The issue type. + */ + readonly type: "to_string"; + /** + * The expected property. + */ + readonly expected: null; +} +/** +* To string action interface. +*/ +interface ToStringAction> | undefined> extends BaseTransformation> { + /** + * The action type. + */ + readonly type: "to_string"; + /** + * The action reference. + */ + readonly reference: typeof toString; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a to string transformation action. +* +* @returns A to string action. +* +* @beta +*/ +declare function toString(): ToStringAction; +/** +* Creates a to string transformation action. +* +* @param message The error message. +* +* @returns A to string action. +* +* @beta +*/ +declare function toString> | undefined>(message: TMessage): ToStringAction; +//#endregion +//#region src/actions/toUpperCase/toUpperCase.d.ts +/** +* To upper case action interface. +*/ +interface ToUpperCaseAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "to_upper_case"; + /** + * The action reference. + */ + readonly reference: typeof toUpperCase; +} +/** +* Creates a to upper case transformation action. +* +* @returns A to upper case action. +*/ +declare function toUpperCase(): ToUpperCaseAction; +//#endregion +//#region src/actions/transform/transform.d.ts +/** +* Transform action interface. +*/ +interface TransformAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "transform"; + /** + * The action reference. + */ + readonly reference: typeof transform; + /** + * The transformation operation. + */ + readonly operation: (input: TInput$1) => TOutput$1; +} +/** +* Creates a custom transformation action. +* +* @param operation The transformation operation. +* +* @returns A transform action. +*/ +declare function transform(operation: (input: TInput$1) => TOutput$1): TransformAction; +//#endregion +//#region src/actions/transform/transformAsync.d.ts +/** +* Transform action async interface. +*/ +interface TransformActionAsync extends BaseTransformationAsync { + /** + * The action type. + */ + readonly type: "transform"; + /** + * The action reference. + */ + readonly reference: typeof transformAsync; + /** + * The transformation operation. + */ + readonly operation: (input: TInput$1) => Promise; +} +/** +* Creates a custom transformation action. +* +* @param operation The transformation operation. +* +* @returns A transform action. +*/ +declare function transformAsync(operation: (input: TInput$1) => Promise): TransformActionAsync; +//#endregion +//#region src/actions/trim/trim.d.ts +/** +* Trim action interface. +*/ +interface TrimAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "trim"; + /** + * The action reference. + */ + readonly reference: typeof trim; +} +/** +* Creates a trim transformation action. +* +* @returns A trim action. +*/ +declare function trim(): TrimAction; +//#endregion +//#region src/actions/trimEnd/trimEnd.d.ts +/** +* Trim end action interface. +*/ +interface TrimEndAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "trim_end"; + /** + * The action reference. + */ + readonly reference: typeof trimEnd; +} +/** +* Creates a trim end transformation action. +* +* @returns A trim end action. +*/ +declare function trimEnd(): TrimEndAction; +//#endregion +//#region src/actions/trimStart/trimStart.d.ts +/** +* Trim start action interface. +*/ +interface TrimStartAction extends BaseTransformation { + /** + * The action type. + */ + readonly type: "trim_start"; + /** + * The action reference. + */ + readonly reference: typeof trimStart; +} +/** +* Creates a trim start transformation action. +* +* @returns A trim start action. +*/ +declare function trimStart(): TrimStartAction; +//#endregion +//#region src/actions/ulid/ulid.d.ts +/** +* ULID issue interface. +*/ +interface UlidIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "ulid"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The ULID regex. + */ + readonly requirement: RegExp; +} +/** +* ULID action interface. +*/ +interface UlidAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "ulid"; + /** + * The action reference. + */ + readonly reference: typeof ulid; + /** + * The expected property. + */ + readonly expects: null; + /** + * The ULID regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [ULID](https://github.com/ulid/spec) validation action. +* +* @returns An ULID action. +*/ +declare function ulid(): UlidAction; +/** +* Creates an [ULID](https://github.com/ulid/spec) validation action. +* +* @param message The error message. +* +* @returns An ULID action. +*/ +declare function ulid> | undefined>(message: TMessage): UlidAction; +//#endregion +//#region src/actions/url/url.d.ts +/** +* URL issue interface. +*/ +interface UrlIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "url"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; +} +/** +* URL action interface. +*/ +interface UrlAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "url"; + /** + * The action reference. + */ + readonly reference: typeof url; + /** + * The expected property. + */ + readonly expects: null; + /** + * The validation function. + */ + readonly requirement: (input: string) => boolean; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [URL](https://en.wikipedia.org/wiki/URL) validation action. +* +* Hint: The value is passed to the URL constructor to check if it is valid. +* This check is not perfect. For example, values like "abc:1234" are accepted. +* +* @returns An URL action. +*/ +declare function url(): UrlAction; +/** +* Creates an [URL](https://en.wikipedia.org/wiki/URL) validation action. +* +* Hint: The value is passed to the URL constructor to check if it is valid. +* This check is not perfect. For example, values like "abc:1234" are accepted. +* +* @param message The error message. +* +* @returns An URL action. +*/ +declare function url> | undefined>(message: TMessage): UrlAction; +//#endregion +//#region src/actions/uuid/uuid.d.ts +/** +* UUID issue interface. +*/ +interface UuidIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "uuid"; + /** + * The expected property. + */ + readonly expected: null; + /** + * The received property. + */ + readonly received: `"${string}"`; + /** + * The UUID regex. + */ + readonly requirement: RegExp; +} +/** +* UUID action interface. +*/ +interface UuidAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "uuid"; + /** + * The action reference. + */ + readonly reference: typeof uuid; + /** + * The expected property. + */ + readonly expects: null; + /** + * The UUID regex. + */ + readonly requirement: RegExp; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates an [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) validation action. +* +* @returns An UUID action. +*/ +declare function uuid(): UuidAction; +/** +* Creates an [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) validation action. +* +* @param message The error message. +* +* @returns An UUID action. +*/ +declare function uuid> | undefined>(message: TMessage): UuidAction; +//#endregion +//#region src/actions/value/value.d.ts +/** +* Value issue interface. +*/ +interface ValueIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "value"; + /** + * The expected property. + */ + readonly expected: string; + /** + * The required value. + */ + readonly requirement: TRequirement; +} +/** +* Value action interface. +*/ +interface ValueAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "value"; + /** + * The action reference. + */ + readonly reference: typeof value; + /** + * The expected property. + */ + readonly expects: string; + /** + * The required value. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a value validation action. +* +* @param requirement The required value. +* +* @returns A value action. +*/ +declare function value(requirement: TRequirement): ValueAction; +/** +* Creates a value validation action. +* +* @param requirement The required value. +* @param message The error message. +* +* @returns A value action. +*/ +declare function value> | undefined>(requirement: TRequirement, message: TMessage): ValueAction; +//#endregion +//#region src/actions/values/values.d.ts +/** +* Values issue type. +*/ +interface ValuesIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "values"; + /** + * The expected property. + */ + readonly expected: string; + /** + * The required values. + */ + readonly requirement: TRequirement; +} +/** +* Values action type. +*/ +interface ValuesAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "values"; + /** + * The action reference. + */ + readonly reference: typeof values; + /** + * The expected property. + */ + readonly expects: string; + /** + * The required values. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a values validation action. +* +* @param requirement The required values. +* +* @returns A values action. +*/ +declare function values(requirement: TRequirement): ValuesAction; +/** +* Creates a values validation action. +* +* @param requirement The required values. +* @param message The error message. +* +* @returns A values action. +*/ +declare function values> | undefined>(requirement: TRequirement, message: TMessage): ValuesAction; +//#endregion +//#region src/actions/words/words.d.ts +/** +* Words issue interface. +*/ +interface WordsIssue extends BaseIssue { + /** + * The issue kind. + */ + readonly kind: "validation"; + /** + * The issue type. + */ + readonly type: "words"; + /** + * The expected property. + */ + readonly expected: `${TRequirement}`; + /** + * The received property. + */ + readonly received: `${number}`; + /** + * The required words. + */ + readonly requirement: TRequirement; +} +/** +* Words action interface. +*/ +interface WordsAction> | undefined> extends BaseValidation> { + /** + * The action type. + */ + readonly type: "words"; + /** + * The action reference. + */ + readonly reference: typeof words; + /** + * The expected property. + */ + readonly expects: `${TRequirement}`; + /** + * The locales to be used. + */ + readonly locales: TLocales; + /** + * The required words. + */ + readonly requirement: TRequirement; + /** + * The error message. + */ + readonly message: TMessage; +} +/** +* Creates a words validation action. +* +* @param locales The locales to be used. +* @param requirement The required words. +* +* @returns A words action. +*/ +declare function words(locales: TLocales, requirement: TRequirement): WordsAction; +/** +* Creates a words validation action. +* +* @param locales The locales to be used. +* @param requirement The required words. +* @param message The error message. +* +* @returns A words action. +*/ +declare function words> | undefined>(locales: TLocales, requirement: TRequirement, message: TMessage): WordsAction; +//#endregion +//#region src/regex.d.ts +/** +* [Base64](https://en.wikipedia.org/wiki/Base64) regex. +*/ +declare const BASE64_REGEX: RegExp; +/** +* [BIC](https://en.wikipedia.org/wiki/ISO_9362) regex. +*/ +declare const BIC_REGEX: RegExp; +/** +* [Cuid2](https://github.com/paralleldrive/cuid2) regex. +*/ +declare const CUID2_REGEX: RegExp; +/** +* [Decimal](https://en.wikipedia.org/wiki/Decimal) regex. +*/ +declare const DECIMAL_REGEX: RegExp; +/** +* [Digits](https://en.wikipedia.org/wiki/Numerical_digit) regex. +*/ +declare const DIGITS_REGEX: RegExp; +/** +* [Domain name](https://en.wikipedia.org/wiki/Domain_name) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +* ASCII-only validation. Internationalized domain names (IDNs) are not +* supported, including Punycode-encoded labels. +*/ +declare const DOMAIN_REGEX: RegExp; +/** +* [Email address](https://en.wikipedia.org/wiki/Email_address) regex. +*/ +declare const EMAIL_REGEX: RegExp; +/** +* Emoji regex from [emoji-regex-xs](https://github.com/slevithan/emoji-regex-xs) v1.0.0 (MIT license). +* +* Hint: We decided against the newer `/^\p{RGI_Emoji}+$/v` regex because it is +* not supported in older runtimes and does not match all emoji. +*/ +declare const EMOJI_REGEX: RegExp; +/** +* [Hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +declare const HEXADECIMAL_REGEX: RegExp; +/** +* [Hex color](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +declare const HEX_COLOR_REGEX: RegExp; +/** +* [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) regex. +*/ +declare const IMEI_REGEX: RegExp; +/** +* [IPv4](https://en.wikipedia.org/wiki/IPv4) regex. +*/ +declare const IPV4_REGEX: RegExp; +/** +* [IPv6](https://en.wikipedia.org/wiki/IPv6) regex. +*/ +declare const IPV6_REGEX: RegExp; +/** +* [IP](https://en.wikipedia.org/wiki/IP_address) regex. +*/ +declare const IP_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date regex. +*/ +declare const ISO_DATE_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time regex. +*/ +declare const ISO_DATE_TIME_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with seconds regex. +*/ +declare const ISO_DATE_TIME_SECOND_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time regex. +*/ +declare const ISO_TIME_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time with seconds regex. +*/ +declare const ISO_TIME_SECOND_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp regex. Allows a +* space as a date/time separator and an optional space before the UTC offset. +*/ +declare const ISO_TIMESTAMP_REGEX: RegExp; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) week regex. +*/ +declare const ISO_WEEK_REGEX: RegExp; +/** +* [JWS compact serialization](https://datatracker.ietf.org/doc/html/rfc7515#section-3.1) +* regex. +* +* Hint: Empty payload and signature segments are allowed because the +* Base64URL-encoded representation of an empty octet sequence is an empty +* string. +*/ +declare const JWS_COMPACT_REGEX: RegExp; +/** +* [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) regex. +*/ +declare const ISRC_REGEX: RegExp; +/** +* [MAC](https://en.wikipedia.org/wiki/MAC_address) 48 bit regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +declare const MAC48_REGEX: RegExp; +/** +* [MAC](https://en.wikipedia.org/wiki/MAC_address) 64 bit regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +declare const MAC64_REGEX: RegExp; +/** +* [MAC](https://en.wikipedia.org/wiki/MAC_address) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +declare const MAC_REGEX: RegExp; +/** +* [Nano ID](https://github.com/ai/nanoid) regex. +*/ +declare const NANO_ID_REGEX: RegExp; +/** +* [Octal](https://en.wikipedia.org/wiki/Octal) regex. +*/ +declare const OCTAL_REGEX: RegExp; +/** +* [RFC 5322 email address](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) regex. +* +* Hint: This regex was taken from the [HTML Living Standard Specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) and does not perfectly represent RFC 5322. +*/ +declare const RFC_EMAIL_REGEX: RegExp; +/** +* [Slug](https://en.wikipedia.org/wiki/Clean_URL#Slug) regex. +*/ +declare const SLUG_REGEX: RegExp; +/** +* [ULID](https://github.com/ulid/spec) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +declare const ULID_REGEX: RegExp; +/** +* [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) regex. +*/ +declare const UUID_REGEX: RegExp; +//#endregion +//#region src/storages/globalConfig/globalConfig.d.ts +/** +* The global config type. +*/ +type GlobalConfig = Omit, "message">; +/** +* Sets the global configuration. +* +* @param config The configuration. +*/ +declare function setGlobalConfig(config: GlobalConfig): void; +/** +* Returns the global configuration. +* +* @param config The config to merge. +* +* @returns The configuration. +*/ +declare function getGlobalConfig>(config?: Config): Config; +/** +* Deletes the global configuration. +*/ +declare function deleteGlobalConfig(): void; +//#endregion +//#region src/storages/globalMessage/globalMessage.d.ts +/** +* Sets a global error message. +* +* @param message The error message. +* @param lang The language of the message. +*/ +declare function setGlobalMessage(message: ErrorMessage>, lang?: string): void; +/** +* Returns a global error message. +* +* @param lang The language of the message. +* +* @returns The error message. +*/ +declare function getGlobalMessage(lang?: string): ErrorMessage> | undefined; +/** +* Deletes a global error message. +* +* @param lang The language of the message. +*/ +declare function deleteGlobalMessage(lang?: string): void; +//#endregion +//#region src/storages/schemaMessage/schemaMessage.d.ts +/** +* Sets a schema error message. +* +* @param message The error message. +* @param lang The language of the message. +*/ +declare function setSchemaMessage(message: ErrorMessage>, lang?: string): void; +/** +* Returns a schema error message. +* +* @param lang The language of the message. +* +* @returns The error message. +*/ +declare function getSchemaMessage(lang?: string): ErrorMessage> | undefined; +/** +* Deletes a schema error message. +* +* @param lang The language of the message. +*/ +declare function deleteSchemaMessage(lang?: string): void; +//#endregion +//#region src/storages/specificMessage/specificMessage.d.ts +/** +* Reference type. +*/ +type Reference = (...args: any[]) => BaseSchema> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync>; +/** +* Sets a specific error message. +* +* @param reference The identifier reference. +* @param message The error message. +* @param lang The language of the message. +*/ +declare function setSpecificMessage(reference: TReference, message: ErrorMessage>>, lang?: string): void; +/** +* Returns a specific error message. +* +* @param reference The identifier reference. +* @param lang The language of the message. +* +* @returns The error message. +*/ +declare function getSpecificMessage(reference: TReference, lang?: string): ErrorMessage>> | undefined; +/** +* Deletes a specific error message. +* +* @param reference The identifier reference. +* @param lang The language of the message. +*/ +declare function deleteSpecificMessage(reference: Reference, lang?: string): void; +//#endregion +//#region src/utils/_addIssue/_addIssue.d.ts +/** +* Context type. +*/ +type Context = BaseSchema> | BaseSchemaAsync> | BaseValidation> | BaseValidationAsync> | BaseTransformation> | BaseTransformationAsync>; +/** +* Other interface. +*/ +interface Other { + input?: unknown | undefined; + expected?: string | undefined; + received?: string | undefined; + message?: ErrorMessage> | undefined; + path?: [IssuePathItem, ...IssuePathItem[]] | undefined; + issues?: [BaseIssue>, ...BaseIssue>[]] | undefined; +} +/** +* Adds an issue to the dataset. +* +* @param context The issue context. +* @param label The issue label. +* @param dataset The input dataset. +* @param config The configuration. +* @param other The optional props. +* +* @internal +*/ +declare function _addIssue(context: TContext & { + expects?: string | null; + requirement?: unknown; + message?: ErrorMessage, { + type: TContext["type"]; + }>> | undefined; +}, label: string, dataset: UnknownDataset | OutputDataset>, config: Config>, other?: Other): void; +//#endregion +//#region src/utils/_cloneDataset/_cloneDataset.d.ts +/** +* Creates a shallow copy of a dataset. +* +* Hint: The `value` is copied by reference, but the `issues` array is cloned +* to avoid reusing mutable dataset state across multiple runs. Mutating a +* returned object or array value can therefore affect later cache hits that +* reuse the same cached output. +* +* @param dataset The output dataset. +* +* @returns The copied output dataset. +*/ +declare function _cloneDataset>(dataset: OutputDataset): OutputDataset; +//#endregion +//#region src/utils/_formatCase/_formatCase.d.ts +/** +* Splits a string into lowercase words and rejoins them with the given +* separator and capitalization rules. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. Whether the first or subsequent words are +* capitalized is controlled by `capFirst` and `capRest`. +* +* Hint: Implemented in a single pass that emits directly to the result +* string to avoid an intermediate `string[]` allocation. ASCII chars are +* classified via char codes to skip `.toLowerCase()` and `.toUpperCase()` +* method calls in the common case. +* +* Hint: Digits are treated as a separate character class, so `item2Name` +* yields `item2` and `name` rather than `item`, `2` and `name`. +* +* @param input The input string. +* @param separator The string inserted between words. +* @param capFirst Whether to capitalize the first word. +* @param capRest Whether to capitalize subsequent words. +* +* @returns The formatted string. +* +* @internal +*/ +declare function _formatCase(input: string, separator: string, capFirst: boolean, capRest: boolean): string; +//#endregion +//#region src/utils/_getByteCount/_getByteCount.d.ts +/** +* Returns the byte count of the input. +* +* @param input The input to be measured. +* +* @returns The byte count. +* +* @internal +*/ +declare function _getByteCount(input: string): number; +//#endregion +//#region src/utils/_getGraphemeCount/_getGraphemeCount.d.ts +/** +* Returns the grapheme count of the input. +* +* @param input The input to be measured. +* +* @returns The grapheme count. +* +* @internal +*/ +declare function _getGraphemeCount(input: string): number; +//#endregion +//#region src/utils/_getLastMetadata/_getLastMetadata.d.ts +/** +* Metadata action type. +*/ +type MetadataAction$1 = TitleAction | DescriptionAction; +/** +* Schema type. +*/ +type Schema$1 = BaseSchema> | BaseSchemaAsync> | SchemaWithPipe>, ...(PipeItem> | MetadataAction$1)[]]> | SchemaWithPipeAsync> | BaseSchemaAsync>), ...(PipeItem> | PipeItemAsync> | MetadataAction$1)[]]>; +/** +* Returns the last top-level value of a given metadata type from a schema +* using a breadth-first search that starts with the last item in the pipeline. +* +* @param schema The schema to search. +* @param type The metadata type. +* +* @returns The value, if any. +* +* @internal +*/ +declare function _getLastMetadata(schema: Schema$1, type: "title" | "description"): string | undefined; +//#endregion +//#region src/utils/_getStandardProps/_getStandardProps.d.ts +/** +* Returns the Standard Schema properties. +* +* @param context The schema context. +* +* @returns The Standard Schema properties. +*/ +declare function _getStandardProps> | BaseSchemaAsync>>(context: TSchema): StandardProps, InferOutput>; +//#endregion +//#region src/utils/_getWordCount/_getWordCount.d.ts +/** +* Returns the word count of the input. +* +* @param locales The locales to be used. +* @param input The input to be measured. +* +* @returns The word count. +* +* @internal +*/ +declare function _getWordCount(locales: Intl.LocalesArgument, input: string): number; +//#endregion +//#region src/utils/_isLuhnAlgo/_isLuhnAlgo.d.ts +/** +* Checks whether a string with numbers corresponds to the luhn algorithm. +* +* @param input The input to be checked. +* +* @returns Whether input is valid. +* +* @internal +*/ +declare function _isLuhnAlgo(input: string): boolean; +//#endregion +//#region src/utils/_isValidObjectKey/_isValidObjectKey.d.ts +/** +* Disallows inherited object properties and prevents object prototype +* pollution by disallowing certain keys. +* +* @param object The object to check. +* @param key The key to check. +* +* @returns Whether the key is allowed. +* +* @internal +*/ +declare function _isValidObjectKey(object: object, key: string): boolean; +//#endregion +//#region src/utils/_joinExpects/_joinExpects.d.ts +/** +* Joins multiple `expects` values with the given separator. +* +* @param values The `expects` values. +* @param separator The separator. +* +* @returns The joined `expects` property. +* +* @internal +*/ +declare function _joinExpects(values: string[], separator: "&" | "|"): string; +//#endregion +//#region src/utils/_stringify/_stringify.d.ts +/** +* Stringifies an unknown input to a literal or type string. +* +* @param input The unknown input. +* +* @returns A literal or type string. +* +* @internal +*/ +declare function _stringify(input: unknown): string; +//#endregion +//#region src/utils/entriesFromList/entriesFromList.d.ts +/** +* Creates an object entries definition from a list of keys and a schema. +* +* @param list A list of keys. +* @param schema The schema of the keys. +* +* @returns The object entries. +*/ +declare function entriesFromList> | BaseSchemaAsync>>(list: TList, schema: TSchema): Record; +//#endregion +//#region src/utils/entriesFromObjects/entriesFromObjects.d.ts +/** +* Schema type. +*/ +type Schema = LooseObjectSchema | undefined> | LooseObjectSchemaAsync | undefined> | ObjectSchema | undefined> | ObjectSchemaAsync | undefined> | ObjectWithRestSchema>, ErrorMessage | undefined> | ObjectWithRestSchemaAsync> | BaseSchemaAsync>, ErrorMessage | undefined> | StrictObjectSchema | undefined> | StrictObjectSchemaAsync | undefined>; +/** +* Recursive merge type. +*/ +type RecursiveMerge = TSchemas extends readonly [infer TFirstSchema extends Schema] ? TFirstSchema["entries"] : TSchemas extends readonly [infer TFirstSchema extends Schema, ...infer TRestSchemas extends readonly [Schema, ...Schema[]]] ? Merge> : never; +/** +* Merged entries types. +*/ +type MergedEntries = Prettify>; +/** +* Creates a new object entries definition from existing object schemas. +* +* @param schemas The schemas to merge the entries from. +* +* @returns The object entries from the schemas. +*/ +declare function entriesFromObjects(schemas: TSchemas): MergedEntries; +//#endregion +//#region src/utils/getDotPath/getDotPath.d.ts +/** +* Creates and returns the dot path of an issue if possible. +* +* @param issue The issue to get the dot path from. +* +* @returns The dot path or null. +*/ +declare function getDotPath(issue: BaseIssue): string | null; +/** +* Creates and returns the dot path of an issue if possible. +* +* @param issue The issue to get the dot path from. +* +* @returns The dot path or null. +*/ +declare function getDotPath> | BaseSchemaAsync>>(issue: InferIssue): IssueDotPath | null; +//#endregion +//#region src/utils/isOfKind/isOfKind.d.ts +/** +* A generic type guard to check the kind of an object. +* +* @param kind The kind to check for. +* @param object The object to check. +* +* @returns Whether it matches. +*/ +declare function isOfKind(kind: TKind, object: TObject): object is Extract; +//#endregion +//#region src/utils/isOfType/isOfType.d.ts +/** +* A generic type guard to check the type of an object. +* +* @param type The type to check for. +* @param object The object to check. +* +* @returns Whether it matches. +*/ +declare function isOfType(type: TType, object: TObject): object is Extract; +//#endregion +//#region src/utils/isValiError/isValiError.d.ts +/** +* A type guard to check if an error is a ValiError. +* +* @param error The error to check. +* +* @returns Whether its a ValiError. +*/ +declare function isValiError> | BaseSchemaAsync>>(error: unknown): error is ValiError; +//#endregion +//#region src/utils/ValiError/ValiError.d.ts +/** +* A Valibot error with useful information. +*/ +declare class ValiError> | BaseSchemaAsync>> extends Error { + /** + * The error issues. + */ + readonly issues: [InferIssue, ...InferIssue[]]; + /** + * Creates a Valibot error with useful information. + * + * @param issues The error issues. + */ + constructor(issues: [InferIssue, ...InferIssue[]]); +} +//#endregion +export { AnySchema, ArgsAction, ArgsActionAsync, ArrayInput, ArrayIssue, type ArrayPathItem, ArrayRequirement, ArrayRequirementAsync, ArraySchema, ArraySchemaAsync, AwaitActionAsync, BASE64_REGEX, BIC_REGEX, Base64Action, Base64Issue, type BaseIssue, type BaseMetadata, type BaseSchema, type BaseSchemaAsync, type BaseTransformation, type BaseTransformationAsync, type BaseValidation, type BaseValidationAsync, BicAction, BicIssue, BigintIssue, BigintSchema, BlobIssue, BlobSchema, BooleanIssue, BooleanSchema, Brand, BrandAction, BrandName, BrandSymbol, BytesAction, BytesIssue, CUID2_REGEX, Cache, CacheConfig, CheckAction, CheckActionAsync, CheckIssue, CheckItemsAction, CheckItemsActionAsync, CheckItemsIssue, Class, type Config, ContentInput, ContentRequirement, CreditCardAction, CreditCardIssue, Cuid2Action, Cuid2Issue, CustomIssue, CustomSchema, CustomSchemaAsync, DECIMAL_REGEX, DIGITS_REGEX, DOMAIN_REGEX, DateIssue, DateSchema, DecimalAction, DecimalIssue, type Default, type DefaultAsync, type DefaultValue, DescriptionAction, DigitsAction, DigitsIssue, DomainAction, DomainIssue, EMAIL_REGEX, EMOJI_REGEX, EmailAction, EmailIssue, EmojiAction, EmojiIssue, EmptyAction, EmptyIssue, EndsWithAction, EndsWithIssue, EntriesAction, EntriesInput, EntriesIssue, Enum, EnumIssue, EnumSchema, EnumValues, type ErrorMessage, EveryItemAction, EveryItemIssue, ExactOptionalSchema, ExactOptionalSchemaAsync, ExamplesAction, ExcludesAction, ExcludesIssue, type FailureDataset, Fallback, FallbackAsync, FileIssue, FileSchema, FilterItemsAction, FindItemAction, FiniteAction, FiniteIssue, FlatErrors, Flavor, FlavorAction, FlavorName, FlavorSymbol, FunctionIssue, FunctionSchema, type GenericIssue, type GenericMetadata, type GenericPipeAction, type GenericPipeActionAsync, type GenericPipeItem, type GenericPipeItemAsync, type GenericSchema, type GenericSchemaAsync, type GenericTransformation, type GenericTransformationAsync, type GenericValidation, type GenericValidationAsync, GlobalConfig, GraphemesAction, GraphemesIssue, GtValueAction, GtValueIssue, GuardAction, GuardFunction, GuardIssue, HEXADECIMAL_REGEX, HEX_COLOR_REGEX, HashAction, HashIssue, HashType, HexColorAction, HexColorIssue, HexadecimalAction, HexadecimalIssue, IMEI_REGEX, IPV4_REGEX, IPV6_REGEX, IP_REGEX, ISO_DATE_REGEX, ISO_DATE_TIME_REGEX, ISO_DATE_TIME_SECOND_REGEX, ISO_TIMESTAMP_REGEX, ISO_TIME_REGEX, ISO_TIME_SECOND_REGEX, ISO_WEEK_REGEX, ISRC_REGEX, ImeiAction, ImeiIssue, IncludesAction, IncludesIssue, InferDefault, InferDefaults, InferExamples, InferFallback, InferFallbacks, InferGuardOutput, type InferInput, type InferIssue, InferMetadata, type InferOutput, InstanceIssue, InstanceSchema, IntegerAction, IntegerIssue, IntersectIssue, IntersectOptions, IntersectOptionsAsync, IntersectSchema, IntersectSchemaAsync, IpAction, IpIssue, Ipv4Action, Ipv4Issue, Ipv6Action, Ipv6Issue, IsbnAction, IsbnIssue, IsoDateAction, IsoDateIssue, IsoDateTimeAction, IsoDateTimeIssue, IsoDateTimeSecondAction, IsoDateTimeSecondIssue, IsoTimeAction, IsoTimeIssue, IsoTimeSecondAction, IsoTimeSecondIssue, IsoTimestampAction, IsoTimestampIssue, IsoWeekAction, IsoWeekIssue, IsrcAction, IsrcIssue, type IssueDotPath, type IssuePathItem, JWS_COMPACT_REGEX, JwsCompactAction, JwsCompactIssue, LazySchema, LazySchemaAsync, LengthAction, LengthInput, LengthIssue, Literal, LiteralIssue, LiteralSchema, LooseObjectIssue, LooseObjectSchema, LooseObjectSchemaAsync, LooseTupleIssue, LooseTupleSchema, LooseTupleSchemaAsync, LtValueAction, LtValueIssue, MAC48_REGEX, MAC64_REGEX, MAC_REGEX, Mac48Action, Mac48Issue, Mac64Action, Mac64Issue, MacAction, MacIssue, MapIssue, MapItemsAction, type MapPathItem, MapSchema, MapSchemaAsync, MaxBytesAction, MaxBytesIssue, MaxEntriesAction, MaxEntriesIssue, MaxGraphemesAction, MaxGraphemesIssue, MaxLengthAction, MaxLengthIssue, MaxSizeAction, MaxSizeIssue, MaxValueAction, MaxValueIssue, MaxWordsAction, MaxWordsIssue, MetadataAction, MimeTypeAction, MimeTypeIssue, MinBytesAction, MinBytesIssue, MinEntriesAction, MinEntriesIssue, MinGraphemesAction, MinGraphemesIssue, MinLengthAction, MinLengthIssue, MinSizeAction, MinSizeIssue, MinValueAction, MinValueIssue, MinWordsAction, MinWordsIssue, MultipleOfAction, MultipleOfIssue, NANO_ID_REGEX, NanIssue, NanSchema, NanoIDAction, NanoIDIssue, NanoIdAction, NanoIdIssue, NeverIssue, NeverSchema, NonEmptyAction, NonEmptyIssue, NonNullableIssue, NonNullableSchema, NonNullableSchemaAsync, NonNullishIssue, NonNullishSchema, NonNullishSchemaAsync, NonOptionalIssue, NonOptionalSchema, NonOptionalSchemaAsync, NormalizeAction, NormalizeForm, NotBytesAction, NotBytesIssue, NotEntriesAction, NotEntriesIssue, NotGraphemesAction, NotGraphemesIssue, NotLengthAction, NotLengthIssue, NotSizeAction, NotSizeIssue, NotValueAction, NotValueIssue, NotValuesAction, NotValuesIssue, NotWordsAction, NotWordsIssue, NullIssue, NullSchema, NullableSchema, NullableSchemaAsync, NullishSchema, NullishSchemaAsync, NumberIssue, NumberSchema, OCTAL_REGEX, type ObjectEntries, type ObjectEntriesAsync, ObjectIssue, type ObjectKeys, type ObjectPathItem, ObjectSchema, ObjectSchemaAsync, ObjectWithRestIssue, ObjectWithRestSchema, ObjectWithRestSchemaAsync, OctalAction, OctalIssue, OptionalSchema, OptionalSchemaAsync, type OutputDataset, ParseBooleanAction, ParseBooleanConfig, ParseBooleanIssue, ParseJsonAction, ParseJsonConfig, ParseJsonIssue, Parser, ParserAsync, PartialCheckAction, PartialCheckActionAsync, PartialCheckIssue, type PartialDataset, PicklistIssue, PicklistOptions, PicklistSchema, type PipeAction, type PipeActionAsync, type PipeItem, type PipeItemAsync, PromiseIssue, PromiseSchema, RFC_EMAIL_REGEX, RawCheckAction, RawCheckActionAsync, RawCheckAddIssue, RawCheckContext, RawCheckIssue, RawCheckIssueInfo, RawTransformAction, RawTransformActionAsync, RawTransformAddIssue, RawTransformContext, RawTransformIssue, RawTransformIssueInfo, ReadonlyAction, RecordIssue, RecordSchema, RecordSchemaAsync, ReduceItemsAction, RegexAction, RegexIssue, ReturnsAction, ReturnsActionAsync, RfcEmailAction, RfcEmailIssue, SLUG_REGEX, SafeIntegerAction, SafeIntegerIssue, SafeParseResult, SafeParser, SafeParserAsync, SchemaWithCache, SchemaWithCacheAsync, SchemaWithFallback, SchemaWithFallbackAsync, SchemaWithOmit, SchemaWithPartial, SchemaWithPartialAsync, SchemaWithPick, SchemaWithPipe, SchemaWithPipeAsync, SchemaWithRequired, SchemaWithRequiredAsync, type SchemaWithoutPipe, SetIssue, type SetPathItem, SetSchema, SetSchemaAsync, SizeAction, SizeInput, SizeIssue, SlugAction, SlugIssue, SomeItemAction, SomeItemIssue, SortItemsAction, type StandardProps, StartsWithAction, StartsWithIssue, StrictObjectIssue, StrictObjectSchema, StrictObjectSchemaAsync, StrictTupleIssue, StrictTupleSchema, StrictTupleSchemaAsync, StringIssue, StringSchema, StringifyJsonAction, StringifyJsonConfig, StringifyJsonIssue, type SuccessDataset, SymbolIssue, SymbolSchema, TitleAction, ToBigintAction, ToBigintIssue, ToBooleanAction, ToCamelCaseAction, ToDateAction, ToDateIssue, ToKebabCaseAction, ToLowerCaseAction, ToMaxValueAction, ToMinValueAction, ToNumberAction, ToNumberIssue, ToPascalCaseAction, ToSnakeCaseAction, ToStringAction, ToStringIssue, ToUpperCaseAction, TransformAction, TransformActionAsync, TrimAction, TrimEndAction, TrimStartAction, TupleIssue, type TupleItems, type TupleItemsAsync, TupleSchema, TupleSchemaAsync, TupleWithRestIssue, TupleWithRestSchema, TupleWithRestSchemaAsync, ULID_REGEX, UUID_REGEX, UlidAction, UlidIssue, UndefinedIssue, UndefinedSchema, UndefinedableSchema, UndefinedableSchemaAsync, UnionIssue, UnionOptions, UnionOptionsAsync, UnionSchema, UnionSchemaAsync, type UnknownDataset, type UnknownPathItem, UnknownSchema, UrlAction, UrlIssue, UuidAction, UuidIssue, ValiError, ValueAction, ValueInput, ValueIssue, ValuesAction, ValuesIssue, VariantIssue, VariantOptions, VariantOptionsAsync, VariantSchema, VariantSchemaAsync, VoidIssue, VoidSchema, WordsAction, WordsIssue, _addIssue, _cloneDataset, _formatCase, _getByteCount, _getGraphemeCount, _getLastMetadata, _getStandardProps, _getWordCount, _isLuhnAlgo, _isValidObjectKey, _joinExpects, _stringify, any, args, argsAsync, array, arrayAsync, assert, awaitAsync, base64, bic, bigint, blob, boolean, brand, bytes, cache, cacheAsync, check, checkAsync, checkItems, checkItemsAsync, config, creditCard, cuid2, custom, customAsync, date, decimal, deleteGlobalConfig, deleteGlobalMessage, deleteSchemaMessage, deleteSpecificMessage, description, digits, domain, email, emoji, empty, endsWith, entries, entriesFromList, entriesFromObjects, enum_ as enum, enum_, everyItem, exactOptional, exactOptionalAsync, examples, excludes, fallback, fallbackAsync, file, filterItems, findItem, finite, flatten, flavor, forward, forwardAsync, function_ as function, function_, getDefault, getDefaults, getDefaultsAsync, getDescription, getDotPath, getExamples, getFallback, getFallbacks, getFallbacksAsync, getGlobalConfig, getGlobalMessage, getMetadata, getSchemaMessage, getSpecificMessage, getTitle, graphemes, gtValue, guard, hash, hexColor, hexadecimal, imei, includes, instance, integer, intersect, intersectAsync, ip, ipv4, ipv6, is, isOfKind, isOfType, isValiError, isbn, isoDate, isoDateTime, isoDateTimeSecond, isoTime, isoTimeSecond, isoTimestamp, isoWeek, isrc, jwsCompact, keyof, lazy, lazyAsync, length, literal, looseObject, looseObjectAsync, looseTuple, looseTupleAsync, ltValue, mac, mac48, mac64, map, mapAsync, mapItems, maxBytes, maxEntries, maxGraphemes, maxLength, maxSize, maxValue, maxWords, message, metadata, mimeType, minBytes, minEntries, minGraphemes, minLength, minSize, minValue, minWords, multipleOf, nan, nanoid, never, nonEmpty, nonNullable, nonNullableAsync, nonNullish, nonNullishAsync, nonOptional, nonOptionalAsync, normalize, notBytes, notEntries, notGraphemes, notLength, notSize, notValue, notValues, notWords, null_ as null, null_, nullable, nullableAsync, nullish, nullishAsync, number, object, objectAsync, objectWithRest, objectWithRestAsync, octal, omit, optional, optionalAsync, parse, parseAsync, parseBoolean, parseJson, parser, parserAsync, partial, partialAsync, partialCheck, partialCheckAsync, pick, picklist, pipe, pipeAsync, promise, rawCheck, rawCheckAsync, rawTransform, rawTransformAsync, readonly, record, recordAsync, reduceItems, regex, required, requiredAsync, returns, returnsAsync, rfcEmail, safeInteger, safeParse, safeParseAsync, safeParser, safeParserAsync, set, setAsync, setGlobalConfig, setGlobalMessage, setSchemaMessage, setSpecificMessage, size, slug, someItem, sortItems, startsWith, strictObject, strictObjectAsync, strictTuple, strictTupleAsync, string, stringifyJson, summarize, symbol, title, toBigint, toBoolean, toCamelCase, toDate, toKebabCase, toLowerCase, toMaxValue, toMinValue, toNumber, toPascalCase, toSnakeCase, toString, toUpperCase, transform, transformAsync, trim, trimEnd, trimStart, tuple, tupleAsync, tupleWithRest, tupleWithRestAsync, ulid, undefined_ as undefined, undefined_, undefinedable, undefinedableAsync, union, unionAsync, unknown, unwrap, url, uuid, value, values, variant, variantAsync, void_ as void, void_, words }; \ No newline at end of file diff --git a/tools/ui/node_modules/valibot/dist/index.min.cjs b/tools/ui/node_modules/valibot/dist/index.min.cjs new file mode 100644 index 0000000000000000000000000000000000000000..e909ac4a6b7450bc2c6bdd228230e2654d7c4644 --- /dev/null +++ b/tools/ui/node_modules/valibot/dist/index.min.cjs @@ -0,0 +1,2 @@ +let e;const t={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function n(t){e={...e,...t}}function r(n){return!n&&!e?t:{lang:n?.lang??e?.lang,message:n?.message,abortEarly:n?.abortEarly??e?.abortEarly,abortPipeEarly:n?.abortPipeEarly??e?.abortPipeEarly}}function i(){e=void 0}let a;function o(e,t){a||(a=new Map),a.set(t,e)}function s(e){return a?.get(e)}function c(e){a?.delete(e)}let l;function u(e,t){l||(l=new Map),l.set(t,e)}function ee(e){return l?.get(e)}function d(e){l?.delete(e)}let f;function te(e,t,n){f||(f=new Map),f.get(e)||f.set(e,new Map),f.get(e).set(n,t)}function ne(e,t){return f?.get(e)?.get(t)}function re(e,t){f?.get(e)?.delete(t)}function p(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function m(e,t,n,r,i){let a=i&&`input`in i?i.input:n.value,o=i?.expected??e.expects??null,c=i?.received??p(a),l={kind:e.kind,type:e.type,input:a,expected:o,received:c,message:`Invalid ${t}: ${o?`Expected ${o} but r`:`R`}eceived ${c}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},u=e.kind===`schema`,d=i?.message??e.message??ne(e.reference,l.lang)??(u?ee(l.lang):null)??r.message??s(l.lang);d!==void 0&&(l.message=typeof d==`function`?d(l):d),u&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function h(e){return{typed:e.typed,value:e.value,issues:e.issues&&[...e.issues]}}function g(e,t,n,r){let i=``,a=!0,o=0,s=0,c=0,l=s=>{if(s>o){let c=e.slice(o,s).toLowerCase();if(a?n:r){let e=c.charCodeAt(0);if(e>=97&&e<=122)c=String.fromCharCode(e-32)+c.slice(1);else{let t=e>=55296&&e<=56319?2:1;c=c.slice(0,t).toUpperCase()+c.slice(t)}}i+=a?c:t+c,a=!1}};for(let t=0;t=65&&n<=90?1:n>=97&&n<=122?2:3;else{let n=e[t],i=n.toLowerCase();r=i===n.toUpperCase()?3:n===i?2:1}r===1&&(s===2||s===3)&&t>o?(l(t),o=t):r===2&&s===1&&c===1&&t-1>o&&(l(t-1),o=t-1),c=s,s=r}return l(e.length),i}let _;function v(e){return _||(_=new TextEncoder),_.encode(e).length}let y;function b(e){y||(y=new Intl.Segmenter);let t=y.segment(e),n=0;for(let e of t)n++;return n}function x(e,t){if(`pipe`in e){let n=[];for(let r=e.pipe.length-1;r>=0;r--){let i=e.pipe[r];if(i.kind===`schema`&&`pipe`in i)n.push(i);else if(i.kind===`metadata`&&i.type===t)return i[t]}for(let e of n){let n=x(e,t);if(n!==void 0)return n}}}const ie=new WeakMap;function S(e){let t=ie.get(e);return t||(t={version:1,vendor:`valibot`,validate(t){return e[`~run`]({value:t},r())}},ie.set(e,t)),t}let C;function w(e,t){C||(C=new Map);let n=String(e),r=C.get(n);r||(r=new Intl.Segmenter(e,{granularity:`word`}),C.set(n,r));let i=r.segment(t),a=0;for(let e of i)e.isWordLike&&a++;return a}const ae=/\D/gu;function T(e){let t=e.replace(ae,``),n=t.length,r=1,i=0;for(;n;){let e=+t[--n];r^=1,i+=r?[0,2,4,6,8,1,3,5,7,9][e]:e}return i%10==0}function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&t!==`__proto__`&&t!==`prototype`&&t!==`constructor`}function D(e,t){let n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??`never`}function oe(e,t){let n={};for(let r of e)n[r]=t;return n}function se(e){let t={};for(let n of e)Object.assign(t,n.entries);return t}function O(e){if(e.path){let t=``;for(let n of e.path)if(typeof n.key==`string`||typeof n.key==`number`)t?t+=`.${n.key}`:t+=n.key;else return null;return t}return null}function ce(e,t){return t.kind===e}function le(e,t){return t.type===e}function ue(e){return e instanceof k}var k=class extends Error{constructor(e){super(e[0].message),this.name=`ValiError`,this.issues=e}};function de(e){return{kind:`transformation`,type:`args`,reference:de,async:!1,schema:e,"~run"(e,t){let n=e.value;return e.value=(...e)=>{let r=this.schema[`~run`]({value:e},t);if(r.issues)throw new k(r.issues);return n(...r.value)},e}}}function fe(e){return{kind:`transformation`,type:`args`,reference:fe,async:!1,schema:e,"~run"(t,n){let r=t.value;return t.value=async(...t)=>{let i=await e[`~run`]({value:t},n);if(i.issues)throw new k(i.issues);return r(...i.value)},t}}}function pe(){return{kind:`transformation`,type:`await`,reference:pe,async:!0,async"~run"(e){return e.value=await e.value,e}}}const me=/^(?:[\da-z+/]{4})*(?:[\da-z+/]{2}==|[\da-z+/]{3}=)?$/iu,he=/^[A-Z]{6}(?!00)[\dA-Z]{2}(?:[\dA-Z]{3})?$/u,ge=/^[a-z][\da-z]*$/u,_e=/^[+-]?(?:\d*\.)?\d+$/u,ve=/^\d+$/u,ye=/^(?=.{1,253}$)(?:(?![Xx][Nn]--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]{2,63}$/u,be=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu,A=/^(?:[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation}))*)+$/u,j=/^(?:0[hx])?[\da-fA-F]+$/u,M=/^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u,N=/^\d{15}$|^\d{2}-\d{6}-\d{6}-\d$/u,xe=/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u,Se=/^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu,Ce=/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$|^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu,we=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,Te=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3]):[0-5]\d$/u,Ee=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u,De=/^(?:0\d|1\d|2[0-3]):[0-5]\d$/u,Oe=/^(?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u,ke=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u,Ae=/^\d{4}-W(?:0[1-9]|[1-4]\d|5[0-3])$/u,je=/^(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)\.(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)?\.(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)?$/u,Me=/^(?:[A-Z]{2}[A-Z\d]{3}\d{7}|[A-Z]{2}-[A-Z\d]{3}-\d{2}-\d{5})$/u,Ne=/^(?:[\da-fA-F]{2}:){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){2}[\da-fA-F]{4}$/u,Pe=/^(?:[\da-fA-F]{2}:){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){3}[\da-fA-F]{4}$|^(?:[\da-fA-F]{4}:){3}[\da-fA-F]{4}$/u,Fe=/^(?:[\da-fA-F]{2}:){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){2}[\da-fA-F]{4}$|^(?:[\da-fA-F]{2}:){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){3}[\da-fA-F]{4}$|^(?:[\da-fA-F]{4}:){3}[\da-fA-F]{4}$/u,Ie=/^[\w-]+$/u,Le=/^(?:0o)?[0-7]+$/u,Re=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ze=/^[\da-z]+(?:[-_][\da-z]+)*$/u,Be=/^[\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{26}$/u,Ve=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu;function He(e){return{kind:`validation`,type:`base64`,reference:He,async:!1,expects:null,requirement:me,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`Base64`,e,t),e}}}function Ue(e){return{kind:`validation`,type:`bic`,reference:Ue,async:!1,expects:null,requirement:he,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`BIC`,e,t),e}}}function We(e){return{kind:`transformation`,type:`brand`,reference:We,async:!1,name:e,"~run"(e){return e}}}function Ge(e,t){return{kind:`validation`,type:`bytes`,reference:Ge,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){if(e.typed){let n=v(e.value);n!==this.requirement&&m(this,`bytes`,e,t,{received:`${n}`})}return e}}}function Ke(e,t){return{kind:`validation`,type:`check`,reference:Ke,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`input`,e,t),e}}}function qe(e,t){return{kind:`validation`,type:`check`,reference:qe,async:!0,expects:null,requirement:e,message:t,async"~run"(e,t){return e.typed&&!await this.requirement(e.value)&&m(this,`input`,e,t),e}}}function Je(e,t){return{kind:`validation`,type:`check_items`,reference:Je,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){if(e.typed)for(let n=0;ne.test(t))&&T(t)},message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`credit card`,e,t),e}}}function et(e){return{kind:`validation`,type:`cuid2`,reference:et,async:!1,expects:null,requirement:ge,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`Cuid2`,e,t),e}}}function tt(e){return{kind:`validation`,type:`decimal`,reference:tt,async:!1,expects:null,requirement:_e,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`decimal`,e,t),e}}}function nt(e){return{kind:`metadata`,type:`description`,reference:nt,description:e}}function rt(e){return{kind:`validation`,type:`digits`,reference:rt,async:!1,expects:null,requirement:ve,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`digits`,e,t),e}}}function it(e){return{kind:`validation`,type:`domain`,reference:it,expects:null,async:!1,requirement:ye,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`domain`,e,t),e}}}function at(e){return{kind:`validation`,type:`email`,reference:at,expects:null,async:!1,requirement:be,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`email`,e,t),e}}}function ot(e){return{kind:`validation`,type:`emoji`,reference:ot,async:!1,expects:null,requirement:A,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`emoji`,e,t),e}}}function st(e){return{kind:`validation`,type:`empty`,reference:st,async:!1,expects:`0`,message:e,"~run"(e,t){return e.typed&&e.value.length>0&&m(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function ct(e,t){return{kind:`validation`,type:`ends_with`,reference:ct,async:!1,expects:`"${e}"`,requirement:e,message:t,"~run"(e,t){return e.typed&&!e.value.endsWith(this.requirement)&&m(this,`end`,e,t,{received:`"${e.value.slice(-this.requirement.length)}"`}),e}}}function lt(e,t){return{kind:`validation`,type:`entries`,reference:lt,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){if(!e.typed)return e;let n=Object.keys(e.value).length;return e.typed&&n!==this.requirement&&m(this,`entries`,e,t,{received:`${n}`}),e}}}function ut(e,t){return{kind:`validation`,type:`every_item`,reference:ut,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){return e.typed&&!e.value.every(this.requirement)&&m(this,`item`,e,t),e}}}function dt(e){return{kind:`metadata`,type:`examples`,reference:dt,examples:e}}function ft(e,t){let n=p(e);return{kind:`validation`,type:`excludes`,reference:ft,async:!1,expects:`!${n}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.includes(this.requirement)&&m(this,`content`,e,t,{received:n}),e}}}function pt(e){return{kind:`transformation`,type:`filter_items`,reference:pt,async:!1,operation:e,"~run"(e){return e.value=e.value.filter(this.operation),e}}}function mt(e){return{kind:`transformation`,type:`find_item`,reference:mt,async:!1,operation:e,"~run"(e){return e.value=e.value.find(this.operation),e}}}function ht(e){return{kind:`validation`,type:`finite`,reference:ht,async:!1,expects:null,requirement:Number.isFinite,message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`finite`,e,t),e}}}function gt(e){return{kind:`transformation`,type:`flavor`,reference:gt,async:!1,name:e,"~run"(e){return e}}}function _t(e,t){return{kind:`validation`,type:`graphemes`,reference:_t,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){if(e.typed){let n=b(e.value);n!==this.requirement&&m(this,`graphemes`,e,t,{received:`${n}`})}return e}}}function vt(e,t){return{kind:`validation`,type:`gt_value`,reference:vt,async:!1,expects:`>${e instanceof Date?e.toJSON():p(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value>this.requirement)&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function yt(e,t){return{kind:`transformation`,type:`guard`,reference:yt,async:!1,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&(m(this,`input`,e,t),e.typed=!1),e}}}const bt={md4:32,md5:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8,adler32:8};function xt(e,t){return{kind:`validation`,type:`hash`,reference:xt,expects:null,async:!1,requirement:RegExp(e.map(e=>`^[a-fA-F0-9]{${bt[e]}}$`).join(`|`),`u`),message:t,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`hash`,e,t),e}}}function St(e){return{kind:`validation`,type:`hexadecimal`,reference:St,async:!1,expects:null,requirement:j,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`hexadecimal`,e,t),e}}}function Ct(e){return{kind:`validation`,type:`hex_color`,reference:Ct,async:!1,expects:null,requirement:M,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`hex color`,e,t),e}}}function wt(e){return{kind:`validation`,type:`imei`,reference:wt,async:!1,expects:null,requirement(e){return N.test(e)&&T(e)},message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`IMEI`,e,t),e}}}function Tt(e,t){let n=p(e);return{kind:`validation`,type:`includes`,reference:Tt,async:!1,expects:n,requirement:e,message:t,"~run"(e,t){return e.typed&&!e.value.includes(this.requirement)&&m(this,`content`,e,t,{received:`!${n}`}),e}}}function Et(e){return{kind:`validation`,type:`integer`,reference:Et,async:!1,expects:null,requirement:Number.isInteger,message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`integer`,e,t),e}}}function Dt(e){return{kind:`validation`,type:`ip`,reference:Dt,async:!1,expects:null,requirement:Ce,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`IP`,e,t),e}}}function Ot(e){return{kind:`validation`,type:`ipv4`,reference:Ot,async:!1,expects:null,requirement:xe,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`IPv4`,e,t),e}}}function kt(e){return{kind:`validation`,type:`ipv6`,reference:kt,async:!1,expects:null,requirement:Se,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`IPv6`,e,t),e}}}function At(e){let t=e.split(``).map(e=>e===`X`?10:parseInt(e)),n=0;for(let e=0;e<10;e++)n+=t[e]*(10-e);return n%11==0}function jt(e){let t=e.split(``).map(e=>parseInt(e)),n=0;for(let e=0;e<13;e++)n+=t[e]*(e%2==0?1:3);return n%10==0}const Mt=/[- ]/gu,Nt=/^\d{9}[\dX]$/u,Pt=/^\d{13}$/u;function Ft(e){return{kind:`validation`,type:`isbn`,reference:Ft,async:!1,expects:null,requirement(e){let t=e.replace(Mt,``);return Nt.test(t)?At(t):Pt.test(t)?jt(t):!1},message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`ISBN`,e,t),e}}}function It(e){return{kind:`validation`,type:`isrc`,reference:It,async:!1,expects:null,requirement:Me,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`ISRC`,e,t),e}}}function Lt(e){return{kind:`validation`,type:`iso_date`,reference:Lt,async:!1,expects:null,requirement:we,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`date`,e,t),e}}}function Rt(e){return{kind:`validation`,type:`iso_date_time`,reference:Rt,async:!1,expects:null,requirement:Te,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`date-time`,e,t),e}}}function zt(e){return{kind:`validation`,type:`iso_date_time_second`,reference:zt,async:!1,expects:null,requirement:Ee,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`date-time-second`,e,t),e}}}function Bt(e){return{kind:`validation`,type:`iso_time`,reference:Bt,async:!1,expects:null,requirement:De,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`time`,e,t),e}}}function Vt(e){return{kind:`validation`,type:`iso_time_second`,reference:Vt,async:!1,expects:null,requirement:Oe,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`time-second`,e,t),e}}}function Ht(e){return{kind:`validation`,type:`iso_timestamp`,reference:Ht,async:!1,expects:null,requirement:ke,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`timestamp`,e,t),e}}}function Ut(e){return{kind:`validation`,type:`iso_week`,reference:Ut,async:!1,expects:null,requirement:Ae,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`week`,e,t),e}}}function Wt(e){return{kind:`validation`,type:`jws_compact`,reference:Wt,async:!1,expects:null,requirement:je,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`JWS compact`,e,t),e}}}function Gt(e,t){return{kind:`validation`,type:`length`,reference:Gt,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length!==this.requirement&&m(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function Kt(e,t){return{kind:`validation`,type:`lt_value`,reference:Kt,async:!1,expects:`<${e instanceof Date?e.toJSON():p(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.valuethis.requirement&&m(this,`bytes`,e,t,{received:`${n}`})}return e}}}function Qt(e,t){return{kind:`validation`,type:`max_entries`,reference:Qt,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(e,t){if(!e.typed)return e;let n=Object.keys(e.value).length;return e.typed&&n>this.requirement&&m(this,`entries`,e,t,{received:`${n}`}),e}}}function $t(e,t){return{kind:`validation`,type:`max_graphemes`,reference:$t,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(e,t){if(e.typed){let n=b(e.value);n>this.requirement&&m(this,`graphemes`,e,t,{received:`${n}`})}return e}}}function en(e,t){return{kind:`validation`,type:`max_length`,reference:en,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length>this.requirement&&m(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function tn(e,t){return{kind:`validation`,type:`max_size`,reference:tn,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.size>this.requirement&&m(this,`size`,e,t,{received:`${e.value.size}`}),e}}}function nn(e,t){return{kind:`validation`,type:`max_value`,reference:nn,async:!1,expects:`<=${e instanceof Date?e.toJSON():p(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value<=this.requirement)&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function rn(e,t,n){return{kind:`validation`,type:`max_words`,reference:rn,async:!1,expects:`<=${t}`,locales:e,requirement:t,message:n,"~run"(e,t){if(e.typed){let n=w(this.locales,e.value);n>this.requirement&&m(this,`words`,e,t,{received:`${n}`})}return e}}}function an(e){return{kind:`metadata`,type:`metadata`,reference:an,metadata:e}}function on(e,t){return{kind:`validation`,type:`mime_type`,reference:on,async:!1,expects:D(e.map(e=>`"${e}"`),`|`),requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement.includes(e.value.type)&&m(this,`MIME type`,e,t,{received:`"${e.value.type}"`}),e}}}function sn(e,t){return{kind:`validation`,type:`min_bytes`,reference:sn,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(e,t){if(e.typed){let n=v(e.value);n=${e}`,requirement:e,message:t,"~run"(e,t){if(!e.typed)return e;let n=Object.keys(e.value).length;return e.typed&&n=${e}`,requirement:e,message:t,"~run"(e,t){if(e.typed){let n=b(e.value);n=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.size=${e instanceof Date?e.toJSON():p(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value>=this.requirement)&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function pn(e,t,n){return{kind:`validation`,type:`min_words`,reference:pn,async:!1,expects:`>=${t}`,locales:e,requirement:t,message:n,"~run"(e,t){if(e.typed){let n=w(this.locales,e.value);n=e.value&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function wn(e,t){return{kind:`validation`,type:`not_values`,reference:wn,async:!1,expects:`!${D(e.map(e=>e instanceof Date?e.toJSON():p(e)),`|`)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&this.requirement.some(t=>t<=e.value&&t>=e.value)&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function Tn(e,t,n){return{kind:`validation`,type:`not_words`,reference:Tn,async:!1,expects:`!${t}`,locales:e,requirement:t,message:n,"~run"(e,t){if(e.typed){let n=w(this.locales,e.value);n===this.requirement&&m(this,`words`,e,t,{received:`${n}`})}return e}}}function En(e){return{kind:`validation`,type:`octal`,reference:En,async:!1,expects:null,requirement:Le,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`octal`,e,t),e}}}const Dn=[!0,1,`true`,`1`,`yes`,`y`,`on`,`enabled`],On=[!1,0,`false`,`0`,`no`,`n`,`off`,`disabled`];function kn(e,t){let n=e=>typeof e==`string`?e.toLowerCase():e,r=e?.truthy??Dn,i=e?.falsy??On,a=e?.truthy?e.truthy.map(n):Dn,o=e?.falsy?e.falsy.map(n):On;return{kind:`transformation`,type:`parse_boolean`,reference:kn,expects:D([...r,...i].map(p),`|`),config:e,message:t,async:!1,"~run"(e,t){let r=n(e.value);return a.includes(r)?e.value=!0:o.includes(r)?e.value=!1:(m(this,`boolean`,e,t),e.typed=!1),e}}}function An(e,t){return{kind:`transformation`,type:`parse_json`,reference:An,config:e,message:t,async:!1,"~run"(e,t){try{e.value=JSON.parse(e.value,this.config?.reviver)}catch(n){if(n instanceof Error)m(this,`JSON`,e,t,{received:`"${n.message}"`}),e.typed=!1;else throw n}return e}}}function jn(e,t){if(e.issues)for(let n of t)for(let t of e.issues){let e=!1,r=Math.min(n.length,t.path?.length??0);for(let i=0;im(this,e?.label??`input`,t,n,e)}),t}}}function Fn(e){return{kind:`validation`,type:`raw_check`,reference:Fn,async:!0,expects:null,async"~run"(t,n){return await e({dataset:t,config:n,addIssue:e=>m(this,e?.label??`input`,t,n,e)}),t}}}function In(e){return{kind:`transformation`,type:`raw_transform`,reference:In,async:!1,"~run"(t,n){let r=e({dataset:t,config:n,addIssue:e=>m(this,e?.label??`input`,t,n,e),NEVER:null});return t.issues?t.typed=!1:t.value=r,t}}}function Ln(e){return{kind:`transformation`,type:`raw_transform`,reference:Ln,async:!0,async"~run"(t,n){let r=await e({dataset:t,config:n,addIssue:e=>m(this,e?.label??`input`,t,n,e),NEVER:null});return t.issues?t.typed=!1:t.value=r,t}}}function Rn(){return{kind:`transformation`,type:`readonly`,reference:Rn,async:!1,"~run"(e){return e}}}function zn(e,t){return{kind:`transformation`,type:`reduce_items`,reference:zn,async:!1,operation:e,initial:t,"~run"(e){return e.value=e.value.reduce(this.operation,this.initial),e}}}function Bn(e,t){return{kind:`validation`,type:`regex`,reference:Bn,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`format`,e,t),e}}}function Vn(e){return{kind:`transformation`,type:`returns`,reference:Vn,async:!1,schema:e,"~run"(e,t){let n=e.value;return e.value=(...e)=>{let r=this.schema[`~run`]({value:n(...e)},t);if(r.issues)throw new k(r.issues);return r.value},e}}}function Hn(e){return{kind:`transformation`,type:`returns`,reference:Hn,async:!1,schema:e,"~run"(e,t){let n=e.value;return e.value=async(...e)=>{let r=await this.schema[`~run`]({value:await n(...e)},t);if(r.issues)throw new k(r.issues);return r.value},e}}}function Un(e){return{kind:`validation`,type:`rfc_email`,reference:Un,expects:null,async:!1,requirement:Re,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`email`,e,t),e}}}function Wn(e){return{kind:`validation`,type:`safe_integer`,reference:Wn,async:!1,expects:null,requirement:Number.isSafeInteger,message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`safe integer`,e,t),e}}}function Gn(e,t){return{kind:`validation`,type:`size`,reference:Gn,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.size!==this.requirement&&m(this,`size`,e,t,{received:`${e.value.size}`}),e}}}function Kn(e){return{kind:`validation`,type:`slug`,reference:Kn,async:!1,expects:null,requirement:ze,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`slug`,e,t),e}}}function qn(e,t){return{kind:`validation`,type:`some_item`,reference:qn,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){return e.typed&&!e.value.some(this.requirement)&&m(this,`item`,e,t),e}}}function Jn(e){return{kind:`transformation`,type:`sort_items`,reference:Jn,async:!1,operation:e,"~run"(e){return e.value=e.value.sort(this.operation),e}}}function Yn(e,t){return{kind:`validation`,type:`starts_with`,reference:Yn,async:!1,expects:`"${e}"`,requirement:e,message:t,"~run"(e,t){return e.typed&&!e.value.startsWith(this.requirement)&&m(this,`start`,e,t,{received:`"${e.value.slice(0,this.requirement.length)}"`}),e}}}function Xn(e,t){return{kind:`transformation`,type:`stringify_json`,reference:Xn,message:t,config:e,async:!1,"~run"(e,t){try{let n=JSON.stringify(e.value,this.config?.replacer,this.config?.space);n===void 0&&(m(this,`JSON`,e,t),e.typed=!1),e.value=n}catch(n){if(n instanceof Error)m(this,`JSON`,e,t,{received:`"${n.message}"`}),e.typed=!1;else throw n}return e}}}function Zn(e){return{kind:`metadata`,type:`title`,reference:Zn,title:e}}function Qn(e){return{kind:`transformation`,type:`to_bigint`,reference:Qn,async:!1,message:e,"~run"(e,t){try{e.value=BigInt(e.value)}catch{m(this,`bigint`,e,t),e.typed=!1}return e}}}function $n(){return{kind:`transformation`,type:`to_boolean`,reference:$n,async:!1,"~run"(e){return e.value=!!e.value,e}}}function er(){return{kind:`transformation`,type:`to_camel_case`,reference:er,async:!1,"~run"(e){return e.value=g(e.value,``,!1,!0),e}}}function tr(e){return{kind:`transformation`,type:`to_date`,reference:tr,async:!1,message:e,"~run"(e,t){try{e.value=new Date(e.value),isNaN(e.value)&&(m(this,`date`,e,t,{received:`"Invalid Date"`}),e.typed=!1)}catch{m(this,`date`,e,t),e.typed=!1}return e}}}function nr(){return{kind:`transformation`,type:`to_kebab_case`,reference:nr,async:!1,"~run"(e){return e.value=g(e.value,`-`,!1,!1),e}}}function rr(){return{kind:`transformation`,type:`to_lower_case`,reference:rr,async:!1,"~run"(e){return e.value=e.value.toLowerCase(),e}}}function ir(e){return{kind:`transformation`,type:`to_max_value`,reference:ir,async:!1,requirement:e,"~run"(e){return e.value=e.value>this.requirement?this.requirement:e.value,e}}}function ar(e){return{kind:`transformation`,type:`to_min_value`,reference:ar,async:!1,requirement:e,"~run"(e){return e.value=e.value=e.value)&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function br(e,t){return{kind:`validation`,type:`values`,reference:br,async:!1,expects:`${D(e.map(e=>e instanceof Date?e.toJSON():p(e)),`|`)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement.some(t=>t<=e.value&&t>=e.value)&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function xr(e,t,n){return{kind:`validation`,type:`words`,reference:xr,async:!1,expects:`${t}`,locales:e,requirement:t,message:n,"~run"(e,t){if(e.typed){let n=w(this.locales,e.value);n!==this.requirement&&m(this,`words`,e,t,{received:`${n}`})}return e}}}const P={abortEarly:!0};function Sr(e,t){let n=e[`~run`]({value:t},P).issues;if(n)throw new k(n)}var Cr=class{constructor(e){this.refCount=0,this.maxSize=e?.maxSize??1e3,this.maxAge=e?.maxAge??1/0,this.hasMaxAge=isFinite(this.maxAge)}stringify(e){let t=typeof e;if(t===`string`)return`"${e}"`;if(t===`number`||t===`boolean`)return`${e}`;if(t===`bigint`)return`${e}n`;if(t===`object`||t===`function`){if(e){this.refIds??(this.refIds=new WeakMap);let t=this.refIds.get(e);return t||(t=++this.refCount,this.refIds.set(e,t)),`#${t}`}return`null`}return t}key(e,t={}){return`${this.stringify(e)}|${this.stringify(t.lang)}|${this.stringify(t.message)}|${this.stringify(t.abortEarly)}|${this.stringify(t.abortPipeEarly)}`}get(e){if(!this.store)return;let t=this.store.get(e);if(t){if(this.hasMaxAge&&Date.now()-t[1]>this.maxAge){this.store.delete(e);return}return this.store.delete(e),this.store.set(e,t),t[0]}}set(e,t){this.store??(this.store=new Map),this.store.delete(e);let n=this.hasMaxAge?Date.now():0;this.store.set(e,[t,n]),this.store.size>this.maxSize&&this.store.delete(this.store.keys().next().value)}clear(){this.store?.clear()}};function wr(e,t){return{...e,cacheConfig:t,cache:new Cr(t),get"~standard"(){return S(this)},"~run"(t,n){let r=this.cache.key(t.value,n),i=this.cache.get(r);return i||this.cache.set(r,i=e[`~run`](t,n)),h(i)}}}function Tr(e,t){let n;return{...e,async:!0,cacheConfig:t,cache:new Cr(t),get"~standard"(){return S(this)},async"~run"(t,r){let i=this.cache.key(t.value,r),a=this.cache.get(i);if(a)return h(a);let o=n?.get(i);o||(n??(n=new Map),o=Promise.resolve(e[`~run`](t,r)),n.set(i,o));try{let e=await o;return this.cache.set(i,e),h(e)}finally{n?.delete(i)}}}}function Er(e,t){return{...e,get"~standard"(){return S(this)},"~run"(n,r){return e[`~run`](n,{...r,...t})}}}function F(e,t,n){return typeof e.fallback==`function`?e.fallback(t,n):e.fallback}function Dr(e,t){return{...e,fallback:t,get"~standard"(){return S(this)},"~run"(t,n){let r=e[`~run`](t,n);return r.issues?{typed:!0,value:F(this,r,n)}:r}}}function Or(e,t){return{...e,fallback:t,async:!0,get"~standard"(){return S(this)},async"~run"(t,n){let r=await e[`~run`](t,n);return r.issues?{typed:!0,value:await F(this,r,n)}:r}}}function kr(e){let t={};for(let n of e)if(n.path){let e=O(n);e?(t.nested||(t.nested={}),Object.prototype.hasOwnProperty.call(t.nested,e)?t.nested[e].push(n.message):t.nested[e]=[n.message]):t.other?t.other.push(n.message):t.other=[n.message]}else t.root?t.root.push(n.message):t.root=[n.message];return t}function Ar(e,t){return{...e,"~run"(n,r){let i=n.issues&&[...n.issues];if(n=e[`~run`](n,r),n.issues){for(let e of n.issues)if(!i?.includes(e)){let r=n.value;for(let n of t){let t=r[n],i={type:`unknown`,origin:`value`,input:r,key:n,value:t};if(e.path?e.path.push(i):e.path=[i],!t)break;r=t}}}return n}}}function jr(e,t){return{...e,async:!0,async"~run"(n,r){let i=n.issues&&[...n.issues];if(n=await e[`~run`](n,r),n.issues){for(let e of n.issues)if(!i?.includes(e)){let r=n.value;for(let n of t){let t=r[n],i={type:`unknown`,origin:`value`,input:r,key:n,value:t};if(e.path?e.path.push(i):e.path=[i],!t)break;r=t}}}return n}}}function I(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}function L(e){if(`entries`in e){let t={};for(let n in e.entries)t[n]=L(e.entries[n]);return t}return`items`in e?e.items.map(L):I(e)}async function R(e){return`entries`in e?Object.fromEntries(await Promise.all(Object.entries(e.entries).map(async([e,t])=>[e,await R(t)]))):`items`in e?Promise.all(e.items.map(R)):I(e)}function Mr(e){return x(e,`description`)}function Nr(e){let t=[];function n(e){if(`pipe`in e){for(let r of e.pipe)if(r.kind===`schema`&&`pipe`in r)n(r);else if(r.kind===`metadata`&&r.type===`examples`)for(let e of r.examples)t.push(e)}}return n(e),t}function z(e){if(`entries`in e){let t={};for(let n in e.entries)t[n]=z(e.entries[n]);return t}return`items`in e?e.items.map(z):F(e)}async function B(e){return`entries`in e?Object.fromEntries(await Promise.all(Object.entries(e.entries).map(async([e,t])=>[e,await B(t)]))):`items`in e?Promise.all(e.items.map(B)):F(e)}function Pr(e){let t={};function n(e){if(`pipe`in e)for(let r of e.pipe)r.kind===`schema`&&`pipe`in r?n(r):r.kind===`metadata`&&r.type===`metadata`&&Object.assign(t,r.metadata)}return n(e),t}function Fr(e){return x(e,`title`)}function Ir(e,t){return!e[`~run`]({value:t},P).issues}function Lr(){return{kind:`schema`,type:`any`,reference:Lr,expects:`any`,async:!1,get"~standard"(){return S(this)},"~run"(e){return e.typed=!0,e}}}function Rr(e,t){return{kind:`schema`,type:`array`,reference:Rr,expects:`Array`,async:!1,item:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;rthis.item[`~run`]({value:e},t)));for(let i=0;ie.expects),`&`),async:!1,options:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){if(this.options.length){let n=e.value,r;e.typed=!0;for(let i of this.options){let a=i[`~run`]({value:n},t);if(a.issues){if(e.issues)for(let t of a.issues)e.issues.push(t);else e.issues=a.issues;if(t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.typed&&(r?r.push(a.value):r=[a.value])}if(e.typed){e.value=r[0];for(let n=1;ne.expects),`&`),async:!0,options:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){if(this.options.length){let n=e.value,r;e.typed=!0;let i=await Promise.all(this.options.map(e=>e[`~run`]({value:n},t)));for(let n of i){if(n.issues){if(e.issues)for(let t of n.issues)e.issues.push(t);else e.issues=n.issues;if(t.abortEarly){e.typed=!1;break}}n.typed||(e.typed=!1),e.typed&&(r?r.push(n.value):r=[n.value])}if(e.typed){e.value=r[0];for(let n=1;n{if(e in n||(r.type===`exact_optional`||r.type===`optional`||r.type===`nullish`)&&r.default!==void 0){let i=e in n?n[e]:await I(r);return[e,i,r,await r[`~run`]({value:i},t)]}return[e,n[e],r,null]}));for(let[i,a,o,s]of r)if(s){if(s.issues){let r={type:`object`,origin:`value`,input:n,key:i,value:a};for(let t of s.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[i]=s.value}else if(o.fallback!==void 0)e.value[i]=await F(o);else if(o.type!==`exact_optional`&&o.type!==`optional`&&o.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${i}"`,path:[{type:`object`,origin:`key`,input:n,key:i,value:a}]}),t.abortEarly))break;if(!e.issues||!t.abortEarly)for(let t in n)E(n,t)&&!(t in this.entries)&&(e.value[t]=n[t])}else m(this,`type`,e,t);return e}}}function ri(e,t){return{kind:`schema`,type:`loose_tuple`,reference:ri,expects:`Array`,async:!1,items:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r{let i=n[r];return[r,i,await e[`~run`]({value:i},t)]}));for(let[i,a,o]of r){if(o.issues){let r={type:`array`,origin:`value`,input:n,key:i,value:a};for(let t of o.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}if(!e.issues||!t.abortEarly)for(let t=this.items.length;tPromise.all([e,n,this.key[`~run`]({value:e},t),this.value[`~run`]({value:n},t)])));for(let[i,a,o,s]of r){if(o.issues){let r={type:`map`,origin:`key`,input:n,key:i,value:a};for(let t of o.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}if(s.issues){let r={type:`map`,origin:`value`,input:n,key:i,value:a};for(let t of s.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}(!o.typed||!s.typed)&&(e.typed=!1),e.value.set(o.value,s.value)}}else m(this,`type`,e,t);return e}}}function si(e){return{kind:`schema`,type:`nan`,reference:si,expects:`NaN`,async:!1,message:e,get"~standard"(){return S(this)},"~run"(e,t){return Number.isNaN(e.value)?e.typed=!0:m(this,`type`,e,t),e}}}function ci(e){return{kind:`schema`,type:`never`,reference:ci,expects:`never`,async:!1,message:e,get"~standard"(){return S(this)},"~run"(e,t){return m(this,`type`,e,t),e}}}function li(e,t){return{kind:`schema`,type:`non_nullable`,reference:li,expects:`!null`,async:!1,wrapped:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){return e.value!==null&&(e=this.wrapped[`~run`](e,t)),e.value===null&&m(this,`type`,e,t),e}}}function ui(e,t){return{kind:`schema`,type:`non_nullable`,reference:ui,expects:`!null`,async:!0,wrapped:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){return e.value!==null&&(e=await this.wrapped[`~run`](e,t)),e.value===null&&m(this,`type`,e,t),e}}}function di(e,t){return{kind:`schema`,type:`non_nullish`,reference:di,expects:`(!null & !undefined)`,async:!1,wrapped:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){return e.value===null||e.value===void 0||(e=this.wrapped[`~run`](e,t)),(e.value===null||e.value===void 0)&&m(this,`type`,e,t),e}}}function fi(e,t){return{kind:`schema`,type:`non_nullish`,reference:fi,expects:`(!null & !undefined)`,async:!0,wrapped:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){return e.value===null||e.value===void 0||(e=await this.wrapped[`~run`](e,t)),(e.value===null||e.value===void 0)&&m(this,`type`,e,t),e}}}function W(e,t){return{kind:`schema`,type:`non_optional`,reference:W,expects:`!undefined`,async:!1,wrapped:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){return e.value!==void 0&&(e=this.wrapped[`~run`](e,t)),e.value===void 0&&m(this,`type`,e,t),e}}}function G(e,t){return{kind:`schema`,type:`non_optional`,reference:G,expects:`!undefined`,async:!0,wrapped:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){return e.value!==void 0&&(e=await this.wrapped[`~run`](e,t)),e.value===void 0&&m(this,`type`,e,t),e}}}function K(e){return{kind:`schema`,type:`null`,reference:K,expects:`null`,async:!1,message:e,get"~standard"(){return S(this)},"~run"(e,t){return e.value===null?e.typed=!0:m(this,`type`,e,t),e}}}function pi(e,t){return{kind:`schema`,type:`nullable`,reference:pi,expects:`(${e.expects} | null)`,async:!1,wrapped:e,default:t,get"~standard"(){return S(this)},"~run"(e,t){return e.value===null&&(this.default!==void 0&&(e.value=I(this,e,t)),e.value===null)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function mi(e,t){return{kind:`schema`,type:`nullable`,reference:mi,expects:`(${e.expects} | null)`,async:!0,wrapped:e,default:t,get"~standard"(){return S(this)},async"~run"(e,t){return e.value===null&&(this.default!==void 0&&(e.value=await I(this,e,t)),e.value===null)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function hi(e,t){return{kind:`schema`,type:`nullish`,reference:hi,expects:`(${e.expects} | null | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return S(this)},"~run"(e,t){return(e.value===null||e.value===void 0)&&(this.default!==void 0&&(e.value=I(this,e,t)),e.value===null||e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function gi(e,t){return{kind:`schema`,type:`nullish`,reference:gi,expects:`(${e.expects} | null | undefined)`,async:!0,wrapped:e,default:t,get"~standard"(){return S(this)},async"~run"(e,t){return(e.value===null||e.value===void 0)&&(this.default!==void 0&&(e.value=await I(this,e,t)),e.value===null||e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function _i(e){return{kind:`schema`,type:`number`,reference:_i,expects:`number`,async:!1,message:e,get"~standard"(){return S(this)},"~run"(e,t){return typeof e.value==`number`&&!isNaN(e.value)?e.typed=!0:m(this,`type`,e,t),e}}}function vi(e,t){return{kind:`schema`,type:`object`,reference:vi,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`)for(let r in e.typed=!0,e.value={},this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:I(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=F(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}else m(this,`type`,e,t);return e}}}function yi(e,t){return{kind:`schema`,type:`object`,reference:yi,expects:`Object`,async:!0,entries:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};let r=await Promise.all(Object.entries(this.entries).map(async([e,r])=>{if(e in n||(r.type===`exact_optional`||r.type===`optional`||r.type===`nullish`)&&r.default!==void 0){let i=e in n?n[e]:await I(r);return[e,i,r,await r[`~run`]({value:i},t)]}return[e,n[e],r,null]}));for(let[i,a,o,s]of r)if(s){if(s.issues){let r={type:`object`,origin:`value`,input:n,key:i,value:a};for(let t of s.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[i]=s.value}else if(o.fallback!==void 0)e.value[i]=await F(o);else if(o.type!==`exact_optional`&&o.type!==`optional`&&o.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${i}"`,path:[{type:`object`,origin:`key`,input:n,key:i,value:a}]}),t.abortEarly))break}else m(this,`type`,e,t);return e}}}function bi(e,t,n){return{kind:`schema`,type:`object_with_rest`,reference:bi,expects:`Object`,async:!1,entries:e,rest:t,message:n,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){for(let r in e.typed=!0,e.value={},this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:I(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=F(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}if(!e.issues||!t.abortEarly){for(let r in n)if(E(n,r)&&!(r in this.entries)){let i=this.rest[`~run`]({value:n[r]},t);if(i.issues){let a={type:`object`,origin:`value`,input:n,key:r,value:n[r]};for(let t of i.issues)t.path?t.path.unshift(a):t.path=[a],e.issues?.push(t);if(e.issues||(e.issues=i.issues),t.abortEarly){e.typed=!1;break}}i.typed||(e.typed=!1),e.value[r]=i.value}}}else m(this,`type`,e,t);return e}}}function xi(e,t,n){return{kind:`schema`,type:`object_with_rest`,reference:xi,expects:`Object`,async:!0,entries:e,rest:t,message:n,get"~standard"(){return S(this)},async"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};let[r,i]=await Promise.all([Promise.all(Object.entries(this.entries).map(async([e,r])=>{if(e in n||(r.type===`exact_optional`||r.type===`optional`||r.type===`nullish`)&&r.default!==void 0){let i=e in n?n[e]:await I(r);return[e,i,r,await r[`~run`]({value:i},t)]}return[e,n[e],r,null]})),Promise.all(Object.entries(n).filter(([e])=>E(n,e)&&!(e in this.entries)).map(async([e,n])=>[e,n,await this.rest[`~run`]({value:n},t)]))]);for(let[i,a,o,s]of r)if(s){if(s.issues){let r={type:`object`,origin:`value`,input:n,key:i,value:a};for(let t of s.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[i]=s.value}else if(o.fallback!==void 0)e.value[i]=await F(o);else if(o.type!==`exact_optional`&&o.type!==`optional`&&o.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${i}"`,path:[{type:`object`,origin:`key`,input:n,key:i,value:a}]}),t.abortEarly))break;if(!e.issues||!t.abortEarly)for(let[r,a,o]of i){if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}}else m(this,`type`,e,t);return e}}}function q(e,t){return{kind:`schema`,type:`optional`,reference:q,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return S(this)},"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=I(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function J(e,t){return{kind:`schema`,type:`optional`,reference:J,expects:`(${e.expects} | undefined)`,async:!0,wrapped:e,default:t,get"~standard"(){return S(this)},async"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=await I(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function Y(e,t){return{kind:`schema`,type:`picklist`,reference:Y,expects:D(e.map(p),`|`),async:!1,options:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){return this.options.includes(e.value)?e.typed=!0:m(this,`type`,e,t),e}}}function X(e){return{kind:`schema`,type:`promise`,reference:X,expects:`Promise`,async:!1,message:e,get"~standard"(){return S(this)},"~run"(e,t){return e.value instanceof Promise?e.typed=!0:m(this,`type`,e,t),e}}}function Si(e,t,n){return{kind:`schema`,type:`record`,reference:Si,expects:`Object`,async:!1,key:e,value:t,message:n,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){for(let r in e.typed=!0,e.value={},n)if(E(n,r)){let i=n[r],a=this.key[`~run`]({value:r},t);if(a.issues){let o={type:`object`,origin:`key`,input:n,key:r,value:i};for(let t of a.issues)t.path=[o],e.issues?.push(t);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}let o=this.value[`~run`]({value:i},t);if(o.issues){let a={type:`object`,origin:`value`,input:n,key:r,value:i};for(let t of o.issues)t.path?t.path.unshift(a):t.path=[a],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}(!a.typed||!o.typed)&&(e.typed=!1),a.typed&&(e.value[a.value]=o.value)}}else m(this,`type`,e,t);return e}}}function Ci(e,t,n){return{kind:`schema`,type:`record`,reference:Ci,expects:`Object`,async:!0,key:e,value:t,message:n,get"~standard"(){return S(this)},async"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};let r=await Promise.all(Object.entries(n).filter(([e])=>E(n,e)).map(([e,n])=>Promise.all([e,n,this.key[`~run`]({value:e},t),this.value[`~run`]({value:n},t)])));for(let[i,a,o,s]of r){if(o.issues){let r={type:`object`,origin:`key`,input:n,key:i,value:a};for(let t of o.issues)t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}if(s.issues){let r={type:`object`,origin:`value`,input:n,key:i,value:a};for(let t of s.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}(!o.typed||!s.typed)&&(e.typed=!1),o.typed&&(e.value[o.value]=s.value)}}else m(this,`type`,e,t);return e}}}function wi(e,t){return{kind:`schema`,type:`set`,reference:wi,expects:`Set`,async:!1,value:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(n instanceof Set){e.typed=!0,e.value=new Set;for(let r of n){let i=this.value[`~run`]({value:r},t);if(i.issues){let a={type:`set`,origin:`value`,input:n,key:null,value:r};for(let t of i.issues)t.path?t.path.unshift(a):t.path=[a],e.issues?.push(t);if(e.issues||(e.issues=i.issues),t.abortEarly){e.typed=!1;break}}i.typed||(e.typed=!1),e.value.add(i.value)}}else m(this,`type`,e,t);return e}}}function Ti(e,t){return{kind:`schema`,type:`set`,reference:Ti,expects:`Set`,async:!0,value:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){let n=e.value;if(n instanceof Set){e.typed=!0,e.value=new Set;let r=await Promise.all([...n].map(async e=>[e,await this.value[`~run`]({value:e},t)]));for(let[i,a]of r){if(a.issues){let r={type:`set`,origin:`value`,input:n,key:null,value:i};for(let t of a.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.add(a.value)}}else m(this,`type`,e,t);return e}}}function Ei(e,t){return{kind:`schema`,type:`strict_object`,reference:Ei,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){for(let r in e.typed=!0,e.value={},this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:I(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=F(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}if(!e.issues||!t.abortEarly){for(let r in n)if(!(r in this.entries)){m(this,`key`,e,t,{input:r,expected:`never`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]});break}}}else m(this,`type`,e,t);return e}}}function Di(e,t){return{kind:`schema`,type:`strict_object`,reference:Di,expects:`Object`,async:!0,entries:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};let r=await Promise.all(Object.entries(this.entries).map(async([e,r])=>{if(e in n||(r.type===`exact_optional`||r.type===`optional`||r.type===`nullish`)&&r.default!==void 0){let i=e in n?n[e]:await I(r);return[e,i,r,await r[`~run`]({value:i},t)]}return[e,n[e],r,null]}));for(let[i,a,o,s]of r)if(s){if(s.issues){let r={type:`object`,origin:`value`,input:n,key:i,value:a};for(let t of s.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[i]=s.value}else if(o.fallback!==void 0)e.value[i]=await F(o);else if(o.type!==`exact_optional`&&o.type!==`optional`&&o.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${i}"`,path:[{type:`object`,origin:`key`,input:n,key:i,value:a}]}),t.abortEarly))break;if(!e.issues||!t.abortEarly){for(let r in n)if(!(r in this.entries)){m(this,`key`,e,t,{input:r,expected:`never`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]});break}}}else m(this,`type`,e,t);return e}}}function Oi(e,t){return{kind:`schema`,type:`strict_tuple`,reference:Oi,expects:`Array`,async:!1,items:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r{let i=n[r];return[r,i,await e[`~run`]({value:i},t)]}));for(let[i,a,o]of r){if(o.issues){let r={type:`array`,origin:`value`,input:n,key:i,value:a};for(let t of o.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}!(e.issues&&t.abortEarly)&&this.items.length{let i=n[r];return[r,i,await e[`~run`]({value:i},t)]}));for(let[i,a,o]of r){if(o.issues){let r={type:`array`,origin:`value`,input:n,key:i,value:a};for(let t of o.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}}else m(this,`type`,e,t);return e}}}function Pi(e,t,n){return{kind:`schema`,type:`tuple_with_rest`,reference:Pi,expects:`Array`,async:!1,items:e,rest:t,message:n,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r{let i=n[r];return[r,i,await e[`~run`]({value:i},t)]})),Promise.all(n.slice(this.items.length).map(async(e,n)=>[n+this.items.length,e,await this.rest[`~run`]({value:e},t)]))]);for(let[i,a,o]of r){if(o.issues){let r={type:`array`,origin:`value`,input:n,key:i,value:a};for(let t of o.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}if(!e.issues||!t.abortEarly)for(let[r,a,o]of i){if(o.issues){let i={type:`array`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}}else m(this,`type`,e,t);return e}}}function Z(e){return{kind:`schema`,type:`undefined`,reference:Z,expects:`undefined`,async:!1,message:e,get"~standard"(){return S(this)},"~run"(e,t){return e.value===void 0?e.typed=!0:m(this,`type`,e,t),e}}}function Ii(e,t){return{kind:`schema`,type:`undefinedable`,reference:Ii,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return S(this)},"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=I(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function Li(e,t){return{kind:`schema`,type:`undefinedable`,reference:Li,expects:`(${e.expects} | undefined)`,async:!0,wrapped:e,default:t,get"~standard"(){return S(this)},async"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=await I(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function Q(e){let t;if(e)for(let n of e)if(t)for(let e of n.issues)t.push(e);else t=n.issues;return t}function Ri(e,t){return{kind:`schema`,type:`union`,reference:Ri,expects:D(e.map(e=>e.expects),`|`),async:!1,options:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n,r,i;for(let a of this.options){let o=a[`~run`]({value:e.value},t);if(o.typed)if(o.issues)r?r.push(o):r=[o];else{n=o;break}else i?i.push(o):i=[o]}if(n)return n;if(r){if(r.length===1)return r[0];m(this,`type`,e,t,{issues:Q(r)}),e.typed=!0}else if(i?.length===1)return i[0];else m(this,`type`,e,t,{issues:Q(i)});return e}}}function zi(e,t){return{kind:`schema`,type:`union`,reference:zi,expects:D(e.map(e=>e.expects),`|`),async:!0,options:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){let n,r,i;for(let a of this.options){let o=await a[`~run`]({value:e.value},t);if(o.typed)if(o.issues)r?r.push(o):r=[o];else{n=o;break}else i?i.push(o):i=[o]}if(n)return n;if(r){if(r.length===1)return r[0];m(this,`type`,e,t,{issues:Q(r)}),e.typed=!0}else if(i?.length===1)return i[0];else m(this,`type`,e,t,{issues:Q(i)});return e}}}function Bi(){return{kind:`schema`,type:`unknown`,reference:Bi,expects:`unknown`,async:!1,get"~standard"(){return S(this)},"~run"(e){return e.typed=!0,e}}}function Vi(e,t,n){return{kind:`schema`,type:`variant`,reference:Vi,expects:`Object`,async:!1,key:e,options:t,message:n,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){let r,i=0,a=this.key,o=[],s=(e,c)=>{for(let l of e.options){if(l.type===`variant`)s(l,new Set(c).add(l.key));else{let e=!0,s=0;for(let t of c){let r=l.entries[t];if(t in n?r[`~run`]({typed:!1,value:n[t]},P).issues:r.type!==`exact_optional`&&r.type!==`optional`&&r.type!==`nullish`){e=!1,a!==t&&(i{for(let l of e.options){if(l.type===`variant`)await s(l,new Set(c).add(l.key));else{let e=!0,s=0;for(let t of c){let r=l.entries[t];if(t in n?(await r[`~run`]({typed:!1,value:n[t]},P)).issues:r.type!==`exact_optional`&&r.type!==`optional`&&r.type!==`nullish`){e=!1,a!==t&&(iKi(e,n,t);return n.schema=e,n.config=t,n}function Yi(e,t){let n=n=>qi(e,n,t);return n.schema=e,n.config=t,n}function Xi(e,t){let n={};for(let r in e.entries)n[r]=!t||t.includes(r)?q(e.entries[r]):e.entries[r];return{...e,entries:n,get"~standard"(){return S(this)}}}function Zi(e,t){let n={};for(let r in e.entries)n[r]=!t||t.includes(r)?J(e.entries[r]):e.entries[r];return{...e,entries:n,get"~standard"(){return S(this)}}}function Qi(e,t){let n={};for(let r of t)n[r]=e.entries[r];return{...e,entries:n,get"~standard"(){return S(this)}}}function $i(...e){return{...e[0],pipe:e,get"~standard"(){return S(this)},"~run"(t,n){for(let r of e)if(r.kind!==`metadata`){if(t.issues&&(r.kind===`schema`||r.kind===`transformation`)){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=r[`~run`](t,n))}return t}}}function ea(...e){return{...e[0],pipe:e,async:!0,get"~standard"(){return S(this)},async"~run"(t,n){for(let r of e)if(r.kind!==`metadata`){if(t.issues&&(r.kind===`schema`||r.kind===`transformation`)){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=await r[`~run`](t,n))}return t}}}function ta(e,t,n){let r=Array.isArray(t)?t:void 0,i=Array.isArray(t)?n:t,a={};for(let t in e.entries)a[t]=!r||r.includes(t)?W(e.entries[t],i):e.entries[t];return{...e,entries:a,get"~standard"(){return S(this)}}}function na(e,t,n){let r=Array.isArray(t)?t:void 0,i=Array.isArray(t)?n:t,a={};for(let t in e.entries)a[t]=!r||r.includes(t)?G(e.entries[t],i):e.entries[t];return{...e,entries:a,get"~standard"(){return S(this)}}}function ra(e,t,n){let i=e[`~run`]({value:t},r(n));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}async function ia(e,t,n){let i=await e[`~run`]({value:t},r(n));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}function aa(e,t){let n=n=>ra(e,n,t);return n.schema=e,n.config=t,n}function oa(e,t){let n=n=>ia(e,n,t);return n.schema=e,n.config=t,n}function sa(e){let t=``;for(let n of e){t&&(t+=` +`),t+=`× ${n.message}`;let e=O(n);e&&(t+=`\n → at ${e}`)}return t}function ca(e){return e.wrapped}exports.BASE64_REGEX=me,exports.BIC_REGEX=he,exports.CUID2_REGEX=ge,exports.DECIMAL_REGEX=_e,exports.DIGITS_REGEX=ve,exports.DOMAIN_REGEX=ye,exports.EMAIL_REGEX=be,exports.EMOJI_REGEX=A,exports.HEXADECIMAL_REGEX=j,exports.HEX_COLOR_REGEX=M,exports.IMEI_REGEX=N,exports.IPV4_REGEX=xe,exports.IPV6_REGEX=Se,exports.IP_REGEX=Ce,exports.ISO_DATE_REGEX=we,exports.ISO_DATE_TIME_REGEX=Te,exports.ISO_DATE_TIME_SECOND_REGEX=Ee,exports.ISO_TIMESTAMP_REGEX=ke,exports.ISO_TIME_REGEX=De,exports.ISO_TIME_SECOND_REGEX=Oe,exports.ISO_WEEK_REGEX=Ae,exports.ISRC_REGEX=Me,exports.JWS_COMPACT_REGEX=je,exports.MAC48_REGEX=Ne,exports.MAC64_REGEX=Pe,exports.MAC_REGEX=Fe,exports.NANO_ID_REGEX=Ie,exports.OCTAL_REGEX=Le,exports.RFC_EMAIL_REGEX=Re,exports.SLUG_REGEX=ze,exports.ULID_REGEX=Be,exports.UUID_REGEX=Ve,exports.ValiError=k,exports._addIssue=m,exports._cloneDataset=h,exports._formatCase=g,exports._getByteCount=v,exports._getGraphemeCount=b,exports._getLastMetadata=x,exports._getStandardProps=S,exports._getWordCount=w,exports._isLuhnAlgo=T,exports._isValidObjectKey=E,exports._joinExpects=D,exports._stringify=p,exports.any=Lr,exports.args=de,exports.argsAsync=fe,exports.array=Rr,exports.arrayAsync=zr,exports.assert=Sr,exports.awaitAsync=pe,exports.base64=He,exports.bic=Ue,exports.bigint=Br,exports.blob=Vr,exports.boolean=Hr,exports.brand=We,exports.bytes=Ge,exports.cache=wr,exports.cacheAsync=Tr,exports.check=Ke,exports.checkAsync=qe,exports.checkItems=Je,exports.checkItemsAsync=Ye,exports.config=Er,exports.creditCard=$e,exports.cuid2=et,exports.custom=Ur,exports.customAsync=Wr,exports.date=Gr,exports.decimal=tt,exports.deleteGlobalConfig=i,exports.deleteGlobalMessage=c,exports.deleteSchemaMessage=d,exports.deleteSpecificMessage=re,exports.description=nt,exports.digits=rt,exports.domain=it,exports.email=at,exports.emoji=ot,exports.empty=st,exports.endsWith=ct,exports.entries=lt,exports.entriesFromList=oe,exports.entriesFromObjects=se,exports.enum=V,exports.enum_=V,exports.everyItem=ut,exports.exactOptional=Kr,exports.exactOptionalAsync=qr,exports.examples=dt,exports.excludes=ft,exports.fallback=Dr,exports.fallbackAsync=Or,exports.file=Jr,exports.filterItems=pt,exports.findItem=mt,exports.finite=ht,exports.flatten=kr,exports.flavor=gt,exports.forward=Ar,exports.forwardAsync=jr,exports.function=H,exports.function_=H,exports.getDefault=I,exports.getDefaults=L,exports.getDefaultsAsync=R,exports.getDescription=Mr,exports.getDotPath=O,exports.getExamples=Nr,exports.getFallback=F,exports.getFallbacks=z,exports.getFallbacksAsync=B,exports.getGlobalConfig=r,exports.getGlobalMessage=s,exports.getMetadata=Pr,exports.getSchemaMessage=ee,exports.getSpecificMessage=ne,exports.getTitle=Fr,exports.graphemes=_t,exports.gtValue=vt,exports.guard=yt,exports.hash=xt,exports.hexColor=Ct,exports.hexadecimal=St,exports.imei=wt,exports.includes=Tt,exports.instance=Yr,exports.integer=Et,exports.intersect=Xr,exports.intersectAsync=Zr,exports.ip=Dt,exports.ipv4=Ot,exports.ipv6=kt,exports.is=Ir,exports.isOfKind=ce,exports.isOfType=le,exports.isValiError=ue,exports.isbn=Ft,exports.isoDate=Lt,exports.isoDateTime=Rt,exports.isoDateTimeSecond=zt,exports.isoTime=Bt,exports.isoTimeSecond=Vt,exports.isoTimestamp=Ht,exports.isoWeek=Ut,exports.isrc=It,exports.jwsCompact=Wt,exports.keyof=Ui,exports.lazy=Qr,exports.lazyAsync=$r,exports.length=Gt,exports.literal=ei,exports.looseObject=ti,exports.looseObjectAsync=ni,exports.looseTuple=ri,exports.looseTupleAsync=ii,exports.ltValue=Kt,exports.mac=qt,exports.mac48=Jt,exports.mac64=Yt,exports.map=ai,exports.mapAsync=oi,exports.mapItems=Xt,exports.maxBytes=Zt,exports.maxEntries=Qt,exports.maxGraphemes=$t,exports.maxLength=en,exports.maxSize=tn,exports.maxValue=nn,exports.maxWords=rn,exports.message=Wi,exports.metadata=an,exports.mimeType=on,exports.minBytes=sn,exports.minEntries=cn,exports.minGraphemes=ln,exports.minLength=un,exports.minSize=dn,exports.minValue=fn,exports.minWords=pn,exports.multipleOf=mn,exports.nan=si,exports.nanoid=hn,exports.never=ci,exports.nonEmpty=gn,exports.nonNullable=li,exports.nonNullableAsync=ui,exports.nonNullish=di,exports.nonNullishAsync=fi,exports.nonOptional=W,exports.nonOptionalAsync=G,exports.normalize=_n,exports.notBytes=vn,exports.notEntries=yn,exports.notGraphemes=bn,exports.notLength=xn,exports.notSize=Sn,exports.notValue=Cn,exports.notValues=wn,exports.notWords=Tn,exports.null=K,exports.null_=K,exports.nullable=pi,exports.nullableAsync=mi,exports.nullish=hi,exports.nullishAsync=gi,exports.number=_i,exports.object=vi,exports.objectAsync=yi,exports.objectWithRest=bi,exports.objectWithRestAsync=xi,exports.octal=En,exports.omit=Gi,exports.optional=q,exports.optionalAsync=J,exports.parse=Ki,exports.parseAsync=qi,exports.parseBoolean=kn,exports.parseJson=An,exports.parser=Ji,exports.parserAsync=Yi,exports.partial=Xi,exports.partialAsync=Zi,exports.partialCheck=Mn,exports.partialCheckAsync=Nn,exports.pick=Qi,exports.picklist=Y,exports.pipe=$i,exports.pipeAsync=ea,exports.promise=X,exports.rawCheck=Pn,exports.rawCheckAsync=Fn,exports.rawTransform=In,exports.rawTransformAsync=Ln,exports.readonly=Rn,exports.record=Si,exports.recordAsync=Ci,exports.reduceItems=zn,exports.regex=Bn,exports.required=ta,exports.requiredAsync=na,exports.returns=Vn,exports.returnsAsync=Hn,exports.rfcEmail=Un,exports.safeInteger=Wn,exports.safeParse=ra,exports.safeParseAsync=ia,exports.safeParser=aa,exports.safeParserAsync=oa,exports.set=wi,exports.setAsync=Ti,exports.setGlobalConfig=n,exports.setGlobalMessage=o,exports.setSchemaMessage=u,exports.setSpecificMessage=te,exports.size=Gn,exports.slug=Kn,exports.someItem=qn,exports.sortItems=Jn,exports.startsWith=Yn,exports.strictObject=Ei,exports.strictObjectAsync=Di,exports.strictTuple=Oi,exports.strictTupleAsync=ki,exports.string=Ai,exports.stringifyJson=Xn,exports.summarize=sa,exports.symbol=ji,exports.title=Zn,exports.toBigint=Qn,exports.toBoolean=$n,exports.toCamelCase=er,exports.toDate=tr,exports.toKebabCase=nr,exports.toLowerCase=rr,exports.toMaxValue=ir,exports.toMinValue=ar,exports.toNumber=or,exports.toPascalCase=sr,exports.toSnakeCase=cr,exports.toString=lr,exports.toUpperCase=ur,exports.transform=dr,exports.transformAsync=fr,exports.trim=pr,exports.trimEnd=mr,exports.trimStart=hr,exports.tuple=Mi,exports.tupleAsync=Ni,exports.tupleWithRest=Pi,exports.tupleWithRestAsync=Fi,exports.ulid=gr,exports.undefined=Z,exports.undefined_=Z,exports.undefinedable=Ii,exports.undefinedableAsync=Li,exports.union=Ri,exports.unionAsync=zi,exports.unknown=Bi,exports.unwrap=ca,exports.url=_r,exports.uuid=vr,exports.value=yr,exports.values=br,exports.variant=Vi,exports.variantAsync=Hi,exports.void=$,exports.void_=$,exports.words=xr; \ No newline at end of file diff --git a/tools/ui/node_modules/valibot/dist/index.min.mjs b/tools/ui/node_modules/valibot/dist/index.min.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d485d4b5d7e482dff96847dbaeb007cd2acc3c09 --- /dev/null +++ b/tools/ui/node_modules/valibot/dist/index.min.mjs @@ -0,0 +1,2 @@ +let e;const t={lang:void 0,message:void 0,abortEarly:void 0,abortPipeEarly:void 0};function n(t){e={...e,...t}}function r(n){return!n&&!e?t:{lang:n?.lang??e?.lang,message:n?.message,abortEarly:n?.abortEarly??e?.abortEarly,abortPipeEarly:n?.abortPipeEarly??e?.abortPipeEarly}}function i(){e=void 0}let a;function o(e,t){a||(a=new Map),a.set(t,e)}function s(e){return a?.get(e)}function c(e){a?.delete(e)}let l;function u(e,t){l||(l=new Map),l.set(t,e)}function ee(e){return l?.get(e)}function d(e){l?.delete(e)}let f;function te(e,t,n){f||(f=new Map),f.get(e)||f.set(e,new Map),f.get(e).set(n,t)}function ne(e,t){return f?.get(e)?.get(t)}function re(e,t){f?.get(e)?.delete(t)}function p(e){let t=typeof e;return t===`string`?`"${e}"`:t===`number`||t===`bigint`||t===`boolean`?`${e}`:t===`object`||t===`function`?(e&&Object.getPrototypeOf(e)?.constructor?.name)??`null`:t}function m(e,t,n,r,i){let a=i&&`input`in i?i.input:n.value,o=i?.expected??e.expects??null,c=i?.received??p(a),l={kind:e.kind,type:e.type,input:a,expected:o,received:c,message:`Invalid ${t}: ${o?`Expected ${o} but r`:`R`}eceived ${c}`,requirement:e.requirement,path:i?.path,issues:i?.issues,lang:r.lang,abortEarly:r.abortEarly,abortPipeEarly:r.abortPipeEarly},u=e.kind===`schema`,d=i?.message??e.message??ne(e.reference,l.lang)??(u?ee(l.lang):null)??r.message??s(l.lang);d!==void 0&&(l.message=typeof d==`function`?d(l):d),u&&(n.typed=!1),n.issues?n.issues.push(l):n.issues=[l]}function h(e){return{typed:e.typed,value:e.value,issues:e.issues&&[...e.issues]}}function g(e,t,n,r){let i=``,a=!0,o=0,s=0,c=0,l=s=>{if(s>o){let c=e.slice(o,s).toLowerCase();if(a?n:r){let e=c.charCodeAt(0);if(e>=97&&e<=122)c=String.fromCharCode(e-32)+c.slice(1);else{let t=e>=55296&&e<=56319?2:1;c=c.slice(0,t).toUpperCase()+c.slice(t)}}i+=a?c:t+c,a=!1}};for(let t=0;t=65&&n<=90?1:n>=97&&n<=122?2:3;else{let n=e[t],i=n.toLowerCase();r=i===n.toUpperCase()?3:n===i?2:1}r===1&&(s===2||s===3)&&t>o?(l(t),o=t):r===2&&s===1&&c===1&&t-1>o&&(l(t-1),o=t-1),c=s,s=r}return l(e.length),i}let _;function v(e){return _||(_=new TextEncoder),_.encode(e).length}let y;function b(e){y||(y=new Intl.Segmenter);let t=y.segment(e),n=0;for(let e of t)n++;return n}function x(e,t){if(`pipe`in e){let n=[];for(let r=e.pipe.length-1;r>=0;r--){let i=e.pipe[r];if(i.kind===`schema`&&`pipe`in i)n.push(i);else if(i.kind===`metadata`&&i.type===t)return i[t]}for(let e of n){let n=x(e,t);if(n!==void 0)return n}}}const ie=new WeakMap;function S(e){let t=ie.get(e);return t||(t={version:1,vendor:`valibot`,validate(t){return e[`~run`]({value:t},r())}},ie.set(e,t)),t}let C;function w(e,t){C||(C=new Map);let n=String(e),r=C.get(n);r||(r=new Intl.Segmenter(e,{granularity:`word`}),C.set(n,r));let i=r.segment(t),a=0;for(let e of i)e.isWordLike&&a++;return a}const ae=/\D/gu;function T(e){let t=e.replace(ae,``),n=t.length,r=1,i=0;for(;n;){let e=+t[--n];r^=1,i+=r?[0,2,4,6,8,1,3,5,7,9][e]:e}return i%10==0}function E(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&t!==`__proto__`&&t!==`prototype`&&t!==`constructor`}function D(e,t){let n=[...new Set(e)];return n.length>1?`(${n.join(` ${t} `)})`:n[0]??`never`}function oe(e,t){let n={};for(let r of e)n[r]=t;return n}function se(e){let t={};for(let n of e)Object.assign(t,n.entries);return t}function O(e){if(e.path){let t=``;for(let n of e.path)if(typeof n.key==`string`||typeof n.key==`number`)t?t+=`.${n.key}`:t+=n.key;else return null;return t}return null}function ce(e,t){return t.kind===e}function le(e,t){return t.type===e}function ue(e){return e instanceof k}var k=class extends Error{constructor(e){super(e[0].message),this.name=`ValiError`,this.issues=e}};function de(e){return{kind:`transformation`,type:`args`,reference:de,async:!1,schema:e,"~run"(e,t){let n=e.value;return e.value=(...e)=>{let r=this.schema[`~run`]({value:e},t);if(r.issues)throw new k(r.issues);return n(...r.value)},e}}}function fe(e){return{kind:`transformation`,type:`args`,reference:fe,async:!1,schema:e,"~run"(t,n){let r=t.value;return t.value=async(...t)=>{let i=await e[`~run`]({value:t},n);if(i.issues)throw new k(i.issues);return r(...i.value)},t}}}function pe(){return{kind:`transformation`,type:`await`,reference:pe,async:!0,async"~run"(e){return e.value=await e.value,e}}}const me=/^(?:[\da-z+/]{4})*(?:[\da-z+/]{2}==|[\da-z+/]{3}=)?$/iu,he=/^[A-Z]{6}(?!00)[\dA-Z]{2}(?:[\dA-Z]{3})?$/u,ge=/^[a-z][\da-z]*$/u,_e=/^[+-]?(?:\d*\.)?\d+$/u,ve=/^\d+$/u,ye=/^(?=.{1,253}$)(?:(?![Xx][Nn]--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]{2,63}$/u,be=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu,A=/^(?:[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation}))*)+$/u,j=/^(?:0[hx])?[\da-fA-F]+$/u,M=/^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u,N=/^\d{15}$|^\d{2}-\d{6}-\d{6}-\d$/u,xe=/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u,Se=/^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu,Ce=/^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$|^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu,we=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u,Te=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3]):[0-5]\d$/u,Ee=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u,De=/^(?:0\d|1\d|2[0-3]):[0-5]\d$/u,Oe=/^(?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u,ke=/^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u,Ae=/^\d{4}-W(?:0[1-9]|[1-4]\d|5[0-3])$/u,je=/^(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)\.(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)?\.(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)?$/u,Me=/^(?:[A-Z]{2}[A-Z\d]{3}\d{7}|[A-Z]{2}-[A-Z\d]{3}-\d{2}-\d{5})$/u,Ne=/^(?:[\da-fA-F]{2}:){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){2}[\da-fA-F]{4}$/u,Pe=/^(?:[\da-fA-F]{2}:){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){3}[\da-fA-F]{4}$|^(?:[\da-fA-F]{4}:){3}[\da-fA-F]{4}$/u,Fe=/^(?:[\da-fA-F]{2}:){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){2}[\da-fA-F]{4}$|^(?:[\da-fA-F]{2}:){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){3}[\da-fA-F]{4}$|^(?:[\da-fA-F]{4}:){3}[\da-fA-F]{4}$/u,Ie=/^[\w-]+$/u,Le=/^(?:0o)?[0-7]+$/u,Re=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,ze=/^[\da-z]+(?:[-_][\da-z]+)*$/u,Be=/^[\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{26}$/u,Ve=/^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu;function He(e){return{kind:`validation`,type:`base64`,reference:He,async:!1,expects:null,requirement:me,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`Base64`,e,t),e}}}function Ue(e){return{kind:`validation`,type:`bic`,reference:Ue,async:!1,expects:null,requirement:he,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`BIC`,e,t),e}}}function We(e){return{kind:`transformation`,type:`brand`,reference:We,async:!1,name:e,"~run"(e){return e}}}function Ge(e,t){return{kind:`validation`,type:`bytes`,reference:Ge,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){if(e.typed){let n=v(e.value);n!==this.requirement&&m(this,`bytes`,e,t,{received:`${n}`})}return e}}}function Ke(e,t){return{kind:`validation`,type:`check`,reference:Ke,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`input`,e,t),e}}}function qe(e,t){return{kind:`validation`,type:`check`,reference:qe,async:!0,expects:null,requirement:e,message:t,async"~run"(e,t){return e.typed&&!await this.requirement(e.value)&&m(this,`input`,e,t),e}}}function Je(e,t){return{kind:`validation`,type:`check_items`,reference:Je,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){if(e.typed)for(let n=0;ne.test(t))&&T(t)},message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`credit card`,e,t),e}}}function et(e){return{kind:`validation`,type:`cuid2`,reference:et,async:!1,expects:null,requirement:ge,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`Cuid2`,e,t),e}}}function tt(e){return{kind:`validation`,type:`decimal`,reference:tt,async:!1,expects:null,requirement:_e,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`decimal`,e,t),e}}}function nt(e){return{kind:`metadata`,type:`description`,reference:nt,description:e}}function rt(e){return{kind:`validation`,type:`digits`,reference:rt,async:!1,expects:null,requirement:ve,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`digits`,e,t),e}}}function it(e){return{kind:`validation`,type:`domain`,reference:it,expects:null,async:!1,requirement:ye,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`domain`,e,t),e}}}function at(e){return{kind:`validation`,type:`email`,reference:at,expects:null,async:!1,requirement:be,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`email`,e,t),e}}}function ot(e){return{kind:`validation`,type:`emoji`,reference:ot,async:!1,expects:null,requirement:A,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`emoji`,e,t),e}}}function st(e){return{kind:`validation`,type:`empty`,reference:st,async:!1,expects:`0`,message:e,"~run"(e,t){return e.typed&&e.value.length>0&&m(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function ct(e,t){return{kind:`validation`,type:`ends_with`,reference:ct,async:!1,expects:`"${e}"`,requirement:e,message:t,"~run"(e,t){return e.typed&&!e.value.endsWith(this.requirement)&&m(this,`end`,e,t,{received:`"${e.value.slice(-this.requirement.length)}"`}),e}}}function lt(e,t){return{kind:`validation`,type:`entries`,reference:lt,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){if(!e.typed)return e;let n=Object.keys(e.value).length;return e.typed&&n!==this.requirement&&m(this,`entries`,e,t,{received:`${n}`}),e}}}function ut(e,t){return{kind:`validation`,type:`every_item`,reference:ut,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){return e.typed&&!e.value.every(this.requirement)&&m(this,`item`,e,t),e}}}function dt(e){return{kind:`metadata`,type:`examples`,reference:dt,examples:e}}function ft(e,t){let n=p(e);return{kind:`validation`,type:`excludes`,reference:ft,async:!1,expects:`!${n}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.includes(this.requirement)&&m(this,`content`,e,t,{received:n}),e}}}function pt(e){return{kind:`transformation`,type:`filter_items`,reference:pt,async:!1,operation:e,"~run"(e){return e.value=e.value.filter(this.operation),e}}}function mt(e){return{kind:`transformation`,type:`find_item`,reference:mt,async:!1,operation:e,"~run"(e){return e.value=e.value.find(this.operation),e}}}function ht(e){return{kind:`validation`,type:`finite`,reference:ht,async:!1,expects:null,requirement:Number.isFinite,message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`finite`,e,t),e}}}function gt(e){return{kind:`transformation`,type:`flavor`,reference:gt,async:!1,name:e,"~run"(e){return e}}}function _t(e,t){return{kind:`validation`,type:`graphemes`,reference:_t,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){if(e.typed){let n=b(e.value);n!==this.requirement&&m(this,`graphemes`,e,t,{received:`${n}`})}return e}}}function vt(e,t){return{kind:`validation`,type:`gt_value`,reference:vt,async:!1,expects:`>${e instanceof Date?e.toJSON():p(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value>this.requirement)&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function yt(e,t){return{kind:`transformation`,type:`guard`,reference:yt,async:!1,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&(m(this,`input`,e,t),e.typed=!1),e}}}const bt={md4:32,md5:32,sha1:40,sha256:64,sha384:96,sha512:128,ripemd128:32,ripemd160:40,tiger128:32,tiger160:40,tiger192:48,crc32:8,crc32b:8,adler32:8};function xt(e,t){return{kind:`validation`,type:`hash`,reference:xt,expects:null,async:!1,requirement:RegExp(e.map(e=>`^[a-fA-F0-9]{${bt[e]}}$`).join(`|`),`u`),message:t,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`hash`,e,t),e}}}function St(e){return{kind:`validation`,type:`hexadecimal`,reference:St,async:!1,expects:null,requirement:j,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`hexadecimal`,e,t),e}}}function Ct(e){return{kind:`validation`,type:`hex_color`,reference:Ct,async:!1,expects:null,requirement:M,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`hex color`,e,t),e}}}function wt(e){return{kind:`validation`,type:`imei`,reference:wt,async:!1,expects:null,requirement(e){return N.test(e)&&T(e)},message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`IMEI`,e,t),e}}}function Tt(e,t){let n=p(e);return{kind:`validation`,type:`includes`,reference:Tt,async:!1,expects:n,requirement:e,message:t,"~run"(e,t){return e.typed&&!e.value.includes(this.requirement)&&m(this,`content`,e,t,{received:`!${n}`}),e}}}function Et(e){return{kind:`validation`,type:`integer`,reference:Et,async:!1,expects:null,requirement:Number.isInteger,message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`integer`,e,t),e}}}function Dt(e){return{kind:`validation`,type:`ip`,reference:Dt,async:!1,expects:null,requirement:Ce,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`IP`,e,t),e}}}function Ot(e){return{kind:`validation`,type:`ipv4`,reference:Ot,async:!1,expects:null,requirement:xe,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`IPv4`,e,t),e}}}function kt(e){return{kind:`validation`,type:`ipv6`,reference:kt,async:!1,expects:null,requirement:Se,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`IPv6`,e,t),e}}}function At(e){let t=e.split(``).map(e=>e===`X`?10:parseInt(e)),n=0;for(let e=0;e<10;e++)n+=t[e]*(10-e);return n%11==0}function jt(e){let t=e.split(``).map(e=>parseInt(e)),n=0;for(let e=0;e<13;e++)n+=t[e]*(e%2==0?1:3);return n%10==0}const Mt=/[- ]/gu,Nt=/^\d{9}[\dX]$/u,Pt=/^\d{13}$/u;function Ft(e){return{kind:`validation`,type:`isbn`,reference:Ft,async:!1,expects:null,requirement(e){let t=e.replace(Mt,``);return Nt.test(t)?At(t):Pt.test(t)?jt(t):!1},message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`ISBN`,e,t),e}}}function It(e){return{kind:`validation`,type:`isrc`,reference:It,async:!1,expects:null,requirement:Me,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`ISRC`,e,t),e}}}function Lt(e){return{kind:`validation`,type:`iso_date`,reference:Lt,async:!1,expects:null,requirement:we,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`date`,e,t),e}}}function Rt(e){return{kind:`validation`,type:`iso_date_time`,reference:Rt,async:!1,expects:null,requirement:Te,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`date-time`,e,t),e}}}function zt(e){return{kind:`validation`,type:`iso_date_time_second`,reference:zt,async:!1,expects:null,requirement:Ee,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`date-time-second`,e,t),e}}}function Bt(e){return{kind:`validation`,type:`iso_time`,reference:Bt,async:!1,expects:null,requirement:De,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`time`,e,t),e}}}function Vt(e){return{kind:`validation`,type:`iso_time_second`,reference:Vt,async:!1,expects:null,requirement:Oe,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`time-second`,e,t),e}}}function Ht(e){return{kind:`validation`,type:`iso_timestamp`,reference:Ht,async:!1,expects:null,requirement:ke,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`timestamp`,e,t),e}}}function Ut(e){return{kind:`validation`,type:`iso_week`,reference:Ut,async:!1,expects:null,requirement:Ae,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`week`,e,t),e}}}function Wt(e){return{kind:`validation`,type:`jws_compact`,reference:Wt,async:!1,expects:null,requirement:je,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`JWS compact`,e,t),e}}}function Gt(e,t){return{kind:`validation`,type:`length`,reference:Gt,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length!==this.requirement&&m(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function Kt(e,t){return{kind:`validation`,type:`lt_value`,reference:Kt,async:!1,expects:`<${e instanceof Date?e.toJSON():p(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.valuethis.requirement&&m(this,`bytes`,e,t,{received:`${n}`})}return e}}}function Qt(e,t){return{kind:`validation`,type:`max_entries`,reference:Qt,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(e,t){if(!e.typed)return e;let n=Object.keys(e.value).length;return e.typed&&n>this.requirement&&m(this,`entries`,e,t,{received:`${n}`}),e}}}function $t(e,t){return{kind:`validation`,type:`max_graphemes`,reference:$t,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(e,t){if(e.typed){let n=b(e.value);n>this.requirement&&m(this,`graphemes`,e,t,{received:`${n}`})}return e}}}function en(e,t){return{kind:`validation`,type:`max_length`,reference:en,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length>this.requirement&&m(this,`length`,e,t,{received:`${e.value.length}`}),e}}}function tn(e,t){return{kind:`validation`,type:`max_size`,reference:tn,async:!1,expects:`<=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.size>this.requirement&&m(this,`size`,e,t,{received:`${e.value.size}`}),e}}}function nn(e,t){return{kind:`validation`,type:`max_value`,reference:nn,async:!1,expects:`<=${e instanceof Date?e.toJSON():p(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value<=this.requirement)&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function rn(e,t,n){return{kind:`validation`,type:`max_words`,reference:rn,async:!1,expects:`<=${t}`,locales:e,requirement:t,message:n,"~run"(e,t){if(e.typed){let n=w(this.locales,e.value);n>this.requirement&&m(this,`words`,e,t,{received:`${n}`})}return e}}}function an(e){return{kind:`metadata`,type:`metadata`,reference:an,metadata:e}}function on(e,t){return{kind:`validation`,type:`mime_type`,reference:on,async:!1,expects:D(e.map(e=>`"${e}"`),`|`),requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement.includes(e.value.type)&&m(this,`MIME type`,e,t,{received:`"${e.value.type}"`}),e}}}function sn(e,t){return{kind:`validation`,type:`min_bytes`,reference:sn,async:!1,expects:`>=${e}`,requirement:e,message:t,"~run"(e,t){if(e.typed){let n=v(e.value);n=${e}`,requirement:e,message:t,"~run"(e,t){if(!e.typed)return e;let n=Object.keys(e.value).length;return e.typed&&n=${e}`,requirement:e,message:t,"~run"(e,t){if(e.typed){let n=b(e.value);n=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.length=${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.size=${e instanceof Date?e.toJSON():p(e)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!(e.value>=this.requirement)&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function pn(e,t,n){return{kind:`validation`,type:`min_words`,reference:pn,async:!1,expects:`>=${t}`,locales:e,requirement:t,message:n,"~run"(e,t){if(e.typed){let n=w(this.locales,e.value);n=e.value&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function wn(e,t){return{kind:`validation`,type:`not_values`,reference:wn,async:!1,expects:`!${D(e.map(e=>e instanceof Date?e.toJSON():p(e)),`|`)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&this.requirement.some(t=>t<=e.value&&t>=e.value)&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function Tn(e,t,n){return{kind:`validation`,type:`not_words`,reference:Tn,async:!1,expects:`!${t}`,locales:e,requirement:t,message:n,"~run"(e,t){if(e.typed){let n=w(this.locales,e.value);n===this.requirement&&m(this,`words`,e,t,{received:`${n}`})}return e}}}function En(e){return{kind:`validation`,type:`octal`,reference:En,async:!1,expects:null,requirement:Le,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`octal`,e,t),e}}}const Dn=[!0,1,`true`,`1`,`yes`,`y`,`on`,`enabled`],On=[!1,0,`false`,`0`,`no`,`n`,`off`,`disabled`];function kn(e,t){let n=e=>typeof e==`string`?e.toLowerCase():e,r=e?.truthy??Dn,i=e?.falsy??On,a=e?.truthy?e.truthy.map(n):Dn,o=e?.falsy?e.falsy.map(n):On;return{kind:`transformation`,type:`parse_boolean`,reference:kn,expects:D([...r,...i].map(p),`|`),config:e,message:t,async:!1,"~run"(e,t){let r=n(e.value);return a.includes(r)?e.value=!0:o.includes(r)?e.value=!1:(m(this,`boolean`,e,t),e.typed=!1),e}}}function An(e,t){return{kind:`transformation`,type:`parse_json`,reference:An,config:e,message:t,async:!1,"~run"(e,t){try{e.value=JSON.parse(e.value,this.config?.reviver)}catch(n){if(n instanceof Error)m(this,`JSON`,e,t,{received:`"${n.message}"`}),e.typed=!1;else throw n}return e}}}function jn(e,t){if(e.issues)for(let n of t)for(let t of e.issues){let e=!1,r=Math.min(n.length,t.path?.length??0);for(let i=0;im(this,e?.label??`input`,t,n,e)}),t}}}function Fn(e){return{kind:`validation`,type:`raw_check`,reference:Fn,async:!0,expects:null,async"~run"(t,n){return await e({dataset:t,config:n,addIssue:e=>m(this,e?.label??`input`,t,n,e)}),t}}}function In(e){return{kind:`transformation`,type:`raw_transform`,reference:In,async:!1,"~run"(t,n){let r=e({dataset:t,config:n,addIssue:e=>m(this,e?.label??`input`,t,n,e),NEVER:null});return t.issues?t.typed=!1:t.value=r,t}}}function Ln(e){return{kind:`transformation`,type:`raw_transform`,reference:Ln,async:!0,async"~run"(t,n){let r=await e({dataset:t,config:n,addIssue:e=>m(this,e?.label??`input`,t,n,e),NEVER:null});return t.issues?t.typed=!1:t.value=r,t}}}function Rn(){return{kind:`transformation`,type:`readonly`,reference:Rn,async:!1,"~run"(e){return e}}}function zn(e,t){return{kind:`transformation`,type:`reduce_items`,reference:zn,async:!1,operation:e,initial:t,"~run"(e){return e.value=e.value.reduce(this.operation,this.initial),e}}}function Bn(e,t){return{kind:`validation`,type:`regex`,reference:Bn,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`format`,e,t),e}}}function Vn(e){return{kind:`transformation`,type:`returns`,reference:Vn,async:!1,schema:e,"~run"(e,t){let n=e.value;return e.value=(...e)=>{let r=this.schema[`~run`]({value:n(...e)},t);if(r.issues)throw new k(r.issues);return r.value},e}}}function Hn(e){return{kind:`transformation`,type:`returns`,reference:Hn,async:!1,schema:e,"~run"(e,t){let n=e.value;return e.value=async(...e)=>{let r=await this.schema[`~run`]({value:await n(...e)},t);if(r.issues)throw new k(r.issues);return r.value},e}}}function Un(e){return{kind:`validation`,type:`rfc_email`,reference:Un,expects:null,async:!1,requirement:Re,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`email`,e,t),e}}}function Wn(e){return{kind:`validation`,type:`safe_integer`,reference:Wn,async:!1,expects:null,requirement:Number.isSafeInteger,message:e,"~run"(e,t){return e.typed&&!this.requirement(e.value)&&m(this,`safe integer`,e,t),e}}}function Gn(e,t){return{kind:`validation`,type:`size`,reference:Gn,async:!1,expects:`${e}`,requirement:e,message:t,"~run"(e,t){return e.typed&&e.value.size!==this.requirement&&m(this,`size`,e,t,{received:`${e.value.size}`}),e}}}function Kn(e){return{kind:`validation`,type:`slug`,reference:Kn,async:!1,expects:null,requirement:ze,message:e,"~run"(e,t){return e.typed&&!this.requirement.test(e.value)&&m(this,`slug`,e,t),e}}}function qn(e,t){return{kind:`validation`,type:`some_item`,reference:qn,async:!1,expects:null,requirement:e,message:t,"~run"(e,t){return e.typed&&!e.value.some(this.requirement)&&m(this,`item`,e,t),e}}}function Jn(e){return{kind:`transformation`,type:`sort_items`,reference:Jn,async:!1,operation:e,"~run"(e){return e.value=e.value.sort(this.operation),e}}}function Yn(e,t){return{kind:`validation`,type:`starts_with`,reference:Yn,async:!1,expects:`"${e}"`,requirement:e,message:t,"~run"(e,t){return e.typed&&!e.value.startsWith(this.requirement)&&m(this,`start`,e,t,{received:`"${e.value.slice(0,this.requirement.length)}"`}),e}}}function Xn(e,t){return{kind:`transformation`,type:`stringify_json`,reference:Xn,message:t,config:e,async:!1,"~run"(e,t){try{let n=JSON.stringify(e.value,this.config?.replacer,this.config?.space);n===void 0&&(m(this,`JSON`,e,t),e.typed=!1),e.value=n}catch(n){if(n instanceof Error)m(this,`JSON`,e,t,{received:`"${n.message}"`}),e.typed=!1;else throw n}return e}}}function Zn(e){return{kind:`metadata`,type:`title`,reference:Zn,title:e}}function Qn(e){return{kind:`transformation`,type:`to_bigint`,reference:Qn,async:!1,message:e,"~run"(e,t){try{e.value=BigInt(e.value)}catch{m(this,`bigint`,e,t),e.typed=!1}return e}}}function $n(){return{kind:`transformation`,type:`to_boolean`,reference:$n,async:!1,"~run"(e){return e.value=!!e.value,e}}}function er(){return{kind:`transformation`,type:`to_camel_case`,reference:er,async:!1,"~run"(e){return e.value=g(e.value,``,!1,!0),e}}}function tr(e){return{kind:`transformation`,type:`to_date`,reference:tr,async:!1,message:e,"~run"(e,t){try{e.value=new Date(e.value),isNaN(e.value)&&(m(this,`date`,e,t,{received:`"Invalid Date"`}),e.typed=!1)}catch{m(this,`date`,e,t),e.typed=!1}return e}}}function nr(){return{kind:`transformation`,type:`to_kebab_case`,reference:nr,async:!1,"~run"(e){return e.value=g(e.value,`-`,!1,!1),e}}}function rr(){return{kind:`transformation`,type:`to_lower_case`,reference:rr,async:!1,"~run"(e){return e.value=e.value.toLowerCase(),e}}}function ir(e){return{kind:`transformation`,type:`to_max_value`,reference:ir,async:!1,requirement:e,"~run"(e){return e.value=e.value>this.requirement?this.requirement:e.value,e}}}function ar(e){return{kind:`transformation`,type:`to_min_value`,reference:ar,async:!1,requirement:e,"~run"(e){return e.value=e.value=e.value)&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function br(e,t){return{kind:`validation`,type:`values`,reference:br,async:!1,expects:`${D(e.map(e=>e instanceof Date?e.toJSON():p(e)),`|`)}`,requirement:e,message:t,"~run"(e,t){return e.typed&&!this.requirement.some(t=>t<=e.value&&t>=e.value)&&m(this,`value`,e,t,{received:e.value instanceof Date?e.value.toJSON():p(e.value)}),e}}}function xr(e,t,n){return{kind:`validation`,type:`words`,reference:xr,async:!1,expects:`${t}`,locales:e,requirement:t,message:n,"~run"(e,t){if(e.typed){let n=w(this.locales,e.value);n!==this.requirement&&m(this,`words`,e,t,{received:`${n}`})}return e}}}const P={abortEarly:!0};function Sr(e,t){let n=e[`~run`]({value:t},P).issues;if(n)throw new k(n)}var Cr=class{constructor(e){this.refCount=0,this.maxSize=e?.maxSize??1e3,this.maxAge=e?.maxAge??1/0,this.hasMaxAge=isFinite(this.maxAge)}stringify(e){let t=typeof e;if(t===`string`)return`"${e}"`;if(t===`number`||t===`boolean`)return`${e}`;if(t===`bigint`)return`${e}n`;if(t===`object`||t===`function`){if(e){this.refIds??(this.refIds=new WeakMap);let t=this.refIds.get(e);return t||(t=++this.refCount,this.refIds.set(e,t)),`#${t}`}return`null`}return t}key(e,t={}){return`${this.stringify(e)}|${this.stringify(t.lang)}|${this.stringify(t.message)}|${this.stringify(t.abortEarly)}|${this.stringify(t.abortPipeEarly)}`}get(e){if(!this.store)return;let t=this.store.get(e);if(t){if(this.hasMaxAge&&Date.now()-t[1]>this.maxAge){this.store.delete(e);return}return this.store.delete(e),this.store.set(e,t),t[0]}}set(e,t){this.store??(this.store=new Map),this.store.delete(e);let n=this.hasMaxAge?Date.now():0;this.store.set(e,[t,n]),this.store.size>this.maxSize&&this.store.delete(this.store.keys().next().value)}clear(){this.store?.clear()}};function wr(e,t){return{...e,cacheConfig:t,cache:new Cr(t),get"~standard"(){return S(this)},"~run"(t,n){let r=this.cache.key(t.value,n),i=this.cache.get(r);return i||this.cache.set(r,i=e[`~run`](t,n)),h(i)}}}function Tr(e,t){let n;return{...e,async:!0,cacheConfig:t,cache:new Cr(t),get"~standard"(){return S(this)},async"~run"(t,r){let i=this.cache.key(t.value,r),a=this.cache.get(i);if(a)return h(a);let o=n?.get(i);o||(n??(n=new Map),o=Promise.resolve(e[`~run`](t,r)),n.set(i,o));try{let e=await o;return this.cache.set(i,e),h(e)}finally{n?.delete(i)}}}}function Er(e,t){return{...e,get"~standard"(){return S(this)},"~run"(n,r){return e[`~run`](n,{...r,...t})}}}function F(e,t,n){return typeof e.fallback==`function`?e.fallback(t,n):e.fallback}function Dr(e,t){return{...e,fallback:t,get"~standard"(){return S(this)},"~run"(t,n){let r=e[`~run`](t,n);return r.issues?{typed:!0,value:F(this,r,n)}:r}}}function Or(e,t){return{...e,fallback:t,async:!0,get"~standard"(){return S(this)},async"~run"(t,n){let r=await e[`~run`](t,n);return r.issues?{typed:!0,value:await F(this,r,n)}:r}}}function kr(e){let t={};for(let n of e)if(n.path){let e=O(n);e?(t.nested||(t.nested={}),Object.prototype.hasOwnProperty.call(t.nested,e)?t.nested[e].push(n.message):t.nested[e]=[n.message]):t.other?t.other.push(n.message):t.other=[n.message]}else t.root?t.root.push(n.message):t.root=[n.message];return t}function Ar(e,t){return{...e,"~run"(n,r){let i=n.issues&&[...n.issues];if(n=e[`~run`](n,r),n.issues){for(let e of n.issues)if(!i?.includes(e)){let r=n.value;for(let n of t){let t=r[n],i={type:`unknown`,origin:`value`,input:r,key:n,value:t};if(e.path?e.path.push(i):e.path=[i],!t)break;r=t}}}return n}}}function jr(e,t){return{...e,async:!0,async"~run"(n,r){let i=n.issues&&[...n.issues];if(n=await e[`~run`](n,r),n.issues){for(let e of n.issues)if(!i?.includes(e)){let r=n.value;for(let n of t){let t=r[n],i={type:`unknown`,origin:`value`,input:r,key:n,value:t};if(e.path?e.path.push(i):e.path=[i],!t)break;r=t}}}return n}}}function I(e,t,n){return typeof e.default==`function`?e.default(t,n):e.default}function L(e){if(`entries`in e){let t={};for(let n in e.entries)t[n]=L(e.entries[n]);return t}return`items`in e?e.items.map(L):I(e)}async function R(e){return`entries`in e?Object.fromEntries(await Promise.all(Object.entries(e.entries).map(async([e,t])=>[e,await R(t)]))):`items`in e?Promise.all(e.items.map(R)):I(e)}function Mr(e){return x(e,`description`)}function Nr(e){let t=[];function n(e){if(`pipe`in e){for(let r of e.pipe)if(r.kind===`schema`&&`pipe`in r)n(r);else if(r.kind===`metadata`&&r.type===`examples`)for(let e of r.examples)t.push(e)}}return n(e),t}function z(e){if(`entries`in e){let t={};for(let n in e.entries)t[n]=z(e.entries[n]);return t}return`items`in e?e.items.map(z):F(e)}async function B(e){return`entries`in e?Object.fromEntries(await Promise.all(Object.entries(e.entries).map(async([e,t])=>[e,await B(t)]))):`items`in e?Promise.all(e.items.map(B)):F(e)}function Pr(e){let t={};function n(e){if(`pipe`in e)for(let r of e.pipe)r.kind===`schema`&&`pipe`in r?n(r):r.kind===`metadata`&&r.type===`metadata`&&Object.assign(t,r.metadata)}return n(e),t}function Fr(e){return x(e,`title`)}function Ir(e,t){return!e[`~run`]({value:t},P).issues}function Lr(){return{kind:`schema`,type:`any`,reference:Lr,expects:`any`,async:!1,get"~standard"(){return S(this)},"~run"(e){return e.typed=!0,e}}}function Rr(e,t){return{kind:`schema`,type:`array`,reference:Rr,expects:`Array`,async:!1,item:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;rthis.item[`~run`]({value:e},t)));for(let i=0;ie.expects),`&`),async:!1,options:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){if(this.options.length){let n=e.value,r;e.typed=!0;for(let i of this.options){let a=i[`~run`]({value:n},t);if(a.issues){if(e.issues)for(let t of a.issues)e.issues.push(t);else e.issues=a.issues;if(t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.typed&&(r?r.push(a.value):r=[a.value])}if(e.typed){e.value=r[0];for(let n=1;ne.expects),`&`),async:!0,options:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){if(this.options.length){let n=e.value,r;e.typed=!0;let i=await Promise.all(this.options.map(e=>e[`~run`]({value:n},t)));for(let n of i){if(n.issues){if(e.issues)for(let t of n.issues)e.issues.push(t);else e.issues=n.issues;if(t.abortEarly){e.typed=!1;break}}n.typed||(e.typed=!1),e.typed&&(r?r.push(n.value):r=[n.value])}if(e.typed){e.value=r[0];for(let n=1;n{if(e in n||(r.type===`exact_optional`||r.type===`optional`||r.type===`nullish`)&&r.default!==void 0){let i=e in n?n[e]:await I(r);return[e,i,r,await r[`~run`]({value:i},t)]}return[e,n[e],r,null]}));for(let[i,a,o,s]of r)if(s){if(s.issues){let r={type:`object`,origin:`value`,input:n,key:i,value:a};for(let t of s.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[i]=s.value}else if(o.fallback!==void 0)e.value[i]=await F(o);else if(o.type!==`exact_optional`&&o.type!==`optional`&&o.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${i}"`,path:[{type:`object`,origin:`key`,input:n,key:i,value:a}]}),t.abortEarly))break;if(!e.issues||!t.abortEarly)for(let t in n)E(n,t)&&!(t in this.entries)&&(e.value[t]=n[t])}else m(this,`type`,e,t);return e}}}function ri(e,t){return{kind:`schema`,type:`loose_tuple`,reference:ri,expects:`Array`,async:!1,items:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r{let i=n[r];return[r,i,await e[`~run`]({value:i},t)]}));for(let[i,a,o]of r){if(o.issues){let r={type:`array`,origin:`value`,input:n,key:i,value:a};for(let t of o.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}if(!e.issues||!t.abortEarly)for(let t=this.items.length;tPromise.all([e,n,this.key[`~run`]({value:e},t),this.value[`~run`]({value:n},t)])));for(let[i,a,o,s]of r){if(o.issues){let r={type:`map`,origin:`key`,input:n,key:i,value:a};for(let t of o.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}if(s.issues){let r={type:`map`,origin:`value`,input:n,key:i,value:a};for(let t of s.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}(!o.typed||!s.typed)&&(e.typed=!1),e.value.set(o.value,s.value)}}else m(this,`type`,e,t);return e}}}function si(e){return{kind:`schema`,type:`nan`,reference:si,expects:`NaN`,async:!1,message:e,get"~standard"(){return S(this)},"~run"(e,t){return Number.isNaN(e.value)?e.typed=!0:m(this,`type`,e,t),e}}}function ci(e){return{kind:`schema`,type:`never`,reference:ci,expects:`never`,async:!1,message:e,get"~standard"(){return S(this)},"~run"(e,t){return m(this,`type`,e,t),e}}}function li(e,t){return{kind:`schema`,type:`non_nullable`,reference:li,expects:`!null`,async:!1,wrapped:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){return e.value!==null&&(e=this.wrapped[`~run`](e,t)),e.value===null&&m(this,`type`,e,t),e}}}function ui(e,t){return{kind:`schema`,type:`non_nullable`,reference:ui,expects:`!null`,async:!0,wrapped:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){return e.value!==null&&(e=await this.wrapped[`~run`](e,t)),e.value===null&&m(this,`type`,e,t),e}}}function di(e,t){return{kind:`schema`,type:`non_nullish`,reference:di,expects:`(!null & !undefined)`,async:!1,wrapped:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){return e.value===null||e.value===void 0||(e=this.wrapped[`~run`](e,t)),(e.value===null||e.value===void 0)&&m(this,`type`,e,t),e}}}function fi(e,t){return{kind:`schema`,type:`non_nullish`,reference:fi,expects:`(!null & !undefined)`,async:!0,wrapped:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){return e.value===null||e.value===void 0||(e=await this.wrapped[`~run`](e,t)),(e.value===null||e.value===void 0)&&m(this,`type`,e,t),e}}}function W(e,t){return{kind:`schema`,type:`non_optional`,reference:W,expects:`!undefined`,async:!1,wrapped:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){return e.value!==void 0&&(e=this.wrapped[`~run`](e,t)),e.value===void 0&&m(this,`type`,e,t),e}}}function G(e,t){return{kind:`schema`,type:`non_optional`,reference:G,expects:`!undefined`,async:!0,wrapped:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){return e.value!==void 0&&(e=await this.wrapped[`~run`](e,t)),e.value===void 0&&m(this,`type`,e,t),e}}}function K(e){return{kind:`schema`,type:`null`,reference:K,expects:`null`,async:!1,message:e,get"~standard"(){return S(this)},"~run"(e,t){return e.value===null?e.typed=!0:m(this,`type`,e,t),e}}}function pi(e,t){return{kind:`schema`,type:`nullable`,reference:pi,expects:`(${e.expects} | null)`,async:!1,wrapped:e,default:t,get"~standard"(){return S(this)},"~run"(e,t){return e.value===null&&(this.default!==void 0&&(e.value=I(this,e,t)),e.value===null)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function mi(e,t){return{kind:`schema`,type:`nullable`,reference:mi,expects:`(${e.expects} | null)`,async:!0,wrapped:e,default:t,get"~standard"(){return S(this)},async"~run"(e,t){return e.value===null&&(this.default!==void 0&&(e.value=await I(this,e,t)),e.value===null)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function hi(e,t){return{kind:`schema`,type:`nullish`,reference:hi,expects:`(${e.expects} | null | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return S(this)},"~run"(e,t){return(e.value===null||e.value===void 0)&&(this.default!==void 0&&(e.value=I(this,e,t)),e.value===null||e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function gi(e,t){return{kind:`schema`,type:`nullish`,reference:gi,expects:`(${e.expects} | null | undefined)`,async:!0,wrapped:e,default:t,get"~standard"(){return S(this)},async"~run"(e,t){return(e.value===null||e.value===void 0)&&(this.default!==void 0&&(e.value=await I(this,e,t)),e.value===null||e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function _i(e){return{kind:`schema`,type:`number`,reference:_i,expects:`number`,async:!1,message:e,get"~standard"(){return S(this)},"~run"(e,t){return typeof e.value==`number`&&!isNaN(e.value)?e.typed=!0:m(this,`type`,e,t),e}}}function vi(e,t){return{kind:`schema`,type:`object`,reference:vi,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`)for(let r in e.typed=!0,e.value={},this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:I(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=F(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}else m(this,`type`,e,t);return e}}}function yi(e,t){return{kind:`schema`,type:`object`,reference:yi,expects:`Object`,async:!0,entries:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};let r=await Promise.all(Object.entries(this.entries).map(async([e,r])=>{if(e in n||(r.type===`exact_optional`||r.type===`optional`||r.type===`nullish`)&&r.default!==void 0){let i=e in n?n[e]:await I(r);return[e,i,r,await r[`~run`]({value:i},t)]}return[e,n[e],r,null]}));for(let[i,a,o,s]of r)if(s){if(s.issues){let r={type:`object`,origin:`value`,input:n,key:i,value:a};for(let t of s.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[i]=s.value}else if(o.fallback!==void 0)e.value[i]=await F(o);else if(o.type!==`exact_optional`&&o.type!==`optional`&&o.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${i}"`,path:[{type:`object`,origin:`key`,input:n,key:i,value:a}]}),t.abortEarly))break}else m(this,`type`,e,t);return e}}}function bi(e,t,n){return{kind:`schema`,type:`object_with_rest`,reference:bi,expects:`Object`,async:!1,entries:e,rest:t,message:n,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){for(let r in e.typed=!0,e.value={},this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:I(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=F(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}if(!e.issues||!t.abortEarly){for(let r in n)if(E(n,r)&&!(r in this.entries)){let i=this.rest[`~run`]({value:n[r]},t);if(i.issues){let a={type:`object`,origin:`value`,input:n,key:r,value:n[r]};for(let t of i.issues)t.path?t.path.unshift(a):t.path=[a],e.issues?.push(t);if(e.issues||(e.issues=i.issues),t.abortEarly){e.typed=!1;break}}i.typed||(e.typed=!1),e.value[r]=i.value}}}else m(this,`type`,e,t);return e}}}function xi(e,t,n){return{kind:`schema`,type:`object_with_rest`,reference:xi,expects:`Object`,async:!0,entries:e,rest:t,message:n,get"~standard"(){return S(this)},async"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};let[r,i]=await Promise.all([Promise.all(Object.entries(this.entries).map(async([e,r])=>{if(e in n||(r.type===`exact_optional`||r.type===`optional`||r.type===`nullish`)&&r.default!==void 0){let i=e in n?n[e]:await I(r);return[e,i,r,await r[`~run`]({value:i},t)]}return[e,n[e],r,null]})),Promise.all(Object.entries(n).filter(([e])=>E(n,e)&&!(e in this.entries)).map(async([e,n])=>[e,n,await this.rest[`~run`]({value:n},t)]))]);for(let[i,a,o,s]of r)if(s){if(s.issues){let r={type:`object`,origin:`value`,input:n,key:i,value:a};for(let t of s.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[i]=s.value}else if(o.fallback!==void 0)e.value[i]=await F(o);else if(o.type!==`exact_optional`&&o.type!==`optional`&&o.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${i}"`,path:[{type:`object`,origin:`key`,input:n,key:i,value:a}]}),t.abortEarly))break;if(!e.issues||!t.abortEarly)for(let[r,a,o]of i){if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}}else m(this,`type`,e,t);return e}}}function q(e,t){return{kind:`schema`,type:`optional`,reference:q,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return S(this)},"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=I(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function J(e,t){return{kind:`schema`,type:`optional`,reference:J,expects:`(${e.expects} | undefined)`,async:!0,wrapped:e,default:t,get"~standard"(){return S(this)},async"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=await I(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function Y(e,t){return{kind:`schema`,type:`picklist`,reference:Y,expects:D(e.map(p),`|`),async:!1,options:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){return this.options.includes(e.value)?e.typed=!0:m(this,`type`,e,t),e}}}function X(e){return{kind:`schema`,type:`promise`,reference:X,expects:`Promise`,async:!1,message:e,get"~standard"(){return S(this)},"~run"(e,t){return e.value instanceof Promise?e.typed=!0:m(this,`type`,e,t),e}}}function Si(e,t,n){return{kind:`schema`,type:`record`,reference:Si,expects:`Object`,async:!1,key:e,value:t,message:n,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){for(let r in e.typed=!0,e.value={},n)if(E(n,r)){let i=n[r],a=this.key[`~run`]({value:r},t);if(a.issues){let o={type:`object`,origin:`key`,input:n,key:r,value:i};for(let t of a.issues)t.path=[o],e.issues?.push(t);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}let o=this.value[`~run`]({value:i},t);if(o.issues){let a={type:`object`,origin:`value`,input:n,key:r,value:i};for(let t of o.issues)t.path?t.path.unshift(a):t.path=[a],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}(!a.typed||!o.typed)&&(e.typed=!1),a.typed&&(e.value[a.value]=o.value)}}else m(this,`type`,e,t);return e}}}function Ci(e,t,n){return{kind:`schema`,type:`record`,reference:Ci,expects:`Object`,async:!0,key:e,value:t,message:n,get"~standard"(){return S(this)},async"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};let r=await Promise.all(Object.entries(n).filter(([e])=>E(n,e)).map(([e,n])=>Promise.all([e,n,this.key[`~run`]({value:e},t),this.value[`~run`]({value:n},t)])));for(let[i,a,o,s]of r){if(o.issues){let r={type:`object`,origin:`key`,input:n,key:i,value:a};for(let t of o.issues)t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}if(s.issues){let r={type:`object`,origin:`value`,input:n,key:i,value:a};for(let t of s.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}(!o.typed||!s.typed)&&(e.typed=!1),o.typed&&(e.value[o.value]=s.value)}}else m(this,`type`,e,t);return e}}}function wi(e,t){return{kind:`schema`,type:`set`,reference:wi,expects:`Set`,async:!1,value:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(n instanceof Set){e.typed=!0,e.value=new Set;for(let r of n){let i=this.value[`~run`]({value:r},t);if(i.issues){let a={type:`set`,origin:`value`,input:n,key:null,value:r};for(let t of i.issues)t.path?t.path.unshift(a):t.path=[a],e.issues?.push(t);if(e.issues||(e.issues=i.issues),t.abortEarly){e.typed=!1;break}}i.typed||(e.typed=!1),e.value.add(i.value)}}else m(this,`type`,e,t);return e}}}function Ti(e,t){return{kind:`schema`,type:`set`,reference:Ti,expects:`Set`,async:!0,value:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){let n=e.value;if(n instanceof Set){e.typed=!0,e.value=new Set;let r=await Promise.all([...n].map(async e=>[e,await this.value[`~run`]({value:e},t)]));for(let[i,a]of r){if(a.issues){let r={type:`set`,origin:`value`,input:n,key:null,value:i};for(let t of a.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}a.typed||(e.typed=!1),e.value.add(a.value)}}else m(this,`type`,e,t);return e}}}function Ei(e,t){return{kind:`schema`,type:`strict_object`,reference:Ei,expects:`Object`,async:!1,entries:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){for(let r in e.typed=!0,e.value={},this.entries){let i=this.entries[r];if(r in n||(i.type===`exact_optional`||i.type===`optional`||i.type===`nullish`)&&i.default!==void 0){let a=r in n?n[r]:I(i),o=i[`~run`]({value:a},t);if(o.issues){let i={type:`object`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value[r]=o.value}else if(i.fallback!==void 0)e.value[r]=F(i);else if(i.type!==`exact_optional`&&i.type!==`optional`&&i.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${r}"`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]}),t.abortEarly))break}if(!e.issues||!t.abortEarly){for(let r in n)if(!(r in this.entries)){m(this,`key`,e,t,{input:r,expected:`never`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]});break}}}else m(this,`type`,e,t);return e}}}function Di(e,t){return{kind:`schema`,type:`strict_object`,reference:Di,expects:`Object`,async:!0,entries:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){e.typed=!0,e.value={};let r=await Promise.all(Object.entries(this.entries).map(async([e,r])=>{if(e in n||(r.type===`exact_optional`||r.type===`optional`||r.type===`nullish`)&&r.default!==void 0){let i=e in n?n[e]:await I(r);return[e,i,r,await r[`~run`]({value:i},t)]}return[e,n[e],r,null]}));for(let[i,a,o,s]of r)if(s){if(s.issues){let r={type:`object`,origin:`value`,input:n,key:i,value:a};for(let t of s.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=s.issues),t.abortEarly){e.typed=!1;break}}s.typed||(e.typed=!1),e.value[i]=s.value}else if(o.fallback!==void 0)e.value[i]=await F(o);else if(o.type!==`exact_optional`&&o.type!==`optional`&&o.type!==`nullish`&&(m(this,`key`,e,t,{input:void 0,expected:`"${i}"`,path:[{type:`object`,origin:`key`,input:n,key:i,value:a}]}),t.abortEarly))break;if(!e.issues||!t.abortEarly){for(let r in n)if(!(r in this.entries)){m(this,`key`,e,t,{input:r,expected:`never`,path:[{type:`object`,origin:`key`,input:n,key:r,value:n[r]}]});break}}}else m(this,`type`,e,t);return e}}}function Oi(e,t){return{kind:`schema`,type:`strict_tuple`,reference:Oi,expects:`Array`,async:!1,items:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r{let i=n[r];return[r,i,await e[`~run`]({value:i},t)]}));for(let[i,a,o]of r){if(o.issues){let r={type:`array`,origin:`value`,input:n,key:i,value:a};for(let t of o.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}!(e.issues&&t.abortEarly)&&this.items.length{let i=n[r];return[r,i,await e[`~run`]({value:i},t)]}));for(let[i,a,o]of r){if(o.issues){let r={type:`array`,origin:`value`,input:n,key:i,value:a};for(let t of o.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}}else m(this,`type`,e,t);return e}}}function Pi(e,t,n){return{kind:`schema`,type:`tuple_with_rest`,reference:Pi,expects:`Array`,async:!1,items:e,rest:t,message:n,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(Array.isArray(n)){e.typed=!0,e.value=[];for(let r=0;r{let i=n[r];return[r,i,await e[`~run`]({value:i},t)]})),Promise.all(n.slice(this.items.length).map(async(e,n)=>[n+this.items.length,e,await this.rest[`~run`]({value:e},t)]))]);for(let[i,a,o]of r){if(o.issues){let r={type:`array`,origin:`value`,input:n,key:i,value:a};for(let t of o.issues)t.path?t.path.unshift(r):t.path=[r],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}if(!e.issues||!t.abortEarly)for(let[r,a,o]of i){if(o.issues){let i={type:`array`,origin:`value`,input:n,key:r,value:a};for(let t of o.issues)t.path?t.path.unshift(i):t.path=[i],e.issues?.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),e.value.push(o.value)}}else m(this,`type`,e,t);return e}}}function Z(e){return{kind:`schema`,type:`undefined`,reference:Z,expects:`undefined`,async:!1,message:e,get"~standard"(){return S(this)},"~run"(e,t){return e.value===void 0?e.typed=!0:m(this,`type`,e,t),e}}}function Ii(e,t){return{kind:`schema`,type:`undefinedable`,reference:Ii,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:t,get"~standard"(){return S(this)},"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=I(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function Li(e,t){return{kind:`schema`,type:`undefinedable`,reference:Li,expects:`(${e.expects} | undefined)`,async:!0,wrapped:e,default:t,get"~standard"(){return S(this)},async"~run"(e,t){return e.value===void 0&&(this.default!==void 0&&(e.value=await I(this,e,t)),e.value===void 0)?(e.typed=!0,e):this.wrapped[`~run`](e,t)}}}function Q(e){let t;if(e)for(let n of e)if(t)for(let e of n.issues)t.push(e);else t=n.issues;return t}function Ri(e,t){return{kind:`schema`,type:`union`,reference:Ri,expects:D(e.map(e=>e.expects),`|`),async:!1,options:e,message:t,get"~standard"(){return S(this)},"~run"(e,t){let n,r,i;for(let a of this.options){let o=a[`~run`]({value:e.value},t);if(o.typed)if(o.issues)r?r.push(o):r=[o];else{n=o;break}else i?i.push(o):i=[o]}if(n)return n;if(r){if(r.length===1)return r[0];m(this,`type`,e,t,{issues:Q(r)}),e.typed=!0}else if(i?.length===1)return i[0];else m(this,`type`,e,t,{issues:Q(i)});return e}}}function zi(e,t){return{kind:`schema`,type:`union`,reference:zi,expects:D(e.map(e=>e.expects),`|`),async:!0,options:e,message:t,get"~standard"(){return S(this)},async"~run"(e,t){let n,r,i;for(let a of this.options){let o=await a[`~run`]({value:e.value},t);if(o.typed)if(o.issues)r?r.push(o):r=[o];else{n=o;break}else i?i.push(o):i=[o]}if(n)return n;if(r){if(r.length===1)return r[0];m(this,`type`,e,t,{issues:Q(r)}),e.typed=!0}else if(i?.length===1)return i[0];else m(this,`type`,e,t,{issues:Q(i)});return e}}}function Bi(){return{kind:`schema`,type:`unknown`,reference:Bi,expects:`unknown`,async:!1,get"~standard"(){return S(this)},"~run"(e){return e.typed=!0,e}}}function Vi(e,t,n){return{kind:`schema`,type:`variant`,reference:Vi,expects:`Object`,async:!1,key:e,options:t,message:n,get"~standard"(){return S(this)},"~run"(e,t){let n=e.value;if(n&&typeof n==`object`){let r,i=0,a=this.key,o=[],s=(e,c)=>{for(let l of e.options){if(l.type===`variant`)s(l,new Set(c).add(l.key));else{let e=!0,s=0;for(let t of c){let r=l.entries[t];if(t in n?r[`~run`]({typed:!1,value:n[t]},P).issues:r.type!==`exact_optional`&&r.type!==`optional`&&r.type!==`nullish`){e=!1,a!==t&&(i{for(let l of e.options){if(l.type===`variant`)await s(l,new Set(c).add(l.key));else{let e=!0,s=0;for(let t of c){let r=l.entries[t];if(t in n?(await r[`~run`]({typed:!1,value:n[t]},P)).issues:r.type!==`exact_optional`&&r.type!==`optional`&&r.type!==`nullish`){e=!1,a!==t&&(iKi(e,n,t);return n.schema=e,n.config=t,n}function Yi(e,t){let n=n=>qi(e,n,t);return n.schema=e,n.config=t,n}function Xi(e,t){let n={};for(let r in e.entries)n[r]=!t||t.includes(r)?q(e.entries[r]):e.entries[r];return{...e,entries:n,get"~standard"(){return S(this)}}}function Zi(e,t){let n={};for(let r in e.entries)n[r]=!t||t.includes(r)?J(e.entries[r]):e.entries[r];return{...e,entries:n,get"~standard"(){return S(this)}}}function Qi(e,t){let n={};for(let r of t)n[r]=e.entries[r];return{...e,entries:n,get"~standard"(){return S(this)}}}function $i(...e){return{...e[0],pipe:e,get"~standard"(){return S(this)},"~run"(t,n){for(let r of e)if(r.kind!==`metadata`){if(t.issues&&(r.kind===`schema`||r.kind===`transformation`)){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=r[`~run`](t,n))}return t}}}function ea(...e){return{...e[0],pipe:e,async:!0,get"~standard"(){return S(this)},async"~run"(t,n){for(let r of e)if(r.kind!==`metadata`){if(t.issues&&(r.kind===`schema`||r.kind===`transformation`)){t.typed=!1;break}(!t.issues||!n.abortEarly&&!n.abortPipeEarly)&&(t=await r[`~run`](t,n))}return t}}}function ta(e,t,n){let r=Array.isArray(t)?t:void 0,i=Array.isArray(t)?n:t,a={};for(let t in e.entries)a[t]=!r||r.includes(t)?W(e.entries[t],i):e.entries[t];return{...e,entries:a,get"~standard"(){return S(this)}}}function na(e,t,n){let r=Array.isArray(t)?t:void 0,i=Array.isArray(t)?n:t,a={};for(let t in e.entries)a[t]=!r||r.includes(t)?G(e.entries[t],i):e.entries[t];return{...e,entries:a,get"~standard"(){return S(this)}}}function ra(e,t,n){let i=e[`~run`]({value:t},r(n));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}async function ia(e,t,n){let i=await e[`~run`]({value:t},r(n));return{typed:i.typed,success:!i.issues,output:i.value,issues:i.issues}}function aa(e,t){let n=n=>ra(e,n,t);return n.schema=e,n.config=t,n}function oa(e,t){let n=n=>ia(e,n,t);return n.schema=e,n.config=t,n}function sa(e){let t=``;for(let n of e){t&&(t+=` +`),t+=`× ${n.message}`;let e=O(n);e&&(t+=`\n → at ${e}`)}return t}function ca(e){return e.wrapped}export{me as BASE64_REGEX,he as BIC_REGEX,ge as CUID2_REGEX,_e as DECIMAL_REGEX,ve as DIGITS_REGEX,ye as DOMAIN_REGEX,be as EMAIL_REGEX,A as EMOJI_REGEX,j as HEXADECIMAL_REGEX,M as HEX_COLOR_REGEX,N as IMEI_REGEX,xe as IPV4_REGEX,Se as IPV6_REGEX,Ce as IP_REGEX,we as ISO_DATE_REGEX,Te as ISO_DATE_TIME_REGEX,Ee as ISO_DATE_TIME_SECOND_REGEX,ke as ISO_TIMESTAMP_REGEX,De as ISO_TIME_REGEX,Oe as ISO_TIME_SECOND_REGEX,Ae as ISO_WEEK_REGEX,Me as ISRC_REGEX,je as JWS_COMPACT_REGEX,Ne as MAC48_REGEX,Pe as MAC64_REGEX,Fe as MAC_REGEX,Ie as NANO_ID_REGEX,Le as OCTAL_REGEX,Re as RFC_EMAIL_REGEX,ze as SLUG_REGEX,Be as ULID_REGEX,Ve as UUID_REGEX,k as ValiError,m as _addIssue,h as _cloneDataset,g as _formatCase,v as _getByteCount,b as _getGraphemeCount,x as _getLastMetadata,S as _getStandardProps,w as _getWordCount,T as _isLuhnAlgo,E as _isValidObjectKey,D as _joinExpects,p as _stringify,Lr as any,de as args,fe as argsAsync,Rr as array,zr as arrayAsync,Sr as assert,pe as awaitAsync,He as base64,Ue as bic,Br as bigint,Vr as blob,Hr as boolean,We as brand,Ge as bytes,wr as cache,Tr as cacheAsync,Ke as check,qe as checkAsync,Je as checkItems,Ye as checkItemsAsync,Er as config,$e as creditCard,et as cuid2,Ur as custom,Wr as customAsync,Gr as date,tt as decimal,i as deleteGlobalConfig,c as deleteGlobalMessage,d as deleteSchemaMessage,re as deleteSpecificMessage,nt as description,rt as digits,it as domain,at as email,ot as emoji,st as empty,ct as endsWith,lt as entries,oe as entriesFromList,se as entriesFromObjects,V as enum,V as enum_,ut as everyItem,Kr as exactOptional,qr as exactOptionalAsync,dt as examples,ft as excludes,Dr as fallback,Or as fallbackAsync,Jr as file,pt as filterItems,mt as findItem,ht as finite,kr as flatten,gt as flavor,Ar as forward,jr as forwardAsync,H as function,H as function_,I as getDefault,L as getDefaults,R as getDefaultsAsync,Mr as getDescription,O as getDotPath,Nr as getExamples,F as getFallback,z as getFallbacks,B as getFallbacksAsync,r as getGlobalConfig,s as getGlobalMessage,Pr as getMetadata,ee as getSchemaMessage,ne as getSpecificMessage,Fr as getTitle,_t as graphemes,vt as gtValue,yt as guard,xt as hash,Ct as hexColor,St as hexadecimal,wt as imei,Tt as includes,Yr as instance,Et as integer,Xr as intersect,Zr as intersectAsync,Dt as ip,Ot as ipv4,kt as ipv6,Ir as is,ce as isOfKind,le as isOfType,ue as isValiError,Ft as isbn,Lt as isoDate,Rt as isoDateTime,zt as isoDateTimeSecond,Bt as isoTime,Vt as isoTimeSecond,Ht as isoTimestamp,Ut as isoWeek,It as isrc,Wt as jwsCompact,Ui as keyof,Qr as lazy,$r as lazyAsync,Gt as length,ei as literal,ti as looseObject,ni as looseObjectAsync,ri as looseTuple,ii as looseTupleAsync,Kt as ltValue,qt as mac,Jt as mac48,Yt as mac64,ai as map,oi as mapAsync,Xt as mapItems,Zt as maxBytes,Qt as maxEntries,$t as maxGraphemes,en as maxLength,tn as maxSize,nn as maxValue,rn as maxWords,Wi as message,an as metadata,on as mimeType,sn as minBytes,cn as minEntries,ln as minGraphemes,un as minLength,dn as minSize,fn as minValue,pn as minWords,mn as multipleOf,si as nan,hn as nanoid,ci as never,gn as nonEmpty,li as nonNullable,ui as nonNullableAsync,di as nonNullish,fi as nonNullishAsync,W as nonOptional,G as nonOptionalAsync,_n as normalize,vn as notBytes,yn as notEntries,bn as notGraphemes,xn as notLength,Sn as notSize,Cn as notValue,wn as notValues,Tn as notWords,K as null,K as null_,pi as nullable,mi as nullableAsync,hi as nullish,gi as nullishAsync,_i as number,vi as object,yi as objectAsync,bi as objectWithRest,xi as objectWithRestAsync,En as octal,Gi as omit,q as optional,J as optionalAsync,Ki as parse,qi as parseAsync,kn as parseBoolean,An as parseJson,Ji as parser,Yi as parserAsync,Xi as partial,Zi as partialAsync,Mn as partialCheck,Nn as partialCheckAsync,Qi as pick,Y as picklist,$i as pipe,ea as pipeAsync,X as promise,Pn as rawCheck,Fn as rawCheckAsync,In as rawTransform,Ln as rawTransformAsync,Rn as readonly,Si as record,Ci as recordAsync,zn as reduceItems,Bn as regex,ta as required,na as requiredAsync,Vn as returns,Hn as returnsAsync,Un as rfcEmail,Wn as safeInteger,ra as safeParse,ia as safeParseAsync,aa as safeParser,oa as safeParserAsync,wi as set,Ti as setAsync,n as setGlobalConfig,o as setGlobalMessage,u as setSchemaMessage,te as setSpecificMessage,Gn as size,Kn as slug,qn as someItem,Jn as sortItems,Yn as startsWith,Ei as strictObject,Di as strictObjectAsync,Oi as strictTuple,ki as strictTupleAsync,Ai as string,Xn as stringifyJson,sa as summarize,ji as symbol,Zn as title,Qn as toBigint,$n as toBoolean,er as toCamelCase,tr as toDate,nr as toKebabCase,rr as toLowerCase,ir as toMaxValue,ar as toMinValue,or as toNumber,sr as toPascalCase,cr as toSnakeCase,lr as toString,ur as toUpperCase,dr as transform,fr as transformAsync,pr as trim,mr as trimEnd,hr as trimStart,Mi as tuple,Ni as tupleAsync,Pi as tupleWithRest,Fi as tupleWithRestAsync,gr as ulid,Z as undefined,Z as undefined_,Ii as undefinedable,Li as undefinedableAsync,Ri as union,zi as unionAsync,Bi as unknown,ca as unwrap,_r as url,vr as uuid,yr as value,br as values,Vi as variant,Hi as variantAsync,$ as void,$ as void_,xr as words}; \ No newline at end of file diff --git a/tools/ui/node_modules/valibot/dist/index.mjs b/tools/ui/node_modules/valibot/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..3771cf5879644c9317cf0d5785c9e58e6b95ac4e --- /dev/null +++ b/tools/ui/node_modules/valibot/dist/index.mjs @@ -0,0 +1,7663 @@ +//#region src/storages/globalConfig/globalConfig.ts +let store$4; +const DEFAULT_CONFIG = { + lang: void 0, + message: void 0, + abortEarly: void 0, + abortPipeEarly: void 0 +}; +/** +* Sets the global configuration. +* +* @param config The configuration. +*/ +function setGlobalConfig(config$1) { + store$4 = { + ...store$4, + ...config$1 + }; +} +/** +* Returns the global configuration. +* +* @param config The config to merge. +* +* @returns The configuration. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getGlobalConfig(config$1) { + if (!config$1 && !store$4) return DEFAULT_CONFIG; + return { + lang: config$1?.lang ?? store$4?.lang, + message: config$1?.message, + abortEarly: config$1?.abortEarly ?? store$4?.abortEarly, + abortPipeEarly: config$1?.abortPipeEarly ?? store$4?.abortPipeEarly + }; +} +/** +* Deletes the global configuration. +*/ +function deleteGlobalConfig() { + store$4 = void 0; +} + +//#endregion +//#region src/storages/globalMessage/globalMessage.ts +let store$3; +/** +* Sets a global error message. +* +* @param message The error message. +* @param lang The language of the message. +*/ +function setGlobalMessage(message$1, lang) { + if (!store$3) store$3 = /* @__PURE__ */ new Map(); + store$3.set(lang, message$1); +} +/** +* Returns a global error message. +* +* @param lang The language of the message. +* +* @returns The error message. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getGlobalMessage(lang) { + return store$3?.get(lang); +} +/** +* Deletes a global error message. +* +* @param lang The language of the message. +*/ +function deleteGlobalMessage(lang) { + store$3?.delete(lang); +} + +//#endregion +//#region src/storages/schemaMessage/schemaMessage.ts +let store$2; +/** +* Sets a schema error message. +* +* @param message The error message. +* @param lang The language of the message. +*/ +function setSchemaMessage(message$1, lang) { + if (!store$2) store$2 = /* @__PURE__ */ new Map(); + store$2.set(lang, message$1); +} +/** +* Returns a schema error message. +* +* @param lang The language of the message. +* +* @returns The error message. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getSchemaMessage(lang) { + return store$2?.get(lang); +} +/** +* Deletes a schema error message. +* +* @param lang The language of the message. +*/ +function deleteSchemaMessage(lang) { + store$2?.delete(lang); +} + +//#endregion +//#region src/storages/specificMessage/specificMessage.ts +let store$1; +/** +* Sets a specific error message. +* +* @param reference The identifier reference. +* @param message The error message. +* @param lang The language of the message. +*/ +function setSpecificMessage(reference, message$1, lang) { + if (!store$1) store$1 = /* @__PURE__ */ new Map(); + if (!store$1.get(reference)) store$1.set(reference, /* @__PURE__ */ new Map()); + store$1.get(reference).set(lang, message$1); +} +/** +* Returns a specific error message. +* +* @param reference The identifier reference. +* @param lang The language of the message. +* +* @returns The error message. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getSpecificMessage(reference, lang) { + return store$1?.get(reference)?.get(lang); +} +/** +* Deletes a specific error message. +* +* @param reference The identifier reference. +* @param lang The language of the message. +*/ +function deleteSpecificMessage(reference, lang) { + store$1?.get(reference)?.delete(lang); +} + +//#endregion +//#region src/utils/_stringify/_stringify.ts +/** +* Stringifies an unknown input to a literal or type string. +* +* @param input The unknown input. +* +* @returns A literal or type string. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _stringify(input) { + const type = typeof input; + if (type === "string") return `"${input}"`; + if (type === "number" || type === "bigint" || type === "boolean") return `${input}`; + if (type === "object" || type === "function") return (input && Object.getPrototypeOf(input)?.constructor?.name) ?? "null"; + return type; +} + +//#endregion +//#region src/utils/_addIssue/_addIssue.ts +/** +* Adds an issue to the dataset. +* +* @param context The issue context. +* @param label The issue label. +* @param dataset The input dataset. +* @param config The configuration. +* @param other The optional props. +* +* @internal +*/ +function _addIssue(context, label, dataset, config$1, other) { + const input = other && "input" in other ? other.input : dataset.value; + const expected = other?.expected ?? context.expects ?? null; + const received = other?.received ?? /* @__PURE__ */ _stringify(input); + const issue = { + kind: context.kind, + type: context.type, + input, + expected, + received, + message: `Invalid ${label}: ${expected ? `Expected ${expected} but r` : "R"}eceived ${received}`, + requirement: context.requirement, + path: other?.path, + issues: other?.issues, + lang: config$1.lang, + abortEarly: config$1.abortEarly, + abortPipeEarly: config$1.abortPipeEarly + }; + const isSchema = context.kind === "schema"; + const message$1 = other?.message ?? context.message ?? /* @__PURE__ */ getSpecificMessage(context.reference, issue.lang) ?? (isSchema ? /* @__PURE__ */ getSchemaMessage(issue.lang) : null) ?? config$1.message ?? /* @__PURE__ */ getGlobalMessage(issue.lang); + if (message$1 !== void 0) issue.message = typeof message$1 === "function" ? message$1(issue) : message$1; + if (isSchema) dataset.typed = false; + if (dataset.issues) dataset.issues.push(issue); + else dataset.issues = [issue]; +} + +//#endregion +//#region src/utils/_cloneDataset/_cloneDataset.ts +/** +* Creates a shallow copy of a dataset. +* +* Hint: The `value` is copied by reference, but the `issues` array is cloned +* to avoid reusing mutable dataset state across multiple runs. Mutating a +* returned object or array value can therefore affect later cache hits that +* reuse the same cached output. +* +* @param dataset The output dataset. +* +* @returns The copied output dataset. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _cloneDataset(dataset) { + return { + typed: dataset.typed, + value: dataset.value, + issues: dataset.issues && [...dataset.issues] + }; +} + +//#endregion +//#region src/utils/_formatCase/_formatCase.ts +/** +* Splits a string into lowercase words and rejoins them with the given +* separator and capitalization rules. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. Whether the first or subsequent words are +* capitalized is controlled by `capFirst` and `capRest`. +* +* Hint: Implemented in a single pass that emits directly to the result +* string to avoid an intermediate `string[]` allocation. ASCII chars are +* classified via char codes to skip `.toLowerCase()` and `.toUpperCase()` +* method calls in the common case. +* +* Hint: Digits are treated as a separate character class, so `item2Name` +* yields `item2` and `name` rather than `item`, `2` and `name`. +* +* @param input The input string. +* @param separator The string inserted between words. +* @param capFirst Whether to capitalize the first word. +* @param capRest Whether to capitalize subsequent words. +* +* @returns The formatted string. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _formatCase(input, separator, capFirst, capRest) { + let result = ""; + let firstWord = true; + let start = 0; + let prev = 0; + let prevPrev = 0; + const flush = (end) => { + if (end > start) { + let word = input.slice(start, end).toLowerCase(); + if (firstWord ? capFirst : capRest) { + const firstCode = word.charCodeAt(0); + if (firstCode >= 97 && firstCode <= 122) word = String.fromCharCode(firstCode - 32) + word.slice(1); + else { + const charLen = firstCode >= 55296 && firstCode <= 56319 ? 2 : 1; + word = word.slice(0, charLen).toUpperCase() + word.slice(charLen); + } + } + result += firstWord ? word : separator + word; + firstWord = false; + } + }; + for (let index = 0; index < input.length; index++) { + const code = input.charCodeAt(index); + let type; + if (code === 32 || code === 9 || code === 10 || code === 11 || code === 12 || code === 13 || code === 45 || code === 95) { + flush(index); + start = index + 1; + type = 0; + } else if (code < 128) type = code >= 65 && code <= 90 ? 1 : code >= 97 && code <= 122 ? 2 : 3; + else { + const char = input[index]; + const charLower = char.toLowerCase(); + type = charLower === char.toUpperCase() ? 3 : char === charLower ? 2 : 1; + } + if (type === 1 && (prev === 2 || prev === 3) && index > start) { + flush(index); + start = index; + } else if (type === 2 && prev === 1 && prevPrev === 1 && index - 1 > start) { + flush(index - 1); + start = index - 1; + } + prevPrev = prev; + prev = type; + } + flush(input.length); + return result; +} + +//#endregion +//#region src/utils/_getByteCount/_getByteCount.ts +let textEncoder; +/** +* Returns the byte count of the input. +* +* @param input The input to be measured. +* +* @returns The byte count. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _getByteCount(input) { + if (!textEncoder) textEncoder = new TextEncoder(); + return textEncoder.encode(input).length; +} + +//#endregion +//#region src/utils/_getGraphemeCount/_getGraphemeCount.ts +let segmenter; +/** +* Returns the grapheme count of the input. +* +* @param input The input to be measured. +* +* @returns The grapheme count. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _getGraphemeCount(input) { + if (!segmenter) segmenter = new Intl.Segmenter(); + const segments = segmenter.segment(input); + let count = 0; + for (const _ of segments) count++; + return count; +} + +//#endregion +//#region src/utils/_getLastMetadata/_getLastMetadata.ts +/** +* Returns the last top-level value of a given metadata type from a schema +* using a breadth-first search that starts with the last item in the pipeline. +* +* @param schema The schema to search. +* @param type The metadata type. +* +* @returns The value, if any. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _getLastMetadata(schema, type) { + if ("pipe" in schema) { + const nestedSchemas = []; + for (let index = schema.pipe.length - 1; index >= 0; index--) { + const item = schema.pipe[index]; + if (item.kind === "schema" && "pipe" in item) nestedSchemas.push(item); + else if (item.kind === "metadata" && item.type === type) return item[type]; + } + for (const nestedSchema of nestedSchemas) { + const result = /* @__PURE__ */ _getLastMetadata(nestedSchema, type); + if (result !== void 0) return result; + } + } +} + +//#endregion +//#region src/utils/_getStandardProps/_getStandardProps.ts +const _standardCache = /* @__PURE__ */ new WeakMap(); +/** +* Returns the Standard Schema properties. +* +* @param context The schema context. +* +* @returns The Standard Schema properties. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _getStandardProps(context) { + let cached = _standardCache.get(context); + if (!cached) { + cached = { + version: 1, + vendor: "valibot", + validate(value$1) { + return context["~run"]({ value: value$1 }, /* @__PURE__ */ getGlobalConfig()); + } + }; + _standardCache.set(context, cached); + } + return cached; +} + +//#endregion +//#region src/utils/_getWordCount/_getWordCount.ts +let store; +/** +* Returns the word count of the input. +* +* @param locales The locales to be used. +* @param input The input to be measured. +* +* @returns The word count. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _getWordCount(locales, input) { + if (!store) store = /* @__PURE__ */ new Map(); + const key = String(locales); + let segmenter$1 = store.get(key); + if (!segmenter$1) { + segmenter$1 = new Intl.Segmenter(locales, { granularity: "word" }); + store.set(key, segmenter$1); + } + const segments = segmenter$1.segment(input); + let count = 0; + for (const segment of segments) if (segment.isWordLike) count++; + return count; +} + +//#endregion +//#region src/utils/_isLuhnAlgo/_isLuhnAlgo.ts +/** +* Non-digit regex. +*/ +const NON_DIGIT_REGEX = /\D/gu; +/** +* Checks whether a string with numbers corresponds to the luhn algorithm. +* +* @param input The input to be checked. +* +* @returns Whether input is valid. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _isLuhnAlgo(input) { + const number$1 = input.replace(NON_DIGIT_REGEX, ""); + let length$1 = number$1.length; + let bit = 1; + let sum = 0; + while (length$1) { + const value$1 = +number$1[--length$1]; + bit ^= 1; + sum += bit ? [ + 0, + 2, + 4, + 6, + 8, + 1, + 3, + 5, + 7, + 9 + ][value$1] : value$1; + } + return sum % 10 === 0; +} + +//#endregion +//#region src/utils/_isValidObjectKey/_isValidObjectKey.ts +/** +* Disallows inherited object properties and prevents object prototype +* pollution by disallowing certain keys. +* +* @param object The object to check. +* @param key The key to check. +* +* @returns Whether the key is allowed. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _isValidObjectKey(object$1, key) { + return Object.prototype.hasOwnProperty.call(object$1, key) && key !== "__proto__" && key !== "prototype" && key !== "constructor"; +} + +//#endregion +//#region src/utils/_joinExpects/_joinExpects.ts +/** +* Joins multiple `expects` values with the given separator. +* +* @param values The `expects` values. +* @param separator The separator. +* +* @returns The joined `expects` property. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _joinExpects(values$1, separator) { + const list = [...new Set(values$1)]; + if (list.length > 1) return `(${list.join(` ${separator} `)})`; + return list[0] ?? "never"; +} + +//#endregion +//#region src/utils/entriesFromList/entriesFromList.ts +/** +* Creates an object entries definition from a list of keys and a schema. +* +* @param list A list of keys. +* @param schema The schema of the keys. +* +* @returns The object entries. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function entriesFromList(list, schema) { + const entries$1 = {}; + for (const key of list) entries$1[key] = schema; + return entries$1; +} + +//#endregion +//#region src/utils/entriesFromObjects/entriesFromObjects.ts +/* @__NO_SIDE_EFFECTS__ */ +function entriesFromObjects(schemas) { + const entries$1 = {}; + for (const schema of schemas) Object.assign(entries$1, schema.entries); + return entries$1; +} + +//#endregion +//#region src/utils/getDotPath/getDotPath.ts +/* @__NO_SIDE_EFFECTS__ */ +function getDotPath(issue) { + if (issue.path) { + let key = ""; + for (const item of issue.path) if (typeof item.key === "string" || typeof item.key === "number") if (key) key += `.${item.key}`; + else key += item.key; + else return null; + return key; + } + return null; +} + +//#endregion +//#region src/utils/isOfKind/isOfKind.ts +/** +* A generic type guard to check the kind of an object. +* +* @param kind The kind to check for. +* @param object The object to check. +* +* @returns Whether it matches. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function isOfKind(kind, object$1) { + return object$1.kind === kind; +} + +//#endregion +//#region src/utils/isOfType/isOfType.ts +/** +* A generic type guard to check the type of an object. +* +* @param type The type to check for. +* @param object The object to check. +* +* @returns Whether it matches. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function isOfType(type, object$1) { + return object$1.type === type; +} + +//#endregion +//#region src/utils/isValiError/isValiError.ts +/** +* A type guard to check if an error is a ValiError. +* +* @param error The error to check. +* +* @returns Whether its a ValiError. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function isValiError(error) { + return error instanceof ValiError; +} + +//#endregion +//#region src/utils/ValiError/ValiError.ts +/** +* A Valibot error with useful information. +*/ +var ValiError = class extends Error { + /** + * Creates a Valibot error with useful information. + * + * @param issues The error issues. + */ + constructor(issues) { + super(issues[0].message); + this.name = "ValiError"; + this.issues = issues; + } +}; + +//#endregion +//#region src/actions/args/args.ts +/* @__NO_SIDE_EFFECTS__ */ +function args(schema) { + return { + kind: "transformation", + type: "args", + reference: args, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = (...args_) => { + const argsDataset = this.schema["~run"]({ value: args_ }, config$1); + if (argsDataset.issues) throw new ValiError(argsDataset.issues); + return func(...argsDataset.value); + }; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/args/argsAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function argsAsync(schema) { + return { + kind: "transformation", + type: "args", + reference: argsAsync, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = async (...args$1) => { + const argsDataset = await schema["~run"]({ value: args$1 }, config$1); + if (argsDataset.issues) throw new ValiError(argsDataset.issues); + return func(...argsDataset.value); + }; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/await/awaitAsync.ts +/** +* Creates an await transformation action. +* +* @returns An await action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function awaitAsync() { + return { + kind: "transformation", + type: "await", + reference: awaitAsync, + async: true, + async "~run"(dataset) { + dataset.value = await dataset.value; + return dataset; + } + }; +} + +//#endregion +//#region src/regex.ts +/** +* [Base64](https://en.wikipedia.org/wiki/Base64) regex. +*/ +const BASE64_REGEX = /^(?:[\da-z+/]{4})*(?:[\da-z+/]{2}==|[\da-z+/]{3}=)?$/iu; +/** +* [BIC](https://en.wikipedia.org/wiki/ISO_9362) regex. +*/ +const BIC_REGEX = /^[A-Z]{6}(?!00)[\dA-Z]{2}(?:[\dA-Z]{3})?$/u; +/** +* [Cuid2](https://github.com/paralleldrive/cuid2) regex. +*/ +const CUID2_REGEX = /^[a-z][\da-z]*$/u; +/** +* [Decimal](https://en.wikipedia.org/wiki/Decimal) regex. +*/ +const DECIMAL_REGEX = /^[+-]?(?:\d*\.)?\d+$/u; +/** +* [Digits](https://en.wikipedia.org/wiki/Numerical_digit) regex. +*/ +const DIGITS_REGEX = /^\d+$/u; +/** +* [Domain name](https://en.wikipedia.org/wiki/Domain_name) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +* ASCII-only validation. Internationalized domain names (IDNs) are not +* supported, including Punycode-encoded labels. +*/ +const DOMAIN_REGEX = /^(?=.{1,253}$)(?:(?![Xx][Nn]--)[A-Za-z0-9](?:[A-Za-z0-9-]{0,61}[A-Za-z0-9])?\.)+[A-Za-z]{2,63}$/u; +/** +* [Email address](https://en.wikipedia.org/wiki/Email_address) regex. +*/ +const EMAIL_REGEX = /^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu; +/** +* Emoji regex from [emoji-regex-xs](https://github.com/slevithan/emoji-regex-xs) v1.0.0 (MIT license). +* +* Hint: We decided against the newer `/^\p{RGI_Emoji}+$/v` regex because it is +* not supported in older runtimes and does not match all emoji. +*/ +const EMOJI_REGEX = /^(?:[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|(?![\p{Emoji_Modifier_Base}\u{1F1E6}-\u{1F1FF}])\p{Emoji_Presentation}))*)+$/u; +/** +* [Hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +const HEXADECIMAL_REGEX = /^(?:0[hx])?[\da-fA-F]+$/u; +/** +* [Hex color](https://en.wikipedia.org/wiki/Web_colors#Hex_triplet) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +const HEX_COLOR_REGEX = /^#(?:[\da-fA-F]{3,4}|[\da-fA-F]{6}|[\da-fA-F]{8})$/u; +/** +* [IMEI](https://en.wikipedia.org/wiki/International_Mobile_Equipment_Identity) regex. +*/ +const IMEI_REGEX = /^\d{15}$|^\d{2}-\d{6}-\d{6}-\d$/u; +/** +* [IPv4](https://en.wikipedia.org/wiki/IPv4) regex. +*/ +const IPV4_REGEX = /^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$/u; +/** +* [IPv6](https://en.wikipedia.org/wiki/IPv6) regex. +*/ +const IPV6_REGEX = /^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu; +/** +* [IP](https://en.wikipedia.org/wiki/IP_address) regex. +*/ +const IP_REGEX = /^(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])(?:\.(?:(?:[1-9]|1\d|2[0-4])?\d|25[0-5])){3}$|^(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:|(?:[\da-f]{1,4}:){1,6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,5}(?::[\da-f]{1,4}){1,2}|(?:[\da-f]{1,4}:){1,4}(?::[\da-f]{1,4}){1,3}|(?:[\da-f]{1,4}:){1,3}(?::[\da-f]{1,4}){1,4}|(?:[\da-f]{1,4}:){1,2}(?::[\da-f]{1,4}){1,5}|[\da-f]{1,4}:(?::[\da-f]{1,4}){1,6}|:(?:(?::[\da-f]{1,4}){1,7}|:)|fe80:(?::[\da-f]{0,4}){0,4}%[\da-z]+|::(?:f{4}(?::0{1,4})?:)?(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d)|(?:[\da-f]{1,4}:){1,4}:(?:(?:25[0-5]|(?:2[0-4]|1?\d)?\d)\.){3}(?:25[0-5]|(?:2[0-4]|1?\d)?\d))$/iu; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date regex. +*/ +const ISO_DATE_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])$/u; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time regex. +*/ +const ISO_DATE_TIME_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3]):[0-5]\d$/u; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with seconds regex. +*/ +const ISO_DATE_TIME_SECOND_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time regex. +*/ +const ISO_TIME_REGEX = /^(?:0\d|1\d|2[0-3]):[0-5]\d$/u; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time with seconds regex. +*/ +const ISO_TIME_SECOND_REGEX = /^(?:0\d|1\d|2[0-3])(?::[0-5]\d){2}$/u; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp regex. Allows a +* space as a date/time separator and an optional space before the UTC offset. +*/ +const ISO_TIMESTAMP_REGEX = /^\d{4}-(?:0[1-9]|1[0-2])-(?:[12]\d|0[1-9]|3[01])[T ](?:0\d|1\d|2[0-3])(?::[0-5]\d){2}(?:\.\d{1,9})?(?:Z| ?[+-](?:0\d|1\d|2[0-3])(?::?[0-5]\d)?)$/u; +/** +* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) week regex. +*/ +const ISO_WEEK_REGEX = /^\d{4}-W(?:0[1-9]|[1-4]\d|5[0-3])$/u; +/** +* [JWS compact serialization](https://datatracker.ietf.org/doc/html/rfc7515#section-3.1) +* regex. +* +* Hint: Empty payload and signature segments are allowed because the +* Base64URL-encoded representation of an empty octet sequence is an empty +* string. +*/ +const JWS_COMPACT_REGEX = /^(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)\.(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)?\.(?:[\w-]{2,3}|(?:[\w-]{4})+(?:[\w-]{2,3})?)?$/u; +/** +* [ISRC](https://en.wikipedia.org/wiki/International_Standard_Recording_Code) regex. +*/ +const ISRC_REGEX = /^(?:[A-Z]{2}[A-Z\d]{3}\d{7}|[A-Z]{2}-[A-Z\d]{3}-\d{2}-\d{5})$/u; +/** +* [MAC](https://en.wikipedia.org/wiki/MAC_address) 48 bit regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +const MAC48_REGEX = /^(?:[\da-fA-F]{2}:){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){2}[\da-fA-F]{4}$/u; +/** +* [MAC](https://en.wikipedia.org/wiki/MAC_address) 64 bit regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +const MAC64_REGEX = /^(?:[\da-fA-F]{2}:){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){3}[\da-fA-F]{4}$|^(?:[\da-fA-F]{4}:){3}[\da-fA-F]{4}$/u; +/** +* [MAC](https://en.wikipedia.org/wiki/MAC_address) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +const MAC_REGEX = /^(?:[\da-fA-F]{2}:){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){5}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){2}[\da-fA-F]{4}$|^(?:[\da-fA-F]{2}:){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{2}-){7}[\da-fA-F]{2}$|^(?:[\da-fA-F]{4}\.){3}[\da-fA-F]{4}$|^(?:[\da-fA-F]{4}:){3}[\da-fA-F]{4}$/u; +/** +* [Nano ID](https://github.com/ai/nanoid) regex. +*/ +const NANO_ID_REGEX = /^[\w-]+$/u; +/** +* [Octal](https://en.wikipedia.org/wiki/Octal) regex. +*/ +const OCTAL_REGEX = /^(?:0o)?[0-7]+$/u; +/** +* [RFC 5322 email address](https://datatracker.ietf.org/doc/html/rfc5322#section-3.4.1) regex. +* +* Hint: This regex was taken from the [HTML Living Standard Specification](https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address) and does not perfectly represent RFC 5322. +*/ +const RFC_EMAIL_REGEX = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; +/** +* [Slug](https://en.wikipedia.org/wiki/Clean_URL#Slug) regex. +*/ +const SLUG_REGEX = /^[\da-z]+(?:[-_][\da-z]+)*$/u; +/** +* [ULID](https://github.com/ulid/spec) regex. +* +* Hint: We decided against the `i` flag for better JSON Schema compatibility. +*/ +const ULID_REGEX = /^[\da-hjkmnp-tv-zA-HJKMNP-TV-Z]{26}$/u; +/** +* [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier) regex. +*/ +const UUID_REGEX = /^[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}$/iu; + +//#endregion +//#region src/actions/base64/base64.ts +/* @__NO_SIDE_EFFECTS__ */ +function base64(message$1) { + return { + kind: "validation", + type: "base64", + reference: base64, + async: false, + expects: null, + requirement: BASE64_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Base64", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/bic/bic.ts +/* @__NO_SIDE_EFFECTS__ */ +function bic(message$1) { + return { + kind: "validation", + type: "bic", + reference: bic, + async: false, + expects: null, + requirement: BIC_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "BIC", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/brand/brand.ts +/** +* Creates a brand transformation action. +* +* @param name The brand name. +* +* @returns A brand action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function brand(name) { + return { + kind: "transformation", + type: "brand", + reference: brand, + async: false, + name, + "~run"(dataset) { + return dataset; + } + }; +} + +//#endregion +//#region src/actions/bytes/bytes.ts +/* @__NO_SIDE_EFFECTS__ */ +function bytes(requirement, message$1) { + return { + kind: "validation", + type: "bytes", + reference: bytes, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 !== this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/check/check.ts +/* @__NO_SIDE_EFFECTS__ */ +function check(requirement, message$1) { + return { + kind: "validation", + type: "check", + reference: check, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/check/checkAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function checkAsync(requirement, message$1) { + return { + kind: "validation", + type: "check", + reference: checkAsync, + async: true, + expects: null, + requirement, + message: message$1, + async "~run"(dataset, config$1) { + if (dataset.typed && !await this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/checkItems/checkItems.ts +/* @__NO_SIDE_EFFECTS__ */ +function checkItems(requirement, message$1) { + return { + kind: "validation", + type: "check_items", + reference: checkItems, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) for (let index = 0; index < dataset.value.length; index++) { + const item = dataset.value[index]; + if (!this.requirement(item, index, dataset.value)) _addIssue(this, "item", dataset, config$1, { + input: item, + path: [{ + type: "array", + origin: "value", + input: dataset.value, + key: index, + value: item + }] + }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/checkItems/checkItemsAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function checkItemsAsync(requirement, message$1) { + return { + kind: "validation", + type: "check_items", + reference: checkItemsAsync, + async: true, + expects: null, + requirement, + message: message$1, + async "~run"(dataset, config$1) { + if (dataset.typed) { + const requirementResults = await Promise.all(dataset.value.map(this.requirement)); + for (let index = 0; index < dataset.value.length; index++) if (!requirementResults[index]) { + const item = dataset.value[index]; + _addIssue(this, "item", dataset, config$1, { + input: item, + path: [{ + type: "array", + origin: "value", + input: dataset.value, + key: index, + value: item + }] + }); + } + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/creditCard/creditCard.ts +/** +* Credit card regex. +*/ +const CREDIT_CARD_REGEX = /^(?:\d{13,19}|\d{4}(?: \d{3,6}){2,4}|\d{4}(?:-\d{3,6}){2,4})$/u; +/** +* Sanitize regex. +*/ +const SANITIZE_REGEX = /[- ]/gu; +/** +* Provider regex list. +*/ +const PROVIDER_REGEX_LIST = [ + /^3[47]\d{13}$/u, + /^3(?:0[0-5]|[68]\d)\d{11,13}$/u, + /^6(?:011|5\d{2})\d{12,15}$/u, + /^(?:2131|1800|35\d{3})\d{11}$/u, + /^(?:5[1-5]\d{2}|222\d|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}$/u, + /^(?:6[27]\d{14,17}|81\d{14,17})$/u, + /^4\d{12}(?:\d{3,6})?$/u +]; +/* @__NO_SIDE_EFFECTS__ */ +function creditCard(message$1) { + return { + kind: "validation", + type: "credit_card", + reference: creditCard, + async: false, + expects: null, + requirement(input) { + let sanitized; + return CREDIT_CARD_REGEX.test(input) && (sanitized = input.replace(SANITIZE_REGEX, "")) && PROVIDER_REGEX_LIST.some((regex$1) => regex$1.test(sanitized)) && /* @__PURE__ */ _isLuhnAlgo(sanitized); + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "credit card", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/cuid2/cuid2.ts +/* @__NO_SIDE_EFFECTS__ */ +function cuid2(message$1) { + return { + kind: "validation", + type: "cuid2", + reference: cuid2, + async: false, + expects: null, + requirement: CUID2_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Cuid2", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/decimal/decimal.ts +/* @__NO_SIDE_EFFECTS__ */ +function decimal(message$1) { + return { + kind: "validation", + type: "decimal", + reference: decimal, + async: false, + expects: null, + requirement: DECIMAL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "decimal", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/description/description.ts +/** +* Creates a description metadata action. +* +* @param description_ The description text. +* +* @returns A description action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function description(description_) { + return { + kind: "metadata", + type: "description", + reference: description, + description: description_ + }; +} + +//#endregion +//#region src/actions/digits/digits.ts +/* @__NO_SIDE_EFFECTS__ */ +function digits(message$1) { + return { + kind: "validation", + type: "digits", + reference: digits, + async: false, + expects: null, + requirement: DIGITS_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "digits", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/domain/domain.ts +/* @__NO_SIDE_EFFECTS__ */ +function domain(message$1) { + return { + kind: "validation", + type: "domain", + reference: domain, + expects: null, + async: false, + requirement: DOMAIN_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "domain", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/email/email.ts +/* @__NO_SIDE_EFFECTS__ */ +function email(message$1) { + return { + kind: "validation", + type: "email", + reference: email, + expects: null, + async: false, + requirement: EMAIL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "email", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/emoji/emoji.ts +/* @__NO_SIDE_EFFECTS__ */ +function emoji(message$1) { + return { + kind: "validation", + type: "emoji", + reference: emoji, + async: false, + expects: null, + requirement: EMOJI_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "emoji", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/empty/empty.ts +/* @__NO_SIDE_EFFECTS__ */ +function empty(message$1) { + return { + kind: "validation", + type: "empty", + reference: empty, + async: false, + expects: "0", + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length > 0) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/endsWith/endsWith.ts +/* @__NO_SIDE_EFFECTS__ */ +function endsWith(requirement, message$1) { + return { + kind: "validation", + type: "ends_with", + reference: endsWith, + async: false, + expects: `"${requirement}"`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.endsWith(this.requirement)) _addIssue(this, "end", dataset, config$1, { received: `"${dataset.value.slice(-this.requirement.length)}"` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/entries/entries.ts +/* @__NO_SIDE_EFFECTS__ */ +function entries(requirement, message$1) { + return { + kind: "validation", + type: "entries", + reference: entries, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count !== this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/everyItem/everyItem.ts +/* @__NO_SIDE_EFFECTS__ */ +function everyItem(requirement, message$1) { + return { + kind: "validation", + type: "every_item", + reference: everyItem, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.every(this.requirement)) _addIssue(this, "item", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/examples/examples.ts +/** +* Creates an examples metadata action. +* +* @param examples_ The examples. +* +* @returns An examples action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function examples(examples_) { + return { + kind: "metadata", + type: "examples", + reference: examples, + examples: examples_ + }; +} + +//#endregion +//#region src/actions/excludes/excludes.ts +/* @__NO_SIDE_EFFECTS__ */ +function excludes(requirement, message$1) { + const received = /* @__PURE__ */ _stringify(requirement); + return { + kind: "validation", + type: "excludes", + reference: excludes, + async: false, + expects: `!${received}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.includes(this.requirement)) _addIssue(this, "content", dataset, config$1, { received }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/filterItems/filterItems.ts +/* @__NO_SIDE_EFFECTS__ */ +function filterItems(operation) { + return { + kind: "transformation", + type: "filter_items", + reference: filterItems, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.filter(this.operation); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/findItem/findItem.ts +/* @__NO_SIDE_EFFECTS__ */ +function findItem(operation) { + return { + kind: "transformation", + type: "find_item", + reference: findItem, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.find(this.operation); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/finite/finite.ts +/* @__NO_SIDE_EFFECTS__ */ +function finite(message$1) { + return { + kind: "validation", + type: "finite", + reference: finite, + async: false, + expects: null, + requirement: Number.isFinite, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "finite", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/flavor/flavor.ts +/** +* Creates a flavor transformation action. +* +* @param name The flavor name. +* +* @returns A flavor action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function flavor(name) { + return { + kind: "transformation", + type: "flavor", + reference: flavor, + async: false, + name, + "~run"(dataset) { + return dataset; + } + }; +} + +//#endregion +//#region src/actions/graphemes/graphemes.ts +/* @__NO_SIDE_EFFECTS__ */ +function graphemes(requirement, message$1) { + return { + kind: "validation", + type: "graphemes", + reference: graphemes, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count !== this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/gtValue/gtValue.ts +/* @__NO_SIDE_EFFECTS__ */ +function gtValue(requirement, message$1) { + return { + kind: "validation", + type: "gt_value", + reference: gtValue, + async: false, + expects: `>${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value > this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/guard/guard.ts +/* @__NO_SIDE_EFFECTS__ */ +function guard(requirement, message$1) { + return { + kind: "transformation", + type: "guard", + reference: guard, + async: false, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) { + _addIssue(this, "input", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/hash/hash.ts +/** +* Hash lengths object. +*/ +const HASH_LENGTHS = { + md4: 32, + md5: 32, + sha1: 40, + sha256: 64, + sha384: 96, + sha512: 128, + ripemd128: 32, + ripemd160: 40, + tiger128: 32, + tiger160: 40, + tiger192: 48, + crc32: 8, + crc32b: 8, + adler32: 8 +}; +/* @__NO_SIDE_EFFECTS__ */ +function hash(types, message$1) { + return { + kind: "validation", + type: "hash", + reference: hash, + expects: null, + async: false, + requirement: RegExp(types.map((type) => `^[a-fA-F0-9]{${HASH_LENGTHS[type]}}$`).join("|"), "u"), + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "hash", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/hexadecimal/hexadecimal.ts +/* @__NO_SIDE_EFFECTS__ */ +function hexadecimal(message$1) { + return { + kind: "validation", + type: "hexadecimal", + reference: hexadecimal, + async: false, + expects: null, + requirement: HEXADECIMAL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "hexadecimal", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/hexColor/hexColor.ts +/* @__NO_SIDE_EFFECTS__ */ +function hexColor(message$1) { + return { + kind: "validation", + type: "hex_color", + reference: hexColor, + async: false, + expects: null, + requirement: HEX_COLOR_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "hex color", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/imei/imei.ts +/* @__NO_SIDE_EFFECTS__ */ +function imei(message$1) { + return { + kind: "validation", + type: "imei", + reference: imei, + async: false, + expects: null, + requirement(input) { + return IMEI_REGEX.test(input) && /* @__PURE__ */ _isLuhnAlgo(input); + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "IMEI", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/includes/includes.ts +/* @__NO_SIDE_EFFECTS__ */ +function includes(requirement, message$1) { + const expects = /* @__PURE__ */ _stringify(requirement); + return { + kind: "validation", + type: "includes", + reference: includes, + async: false, + expects, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.includes(this.requirement)) _addIssue(this, "content", dataset, config$1, { received: `!${expects}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/integer/integer.ts +/* @__NO_SIDE_EFFECTS__ */ +function integer(message$1) { + return { + kind: "validation", + type: "integer", + reference: integer, + async: false, + expects: null, + requirement: Number.isInteger, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "integer", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/ip/ip.ts +/* @__NO_SIDE_EFFECTS__ */ +function ip(message$1) { + return { + kind: "validation", + type: "ip", + reference: ip, + async: false, + expects: null, + requirement: IP_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IP", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/ipv4/ipv4.ts +/* @__NO_SIDE_EFFECTS__ */ +function ipv4(message$1) { + return { + kind: "validation", + type: "ipv4", + reference: ipv4, + async: false, + expects: null, + requirement: IPV4_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IPv4", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/ipv6/ipv6.ts +/* @__NO_SIDE_EFFECTS__ */ +function ipv6(message$1) { + return { + kind: "validation", + type: "ipv6", + reference: ipv6, + async: false, + expects: null, + requirement: IPV6_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "IPv6", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isbn/utils/_isIsbn10.ts +/** +* [Validates an ISBN-10](https://en.wikipedia.org/wiki/ISBN#ISBN-10_check_digits). +* +* @param input The input value. +* +* @returns `true` if the input is a valid ISBN-10, `false` otherwise. +* +* @internal +*/ +function _isIsbn10(input) { + const digits$1 = input.split("").map((c) => c === "X" ? 10 : parseInt(c)); + let sum = 0; + for (let i = 0; i < 10; i++) sum += digits$1[i] * (10 - i); + return sum % 11 === 0; +} + +//#endregion +//#region src/actions/isbn/utils/_isIsbn13.ts +/** +* [Validates an ISBN-13](https://en.wikipedia.org/wiki/ISBN#ISBN-13_check_digit_calculation). +* +* @param input The input value. +* +* @returns `true` if the input is a valid ISBN-13, `false` otherwise. +* +* @internal +*/ +function _isIsbn13(input) { + const digits$1 = input.split("").map((c) => parseInt(c)); + let sum = 0; + for (let i = 0; i < 13; i++) sum += digits$1[i] * (i % 2 === 0 ? 1 : 3); + return sum % 10 === 0; +} + +//#endregion +//#region src/actions/isbn/isbn.ts +/** +* ISBN separator regex. +*/ +const ISBN_SEPARATOR_REGEX = /[- ]/gu; +/** +* ISBN-10 detection regex. +*/ +const ISBN_10_DETECTION_REGEX = /^\d{9}[\dX]$/u; +/** +* ISBN-13 detection regex. +*/ +const ISBN_13_DETECTION_REGEX = /^\d{13}$/u; +/* @__NO_SIDE_EFFECTS__ */ +function isbn(message$1) { + return { + kind: "validation", + type: "isbn", + reference: isbn, + async: false, + expects: null, + requirement(input) { + const replacedInput = input.replace(ISBN_SEPARATOR_REGEX, ""); + if (ISBN_10_DETECTION_REGEX.test(replacedInput)) return _isIsbn10(replacedInput); + else if (ISBN_13_DETECTION_REGEX.test(replacedInput)) return _isIsbn13(replacedInput); + return false; + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "ISBN", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isrc/isrc.ts +/* @__NO_SIDE_EFFECTS__ */ +function isrc(message$1) { + return { + kind: "validation", + type: "isrc", + reference: isrc, + async: false, + expects: null, + requirement: ISRC_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "ISRC", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoDate/isoDate.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoDate(message$1) { + return { + kind: "validation", + type: "iso_date", + reference: isoDate, + async: false, + expects: null, + requirement: ISO_DATE_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "date", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoDateTime/isoDateTime.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoDateTime(message$1) { + return { + kind: "validation", + type: "iso_date_time", + reference: isoDateTime, + async: false, + expects: null, + requirement: ISO_DATE_TIME_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "date-time", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoDateTimeSecond/isoDateTimeSecond.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoDateTimeSecond(message$1) { + return { + kind: "validation", + type: "iso_date_time_second", + reference: isoDateTimeSecond, + async: false, + expects: null, + requirement: ISO_DATE_TIME_SECOND_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "date-time-second", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoTime/isoTime.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoTime(message$1) { + return { + kind: "validation", + type: "iso_time", + reference: isoTime, + async: false, + expects: null, + requirement: ISO_TIME_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "time", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoTimeSecond/isoTimeSecond.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoTimeSecond(message$1) { + return { + kind: "validation", + type: "iso_time_second", + reference: isoTimeSecond, + async: false, + expects: null, + requirement: ISO_TIME_SECOND_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "time-second", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoTimestamp/isoTimestamp.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoTimestamp(message$1) { + return { + kind: "validation", + type: "iso_timestamp", + reference: isoTimestamp, + async: false, + expects: null, + requirement: ISO_TIMESTAMP_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "timestamp", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/isoWeek/isoWeek.ts +/* @__NO_SIDE_EFFECTS__ */ +function isoWeek(message$1) { + return { + kind: "validation", + type: "iso_week", + reference: isoWeek, + async: false, + expects: null, + requirement: ISO_WEEK_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "week", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/jwsCompact/jwsCompact.ts +/* @__NO_SIDE_EFFECTS__ */ +function jwsCompact(message$1) { + return { + kind: "validation", + type: "jws_compact", + reference: jwsCompact, + async: false, + expects: null, + requirement: JWS_COMPACT_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "JWS compact", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/length/length.ts +/* @__NO_SIDE_EFFECTS__ */ +function length(requirement, message$1) { + return { + kind: "validation", + type: "length", + reference: length, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length !== this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/ltValue/ltValue.ts +/* @__NO_SIDE_EFFECTS__ */ +function ltValue(requirement, message$1) { + return { + kind: "validation", + type: "lt_value", + reference: ltValue, + async: false, + expects: `<${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value < this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/mac/mac.ts +/* @__NO_SIDE_EFFECTS__ */ +function mac(message$1) { + return { + kind: "validation", + type: "mac", + reference: mac, + async: false, + expects: null, + requirement: MAC_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "MAC", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/mac48/mac48.ts +/* @__NO_SIDE_EFFECTS__ */ +function mac48(message$1) { + return { + kind: "validation", + type: "mac48", + reference: mac48, + async: false, + expects: null, + requirement: MAC48_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "48-bit MAC", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/mac64/mac64.ts +/* @__NO_SIDE_EFFECTS__ */ +function mac64(message$1) { + return { + kind: "validation", + type: "mac64", + reference: mac64, + async: false, + expects: null, + requirement: MAC64_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "64-bit MAC", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/mapItems/mapItems.ts +/* @__NO_SIDE_EFFECTS__ */ +function mapItems(operation) { + return { + kind: "transformation", + type: "map_items", + reference: mapItems, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.map(this.operation); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxBytes/maxBytes.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxBytes(requirement, message$1) { + return { + kind: "validation", + type: "max_bytes", + reference: maxBytes, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 > this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxEntries/maxEntries.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxEntries(requirement, message$1) { + return { + kind: "validation", + type: "max_entries", + reference: maxEntries, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count > this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxGraphemes/maxGraphemes.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxGraphemes(requirement, message$1) { + return { + kind: "validation", + type: "max_graphemes", + reference: maxGraphemes, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count > this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxLength/maxLength.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxLength(requirement, message$1) { + return { + kind: "validation", + type: "max_length", + reference: maxLength, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length > this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxSize/maxSize.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxSize(requirement, message$1) { + return { + kind: "validation", + type: "max_size", + reference: maxSize, + async: false, + expects: `<=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size > this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxValue/maxValue.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxValue(requirement, message$1) { + return { + kind: "validation", + type: "max_value", + reference: maxValue, + async: false, + expects: `<=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value <= this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/maxWords/maxWords.ts +/* @__NO_SIDE_EFFECTS__ */ +function maxWords(locales, requirement, message$1) { + return { + kind: "validation", + type: "max_words", + reference: maxWords, + async: false, + expects: `<=${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count > this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/metadata/metadata.ts +/** +* Creates a custom metadata action. +* +* @param metadata_ The metadata object. +* +* @returns A metadata action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function metadata(metadata_) { + return { + kind: "metadata", + type: "metadata", + reference: metadata, + metadata: metadata_ + }; +} + +//#endregion +//#region src/actions/mimeType/mimeType.ts +/* @__NO_SIDE_EFFECTS__ */ +function mimeType(requirement, message$1) { + return { + kind: "validation", + type: "mime_type", + reference: mimeType, + async: false, + expects: /* @__PURE__ */ _joinExpects(requirement.map((option) => `"${option}"`), "|"), + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.includes(dataset.value.type)) _addIssue(this, "MIME type", dataset, config$1, { received: `"${dataset.value.type}"` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minBytes/minBytes.ts +/* @__NO_SIDE_EFFECTS__ */ +function minBytes(requirement, message$1) { + return { + kind: "validation", + type: "min_bytes", + reference: minBytes, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 < this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minEntries/minEntries.ts +/* @__NO_SIDE_EFFECTS__ */ +function minEntries(requirement, message$1) { + return { + kind: "validation", + type: "min_entries", + reference: minEntries, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count < this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minGraphemes/minGraphemes.ts +/* @__NO_SIDE_EFFECTS__ */ +function minGraphemes(requirement, message$1) { + return { + kind: "validation", + type: "min_graphemes", + reference: minGraphemes, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count < this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minLength/minLength.ts +/* @__NO_SIDE_EFFECTS__ */ +function minLength(requirement, message$1) { + return { + kind: "validation", + type: "min_length", + reference: minLength, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length < this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minSize/minSize.ts +/* @__NO_SIDE_EFFECTS__ */ +function minSize(requirement, message$1) { + return { + kind: "validation", + type: "min_size", + reference: minSize, + async: false, + expects: `>=${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size < this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minValue/minValue.ts +/* @__NO_SIDE_EFFECTS__ */ +function minValue(requirement, message$1) { + return { + kind: "validation", + type: "min_value", + reference: minValue, + async: false, + expects: `>=${requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(dataset.value >= this.requirement)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/minWords/minWords.ts +/* @__NO_SIDE_EFFECTS__ */ +function minWords(locales, requirement, message$1) { + return { + kind: "validation", + type: "min_words", + reference: minWords, + async: false, + expects: `>=${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count < this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/multipleOf/multipleOf.ts +/* @__NO_SIDE_EFFECTS__ */ +function multipleOf(requirement, message$1) { + return { + kind: "validation", + type: "multiple_of", + reference: multipleOf, + async: false, + expects: `%${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value % this.requirement != 0) _addIssue(this, "multiple", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/nanoid/nanoid.ts +/* @__NO_SIDE_EFFECTS__ */ +function nanoid(message$1) { + return { + kind: "validation", + type: "nanoid", + reference: nanoid, + async: false, + expects: null, + requirement: NANO_ID_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "Nano ID", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/nonEmpty/nonEmpty.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonEmpty(message$1) { + return { + kind: "validation", + type: "non_empty", + reference: nonEmpty, + async: false, + expects: "!0", + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length === 0) _addIssue(this, "length", dataset, config$1, { received: "0" }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/normalize/normalize.ts +/* @__NO_SIDE_EFFECTS__ */ +function normalize(form) { + return { + kind: "transformation", + type: "normalize", + reference: normalize, + async: false, + form, + "~run"(dataset) { + dataset.value = dataset.value.normalize(this.form); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notBytes/notBytes.ts +/* @__NO_SIDE_EFFECTS__ */ +function notBytes(requirement, message$1) { + return { + kind: "validation", + type: "not_bytes", + reference: notBytes, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const length$1 = /* @__PURE__ */ _getByteCount(dataset.value); + if (length$1 === this.requirement) _addIssue(this, "bytes", dataset, config$1, { received: `${length$1}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notEntries/notEntries.ts +/* @__NO_SIDE_EFFECTS__ */ +function notEntries(requirement, message$1) { + return { + kind: "validation", + type: "not_entries", + reference: notEntries, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (!dataset.typed) return dataset; + const count = Object.keys(dataset.value).length; + if (dataset.typed && count === this.requirement) _addIssue(this, "entries", dataset, config$1, { received: `${count}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notGraphemes/notGraphemes.ts +/* @__NO_SIDE_EFFECTS__ */ +function notGraphemes(requirement, message$1) { + return { + kind: "validation", + type: "not_graphemes", + reference: notGraphemes, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getGraphemeCount(dataset.value); + if (count === this.requirement) _addIssue(this, "graphemes", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notLength/notLength.ts +/* @__NO_SIDE_EFFECTS__ */ +function notLength(requirement, message$1) { + return { + kind: "validation", + type: "not_length", + reference: notLength, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.length === this.requirement) _addIssue(this, "length", dataset, config$1, { received: `${dataset.value.length}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notSize/notSize.ts +/* @__NO_SIDE_EFFECTS__ */ +function notSize(requirement, message$1) { + return { + kind: "validation", + type: "not_size", + reference: notSize, + async: false, + expects: `!${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size === this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notValue/notValue.ts +/* @__NO_SIDE_EFFECTS__ */ +function notValue(requirement, message$1) { + return { + kind: "validation", + type: "not_value", + reference: notValue, + async: false, + expects: requirement instanceof Date ? `!${requirement.toJSON()}` : `!${/* @__PURE__ */ _stringify(requirement)}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && this.requirement <= dataset.value && this.requirement >= dataset.value) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notValues/notValues.ts +/* @__NO_SIDE_EFFECTS__ */ +function notValues(requirement, message$1) { + return { + kind: "validation", + type: "not_values", + reference: notValues, + async: false, + expects: `!${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), "|")}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && this.requirement.some((value$1) => value$1 <= dataset.value && value$1 >= dataset.value)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/notWords/notWords.ts +/* @__NO_SIDE_EFFECTS__ */ +function notWords(locales, requirement, message$1) { + return { + kind: "validation", + type: "not_words", + reference: notWords, + async: false, + expects: `!${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count === this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/octal/octal.ts +/* @__NO_SIDE_EFFECTS__ */ +function octal(message$1) { + return { + kind: "validation", + type: "octal", + reference: octal, + async: false, + expects: null, + requirement: OCTAL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "octal", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/parseBoolean/parseBoolean.ts +const TRUTHY = [ + true, + 1, + "true", + "1", + "yes", + "y", + "on", + "enabled" +]; +const FALSY = [ + false, + 0, + "false", + "0", + "no", + "n", + "off", + "disabled" +]; +/* @__NO_SIDE_EFFECTS__ */ +function parseBoolean(config$1, message$1) { + const normalize$1 = (v) => typeof v === "string" ? v.toLowerCase() : v; + const truthyRaw = config$1?.truthy ?? TRUTHY; + const falsyRaw = config$1?.falsy ?? FALSY; + const truthy = config$1?.truthy ? config$1.truthy.map(normalize$1) : TRUTHY; + const falsy = config$1?.falsy ? config$1.falsy.map(normalize$1) : FALSY; + return { + kind: "transformation", + type: "parse_boolean", + reference: parseBoolean, + expects: /* @__PURE__ */ _joinExpects([...truthyRaw, ...falsyRaw].map(_stringify), "|"), + config: config$1, + message: message$1, + async: false, + "~run"(dataset, config$2) { + const input = normalize$1(dataset.value); + if (truthy.includes(input)) dataset.value = true; + else if (falsy.includes(input)) dataset.value = false; + else { + _addIssue(this, "boolean", dataset, config$2); + dataset.typed = false; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/parseJson/parseJson.ts +/* @__NO_SIDE_EFFECTS__ */ +function parseJson(config$1, message$1) { + return { + kind: "transformation", + type: "parse_json", + reference: parseJson, + config: config$1, + message: message$1, + async: false, + "~run"(dataset, config$2) { + try { + dataset.value = JSON.parse(dataset.value, this.config?.reviver); + } catch (error) { + if (error instanceof Error) { + _addIssue(this, "JSON", dataset, config$2, { received: `"${error.message}"` }); + dataset.typed = false; + } else throw error; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/partialCheck/utils/_isPartiallyTyped/_isPartiallyTyped.ts +/** +* Checks if a dataset is partially typed. +* +* @param dataset The dataset to check. +* @param paths The paths to check. +* +* @returns Whether it is partially typed. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _isPartiallyTyped(dataset, paths) { + if (dataset.issues) for (const path of paths) for (const issue of dataset.issues) { + let typed = false; + const bound = Math.min(path.length, issue.path?.length ?? 0); + for (let index = 0; index < bound; index++) if (path[index] !== issue.path[index].key && (path[index] !== "$" || issue.path[index].type !== "array")) { + typed = true; + break; + } + if (!typed) return false; + } + return true; +} + +//#endregion +//#region src/actions/partialCheck/partialCheck.ts +/* @__NO_SIDE_EFFECTS__ */ +function partialCheck(paths, requirement, message$1) { + return { + kind: "validation", + type: "partial_check", + reference: partialCheck, + async: false, + expects: null, + paths, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/partialCheck/partialCheckAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function partialCheckAsync(paths, requirement, message$1) { + return { + kind: "validation", + type: "partial_check", + reference: partialCheckAsync, + async: true, + expects: null, + paths, + requirement, + message: message$1, + async "~run"(dataset, config$1) { + if ((dataset.typed || /* @__PURE__ */ _isPartiallyTyped(dataset, paths)) && !await this.requirement(dataset.value)) _addIssue(this, "input", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/rawCheck/rawCheck.ts +/** +* Creates a raw check validation action. +* +* @param action The validation action. +* +* @returns A raw check action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function rawCheck(action) { + return { + kind: "validation", + type: "raw_check", + reference: rawCheck, + async: false, + expects: null, + "~run"(dataset, config$1) { + action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info) + }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/rawCheck/rawCheckAsync.ts +/** +* Creates a raw check validation action. +* +* @param action The validation action. +* +* @returns A raw check action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function rawCheckAsync(action) { + return { + kind: "validation", + type: "raw_check", + reference: rawCheckAsync, + async: true, + expects: null, + async "~run"(dataset, config$1) { + await action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info) + }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/rawTransform/rawTransform.ts +/** +* Creates a raw transformation action. +* +* @param action The transformation action. +* +* @returns A raw transform action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function rawTransform(action) { + return { + kind: "transformation", + type: "raw_transform", + reference: rawTransform, + async: false, + "~run"(dataset, config$1) { + const output = action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info), + NEVER: null + }); + if (dataset.issues) dataset.typed = false; + else dataset.value = output; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/rawTransform/rawTransformAsync.ts +/** +* Creates a raw transformation action. +* +* @param action The transformation action. +* +* @returns A raw transform action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function rawTransformAsync(action) { + return { + kind: "transformation", + type: "raw_transform", + reference: rawTransformAsync, + async: true, + async "~run"(dataset, config$1) { + const output = await action({ + dataset, + config: config$1, + addIssue: (info) => _addIssue(this, info?.label ?? "input", dataset, config$1, info), + NEVER: null + }); + if (dataset.issues) dataset.typed = false; + else dataset.value = output; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/readonly/readonly.ts +/* @__NO_SIDE_EFFECTS__ */ +function readonly() { + return { + kind: "transformation", + type: "readonly", + reference: readonly, + async: false, + "~run"(dataset) { + return dataset; + } + }; +} + +//#endregion +//#region src/actions/reduceItems/reduceItems.ts +/* @__NO_SIDE_EFFECTS__ */ +function reduceItems(operation, initial) { + return { + kind: "transformation", + type: "reduce_items", + reference: reduceItems, + async: false, + operation, + initial, + "~run"(dataset) { + dataset.value = dataset.value.reduce(this.operation, this.initial); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/regex/regex.ts +/* @__NO_SIDE_EFFECTS__ */ +function regex(requirement, message$1) { + return { + kind: "validation", + type: "regex", + reference: regex, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "format", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/returns/returns.ts +/* @__NO_SIDE_EFFECTS__ */ +function returns(schema) { + return { + kind: "transformation", + type: "returns", + reference: returns, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = (...args_) => { + const returnsDataset = this.schema["~run"]({ value: func(...args_) }, config$1); + if (returnsDataset.issues) throw new ValiError(returnsDataset.issues); + return returnsDataset.value; + }; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/returns/returnsAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function returnsAsync(schema) { + return { + kind: "transformation", + type: "returns", + reference: returnsAsync, + async: false, + schema, + "~run"(dataset, config$1) { + const func = dataset.value; + dataset.value = async (...args_) => { + const returnsDataset = await this.schema["~run"]({ value: await func(...args_) }, config$1); + if (returnsDataset.issues) throw new ValiError(returnsDataset.issues); + return returnsDataset.value; + }; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/rfcEmail/rfcEmail.ts +/* @__NO_SIDE_EFFECTS__ */ +function rfcEmail(message$1) { + return { + kind: "validation", + type: "rfc_email", + reference: rfcEmail, + expects: null, + async: false, + requirement: RFC_EMAIL_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "email", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/safeInteger/safeInteger.ts +/* @__NO_SIDE_EFFECTS__ */ +function safeInteger(message$1) { + return { + kind: "validation", + type: "safe_integer", + reference: safeInteger, + async: false, + expects: null, + requirement: Number.isSafeInteger, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "safe integer", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/size/size.ts +/* @__NO_SIDE_EFFECTS__ */ +function size(requirement, message$1) { + return { + kind: "validation", + type: "size", + reference: size, + async: false, + expects: `${requirement}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && dataset.value.size !== this.requirement) _addIssue(this, "size", dataset, config$1, { received: `${dataset.value.size}` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/slug/slug.ts +/* @__NO_SIDE_EFFECTS__ */ +function slug(message$1) { + return { + kind: "validation", + type: "slug", + reference: slug, + async: false, + expects: null, + requirement: SLUG_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "slug", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/someItem/someItem.ts +/* @__NO_SIDE_EFFECTS__ */ +function someItem(requirement, message$1) { + return { + kind: "validation", + type: "some_item", + reference: someItem, + async: false, + expects: null, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.some(this.requirement)) _addIssue(this, "item", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/sortItems/sortItems.ts +/* @__NO_SIDE_EFFECTS__ */ +function sortItems(operation) { + return { + kind: "transformation", + type: "sort_items", + reference: sortItems, + async: false, + operation, + "~run"(dataset) { + dataset.value = dataset.value.sort(this.operation); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/startsWith/startsWith.ts +/* @__NO_SIDE_EFFECTS__ */ +function startsWith(requirement, message$1) { + return { + kind: "validation", + type: "starts_with", + reference: startsWith, + async: false, + expects: `"${requirement}"`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !dataset.value.startsWith(this.requirement)) _addIssue(this, "start", dataset, config$1, { received: `"${dataset.value.slice(0, this.requirement.length)}"` }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/stringifyJson/stringifyJson.ts +/* @__NO_SIDE_EFFECTS__ */ +function stringifyJson(config$1, message$1) { + return { + kind: "transformation", + type: "stringify_json", + reference: stringifyJson, + message: message$1, + config: config$1, + async: false, + "~run"(dataset, config$2) { + try { + const output = JSON.stringify(dataset.value, this.config?.replacer, this.config?.space); + if (output === void 0) { + _addIssue(this, "JSON", dataset, config$2); + dataset.typed = false; + } + dataset.value = output; + } catch (error) { + if (error instanceof Error) { + _addIssue(this, "JSON", dataset, config$2, { received: `"${error.message}"` }); + dataset.typed = false; + } else throw error; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/title/title.ts +/** +* Creates a title metadata action. +* +* @param title_ The title text. +* +* @returns A title action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function title(title_) { + return { + kind: "metadata", + type: "title", + reference: title, + title: title_ + }; +} + +//#endregion +//#region src/actions/toBigint/toBigint.ts +/* @__NO_SIDE_EFFECTS__ */ +function toBigint(message$1) { + return { + kind: "transformation", + type: "to_bigint", + reference: toBigint, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = BigInt(dataset.value); + } catch { + _addIssue(this, "bigint", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toBoolean/toBoolean.ts +/** +* Creates a to boolean transformation action. +* +* @returns A to boolean action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toBoolean() { + return { + kind: "transformation", + type: "to_boolean", + reference: toBoolean, + async: false, + "~run"(dataset) { + dataset.value = Boolean(dataset.value); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toCamelCase/toCamelCase.ts +/** +* Creates a to camel case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `parseUrlValue`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `item2Name`). +* +* @returns A to camel case action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toCamelCase() { + return { + kind: "transformation", + type: "to_camel_case", + reference: toCamelCase, + async: false, + "~run"(dataset) { + dataset.value = /* @__PURE__ */ _formatCase(dataset.value, "", false, true); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toDate/toDate.ts +/* @__NO_SIDE_EFFECTS__ */ +function toDate(message$1) { + return { + kind: "transformation", + type: "to_date", + reference: toDate, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = new Date(dataset.value); + if (isNaN(dataset.value)) { + _addIssue(this, "date", dataset, config$1, { received: "\"Invalid Date\"" }); + dataset.typed = false; + } + } catch { + _addIssue(this, "date", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toKebabCase/toKebabCase.ts +/** +* Creates a to kebab case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `parse-url-value`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `item2-name`). +* +* @returns A to kebab case action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toKebabCase() { + return { + kind: "transformation", + type: "to_kebab_case", + reference: toKebabCase, + async: false, + "~run"(dataset) { + dataset.value = /* @__PURE__ */ _formatCase(dataset.value, "-", false, false); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toLowerCase/toLowerCase.ts +/** +* Creates a to lower case transformation action. +* +* @returns A to lower case action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toLowerCase() { + return { + kind: "transformation", + type: "to_lower_case", + reference: toLowerCase, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.toLowerCase(); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toMaxValue/toMaxValue.ts +/** +* Creates a to max value transformation action. +* +* @param requirement The maximum value. +* +* @returns A to max value action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toMaxValue(requirement) { + return { + kind: "transformation", + type: "to_max_value", + reference: toMaxValue, + async: false, + requirement, + "~run"(dataset) { + dataset.value = dataset.value > this.requirement ? this.requirement : dataset.value; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toMinValue/toMinValue.ts +/** +* Creates a to min value transformation action. +* +* @param requirement The minimum value. +* +* @returns A to min value action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toMinValue(requirement) { + return { + kind: "transformation", + type: "to_min_value", + reference: toMinValue, + async: false, + requirement, + "~run"(dataset) { + dataset.value = dataset.value < this.requirement ? this.requirement : dataset.value; + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toNumber/toNumber.ts +/* @__NO_SIDE_EFFECTS__ */ +function toNumber(message$1) { + return { + kind: "transformation", + type: "to_number", + reference: toNumber, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = Number(dataset.value); + if (isNaN(dataset.value)) { + _addIssue(this, "number", dataset, config$1); + dataset.typed = false; + } + } catch { + _addIssue(this, "number", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toPascalCase/toPascalCase.ts +/** +* Creates a to pascal case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `ParseUrlValue`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `Item2Name`). +* +* @returns A to pascal case action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toPascalCase() { + return { + kind: "transformation", + type: "to_pascal_case", + reference: toPascalCase, + async: false, + "~run"(dataset) { + dataset.value = /* @__PURE__ */ _formatCase(dataset.value, "", true, true); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toSnakeCase/toSnakeCase.ts +/** +* Creates a to snake case transformation action. +* +* Words are separated by `_`, `-` and ASCII whitespace, as well as by case +* and acronym boundaries. +* +* Hint: Acronym runs are normalized to lowercase (e.g. `parseURLValue` → +* `parse_url_value`) and digits stay attached to the preceding token (e.g. +* `item2Name` → `item2_name`). +* +* @returns A to snake case action. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toSnakeCase() { + return { + kind: "transformation", + type: "to_snake_case", + reference: toSnakeCase, + async: false, + "~run"(dataset) { + dataset.value = /* @__PURE__ */ _formatCase(dataset.value, "_", false, false); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toString/toString.ts +/* @__NO_SIDE_EFFECTS__ */ +function toString(message$1) { + return { + kind: "transformation", + type: "to_string", + reference: toString, + async: false, + message: message$1, + "~run"(dataset, config$1) { + try { + dataset.value = String(dataset.value); + } catch { + _addIssue(this, "string", dataset, config$1); + dataset.typed = false; + } + return dataset; + } + }; +} + +//#endregion +//#region src/actions/toUpperCase/toUpperCase.ts +/** +* Creates a to upper case transformation action. +* +* @returns A to upper case action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function toUpperCase() { + return { + kind: "transformation", + type: "to_upper_case", + reference: toUpperCase, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.toUpperCase(); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/transform/transform.ts +/** +* Creates a custom transformation action. +* +* @param operation The transformation operation. +* +* @returns A transform action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function transform(operation) { + return { + kind: "transformation", + type: "transform", + reference: transform, + async: false, + operation, + "~run"(dataset) { + dataset.value = this.operation(dataset.value); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/transform/transformAsync.ts +/** +* Creates a custom transformation action. +* +* @param operation The transformation operation. +* +* @returns A transform action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function transformAsync(operation) { + return { + kind: "transformation", + type: "transform", + reference: transformAsync, + async: true, + operation, + async "~run"(dataset) { + dataset.value = await this.operation(dataset.value); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/trim/trim.ts +/** +* Creates a trim transformation action. +* +* @returns A trim action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function trim() { + return { + kind: "transformation", + type: "trim", + reference: trim, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.trim(); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/trimEnd/trimEnd.ts +/** +* Creates a trim end transformation action. +* +* @returns A trim end action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function trimEnd() { + return { + kind: "transformation", + type: "trim_end", + reference: trimEnd, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.trimEnd(); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/trimStart/trimStart.ts +/** +* Creates a trim start transformation action. +* +* @returns A trim start action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function trimStart() { + return { + kind: "transformation", + type: "trim_start", + reference: trimStart, + async: false, + "~run"(dataset) { + dataset.value = dataset.value.trimStart(); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/ulid/ulid.ts +/* @__NO_SIDE_EFFECTS__ */ +function ulid(message$1) { + return { + kind: "validation", + type: "ulid", + reference: ulid, + async: false, + expects: null, + requirement: ULID_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "ULID", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/url/url.ts +/* @__NO_SIDE_EFFECTS__ */ +function url(message$1) { + return { + kind: "validation", + type: "url", + reference: url, + async: false, + expects: null, + requirement(input) { + try { + new URL(input); + return true; + } catch { + return false; + } + }, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement(dataset.value)) _addIssue(this, "URL", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/uuid/uuid.ts +/* @__NO_SIDE_EFFECTS__ */ +function uuid(message$1) { + return { + kind: "validation", + type: "uuid", + reference: uuid, + async: false, + expects: null, + requirement: UUID_REGEX, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.test(dataset.value)) _addIssue(this, "UUID", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/value/value.ts +/* @__NO_SIDE_EFFECTS__ */ +function value(requirement, message$1) { + return { + kind: "validation", + type: "value", + reference: value, + async: false, + expects: requirement instanceof Date ? requirement.toJSON() : /* @__PURE__ */ _stringify(requirement), + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !(this.requirement <= dataset.value && this.requirement >= dataset.value)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/values/values.ts +/* @__NO_SIDE_EFFECTS__ */ +function values(requirement, message$1) { + return { + kind: "validation", + type: "values", + reference: values, + async: false, + expects: `${/* @__PURE__ */ _joinExpects(requirement.map((value$1) => value$1 instanceof Date ? value$1.toJSON() : /* @__PURE__ */ _stringify(value$1)), "|")}`, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed && !this.requirement.some((value$1) => value$1 <= dataset.value && value$1 >= dataset.value)) _addIssue(this, "value", dataset, config$1, { received: dataset.value instanceof Date ? dataset.value.toJSON() : /* @__PURE__ */ _stringify(dataset.value) }); + return dataset; + } + }; +} + +//#endregion +//#region src/actions/words/words.ts +/* @__NO_SIDE_EFFECTS__ */ +function words(locales, requirement, message$1) { + return { + kind: "validation", + type: "words", + reference: words, + async: false, + expects: `${requirement}`, + locales, + requirement, + message: message$1, + "~run"(dataset, config$1) { + if (dataset.typed) { + const count = /* @__PURE__ */ _getWordCount(this.locales, dataset.value); + if (count !== this.requirement) _addIssue(this, "words", dataset, config$1, { received: `${count}` }); + } + return dataset; + } + }; +} + +//#endregion +//#region src/const.ts +const ABORT_EARLY_CONFIG = { abortEarly: true }; + +//#endregion +//#region src/methods/assert/assert.ts +/** +* Checks if the input matches the schema. As this is an assertion function, it +* can be used as a type guard. +* +* @param schema The schema to be used. +* @param input The input to be tested. +*/ +function assert(schema, input) { + const issues = schema["~run"]({ value: input }, ABORT_EARLY_CONFIG).issues; + if (issues) throw new ValiError(issues); +} + +//#endregion +//#region src/methods/cache/_LruCache.ts +/** +* Efficient LRU cache using Map iteration order. +*/ +var _LruCache = class { + constructor(config$1) { + this.refCount = 0; + this.maxSize = config$1?.maxSize ?? 1e3; + this.maxAge = config$1?.maxAge ?? Infinity; + this.hasMaxAge = isFinite(this.maxAge); + } + /** + * Stringifies an unknown input to a cache key component. + * + * @param input The unknown input. + * + * @returns A cache key component. + */ + stringify(input) { + const type = typeof input; + if (type === "string") return `"${input}"`; + if (type === "number" || type === "boolean") return `${input}`; + if (type === "bigint") return `${input}n`; + if (type === "object" || type === "function") { + if (input) { + this.refIds ?? (this.refIds = /* @__PURE__ */ new WeakMap()); + let id = this.refIds.get(input); + if (!id) { + id = ++this.refCount; + this.refIds.set(input, id); + } + return `#${id}`; + } + return "null"; + } + return type; + } + /** + * Creates a cache key from input and config. + * + * @param input The input value. + * @param config The parse configuration. + * + * @returns The cache key. + */ + key(input, config$1 = {}) { + return `${this.stringify(input)}|${this.stringify(config$1.lang)}|${this.stringify(config$1.message)}|${this.stringify(config$1.abortEarly)}|${this.stringify(config$1.abortPipeEarly)}`; + } + /** + * Gets a value from the cache by key. + * + * @param key The cache key. + * + * @returns The cached value. + */ + get(key) { + if (!this.store) return void 0; + const entry = this.store.get(key); + if (!entry) return void 0; + if (this.hasMaxAge && Date.now() - entry[1] > this.maxAge) { + this.store.delete(key); + return; + } + this.store.delete(key); + this.store.set(key, entry); + return entry[0]; + } + /** + * Sets a value in the cache by key. + * + * @param key The cache key. + * @param value The cached value. + */ + set(key, value$1) { + this.store ?? (this.store = /* @__PURE__ */ new Map()); + this.store.delete(key); + const timestamp = this.hasMaxAge ? Date.now() : 0; + this.store.set(key, [value$1, timestamp]); + if (this.store.size > this.maxSize) this.store.delete(this.store.keys().next().value); + } + /** + * Clears all entries from the cache. + */ + clear() { + this.store?.clear(); + } +}; + +//#endregion +//#region src/methods/cache/cache.ts +/* @__NO_SIDE_EFFECTS__ */ +function cache(schema, config$1) { + return { + ...schema, + cacheConfig: config$1, + cache: new _LruCache(config$1), + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, runConfig) { + const key = this.cache.key(dataset.value, runConfig); + let outputDataset = this.cache.get(key); + if (!outputDataset) this.cache.set(key, outputDataset = schema["~run"](dataset, runConfig)); + return /* @__PURE__ */ _cloneDataset(outputDataset); + } + }; +} + +//#endregion +//#region src/methods/cache/cacheAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function cacheAsync(schema, config$1) { + let activeRuns; + return { + ...schema, + async: true, + cacheConfig: config$1, + cache: new _LruCache(config$1), + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, runConfig) { + const key = this.cache.key(dataset.value, runConfig); + const cached = this.cache.get(key); + if (cached) return /* @__PURE__ */ _cloneDataset(cached); + let promise$1 = activeRuns?.get(key); + if (!promise$1) { + activeRuns ?? (activeRuns = /* @__PURE__ */ new Map()); + promise$1 = Promise.resolve(schema["~run"](dataset, runConfig)); + activeRuns.set(key, promise$1); + } + try { + const outputDataset = await promise$1; + this.cache.set(key, outputDataset); + return /* @__PURE__ */ _cloneDataset(outputDataset); + } finally { + activeRuns?.delete(key); + } + } + }; +} + +//#endregion +//#region src/methods/config/config.ts +/** +* Changes the local configuration of a schema. +* +* @param schema The schema to configure. +* @param config The parse configuration. +* +* @returns The configured schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function config(schema, config$1) { + return { + ...schema, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config_) { + return schema["~run"](dataset, { + ...config_, + ...config$1 + }); + } + }; +} + +//#endregion +//#region src/methods/getFallback/getFallback.ts +/** +* Returns the fallback value of the schema. +* +* @param schema The schema to get it from. +* @param dataset The output dataset if available. +* @param config The config if available. +* +* @returns The fallback value. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getFallback(schema, dataset, config$1) { + return typeof schema.fallback === "function" ? schema.fallback(dataset, config$1) : schema.fallback; +} + +//#endregion +//#region src/methods/fallback/fallback.ts +/** +* Returns a fallback value as output if the input does not match the schema. +* +* @param schema The schema to catch. +* @param fallback The fallback value. +* +* @returns The passed schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function fallback(schema, fallback$1) { + return { + ...schema, + fallback: fallback$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const outputDataset = schema["~run"](dataset, config$1); + return outputDataset.issues ? { + typed: true, + value: /* @__PURE__ */ getFallback(this, outputDataset, config$1) + } : outputDataset; + } + }; +} + +//#endregion +//#region src/methods/fallback/fallbackAsync.ts +/** +* Returns a fallback value as output if the input does not match the schema. +* +* @param schema The schema to catch. +* @param fallback The fallback value. +* +* @returns The passed schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function fallbackAsync(schema, fallback$1) { + return { + ...schema, + fallback: fallback$1, + async: true, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const outputDataset = await schema["~run"](dataset, config$1); + return outputDataset.issues ? { + typed: true, + value: await /* @__PURE__ */ getFallback(this, outputDataset, config$1) + } : outputDataset; + } + }; +} + +//#endregion +//#region src/methods/flatten/flatten.ts +/* @__NO_SIDE_EFFECTS__ */ +function flatten(issues) { + const flatErrors = {}; + for (const issue of issues) if (issue.path) { + const dotPath = /* @__PURE__ */ getDotPath(issue); + if (dotPath) { + if (!flatErrors.nested) flatErrors.nested = {}; + if (Object.prototype.hasOwnProperty.call(flatErrors.nested, dotPath)) flatErrors.nested[dotPath].push(issue.message); + else flatErrors.nested[dotPath] = [issue.message]; + } else if (flatErrors.other) flatErrors.other.push(issue.message); + else flatErrors.other = [issue.message]; + } else if (flatErrors.root) flatErrors.root.push(issue.message); + else flatErrors.root = [issue.message]; + return flatErrors; +} + +//#endregion +//#region src/methods/forward/forward.ts +/** +* Forwards the issues of the passed validation action. +* +* @param action The validation action. +* @param path The path to forward the issues to. +* +* @returns The modified action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function forward(action, path) { + return { + ...action, + "~run"(dataset, config$1) { + const prevIssues = dataset.issues && [...dataset.issues]; + dataset = action["~run"](dataset, config$1); + if (dataset.issues) { + for (const issue of dataset.issues) if (!prevIssues?.includes(issue)) { + let pathInput = dataset.value; + for (const key of path) { + const pathValue = pathInput[key]; + const pathItem = { + type: "unknown", + origin: "value", + input: pathInput, + key, + value: pathValue + }; + if (issue.path) issue.path.push(pathItem); + else issue.path = [pathItem]; + if (!pathValue) break; + pathInput = pathValue; + } + } + } + return dataset; + } + }; +} + +//#endregion +//#region src/methods/forward/forwardAsync.ts +/** +* Forwards the issues of the passed validation action. +* +* @param action The validation action. +* @param path The path to forward the issues to. +* +* @returns The modified action. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function forwardAsync(action, path) { + return { + ...action, + async: true, + async "~run"(dataset, config$1) { + const prevIssues = dataset.issues && [...dataset.issues]; + dataset = await action["~run"](dataset, config$1); + if (dataset.issues) { + for (const issue of dataset.issues) if (!prevIssues?.includes(issue)) { + let pathInput = dataset.value; + for (const key of path) { + const pathValue = pathInput[key]; + const pathItem = { + type: "unknown", + origin: "value", + input: pathInput, + key, + value: pathValue + }; + if (issue.path) issue.path.push(pathItem); + else issue.path = [pathItem]; + if (!pathValue) break; + pathInput = pathValue; + } + } + } + return dataset; + } + }; +} + +//#endregion +//#region src/methods/getDefault/getDefault.ts +/** +* Returns the default value of the schema. +* +* @param schema The schema to get it from. +* @param dataset The input dataset if available. +* @param config The config if available. +* +* @returns The default value. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getDefault(schema, dataset, config$1) { + return typeof schema.default === "function" ? schema.default(dataset, config$1) : schema.default; +} + +//#endregion +//#region src/methods/getDefaults/getDefaults.ts +/** +* Returns the default values of the schema. +* +* Hint: The difference to `getDefault` is that for object and tuple schemas +* this function recursively returns the default values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The default values. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getDefaults(schema) { + if ("entries" in schema) { + const object$1 = {}; + for (const key in schema.entries) object$1[key] = /* @__PURE__ */ getDefaults(schema.entries[key]); + return object$1; + } + if ("items" in schema) return schema.items.map(getDefaults); + return /* @__PURE__ */ getDefault(schema); +} + +//#endregion +//#region src/methods/getDefaults/getDefaultsAsync.ts +/** +* Returns the default values of the schema. +* +* Hint: The difference to `getDefault` is that for object and tuple schemas +* this function recursively returns the default values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The default values. +*/ +/* @__NO_SIDE_EFFECTS__ */ +async function getDefaultsAsync(schema) { + if ("entries" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getDefaultsAsync(value$1)]))); + if ("items" in schema) return Promise.all(schema.items.map(getDefaultsAsync)); + return /* @__PURE__ */ getDefault(schema); +} + +//#endregion +//#region src/methods/getDescription/getDescription.ts +/** +* Returns the description of the schema. +* +* If multiple descriptions are defined, the last one of the highest level is +* returned. If no description is defined, `undefined` is returned. +* +* @param schema The schema to get the description from. +* +* @returns The description, if any. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getDescription(schema) { + return /* @__PURE__ */ _getLastMetadata(schema, "description"); +} + +//#endregion +//#region src/methods/getExamples/getExamples.ts +/** +* Returns the examples of a schema. +* +* If multiple examples are defined, it concatenates them using depth-first +* search. If no examples are defined, an empty array is returned. +* +* @param schema The schema to get the examples from. +* +* @returns The examples, if any. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getExamples(schema) { + const examples$1 = []; + function depthFirstCollect(schema$1) { + if ("pipe" in schema$1) { + for (const item of schema$1.pipe) if (item.kind === "schema" && "pipe" in item) depthFirstCollect(item); + else if (item.kind === "metadata" && item.type === "examples") for (const example of item.examples) examples$1.push(example); + } + } + depthFirstCollect(schema); + return examples$1; +} + +//#endregion +//#region src/methods/getFallbacks/getFallbacks.ts +/** +* Returns the fallback values of the schema. +* +* Hint: The difference to `getFallback` is that for object and tuple schemas +* this function recursively returns the fallback values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The fallback values. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getFallbacks(schema) { + if ("entries" in schema) { + const object$1 = {}; + for (const key in schema.entries) object$1[key] = /* @__PURE__ */ getFallbacks(schema.entries[key]); + return object$1; + } + if ("items" in schema) return schema.items.map(getFallbacks); + return /* @__PURE__ */ getFallback(schema); +} + +//#endregion +//#region src/methods/getFallbacks/getFallbacksAsync.ts +/** +* Returns the fallback values of the schema. +* +* Hint: The difference to `getFallback` is that for object and tuple schemas +* this function recursively returns the fallback values of the subschemas +* instead of `undefined`. +* +* @param schema The schema to get them from. +* +* @returns The fallback values. +*/ +/* @__NO_SIDE_EFFECTS__ */ +async function getFallbacksAsync(schema) { + if ("entries" in schema) return Object.fromEntries(await Promise.all(Object.entries(schema.entries).map(async ([key, value$1]) => [key, await /* @__PURE__ */ getFallbacksAsync(value$1)]))); + if ("items" in schema) return Promise.all(schema.items.map(getFallbacksAsync)); + return /* @__PURE__ */ getFallback(schema); +} + +//#endregion +//#region src/methods/getMetadata/getMetadata.ts +/** +* Returns the metadata of a schema. +* +* If multiple metadata are defined, it shallowly merges them using depth-first +* search. If no metadata is defined, an empty object is returned. +* +* @param schema Schema to get the metadata from. +* +* @returns The metadata, if any. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getMetadata(schema) { + const result = {}; + function depthFirstMerge(schema$1) { + if ("pipe" in schema$1) { + for (const item of schema$1.pipe) if (item.kind === "schema" && "pipe" in item) depthFirstMerge(item); + else if (item.kind === "metadata" && item.type === "metadata") Object.assign(result, item.metadata); + } + } + depthFirstMerge(schema); + return result; +} + +//#endregion +//#region src/methods/getTitle/getTitle.ts +/** +* Returns the title of the schema. +* +* If multiple titles are defined, the last one of the highest level is +* returned. If no title is defined, `undefined` is returned. +* +* @param schema The schema to get the title from. +* +* @returns The title, if any. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function getTitle(schema) { + return /* @__PURE__ */ _getLastMetadata(schema, "title"); +} + +//#endregion +//#region src/methods/is/is.ts +/** +* Checks if the input matches the schema. By using a type predicate, this +* function can be used as a type guard. +* +* @param schema The schema to be used. +* @param input The input to be tested. +* +* @returns Whether the input matches the schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function is(schema, input) { + return !schema["~run"]({ value: input }, ABORT_EARLY_CONFIG).issues; +} + +//#endregion +//#region src/schemas/any/any.ts +/** +* Creates an any schema. +* +* Hint: This schema function exists only for completeness and is not +* recommended in practice. Instead, `unknown` should be used to accept +* unknown data. +* +* @returns An any schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function any() { + return { + kind: "schema", + type: "any", + reference: any, + expects: "any", + async: false, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset) { + dataset.typed = true; + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/array/array.ts +/* @__NO_SIDE_EFFECTS__ */ +function array(item, message$1) { + return { + kind: "schema", + type: "array", + reference: array, + expects: "Array", + async: false, + item, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < input.length; key++) { + const value$1 = input[key]; + const itemDataset = this.item["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/array/arrayAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function arrayAsync(item, message$1) { + return { + kind: "schema", + type: "array", + reference: arrayAsync, + expects: "Array", + async: true, + item, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(input.map((value$1) => this.item["~run"]({ value: value$1 }, config$1))); + for (let key = 0; key < itemDatasets.length; key++) { + const itemDataset = itemDatasets[key]; + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: input[key] + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/bigint/bigint.ts +/* @__NO_SIDE_EFFECTS__ */ +function bigint(message$1) { + return { + kind: "schema", + type: "bigint", + reference: bigint, + expects: "bigint", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "bigint") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/blob/blob.ts +/* @__NO_SIDE_EFFECTS__ */ +function blob(message$1) { + return { + kind: "schema", + type: "blob", + reference: blob, + expects: "Blob", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof Blob) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/boolean/boolean.ts +/* @__NO_SIDE_EFFECTS__ */ +function boolean(message$1) { + return { + kind: "schema", + type: "boolean", + reference: boolean, + expects: "boolean", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "boolean") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/custom/custom.ts +/* @__NO_SIDE_EFFECTS__ */ +function custom(check$1, message$1) { + return { + kind: "schema", + type: "custom", + reference: custom, + expects: "unknown", + async: false, + check: check$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.check(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/custom/customAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function customAsync(check$1, message$1) { + return { + kind: "schema", + type: "custom", + reference: customAsync, + expects: "unknown", + async: true, + check: check$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (await this.check(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/date/date.ts +/* @__NO_SIDE_EFFECTS__ */ +function date(message$1) { + return { + kind: "schema", + type: "date", + reference: date, + expects: "Date", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof Date) if (!isNaN(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1, { received: "\"Invalid Date\"" }); + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/enum/enum.ts +/* @__NO_SIDE_EFFECTS__ */ +function enum_(enum__, message$1) { + const options = []; + for (const key in enum__) if (`${+key}` !== key || typeof enum__[key] !== "string" || !Object.is(enum__[enum__[key]], +key)) options.push(enum__[key]); + return { + kind: "schema", + type: "enum", + reference: enum_, + expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"), + async: false, + enum: enum__, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.options.includes(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/exactOptional/exactOptional.ts +/* @__NO_SIDE_EFFECTS__ */ +function exactOptional(wrapped, default_) { + return { + kind: "schema", + type: "exact_optional", + reference: exactOptional, + expects: wrapped.expects, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/exactOptional/exactOptionalAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function exactOptionalAsync(wrapped, default_) { + return { + kind: "schema", + type: "exact_optional", + reference: exactOptionalAsync, + expects: wrapped.expects, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/file/file.ts +/* @__NO_SIDE_EFFECTS__ */ +function file(message$1) { + return { + kind: "schema", + type: "file", + reference: file, + expects: "File", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof File) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/function/function.ts +/* @__NO_SIDE_EFFECTS__ */ +function function_(message$1) { + return { + kind: "schema", + type: "function", + reference: function_, + expects: "Function", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "function") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/instance/instance.ts +/* @__NO_SIDE_EFFECTS__ */ +function instance(class_, message$1) { + return { + kind: "schema", + type: "instance", + reference: instance, + expects: class_.name, + async: false, + class: class_, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof this.class) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/intersect/utils/_merge/_merge.ts +/** +* Merges two values into one single output. +* +* @param value1 First value. +* @param value2 Second value. +* +* @returns The merge dataset. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _merge(value1, value2) { + if (typeof value1 === typeof value2) { + if (value1 === value2 || value1 instanceof Date && value2 instanceof Date && +value1 === +value2) return { value: value1 }; + if (value1 && value2 && value1.constructor === Object && value2.constructor === Object) { + const nextValue = { ...value1 }; + for (const key in value2) if (Object.prototype.hasOwnProperty.call(value1, key)) { + const dataset = /* @__PURE__ */ _merge(value1[key], value2[key]); + if (dataset.issue) return dataset; + nextValue[key] = dataset.value; + } else nextValue[key] = value2[key]; + return { value: nextValue }; + } + if (Array.isArray(value1) && Array.isArray(value2)) { + if (value1.length === value2.length) { + const nextValue = [...value1]; + for (let index = 0; index < value1.length; index++) { + const dataset = /* @__PURE__ */ _merge(value1[index], value2[index]); + if (dataset.issue) return dataset; + nextValue[index] = dataset.value; + } + return { value: nextValue }; + } + } + } + return { issue: true }; +} + +//#endregion +//#region src/schemas/intersect/intersect.ts +/* @__NO_SIDE_EFFECTS__ */ +function intersect(options, message$1) { + return { + kind: "schema", + type: "intersect", + reference: intersect, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "&"), + async: false, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.options.length) { + const input = dataset.value; + let outputs; + dataset.typed = true; + for (const schema of this.options) { + const optionDataset = schema["~run"]({ value: input }, config$1); + if (optionDataset.issues) { + if (dataset.issues) for (const issue of optionDataset.issues) dataset.issues.push(issue); + else dataset.issues = optionDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!optionDataset.typed) dataset.typed = false; + if (dataset.typed) if (outputs) outputs.push(optionDataset.value); + else outputs = [optionDataset.value]; + } + if (dataset.typed) { + dataset.value = outputs[0]; + for (let index = 1; index < outputs.length; index++) { + const mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index]); + if (mergeDataset.issue) { + _addIssue(this, "type", dataset, config$1, { received: "unknown" }); + break; + } + dataset.value = mergeDataset.value; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/intersect/intersectAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function intersectAsync(options, message$1) { + return { + kind: "schema", + type: "intersect", + reference: intersectAsync, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "&"), + async: true, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (this.options.length) { + const input = dataset.value; + let outputs; + dataset.typed = true; + const optionDatasets = await Promise.all(this.options.map((schema) => schema["~run"]({ value: input }, config$1))); + for (const optionDataset of optionDatasets) { + if (optionDataset.issues) { + if (dataset.issues) for (const issue of optionDataset.issues) dataset.issues.push(issue); + else dataset.issues = optionDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!optionDataset.typed) dataset.typed = false; + if (dataset.typed) if (outputs) outputs.push(optionDataset.value); + else outputs = [optionDataset.value]; + } + if (dataset.typed) { + dataset.value = outputs[0]; + for (let index = 1; index < outputs.length; index++) { + const mergeDataset = /* @__PURE__ */ _merge(dataset.value, outputs[index]); + if (mergeDataset.issue) { + _addIssue(this, "type", dataset, config$1, { received: "unknown" }); + break; + } + dataset.value = mergeDataset.value; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/lazy/lazy.ts +/** +* Creates a lazy schema. +* +* @param getter The schema getter. +* +* @returns A lazy schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function lazy(getter) { + return { + kind: "schema", + type: "lazy", + reference: lazy, + expects: "unknown", + async: false, + getter, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + return this.getter(dataset.value)["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/lazy/lazyAsync.ts +/** +* Creates a lazy schema. +* +* @param getter The schema getter. +* +* @returns A lazy schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function lazyAsync(getter) { + return { + kind: "schema", + type: "lazy", + reference: lazyAsync, + expects: "unknown", + async: true, + getter, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + return (await this.getter(dataset.value))["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/literal/literal.ts +/* @__NO_SIDE_EFFECTS__ */ +function literal(literal_, message$1) { + return { + kind: "schema", + type: "literal", + reference: literal, + expects: /* @__PURE__ */ _stringify(literal_), + async: false, + literal: literal_, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === this.literal) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/looseObject/looseObject.ts +/* @__NO_SIDE_EFFECTS__ */ +function looseObject(entries$1, message$1) { + return { + kind: "schema", + type: "loose_object", + reference: looseObject, + expects: "Object", + async: false, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key]; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/looseObject/looseObjectAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function looseObjectAsync(entries$1, message$1) { + return { + kind: "schema", + type: "loose_object", + reference: looseObjectAsync, + expects: "Object", + async: true, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })); + for (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key]; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/looseTuple/looseTuple.ts +/* @__NO_SIDE_EFFECTS__ */ +function looseTuple(items, message$1) { + return { + kind: "schema", + type: "loose_tuple", + reference: looseTuple, + expects: "Array", + async: false, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/looseTuple/looseTupleAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function looseTupleAsync(items, message$1) { + return { + kind: "schema", + type: "loose_tuple", + reference: looseTupleAsync, + expects: "Array", + async: true, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })); + for (const [key, value$1, itemDataset] of itemDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) dataset.value.push(input[key]); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/map/map.ts +/* @__NO_SIDE_EFFECTS__ */ +function map(key, value$1, message$1) { + return { + kind: "schema", + type: "map", + reference: map, + expects: "Map", + async: false, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Map) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Map(); + for (const [inputKey, inputValue] of input) { + const keyDataset = this.key["~run"]({ value: inputKey }, config$1); + if (keyDataset.issues) { + const pathItem = { + type: "map", + origin: "key", + input, + key: inputKey, + value: inputValue + }; + for (const issue of keyDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + const valueDataset = this.value["~run"]({ value: inputValue }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "map", + origin: "value", + input, + key: inputKey, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + dataset.value.set(keyDataset.value, valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/map/mapAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function mapAsync(key, value$1, message$1) { + return { + kind: "schema", + type: "map", + reference: mapAsync, + expects: "Map", + async: true, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Map) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Map(); + const datasets = await Promise.all([...input].map(([inputKey, inputValue]) => Promise.all([ + inputKey, + inputValue, + this.key["~run"]({ value: inputKey }, config$1), + this.value["~run"]({ value: inputValue }, config$1) + ]))); + for (const [inputKey, inputValue, keyDataset, valueDataset] of datasets) { + if (keyDataset.issues) { + const pathItem = { + type: "map", + origin: "key", + input, + key: inputKey, + value: inputValue + }; + for (const issue of keyDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (valueDataset.issues) { + const pathItem = { + type: "map", + origin: "value", + input, + key: inputKey, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + dataset.value.set(keyDataset.value, valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nan/nan.ts +/* @__NO_SIDE_EFFECTS__ */ +function nan(message$1) { + return { + kind: "schema", + type: "nan", + reference: nan, + expects: "NaN", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (Number.isNaN(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/never/never.ts +/* @__NO_SIDE_EFFECTS__ */ +function never(message$1) { + return { + kind: "schema", + type: "never", + reference: never, + expects: "never", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nonNullable/nonNullable.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonNullable(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullable", + reference: nonNullable, + expects: "!null", + async: false, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value !== null) dataset = this.wrapped["~run"](dataset, config$1); + if (dataset.value === null) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nonNullable/nonNullableAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonNullableAsync(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullable", + reference: nonNullableAsync, + expects: "!null", + async: true, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value !== null) dataset = await this.wrapped["~run"](dataset, config$1); + if (dataset.value === null) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nonNullish/nonNullish.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonNullish(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullish", + reference: nonNullish, + expects: "(!null & !undefined)", + async: false, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (!(dataset.value === null || dataset.value === void 0)) dataset = this.wrapped["~run"](dataset, config$1); + if (dataset.value === null || dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nonNullish/nonNullishAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonNullishAsync(wrapped, message$1) { + return { + kind: "schema", + type: "non_nullish", + reference: nonNullishAsync, + expects: "(!null & !undefined)", + async: true, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (!(dataset.value === null || dataset.value === void 0)) dataset = await this.wrapped["~run"](dataset, config$1); + if (dataset.value === null || dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nonOptional/nonOptional.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonOptional(wrapped, message$1) { + return { + kind: "schema", + type: "non_optional", + reference: nonOptional, + expects: "!undefined", + async: false, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value !== void 0) dataset = this.wrapped["~run"](dataset, config$1); + if (dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nonOptional/nonOptionalAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function nonOptionalAsync(wrapped, message$1) { + return { + kind: "schema", + type: "non_optional", + reference: nonOptionalAsync, + expects: "!undefined", + async: true, + wrapped, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value !== void 0) dataset = await this.wrapped["~run"](dataset, config$1); + if (dataset.value === void 0) _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/null/null.ts +/* @__NO_SIDE_EFFECTS__ */ +function null_(message$1) { + return { + kind: "schema", + type: "null", + reference: null_, + expects: "null", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === null) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/nullable/nullable.ts +/* @__NO_SIDE_EFFECTS__ */ +function nullable(wrapped, default_) { + return { + kind: "schema", + type: "nullable", + reference: nullable, + expects: `(${wrapped.expects} | null)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === null) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/nullable/nullableAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function nullableAsync(wrapped, default_) { + return { + kind: "schema", + type: "nullable", + reference: nullableAsync, + expects: `(${wrapped.expects} | null)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === null) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/nullish/nullish.ts +/* @__NO_SIDE_EFFECTS__ */ +function nullish(wrapped, default_) { + return { + kind: "schema", + type: "nullish", + reference: nullish, + expects: `(${wrapped.expects} | null | undefined)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === null || dataset.value === void 0) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null || dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/nullish/nullishAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function nullishAsync(wrapped, default_) { + return { + kind: "schema", + type: "nullish", + reference: nullishAsync, + expects: `(${wrapped.expects} | null | undefined)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === null || dataset.value === void 0) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === null || dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/number/number.ts +/* @__NO_SIDE_EFFECTS__ */ +function number(message$1) { + return { + kind: "schema", + type: "number", + reference: number, + expects: "number", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "number" && !isNaN(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/object/object.ts +/* @__NO_SIDE_EFFECTS__ */ +function object(entries$1, message$1) { + return { + kind: "schema", + type: "object", + reference: object, + expects: "Object", + async: false, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/object/objectAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function objectAsync(entries$1, message$1) { + return { + kind: "schema", + type: "object", + reference: objectAsync, + expects: "Object", + async: true, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })); + for (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/objectWithRest/objectWithRest.ts +/* @__NO_SIDE_EFFECTS__ */ +function objectWithRest(entries$1, rest, message$1) { + return { + kind: "schema", + type: "object_with_rest", + reference: objectWithRest, + expects: "Object", + async: false, + entries: entries$1, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (/* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)) { + const valueDataset = this.rest["~run"]({ value: input[key] }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: input[key] + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/objectWithRest/objectWithRestAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function objectWithRestAsync(entries$1, rest, message$1) { + return { + kind: "schema", + type: "object_with_rest", + reference: objectWithRestAsync, + expects: "Object", + async: true, + entries: entries$1, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const [normalDatasets, restDatasets] = await Promise.all([Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })), Promise.all(Object.entries(input).filter(([key]) => /* @__PURE__ */ _isValidObjectKey(input, key) && !(key in this.entries)).map(async ([key, value$1]) => [ + key, + value$1, + await this.rest["~run"]({ value: value$1 }, config$1) + ]))]); + for (const [key, value$1, valueSchema, valueDataset] of normalDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + if (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, valueDataset] of restDatasets) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/optional/optional.ts +/* @__NO_SIDE_EFFECTS__ */ +function optional(wrapped, default_) { + return { + kind: "schema", + type: "optional", + reference: optional, + expects: `(${wrapped.expects} | undefined)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/optional/optionalAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function optionalAsync(wrapped, default_) { + return { + kind: "schema", + type: "optional", + reference: optionalAsync, + expects: `(${wrapped.expects} | undefined)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/picklist/picklist.ts +/* @__NO_SIDE_EFFECTS__ */ +function picklist(options, message$1) { + return { + kind: "schema", + type: "picklist", + reference: picklist, + expects: /* @__PURE__ */ _joinExpects(options.map(_stringify), "|"), + async: false, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (this.options.includes(dataset.value)) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/promise/promise.ts +/* @__NO_SIDE_EFFECTS__ */ +function promise(message$1) { + return { + kind: "schema", + type: "promise", + reference: promise, + expects: "Promise", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value instanceof Promise) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/record/record.ts +/* @__NO_SIDE_EFFECTS__ */ +function record(key, value$1, message$1) { + return { + kind: "schema", + type: "record", + reference: record, + expects: "Object", + async: false, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const entryKey in input) if (/* @__PURE__ */ _isValidObjectKey(input, entryKey)) { + const entryValue = input[entryKey]; + const keyDataset = this.key["~run"]({ value: entryKey }, config$1); + if (keyDataset.issues) { + const pathItem = { + type: "object", + origin: "key", + input, + key: entryKey, + value: entryValue + }; + for (const issue of keyDataset.issues) { + issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + const valueDataset = this.value["~run"]({ value: entryValue }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key: entryKey, + value: entryValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/record/recordAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function recordAsync(key, value$1, message$1) { + return { + kind: "schema", + type: "record", + reference: recordAsync, + expects: "Object", + async: true, + key, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const datasets = await Promise.all(Object.entries(input).filter(([key$1]) => /* @__PURE__ */ _isValidObjectKey(input, key$1)).map(([entryKey, entryValue]) => Promise.all([ + entryKey, + entryValue, + this.key["~run"]({ value: entryKey }, config$1), + this.value["~run"]({ value: entryValue }, config$1) + ]))); + for (const [entryKey, entryValue, keyDataset, valueDataset] of datasets) { + if (keyDataset.issues) { + const pathItem = { + type: "object", + origin: "key", + input, + key: entryKey, + value: entryValue + }; + for (const issue of keyDataset.issues) { + issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = keyDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key: entryKey, + value: entryValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!keyDataset.typed || !valueDataset.typed) dataset.typed = false; + if (keyDataset.typed) dataset.value[keyDataset.value] = valueDataset.value; + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/set/set.ts +/* @__NO_SIDE_EFFECTS__ */ +function set(value$1, message$1) { + return { + kind: "schema", + type: "set", + reference: set, + expects: "Set", + async: false, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Set) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Set(); + for (const inputValue of input) { + const valueDataset = this.value["~run"]({ value: inputValue }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "set", + origin: "value", + input, + key: null, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value.add(valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/set/setAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function setAsync(value$1, message$1) { + return { + kind: "schema", + type: "set", + reference: setAsync, + expects: "Set", + async: true, + value: value$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input instanceof Set) { + dataset.typed = true; + dataset.value = /* @__PURE__ */ new Set(); + const valueDatasets = await Promise.all([...input].map(async (inputValue) => [inputValue, await this.value["~run"]({ value: inputValue }, config$1)])); + for (const [inputValue, valueDataset] of valueDatasets) { + if (valueDataset.issues) { + const pathItem = { + type: "set", + origin: "value", + input, + key: null, + value: inputValue + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value.add(valueDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/strictObject/strictObject.ts +/* @__NO_SIDE_EFFECTS__ */ +function strictObject(entries$1, message$1) { + return { + kind: "schema", + type: "strict_object", + reference: strictObject, + expects: "Object", + async: false, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + for (const key in this.entries) { + const valueSchema = this.entries[key]; + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : /* @__PURE__ */ getDefault(valueSchema); + const valueDataset = valueSchema["~run"]({ value: value$1 }, config$1); + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + if (config$1.abortEarly) break; + } + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (!(key in this.entries)) { + _addIssue(this, "key", dataset, config$1, { + input: key, + expected: "never", + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + break; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/strictObject/strictObjectAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function strictObjectAsync(entries$1, message$1) { + return { + kind: "schema", + type: "strict_object", + reference: strictObjectAsync, + expects: "Object", + async: true, + entries: entries$1, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + dataset.typed = true; + dataset.value = {}; + const valueDatasets = await Promise.all(Object.entries(this.entries).map(async ([key, valueSchema]) => { + if (key in input || (valueSchema.type === "exact_optional" || valueSchema.type === "optional" || valueSchema.type === "nullish") && valueSchema.default !== void 0) { + const value$1 = key in input ? input[key] : await /* @__PURE__ */ getDefault(valueSchema); + return [ + key, + value$1, + valueSchema, + await valueSchema["~run"]({ value: value$1 }, config$1) + ]; + } + return [ + key, + input[key], + valueSchema, + null + ]; + })); + for (const [key, value$1, valueSchema, valueDataset] of valueDatasets) if (valueDataset) { + if (valueDataset.issues) { + const pathItem = { + type: "object", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of valueDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = valueDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!valueDataset.typed) dataset.typed = false; + dataset.value[key] = valueDataset.value; + } else if (valueSchema.fallback !== void 0) dataset.value[key] = await /* @__PURE__ */ getFallback(valueSchema); + else if (valueSchema.type !== "exact_optional" && valueSchema.type !== "optional" && valueSchema.type !== "nullish") { + _addIssue(this, "key", dataset, config$1, { + input: void 0, + expected: `"${key}"`, + path: [{ + type: "object", + origin: "key", + input, + key, + value: value$1 + }] + }); + if (config$1.abortEarly) break; + } + if (!dataset.issues || !config$1.abortEarly) { + for (const key in input) if (!(key in this.entries)) { + _addIssue(this, "key", dataset, config$1, { + input: key, + expected: "never", + path: [{ + type: "object", + origin: "key", + input, + key, + value: input[key] + }] + }); + break; + } + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/strictTuple/strictTuple.ts +/* @__NO_SIDE_EFFECTS__ */ +function strictTuple(items, message$1) { + return { + kind: "schema", + type: "strict_tuple", + reference: strictTuple, + expects: "Array", + async: false, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, "type", dataset, config$1, { + input: input[this.items.length], + expected: "never", + path: [{ + type: "array", + origin: "value", + input, + key: this.items.length, + value: input[this.items.length] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/strictTuple/strictTupleAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function strictTupleAsync(items, message$1) { + return { + kind: "schema", + type: "strict_tuple", + reference: strictTupleAsync, + expects: "Array", + async: true, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })); + for (const [key, value$1, itemDataset] of itemDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!(dataset.issues && config$1.abortEarly) && this.items.length < input.length) _addIssue(this, "type", dataset, config$1, { + input: input[this.items.length], + expected: "never", + path: [{ + type: "array", + origin: "value", + input, + key: this.items.length, + value: input[this.items.length] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/string/string.ts +/* @__NO_SIDE_EFFECTS__ */ +function string(message$1) { + return { + kind: "schema", + type: "string", + reference: string, + expects: "string", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "string") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/symbol/symbol.ts +/* @__NO_SIDE_EFFECTS__ */ +function symbol(message$1) { + return { + kind: "schema", + type: "symbol", + reference: symbol, + expects: "symbol", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (typeof dataset.value === "symbol") dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/tuple/tuple.ts +/* @__NO_SIDE_EFFECTS__ */ +function tuple(items, message$1) { + return { + kind: "schema", + type: "tuple", + reference: tuple, + expects: "Array", + async: false, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/tuple/tupleAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function tupleAsync(items, message$1) { + return { + kind: "schema", + type: "tuple", + reference: tupleAsync, + expects: "Array", + async: true, + items, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const itemDatasets = await Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })); + for (const [key, value$1, itemDataset] of itemDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/tupleWithRest/tupleWithRest.ts +/* @__NO_SIDE_EFFECTS__ */ +function tupleWithRest(items, rest, message$1) { + return { + kind: "schema", + type: "tuple_with_rest", + reference: tupleWithRest, + expects: "Array", + async: false, + items, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + for (let key = 0; key < this.items.length; key++) { + const value$1 = input[key]; + const itemDataset = this.items[key]["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (let key = this.items.length; key < input.length; key++) { + const value$1 = input[key]; + const itemDataset = this.rest["~run"]({ value: value$1 }, config$1); + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/tupleWithRest/tupleWithRestAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function tupleWithRestAsync(items, rest, message$1) { + return { + kind: "schema", + type: "tuple_with_rest", + reference: tupleWithRestAsync, + expects: "Array", + async: true, + items, + rest, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (Array.isArray(input)) { + dataset.typed = true; + dataset.value = []; + const [normalDatasets, restDatasets] = await Promise.all([Promise.all(this.items.map(async (item, key) => { + const value$1 = input[key]; + return [ + key, + value$1, + await item["~run"]({ value: value$1 }, config$1) + ]; + })), Promise.all(input.slice(this.items.length).map(async (value$1, key) => { + return [ + key + this.items.length, + value$1, + await this.rest["~run"]({ value: value$1 }, config$1) + ]; + }))]); + for (const [key, value$1, itemDataset] of normalDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + if (!dataset.issues || !config$1.abortEarly) for (const [key, value$1, itemDataset] of restDatasets) { + if (itemDataset.issues) { + const pathItem = { + type: "array", + origin: "value", + input, + key, + value: value$1 + }; + for (const issue of itemDataset.issues) { + if (issue.path) issue.path.unshift(pathItem); + else issue.path = [pathItem]; + dataset.issues?.push(issue); + } + if (!dataset.issues) dataset.issues = itemDataset.issues; + if (config$1.abortEarly) { + dataset.typed = false; + break; + } + } + if (!itemDataset.typed) dataset.typed = false; + dataset.value.push(itemDataset.value); + } + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/undefined/undefined.ts +/* @__NO_SIDE_EFFECTS__ */ +function undefined_(message$1) { + return { + kind: "schema", + type: "undefined", + reference: undefined_, + expects: "undefined", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/undefinedable/undefinedable.ts +/* @__NO_SIDE_EFFECTS__ */ +function undefinedable(wrapped, default_) { + return { + kind: "schema", + type: "undefinedable", + reference: undefinedable, + expects: `(${wrapped.expects} | undefined)`, + async: false, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/undefinedable/undefinedableAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function undefinedableAsync(wrapped, default_) { + return { + kind: "schema", + type: "undefinedable", + reference: undefinedableAsync, + expects: `(${wrapped.expects} | undefined)`, + async: true, + wrapped, + default: default_, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + if (dataset.value === void 0) { + if (this.default !== void 0) dataset.value = await /* @__PURE__ */ getDefault(this, dataset, config$1); + if (dataset.value === void 0) { + dataset.typed = true; + return dataset; + } + } + return this.wrapped["~run"](dataset, config$1); + } + }; +} + +//#endregion +//#region src/schemas/union/utils/_subIssues/_subIssues.ts +/** +* Returns the sub issues of the provided datasets for the union issue. +* +* @param datasets The datasets. +* +* @returns The sub issues. +* +* @internal +*/ +/* @__NO_SIDE_EFFECTS__ */ +function _subIssues(datasets) { + let issues; + if (datasets) for (const dataset of datasets) if (issues) for (const issue of dataset.issues) issues.push(issue); + else issues = dataset.issues; + return issues; +} + +//#endregion +//#region src/schemas/union/union.ts +/* @__NO_SIDE_EFFECTS__ */ +function union(options, message$1) { + return { + kind: "schema", + type: "union", + reference: union, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"), + async: false, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + let validDataset; + let typedDatasets; + let untypedDatasets; + for (const schema of this.options) { + const optionDataset = schema["~run"]({ value: dataset.value }, config$1); + if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset); + else typedDatasets = [optionDataset]; + else { + validDataset = optionDataset; + break; + } + else if (untypedDatasets) untypedDatasets.push(optionDataset); + else untypedDatasets = [optionDataset]; + } + if (validDataset) return validDataset; + if (typedDatasets) { + if (typedDatasets.length === 1) return typedDatasets[0]; + _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) }); + dataset.typed = true; + } else if (untypedDatasets?.length === 1) return untypedDatasets[0]; + else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) }); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/union/unionAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function unionAsync(options, message$1) { + return { + kind: "schema", + type: "union", + reference: unionAsync, + expects: /* @__PURE__ */ _joinExpects(options.map((option) => option.expects), "|"), + async: true, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + let validDataset; + let typedDatasets; + let untypedDatasets; + for (const schema of this.options) { + const optionDataset = await schema["~run"]({ value: dataset.value }, config$1); + if (optionDataset.typed) if (optionDataset.issues) if (typedDatasets) typedDatasets.push(optionDataset); + else typedDatasets = [optionDataset]; + else { + validDataset = optionDataset; + break; + } + else if (untypedDatasets) untypedDatasets.push(optionDataset); + else untypedDatasets = [optionDataset]; + } + if (validDataset) return validDataset; + if (typedDatasets) { + if (typedDatasets.length === 1) return typedDatasets[0]; + _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(typedDatasets) }); + dataset.typed = true; + } else if (untypedDatasets?.length === 1) return untypedDatasets[0]; + else _addIssue(this, "type", dataset, config$1, { issues: /* @__PURE__ */ _subIssues(untypedDatasets) }); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/unknown/unknown.ts +/** +* Creates a unknown schema. +* +* @returns A unknown schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function unknown() { + return { + kind: "schema", + type: "unknown", + reference: unknown, + expects: "unknown", + async: false, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset) { + dataset.typed = true; + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/variant/variant.ts +/* @__NO_SIDE_EFFECTS__ */ +function variant(key, options, message$1) { + return { + kind: "schema", + type: "variant", + reference: variant, + expects: "Object", + async: false, + key, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + let outputDataset; + let maxDiscriminatorPriority = 0; + let invalidDiscriminatorKey = this.key; + let expectedDiscriminators = []; + const parseOptions = (variant$1, allKeys) => { + for (const schema of variant$1.options) { + if (schema.type === "variant") parseOptions(schema, new Set(allKeys).add(schema.key)); + else { + let keysAreValid = true; + let currentPriority = 0; + for (const currentKey of allKeys) { + const discriminatorSchema = schema.entries[currentKey]; + if (currentKey in input ? discriminatorSchema["~run"]({ + typed: false, + value: input[currentKey] + }, ABORT_EARLY_CONFIG).issues : discriminatorSchema.type !== "exact_optional" && discriminatorSchema.type !== "optional" && discriminatorSchema.type !== "nullish") { + keysAreValid = false; + if (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) { + maxDiscriminatorPriority = currentPriority; + invalidDiscriminatorKey = currentKey; + expectedDiscriminators = []; + } + if (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects); + break; + } + currentPriority++; + } + if (keysAreValid) { + const optionDataset = schema["~run"]({ value: input }, config$1); + if (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset; + } + } + if (outputDataset && !outputDataset.issues) break; + } + }; + parseOptions(this, new Set([this.key])); + if (outputDataset) return outputDataset; + _addIssue(this, "type", dataset, config$1, { + input: input[invalidDiscriminatorKey], + expected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, "|"), + path: [{ + type: "object", + origin: "value", + input, + key: invalidDiscriminatorKey, + value: input[invalidDiscriminatorKey] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/variant/variantAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function variantAsync(key, options, message$1) { + return { + kind: "schema", + type: "variant", + reference: variantAsync, + expects: "Object", + async: true, + key, + options, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + const input = dataset.value; + if (input && typeof input === "object") { + let outputDataset; + let maxDiscriminatorPriority = 0; + let invalidDiscriminatorKey = this.key; + let expectedDiscriminators = []; + const parseOptions = async (variant$1, allKeys) => { + for (const schema of variant$1.options) { + if (schema.type === "variant") await parseOptions(schema, new Set(allKeys).add(schema.key)); + else { + let keysAreValid = true; + let currentPriority = 0; + for (const currentKey of allKeys) { + const discriminatorSchema = schema.entries[currentKey]; + if (currentKey in input ? (await discriminatorSchema["~run"]({ + typed: false, + value: input[currentKey] + }, ABORT_EARLY_CONFIG)).issues : discriminatorSchema.type !== "exact_optional" && discriminatorSchema.type !== "optional" && discriminatorSchema.type !== "nullish") { + keysAreValid = false; + if (invalidDiscriminatorKey !== currentKey && (maxDiscriminatorPriority < currentPriority || maxDiscriminatorPriority === currentPriority && currentKey in input && !(invalidDiscriminatorKey in input))) { + maxDiscriminatorPriority = currentPriority; + invalidDiscriminatorKey = currentKey; + expectedDiscriminators = []; + } + if (invalidDiscriminatorKey === currentKey) expectedDiscriminators.push(schema.entries[currentKey].expects); + break; + } + currentPriority++; + } + if (keysAreValid) { + const optionDataset = await schema["~run"]({ value: input }, config$1); + if (!outputDataset || !outputDataset.typed && optionDataset.typed) outputDataset = optionDataset; + } + } + if (outputDataset && !outputDataset.issues) break; + } + }; + await parseOptions(this, new Set([this.key])); + if (outputDataset) return outputDataset; + _addIssue(this, "type", dataset, config$1, { + input: input[invalidDiscriminatorKey], + expected: /* @__PURE__ */ _joinExpects(expectedDiscriminators, "|"), + path: [{ + type: "object", + origin: "value", + input, + key: invalidDiscriminatorKey, + value: input[invalidDiscriminatorKey] + }] + }); + } else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/schemas/void/void.ts +/* @__NO_SIDE_EFFECTS__ */ +function void_(message$1) { + return { + kind: "schema", + type: "void", + reference: void_, + expects: "void", + async: false, + message: message$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + if (dataset.value === void 0) dataset.typed = true; + else _addIssue(this, "type", dataset, config$1); + return dataset; + } + }; +} + +//#endregion +//#region src/methods/keyof/keyof.ts +/* @__NO_SIDE_EFFECTS__ */ +function keyof(schema, message$1) { + return /* @__PURE__ */ picklist(Object.keys(schema.entries), message$1); +} + +//#endregion +//#region src/methods/message/message.ts +/** +* Changes the local message configuration of a schema. +* +* @param schema The schema to configure. +* @param message_ The error message. +* +* @returns The configured schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function message(schema, message_) { + return { + ...schema, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + return schema["~run"](dataset, { + ...config$1, + message: message_ + }); + } + }; +} + +//#endregion +//#region src/methods/omit/omit.ts +/** +* Creates a modified copy of an object schema that does not contain the +* selected entries. +* +* @param schema The schema to omit from. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function omit(schema, keys) { + const entries$1 = { ...schema.entries }; + for (const key of keys) delete entries$1[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; +} + +//#endregion +//#region src/methods/parse/parse.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parsed input. +*/ +function parse(schema, input, config$1) { + const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + if (dataset.issues) throw new ValiError(dataset.issues); + return dataset.value; +} + +//#endregion +//#region src/methods/parse/parseAsync.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parsed input. +*/ +async function parseAsync(schema, input, config$1) { + const dataset = await schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + if (dataset.issues) throw new ValiError(dataset.issues); + return dataset.value; +} + +//#endregion +//#region src/methods/parser/parser.ts +/* @__NO_SIDE_EFFECTS__ */ +function parser(schema, config$1) { + const func = (input) => parse(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; +} + +//#endregion +//#region src/methods/parser/parserAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function parserAsync(schema, config$1) { + const func = (input) => parseAsync(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; +} + +//#endregion +//#region src/methods/partial/partial.ts +/* @__NO_SIDE_EFFECTS__ */ +function partial(schema, keys) { + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optional(schema.entries[key]) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; +} + +//#endregion +//#region src/methods/partial/partialAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function partialAsync(schema, keys) { + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ optionalAsync(schema.entries[key]) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; +} + +//#endregion +//#region src/methods/pick/pick.ts +/** +* Creates a modified copy of an object schema that contains only the selected +* entries. +* +* @param schema The schema to pick from. +* @param keys The selected entries. +* +* @returns An object schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function pick(schema, keys) { + const entries$1 = {}; + for (const key of keys) entries$1[key] = schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; +} + +//#endregion +//#region src/methods/pipe/pipe.ts +/* @__NO_SIDE_EFFECTS__ */ +function pipe(...pipe$1) { + return { + ...pipe$1[0], + pipe: pipe$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + "~run"(dataset, config$1) { + for (const item of pipe$1) if (item.kind !== "metadata") { + if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) { + dataset.typed = false; + break; + } + if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = item["~run"](dataset, config$1); + } + return dataset; + } + }; +} + +//#endregion +//#region src/methods/pipe/pipeAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function pipeAsync(...pipe$1) { + return { + ...pipe$1[0], + pipe: pipe$1, + async: true, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + }, + async "~run"(dataset, config$1) { + for (const item of pipe$1) if (item.kind !== "metadata") { + if (dataset.issues && (item.kind === "schema" || item.kind === "transformation")) { + dataset.typed = false; + break; + } + if (!dataset.issues || !config$1.abortEarly && !config$1.abortPipeEarly) dataset = await item["~run"](dataset, config$1); + } + return dataset; + } + }; +} + +//#endregion +//#region src/methods/required/required.ts +/* @__NO_SIDE_EFFECTS__ */ +function required(schema, arg2, arg3) { + const keys = Array.isArray(arg2) ? arg2 : void 0; + const message$1 = Array.isArray(arg2) ? arg3 : arg2; + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptional(schema.entries[key], message$1) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; +} + +//#endregion +//#region src/methods/required/requiredAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function requiredAsync(schema, arg2, arg3) { + const keys = Array.isArray(arg2) ? arg2 : void 0; + const message$1 = Array.isArray(arg2) ? arg3 : arg2; + const entries$1 = {}; + for (const key in schema.entries) entries$1[key] = !keys || keys.includes(key) ? /* @__PURE__ */ nonOptionalAsync(schema.entries[key], message$1) : schema.entries[key]; + return { + ...schema, + entries: entries$1, + get "~standard"() { + return /* @__PURE__ */ _getStandardProps(this); + } + }; +} + +//#endregion +//#region src/methods/safeParse/safeParse.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parse result. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function safeParse(schema, input, config$1) { + const dataset = schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + return { + typed: dataset.typed, + success: !dataset.issues, + output: dataset.value, + issues: dataset.issues + }; +} + +//#endregion +//#region src/methods/safeParse/safeParseAsync.ts +/** +* Parses an unknown input based on a schema. +* +* @param schema The schema to be used. +* @param input The input to be parsed. +* @param config The parse configuration. +* +* @returns The parse result. +*/ +/* @__NO_SIDE_EFFECTS__ */ +async function safeParseAsync(schema, input, config$1) { + const dataset = await schema["~run"]({ value: input }, /* @__PURE__ */ getGlobalConfig(config$1)); + return { + typed: dataset.typed, + success: !dataset.issues, + output: dataset.value, + issues: dataset.issues + }; +} + +//#endregion +//#region src/methods/safeParser/safeParser.ts +/* @__NO_SIDE_EFFECTS__ */ +function safeParser(schema, config$1) { + const func = (input) => /* @__PURE__ */ safeParse(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; +} + +//#endregion +//#region src/methods/safeParser/safeParserAsync.ts +/* @__NO_SIDE_EFFECTS__ */ +function safeParserAsync(schema, config$1) { + const func = (input) => /* @__PURE__ */ safeParseAsync(schema, input, config$1); + func.schema = schema; + func.config = config$1; + return func; +} + +//#endregion +//#region src/methods/summarize/summarize.ts +/** +* Summarize the error messages of issues in a pretty-printable multi-line string. +* +* @param issues The list of issues. +* +* @returns A summary of the issues. +* +* @beta +*/ +/* @__NO_SIDE_EFFECTS__ */ +function summarize(issues) { + let summary = ""; + for (const issue of issues) { + if (summary) summary += "\n"; + summary += `× ${issue.message}`; + const dotPath = /* @__PURE__ */ getDotPath(issue); + if (dotPath) summary += `\n → at ${dotPath}`; + } + return summary; +} + +//#endregion +//#region src/methods/unwrap/unwrap.ts +/** +* Unwraps the wrapped schema. +* +* @param schema The schema to be unwrapped. +* +* @returns The unwrapped schema. +*/ +/* @__NO_SIDE_EFFECTS__ */ +function unwrap(schema) { + return schema.wrapped; +} + +//#endregion +export { BASE64_REGEX, BIC_REGEX, CUID2_REGEX, DECIMAL_REGEX, DIGITS_REGEX, DOMAIN_REGEX, EMAIL_REGEX, EMOJI_REGEX, HEXADECIMAL_REGEX, HEX_COLOR_REGEX, IMEI_REGEX, IPV4_REGEX, IPV6_REGEX, IP_REGEX, ISO_DATE_REGEX, ISO_DATE_TIME_REGEX, ISO_DATE_TIME_SECOND_REGEX, ISO_TIMESTAMP_REGEX, ISO_TIME_REGEX, ISO_TIME_SECOND_REGEX, ISO_WEEK_REGEX, ISRC_REGEX, JWS_COMPACT_REGEX, MAC48_REGEX, MAC64_REGEX, MAC_REGEX, NANO_ID_REGEX, OCTAL_REGEX, RFC_EMAIL_REGEX, SLUG_REGEX, ULID_REGEX, UUID_REGEX, ValiError, _addIssue, _cloneDataset, _formatCase, _getByteCount, _getGraphemeCount, _getLastMetadata, _getStandardProps, _getWordCount, _isLuhnAlgo, _isValidObjectKey, _joinExpects, _stringify, any, args, argsAsync, array, arrayAsync, assert, awaitAsync, base64, bic, bigint, blob, boolean, brand, bytes, cache, cacheAsync, check, checkAsync, checkItems, checkItemsAsync, config, creditCard, cuid2, custom, customAsync, date, decimal, deleteGlobalConfig, deleteGlobalMessage, deleteSchemaMessage, deleteSpecificMessage, description, digits, domain, email, emoji, empty, endsWith, entries, entriesFromList, entriesFromObjects, enum_ as enum, enum_, everyItem, exactOptional, exactOptionalAsync, examples, excludes, fallback, fallbackAsync, file, filterItems, findItem, finite, flatten, flavor, forward, forwardAsync, function_ as function, function_, getDefault, getDefaults, getDefaultsAsync, getDescription, getDotPath, getExamples, getFallback, getFallbacks, getFallbacksAsync, getGlobalConfig, getGlobalMessage, getMetadata, getSchemaMessage, getSpecificMessage, getTitle, graphemes, gtValue, guard, hash, hexColor, hexadecimal, imei, includes, instance, integer, intersect, intersectAsync, ip, ipv4, ipv6, is, isOfKind, isOfType, isValiError, isbn, isoDate, isoDateTime, isoDateTimeSecond, isoTime, isoTimeSecond, isoTimestamp, isoWeek, isrc, jwsCompact, keyof, lazy, lazyAsync, length, literal, looseObject, looseObjectAsync, looseTuple, looseTupleAsync, ltValue, mac, mac48, mac64, map, mapAsync, mapItems, maxBytes, maxEntries, maxGraphemes, maxLength, maxSize, maxValue, maxWords, message, metadata, mimeType, minBytes, minEntries, minGraphemes, minLength, minSize, minValue, minWords, multipleOf, nan, nanoid, never, nonEmpty, nonNullable, nonNullableAsync, nonNullish, nonNullishAsync, nonOptional, nonOptionalAsync, normalize, notBytes, notEntries, notGraphemes, notLength, notSize, notValue, notValues, notWords, null_ as null, null_, nullable, nullableAsync, nullish, nullishAsync, number, object, objectAsync, objectWithRest, objectWithRestAsync, octal, omit, optional, optionalAsync, parse, parseAsync, parseBoolean, parseJson, parser, parserAsync, partial, partialAsync, partialCheck, partialCheckAsync, pick, picklist, pipe, pipeAsync, promise, rawCheck, rawCheckAsync, rawTransform, rawTransformAsync, readonly, record, recordAsync, reduceItems, regex, required, requiredAsync, returns, returnsAsync, rfcEmail, safeInteger, safeParse, safeParseAsync, safeParser, safeParserAsync, set, setAsync, setGlobalConfig, setGlobalMessage, setSchemaMessage, setSpecificMessage, size, slug, someItem, sortItems, startsWith, strictObject, strictObjectAsync, strictTuple, strictTupleAsync, string, stringifyJson, summarize, symbol, title, toBigint, toBoolean, toCamelCase, toDate, toKebabCase, toLowerCase, toMaxValue, toMinValue, toNumber, toPascalCase, toSnakeCase, toString, toUpperCase, transform, transformAsync, trim, trimEnd, trimStart, tuple, tupleAsync, tupleWithRest, tupleWithRestAsync, ulid, undefined_ as undefined, undefined_, undefinedable, undefinedableAsync, union, unionAsync, unknown, unwrap, url, uuid, value, values, variant, variantAsync, void_ as void, void_, words }; \ No newline at end of file diff --git a/tools/ui/node_modules/valibot/package.json b/tools/ui/node_modules/valibot/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1ef33184c3d5ca04f1296bce7dd5a8eaf02f26a6 --- /dev/null +++ b/tools/ui/node_modules/valibot/package.json @@ -0,0 +1,79 @@ +{ + "name": "valibot", + "description": "The modular and type safe schema library for validating structural data", + "version": "1.4.2", + "license": "MIT", + "author": "Fabian Hiller", + "homepage": "https://valibot.dev", + "repository": { + "type": "git", + "url": "https://github.com/open-circle/valibot" + }, + "keywords": [ + "modular", + "typescript", + "schema", + "validation", + "parsing", + "bundle-size", + "type-safe", + "runtime" + ], + "type": "module", + "main": "./dist/index.mjs", + "types": "./dist/index.d.mts", + "exports": { + ".": { + "import": { + "types": "./dist/index.d.mts", + "default": "./dist/index.mjs" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } + } + }, + "sideEffects": false, + "files": [ + "dist" + ], + "publishConfig": { + "access": "public" + }, + "scripts": { + "play": "tsm ./playground.ts", + "test": "vitest --typecheck", + "coverage": "vitest run --coverage --isolate", + "lint": "eslint \"src/**/*.ts*\" && tsc --noEmit && deno check ./src/index.ts", + "lint.fix": "eslint \"src/**/*.ts*\" --fix", + "format": "prettier --write ./src", + "format.check": "prettier --check ./src", + "build": "tsdown" + }, + "devDependencies": { + "@eslint/js": "^9.39.1", + "@vitest/coverage-v8": "^4.1.8", + "eslint": "^9.39.1", + "eslint-plugin-import": "^2.32.0", + "eslint-plugin-jsdoc": "^61.4.0", + "eslint-plugin-redos-detector": "^3.1.1", + "eslint-plugin-regexp": "^2.10.0", + "eslint-plugin-security": "^3.0.1", + "jsdom": "^27.2.0", + "tsdown": "^0.16.6", + "tsm": "^2.3.0", + "typescript": "^5.9.3", + "typescript-eslint": "^8.47.0", + "vite": "^7.2.4", + "vitest": "4.1.8" + }, + "peerDependencies": { + "typescript": ">=5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } +} diff --git a/tools/ui/node_modules/vary/HISTORY.md b/tools/ui/node_modules/vary/HISTORY.md new file mode 100644 index 0000000000000000000000000000000000000000..f6cbcf7f9be9d45391c5e4e14d02541f59087351 --- /dev/null +++ b/tools/ui/node_modules/vary/HISTORY.md @@ -0,0 +1,39 @@ +1.1.2 / 2017-09-23 +================== + + * perf: improve header token parsing speed + +1.1.1 / 2017-03-20 +================== + + * perf: hoist regular expression + +1.1.0 / 2015-09-29 +================== + + * Only accept valid field names in the `field` argument + - Ensures the resulting string is a valid HTTP header value + +1.0.1 / 2015-07-08 +================== + + * Fix setting empty header from empty `field` + * perf: enable strict mode + * perf: remove argument reassignments + +1.0.0 / 2014-08-10 +================== + + * Accept valid `Vary` header string as `field` + * Add `vary.append` for low-level string manipulation + * Move to `jshttp` orgainzation + +0.1.0 / 2014-06-05 +================== + + * Support array of fields to set + +0.0.0 / 2014-06-04 +================== + + * Initial release diff --git a/tools/ui/node_modules/vary/LICENSE b/tools/ui/node_modules/vary/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..84441fbb5709262c2bfc9b5ff0166ad4f024a1b8 --- /dev/null +++ b/tools/ui/node_modules/vary/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2014-2017 Douglas Christopher Wilson + +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/vary/README.md b/tools/ui/node_modules/vary/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cc000b34684a1d0b03d4c4cb4fac3e1094a81eec --- /dev/null +++ b/tools/ui/node_modules/vary/README.md @@ -0,0 +1,101 @@ +# vary + +[![NPM Version][npm-image]][npm-url] +[![NPM Downloads][downloads-image]][downloads-url] +[![Node.js Version][node-version-image]][node-version-url] +[![Build Status][travis-image]][travis-url] +[![Test Coverage][coveralls-image]][coveralls-url] + +Manipulate the HTTP Vary header + +## Installation + +This is a [Node.js](https://nodejs.org/en/) module available through the +[npm registry](https://www.npmjs.com/). Installation is done using the +[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally): + +```sh +$ npm install vary +``` + +## API + + + +```js +var vary = require('vary') +``` + +### vary(res, field) + +Adds the given header `field` to the `Vary` response header of `res`. +This can be a string of a single field, a string of a valid `Vary` +header, or an array of multiple fields. + +This will append the header if not already listed, otherwise leaves +it listed in the current location. + + + +```js +// Append "Origin" to the Vary header of the response +vary(res, 'Origin') +``` + +### vary.append(header, field) + +Adds the given header `field` to the `Vary` response header string `header`. +This can be a string of a single field, a string of a valid `Vary` header, +or an array of multiple fields. + +This will append the header if not already listed, otherwise leaves +it listed in the current location. The new header string is returned. + + + +```js +// Get header string appending "Origin" to "Accept, User-Agent" +vary.append('Accept, User-Agent', 'Origin') +``` + +## Examples + +### Updating the Vary header when content is based on it + +```js +var http = require('http') +var vary = require('vary') + +http.createServer(function onRequest (req, res) { + // about to user-agent sniff + vary(res, 'User-Agent') + + var ua = req.headers['user-agent'] || '' + var isMobile = /mobi|android|touch|mini/i.test(ua) + + // serve site, depending on isMobile + res.setHeader('Content-Type', 'text/html') + res.end('You are (probably) ' + (isMobile ? '' : 'not ') + 'a mobile user') +}) +``` + +## Testing + +```sh +$ npm test +``` + +## License + +[MIT](LICENSE) + +[npm-image]: https://img.shields.io/npm/v/vary.svg +[npm-url]: https://npmjs.org/package/vary +[node-version-image]: https://img.shields.io/node/v/vary.svg +[node-version-url]: https://nodejs.org/en/download +[travis-image]: https://img.shields.io/travis/jshttp/vary/master.svg +[travis-url]: https://travis-ci.org/jshttp/vary +[coveralls-image]: https://img.shields.io/coveralls/jshttp/vary/master.svg +[coveralls-url]: https://coveralls.io/r/jshttp/vary +[downloads-image]: https://img.shields.io/npm/dm/vary.svg +[downloads-url]: https://npmjs.org/package/vary diff --git a/tools/ui/node_modules/vary/index.js b/tools/ui/node_modules/vary/index.js new file mode 100644 index 0000000000000000000000000000000000000000..5b5e741279d4b800b0c408c5efbac8de6ece450b --- /dev/null +++ b/tools/ui/node_modules/vary/index.js @@ -0,0 +1,149 @@ +/*! + * vary + * Copyright(c) 2014-2017 Douglas Christopher Wilson + * MIT Licensed + */ + +'use strict' + +/** + * Module exports. + */ + +module.exports = vary +module.exports.append = append + +/** + * RegExp to match field-name in RFC 7230 sec 3.2 + * + * field-name = token + * token = 1*tchar + * tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*" + * / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~" + * / DIGIT / ALPHA + * ; any VCHAR, except delimiters + */ + +var FIELD_NAME_REGEXP = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/ + +/** + * Append a field to a vary header. + * + * @param {String} header + * @param {String|Array} field + * @return {String} + * @public + */ + +function append (header, field) { + if (typeof header !== 'string') { + throw new TypeError('header argument is required') + } + + if (!field) { + throw new TypeError('field argument is required') + } + + // get fields array + var fields = !Array.isArray(field) + ? parse(String(field)) + : field + + // assert on invalid field names + for (var j = 0; j < fields.length; j++) { + if (!FIELD_NAME_REGEXP.test(fields[j])) { + throw new TypeError('field argument contains an invalid header name') + } + } + + // existing, unspecified vary + if (header === '*') { + return header + } + + // enumerate current values + var val = header + var vals = parse(header.toLowerCase()) + + // unspecified vary + if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) { + return '*' + } + + for (var i = 0; i < fields.length; i++) { + var fld = fields[i].toLowerCase() + + // append value (case-preserving) + if (vals.indexOf(fld) === -1) { + vals.push(fld) + val = val + ? val + ', ' + fields[i] + : fields[i] + } + } + + return val +} + +/** + * Parse a vary header into an array. + * + * @param {String} header + * @return {Array} + * @private + */ + +function parse (header) { + var end = 0 + var list = [] + var start = 0 + + // gather tokens + for (var i = 0, len = header.length; i < len; i++) { + switch (header.charCodeAt(i)) { + case 0x20: /* */ + if (start === end) { + start = end = i + 1 + } + break + case 0x2c: /* , */ + list.push(header.substring(start, end)) + start = end = i + 1 + break + default: + end = i + 1 + break + } + } + + // final token + list.push(header.substring(start, end)) + + return list +} + +/** + * Mark that a request is varied on a header field. + * + * @param {Object} res + * @param {String|Array} field + * @public + */ + +function vary (res, field) { + if (!res || !res.getHeader || !res.setHeader) { + // quack quack + throw new TypeError('res argument is required') + } + + // get existing header + var val = res.getHeader('Vary') || '' + var header = Array.isArray(val) + ? val.join(', ') + : String(val) + + // set new header + if ((val = append(header, field))) { + res.setHeader('Vary', val) + } +} diff --git a/tools/ui/node_modules/vary/package.json b/tools/ui/node_modules/vary/package.json new file mode 100644 index 0000000000000000000000000000000000000000..028f72a93c5153af4163764face616d0ccb7a7b8 --- /dev/null +++ b/tools/ui/node_modules/vary/package.json @@ -0,0 +1,43 @@ +{ + "name": "vary", + "description": "Manipulate the HTTP Vary header", + "version": "1.1.2", + "author": "Douglas Christopher Wilson ", + "license": "MIT", + "keywords": [ + "http", + "res", + "vary" + ], + "repository": "jshttp/vary", + "devDependencies": { + "beautify-benchmark": "0.2.4", + "benchmark": "2.1.4", + "eslint": "3.19.0", + "eslint-config-standard": "10.2.1", + "eslint-plugin-import": "2.7.0", + "eslint-plugin-markdown": "1.0.0-beta.6", + "eslint-plugin-node": "5.1.1", + "eslint-plugin-promise": "3.5.0", + "eslint-plugin-standard": "3.0.1", + "istanbul": "0.4.5", + "mocha": "2.5.3", + "supertest": "1.1.0" + }, + "files": [ + "HISTORY.md", + "LICENSE", + "README.md", + "index.js" + ], + "engines": { + "node": ">= 0.8" + }, + "scripts": { + "bench": "node benchmark/index.js", + "lint": "eslint --plugin markdown --ext js,md .", + "test": "mocha --reporter spec --bail --check-leaks test/", + "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", + "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" + } +} diff --git a/tools/ui/node_modules/vfile-location/index.d.ts b/tools/ui/node_modules/vfile-location/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..83081a325e91e72cf667685a51333b088346cc6e --- /dev/null +++ b/tools/ui/node_modules/vfile-location/index.d.ts @@ -0,0 +1,47 @@ +import type {Point as UnistPoint} from 'unist' + +export {location} from './lib/index.js' + +/** + * Accessors for index. + */ +export interface Location { + /** + * Get the `offset` from a line/column based `Point` in the bound indices; + * returns `undefined` when given out of bounds input. + * + * @param point + * Line/column based `Point`. + * @returns + * Offset. + */ + toOffset(point?: PointLike | null | undefined): number | undefined + /** + * Get the line/column based `Point` for `offset` in the bound indices; + * returns `undefined` when given out of bounds input. + * + * @param offset + * Offset. + * @returns + * `Point`. + */ + toPoint(offset?: number | null | undefined): UnistPoint | undefined +} + +/** + * Point from `unist`, allowed as input. + */ +interface PointLike { + /** + * Column. + */ + column?: number | null | undefined + /** + * Line. + */ + line?: number | null | undefined + /** + * Offset. + */ + offset?: number | null | undefined +} diff --git a/tools/ui/node_modules/vfile-location/index.js b/tools/ui/node_modules/vfile-location/index.js new file mode 100644 index 0000000000000000000000000000000000000000..f90e80c60e0ddbe7ad06e861daad989de19225b8 --- /dev/null +++ b/tools/ui/node_modules/vfile-location/index.js @@ -0,0 +1,2 @@ +// Note: types exposed from `index.d.ts`. +export {location} from './lib/index.js' diff --git a/tools/ui/node_modules/vfile-location/lib/index.d.ts b/tools/ui/node_modules/vfile-location/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d28346f136203dd131610935f16c706f37e7f019 --- /dev/null +++ b/tools/ui/node_modules/vfile-location/lib/index.d.ts @@ -0,0 +1,22 @@ +/** + * @import {VFile, Value} from 'vfile' + * @import {Location} from 'vfile-location' + */ +/** + * Create an index of the given document to translate between line/column and + * offset based positional info. + * + * Also implemented in Rust in [`wooorm/markdown-rs`][markdown-rs]. + * + * [markdown-rs]: https://github.com/wooorm/markdown-rs/blob/main/src/util/location.rs + * + * @param {VFile | Value} file + * File to index. + * @returns {Location} + * Accessors for index. + */ +export function location(file: VFile | Value): Location; +import type { VFile } from 'vfile'; +import type { Value } from 'vfile'; +import type { Location } from 'vfile-location'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/vfile-location/lib/index.d.ts.map b/tools/ui/node_modules/vfile-location/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..fd7e9856a190fc04cfedac38ba922853534d3039 --- /dev/null +++ b/tools/ui/node_modules/vfile-location/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AACH,+BALW,KAAK,GAAG,KAAK,GAEX,QAAQ,CAiEpB;2BA/E8B,OAAO;2BAAP,OAAO;8BACX,gBAAgB"} \ No newline at end of file diff --git a/tools/ui/node_modules/vfile-location/lib/index.js b/tools/ui/node_modules/vfile-location/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d2c13c48991b657e27219762d9762df2e9c4a918 --- /dev/null +++ b/tools/ui/node_modules/vfile-location/lib/index.js @@ -0,0 +1,93 @@ +/** + * @import {VFile, Value} from 'vfile' + * @import {Location} from 'vfile-location' + */ + +/** + * Create an index of the given document to translate between line/column and + * offset based positional info. + * + * Also implemented in Rust in [`wooorm/markdown-rs`][markdown-rs]. + * + * [markdown-rs]: https://github.com/wooorm/markdown-rs/blob/main/src/util/location.rs + * + * @param {VFile | Value} file + * File to index. + * @returns {Location} + * Accessors for index. + */ +export function location(file) { + const value = String(file) + /** + * List, where each index is a line number (0-based), and each value is the + * byte index *after* where the line ends. + * + * @type {Array} + */ + const indices = [] + + return {toOffset, toPoint} + + /** @type {Location['toPoint']} */ + function toPoint(offset) { + if (typeof offset === 'number' && offset > -1 && offset <= value.length) { + let index = 0 + + while (true) { + let end = indices[index] + + if (end === undefined) { + const eol = next(value, indices[index - 1]) + end = eol === -1 ? value.length + 1 : eol + 1 + indices[index] = end + } + + if (end > offset) { + return { + line: index + 1, + column: offset - (index > 0 ? indices[index - 1] : 0) + 1, + offset + } + } + + index++ + } + } + } + + /** @type {Location['toOffset']} */ + function toOffset(point) { + if ( + point && + typeof point.line === 'number' && + typeof point.column === 'number' && + !Number.isNaN(point.line) && + !Number.isNaN(point.column) + ) { + while (indices.length < point.line) { + const from = indices[indices.length - 1] + const eol = next(value, from) + const end = eol === -1 ? value.length + 1 : eol + 1 + if (from === end) break + indices.push(end) + } + + const offset = + (point.line > 1 ? indices[point.line - 2] : 0) + point.column - 1 + // The given `column` could not exist on this line. + if (offset < indices[point.line - 1]) return offset + } + } +} + +/** + * @param {string} value + * @param {number} from + */ +function next(value, from) { + const cr = value.indexOf('\r', from) + const lf = value.indexOf('\n', from) + if (lf === -1) return cr + if (cr === -1 || cr + 1 === lf) return lf + return cr < lf ? cr : lf +} diff --git a/tools/ui/node_modules/vfile-location/license b/tools/ui/node_modules/vfile-location/license new file mode 100644 index 0000000000000000000000000000000000000000..8d8660d36ef2eced1f9cce91e17ae0290261734c --- /dev/null +++ b/tools/ui/node_modules/vfile-location/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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/vfile-location/node_modules/@types/unist/LICENSE b/tools/ui/node_modules/vfile-location/node_modules/@types/unist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/tools/ui/node_modules/vfile-location/node_modules/@types/unist/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + 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/vfile-location/node_modules/@types/unist/README.md b/tools/ui/node_modules/vfile-location/node_modules/@types/unist/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b84e51bfb836f999b47b6d8e233b64cb372e48df --- /dev/null +++ b/tools/ui/node_modules/vfile-location/node_modules/@types/unist/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/unist` + +# Summary +This package contains type definitions for unist (https://github.com/syntax-tree/unist). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist. + +### Additional Details + * Last updated: Thu, 15 Aug 2024 02:18:53 GMT + * Dependencies: none + +# Credits +These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), [JounQin](https://github.com/JounQin), and [Remco Haszing](https://github.com/remcohaszing). diff --git a/tools/ui/node_modules/vfile-location/node_modules/@types/unist/index.d.ts b/tools/ui/node_modules/vfile-location/node_modules/@types/unist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..513ddee5e9e2acb1e5c88c26da384212e52ed90b --- /dev/null +++ b/tools/ui/node_modules/vfile-location/node_modules/@types/unist/index.d.ts @@ -0,0 +1,119 @@ +// ## Interfaces + +/** + * Info associated with nodes by the ecosystem. + * + * This space is guaranteed to never be specified by unist or specifications + * implementing unist. + * But you can use it in utilities and plugins to store data. + * + * This type can be augmented to register custom data. + * For example: + * + * ```ts + * declare module 'unist' { + * interface Data { + * // `someNode.data.myId` is typed as `number | undefined` + * myId?: number | undefined + * } + * } + * ``` + */ +export interface Data {} + +/** + * One place in a source file. + */ +export interface Point { + /** + * Line in a source file (1-indexed integer). + */ + line: number; + + /** + * Column in a source file (1-indexed integer). + */ + column: number; + /** + * Character in a source file (0-indexed integer). + */ + offset?: number | undefined; +} + +/** + * Position of a node in a source document. + * + * A position is a range between two points. + */ +export interface Position { + /** + * Place of the first character of the parsed source region. + */ + start: Point; + + /** + * Place of the first character after the parsed source region. + */ + end: Point; +} + +// ## Abstract nodes + +/** + * Abstract unist node that contains the smallest possible value. + * + * This interface is supposed to be extended. + * + * For example, in HTML, a `text` node is a leaf that contains text. + */ +export interface Literal extends Node { + /** + * Plain value. + */ + value: unknown; +} + +/** + * Abstract unist node. + * + * The syntactic unit in unist syntax trees are called nodes. + * + * This interface is supposed to be extended. + * If you can use {@link Literal} or {@link Parent}, you should. + * But for example in markdown, a `thematicBreak` (`***`), is neither literal + * nor parent, but still a node. + */ +export interface Node { + /** + * Node type. + */ + type: string; + + /** + * Info from the ecosystem. + */ + data?: Data | undefined; + + /** + * Position of a node in a source document. + * + * Nodes that are generated (not in the original source document) must not + * have a position. + */ + position?: Position | undefined; +} + +/** + * Abstract unist node that contains other nodes (*children*). + * + * This interface is supposed to be extended. + * + * For example, in XML, an element is a parent of different things, such as + * comments, text, and further elements. + */ +export interface Parent extends Node { + /** + * List of children. + */ + children: Node[]; +} diff --git a/tools/ui/node_modules/vfile-location/node_modules/@types/unist/package.json b/tools/ui/node_modules/vfile-location/node_modules/@types/unist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d2092dba8f2208817af3e1811569d90b6358ad8f --- /dev/null +++ b/tools/ui/node_modules/vfile-location/node_modules/@types/unist/package.json @@ -0,0 +1,60 @@ +{ + "name": "@types/unist", + "version": "3.0.3", + "description": "TypeScript definitions for unist", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist", + "license": "MIT", + "contributors": [ + { + "name": "bizen241", + "githubUsername": "bizen241", + "url": "https://github.com/bizen241" + }, + { + "name": "Jun Lu", + "githubUsername": "lujun2", + "url": "https://github.com/lujun2" + }, + { + "name": "Hernan Rajchert", + "githubUsername": "hrajchert", + "url": "https://github.com/hrajchert" + }, + { + "name": "Titus Wormer", + "githubUsername": "wooorm", + "url": "https://github.com/wooorm" + }, + { + "name": "Junyoung Choi", + "githubUsername": "rokt33r", + "url": "https://github.com/rokt33r" + }, + { + "name": "Ben Moon", + "githubUsername": "GuiltyDolphin", + "url": "https://github.com/GuiltyDolphin" + }, + { + "name": "JounQin", + "githubUsername": "JounQin", + "url": "https://github.com/JounQin" + }, + { + "name": "Remco Haszing", + "githubUsername": "remcohaszing", + "url": "https://github.com/remcohaszing" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/unist" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "7f3d5ce8d56003f3583a5317f98d444bdc99910c7b486c6b10af4f38694e61fe", + "typeScriptVersion": "4.8" +} \ No newline at end of file diff --git a/tools/ui/node_modules/vfile-location/package.json b/tools/ui/node_modules/vfile-location/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e9032670b37d0385e92ffa22aa8e8d5c68f8c013 --- /dev/null +++ b/tools/ui/node_modules/vfile-location/package.json @@ -0,0 +1,115 @@ +{ + "name": "vfile-location", + "version": "5.0.3", + "description": "vfile utility to convert between positional (line and column-based) and offset (range-based) locations", + "license": "MIT", + "keywords": [ + "vfile", + "vfile-util", + "util", + "utility", + "virtual", + "file", + "location", + "point", + "position", + "offset" + ], + "repository": "vfile/vfile-location", + "bugs": "https://github.com/vfile/vfile-location/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)", + "Christian Murphy " + ], + "sideEffects": false, + "type": "module", + "exports": { + "types": "./index.d.ts", + "default": "./index.js" + }, + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/unist": "^3.0.0", + "vfile": "^6.0.0" + }, + "devDependencies": { + "@types/node": "^20.0.0", + "c8": "^10.0.0", + "prettier": "^3.0.0", + "remark-api": "^1.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^10.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.58.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm", + "remark-api" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "overrides": [ + { + "files": [ + "**/*.d.ts" + ], + "rules": { + "@typescript-eslint/array-type": [ + "error", + { + "default": "generic" + } + ], + "@typescript-eslint/ban-types": [ + "error", + { + "extendDefaults": true + } + ], + "@typescript-eslint/consistent-type-definitions": [ + "error", + "interface" + ] + } + } + ], + "prettier": true, + "rules": { + "no-constant-condition": "off", + "unicorn/prefer-at": "off" + } + } +} diff --git a/tools/ui/node_modules/vfile-location/readme.md b/tools/ui/node_modules/vfile-location/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..ff51bf14f7c56089da5553c6b5daa36b39e82bef --- /dev/null +++ b/tools/ui/node_modules/vfile-location/readme.md @@ -0,0 +1,187 @@ +# vfile-location + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[vfile][] utility to convert between positional (line and column-based) and +offsets (range-based) locations. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`Location`](#location) + * [`location(file)`](#locationfile) +* [Types](#types) +* [Compatibility](#compatibility) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This is a tiny but useful package to convert between arbitrary places in a +file. + +## When should I use this? + +This utility is useful when ASTs nodes don’t cut it. +For example, when you are making a lint rule that looks for dangerous +characters in a file, which you accomplish by searching the raw file value, +and still want to report it to users. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install vfile-location +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {location} from 'https://esm.sh/vfile-location@5' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {VFile} from 'vfile' +import {location} from 'vfile-location' + +const place = location(new VFile('foo\nbar\nbaz')) + +const offset = place.toOffset({line: 3, column: 3}) // => 10 +place.toPoint(offset) // => {line: 3, column: 3, offset: 10} +``` + +## API + +### `Location` + +Accessors for index. + +###### Fields + +* `toOffset` (`(point?: PointLike | null | undefined) => number | undefined`) + — get the `offset` from a line/column based `Point` in the bound indices; + returns `undefined` when given out of bounds input +* `toPoint` (`(offset?: number | null | undefined) => UnistPoint | undefined`) + — get the line/column based `Point` for `offset` in the bound indices; + returns `undefined` when given out of bounds input + +### `location(file)` + +Create an index of the given document to translate between line/column and +offset based positional info. + +Also implemented in Rust in [`wooorm/markdown-rs`][markdown-rs]. + +[markdown-rs]: https://github.com/wooorm/markdown-rs/blob/main/src/util/location.rs + +###### Parameters + +* `file` (`VFile | Value`) + — file to index + +###### Returns + +Accessors for index (`Location`). + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional type [`Location`][api-location-map]. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `vfile-location@^5`, +compatible with Node.js 16. + +## Contribute + +See [`contributing.md`][contributing] in [`vfile/.github`][health] for ways to +get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/vfile/vfile-location/workflows/main/badge.svg + +[build]: https://github.com/vfile/vfile-location/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-location.svg + +[coverage]: https://codecov.io/github/vfile/vfile-location + +[downloads-badge]: https://img.shields.io/npm/dm/vfile-location.svg + +[downloads]: https://www.npmjs.com/package/vfile-location + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=vfile-location + +[size]: https://bundlejs.com/?q=vfile-location + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/vfile/vfile/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[contributing]: https://github.com/vfile/.github/blob/main/contributing.md + +[support]: https://github.com/vfile/.github/blob/main/support.md + +[health]: https://github.com/vfile/.github + +[coc]: https://github.com/vfile/.github/blob/main/code-of-conduct.md + +[license]: license + +[author]: https://wooorm.com + +[vfile]: https://github.com/vfile/vfile + +[api-location-map]: #location diff --git a/tools/ui/node_modules/vfile-message/index.js b/tools/ui/node_modules/vfile-message/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c913753249edadeac436ed3e593aeb5c8a46af39 --- /dev/null +++ b/tools/ui/node_modules/vfile-message/index.js @@ -0,0 +1,94 @@ +'use strict' + +var stringify = require('unist-util-stringify-position') + +module.exports = VMessage + +// Inherit from `Error#`. +function VMessagePrototype() {} +VMessagePrototype.prototype = Error.prototype +VMessage.prototype = new VMessagePrototype() + +// Message properties. +var proto = VMessage.prototype + +proto.file = '' +proto.name = '' +proto.reason = '' +proto.message = '' +proto.stack = '' +proto.fatal = null +proto.column = null +proto.line = null + +// Construct a new VMessage. +// +// Note: We cannot invoke `Error` on the created context, as that adds readonly +// `line` and `column` attributes on Safari 9, thus throwing and failing the +// data. +function VMessage(reason, position, origin) { + var parts + var range + var location + + if (typeof position === 'string') { + origin = position + position = null + } + + parts = parseOrigin(origin) + range = stringify(position) || '1:1' + + location = { + start: {line: null, column: null}, + end: {line: null, column: null} + } + + // Node. + if (position && position.position) { + position = position.position + } + + if (position) { + // Position. + if (position.start) { + location = position + position = position.start + } else { + // Point. + location.start = position + } + } + + if (reason.stack) { + this.stack = reason.stack + reason = reason.message + } + + this.message = reason + this.name = range + this.reason = reason + this.line = position ? position.line : null + this.column = position ? position.column : null + this.location = location + this.source = parts[0] + this.ruleId = parts[1] +} + +function parseOrigin(origin) { + var result = [null, null] + var index + + if (typeof origin === 'string') { + index = origin.indexOf(':') + + if (index === -1) { + result[1] = origin + } else { + result[0] = origin.slice(0, index) + result[1] = origin.slice(index + 1) + } + } + + return result +} diff --git a/tools/ui/node_modules/vfile-message/license b/tools/ui/node_modules/vfile-message/license new file mode 100644 index 0000000000000000000000000000000000000000..045ffe0e075da471f1b04e204acce031b22d1c13 --- /dev/null +++ b/tools/ui/node_modules/vfile-message/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2017 Titus Wormer + +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/vfile-message/node_modules/unist-util-stringify-position/index.js b/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3d78a4442f72be8167c2ecd3ed2690349716b7ce --- /dev/null +++ b/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/index.js @@ -0,0 +1,50 @@ +'use strict' + +var own = {}.hasOwnProperty + +module.exports = stringify + +function stringify(value) { + // Nothing. + if (!value || typeof value !== 'object') { + return '' + } + + // Node. + if (own.call(value, 'position') || own.call(value, 'type')) { + return position(value.position) + } + + // Position. + if (own.call(value, 'start') || own.call(value, 'end')) { + return position(value) + } + + // Point. + if (own.call(value, 'line') || own.call(value, 'column')) { + return point(value) + } + + // ? + return '' +} + +function point(point) { + if (!point || typeof point !== 'object') { + point = {} + } + + return index(point.line) + ':' + index(point.column) +} + +function position(pos) { + if (!pos || typeof pos !== 'object') { + pos = {} + } + + return point(pos.start) + '-' + point(pos.end) +} + +function index(value) { + return value && typeof value === 'number' ? value : 1 +} diff --git a/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/license b/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/license new file mode 100644 index 0000000000000000000000000000000000000000..8d8660d36ef2eced1f9cce91e17ae0290261734c --- /dev/null +++ b/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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/vfile-message/node_modules/unist-util-stringify-position/package.json b/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/package.json new file mode 100644 index 0000000000000000000000000000000000000000..0f35015de95ea2d0ac4dd13f11b0fb55c452f786 --- /dev/null +++ b/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/package.json @@ -0,0 +1,84 @@ +{ + "name": "unist-util-stringify-position", + "version": "2.0.3", + "description": "unist utility to serialize a node, position, or point as a human readable location", + "license": "MIT", + "keywords": [ + "unist", + "unist-util", + "util", + "utility", + "position", + "location", + "point", + "node", + "stringify", + "tostring" + ], + "repository": "syntax-tree/unist-util-stringify-position", + "bugs": "https://github.com/syntax-tree/unist-util-stringify-position/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "types": "types/index.d.ts", + "files": [ + "types/index.d.ts", + "index.js" + ], + "dependencies": { + "@types/unist": "^2.0.2" + }, + "devDependencies": { + "browserify": "^16.0.0", + "dtslint": "^3.0.0", + "nyc": "^15.0.0", + "prettier": "^1.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "typescript": "^3.0.0", + "xo": "^0.27.0" + }, + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix", + "build-bundle": "browserify . -s unistUtilStringifyPosition > unist-util-stringify-position.js", + "build-mangle": "browserify . -s unistUtilStringifyPosition -p tinyify > unist-util-stringify-position.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint types", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types" + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "prettier": true, + "esnext": false, + "ignores": [ + "unist-util-stringify-position.js" + ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + } +} diff --git a/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/readme.md b/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..bb565149bb3815d9c8d22a3e4a10fb2076444134 --- /dev/null +++ b/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/readme.md @@ -0,0 +1,140 @@ +# unist-util-stringify-position + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +[**unist**][unist] utility to pretty print the positional information of a node. + +## Install + +[npm][]: + +```sh +npm install unist-util-stringify-position +``` + +## Use + +```js +var stringify = require('unist-util-stringify-position') + +// Point +stringify({line: 2, column: 3}) // => '2:3' + +// Position +stringify({start: {line: 2}, end: {line: 3}}) // => '2:1-3:1' + +// Node +stringify({ + type: 'text', + value: '!', + position: { + start: {line: 5, column: 11}, + end: {line: 5, column: 12} + } +}) // => '5:11-5:12' +``` + +## API + +### `stringifyPosition(node|position|point)` + +Stringify one [point][], a [position][] (start and end [point][]s), or a node’s +[positional information][positional-information]. + +###### Parameters + +* `node` ([`Node`][node]) + — Node whose `'position'` property to stringify +* `position` ([`Position`][position]) + — Position whose `'start'` and `'end'` points to stringify +* `point` ([`Point`][point]) + — Point whose `'line'` and `'column'` to stringify + +###### Returns + +`string?` — A range `ls:cs-le:ce` (when given `node` or `position`) or a point +`l:c` (when given `point`), where `l` stands for line, `c` for column, `s` for +`start`, and `e` for end. +An empty string (`''`) is returned if the given value is neither `node`, +`position`, nor `point`. + +## Related + +* [`unist-util-generated`](https://github.com/syntax-tree/unist-util-generated) + — Check if a node is generated +* [`unist-util-position`](https://github.com/syntax-tree/unist-util-position) + — Get positional info of nodes +* [`unist-util-remove-position`](https://github.com/syntax-tree/unist-util-remove-position) + — Remove positional info from trees +* [`unist-util-source`](https://github.com/syntax-tree/unist-util-source) + — Get the source of a value (node or position) in a file + +## Contribute + +See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get +started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/syntax-tree/unist-util-stringify-position.svg + +[build]: https://travis-ci.org/syntax-tree/unist-util-stringify-position + +[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-stringify-position.svg + +[coverage]: https://codecov.io/github/syntax-tree/unist-util-stringify-position + +[downloads-badge]: https://img.shields.io/npm/dm/unist-util-stringify-position.svg + +[downloads]: https://www.npmjs.com/package/unist-util-stringify-position + +[size-badge]: https://img.shields.io/bundlephobia/minzip/unist-util-stringify-position.svg + +[size]: https://bundlephobia.com/result?p=unist-util-stringify-position + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/syntax-tree + +[npm]: https://docs.npmjs.com/cli/install + +[license]: license + +[author]: https://wooorm.com + +[contributing]: https://github.com/syntax-tree/.github/blob/master/contributing.md + +[support]: https://github.com/syntax-tree/.github/blob/master/support.md + +[coc]: https://github.com/syntax-tree/.github/blob/master/code-of-conduct.md + +[unist]: https://github.com/syntax-tree/unist + +[node]: https://github.com/syntax-tree/unist#node + +[position]: https://github.com/syntax-tree/unist#position + +[point]: https://github.com/syntax-tree/unist#point + +[positional-information]: https://github.com/syntax-tree/unist#positional-information diff --git a/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/types/index.d.ts b/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/types/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f31bc043c8e9e8ab00c02693156fd78ac970c66 --- /dev/null +++ b/tools/ui/node_modules/vfile-message/node_modules/unist-util-stringify-position/types/index.d.ts @@ -0,0 +1,9 @@ +// TypeScript Version: 3.0 + +import * as Unist from 'unist' + +declare function unistUtilStringifyPosition( + value: Unist.Node | Unist.Position | Unist.Point +): string + +export = unistUtilStringifyPosition diff --git a/tools/ui/node_modules/vfile-message/package.json b/tools/ui/node_modules/vfile-message/package.json new file mode 100644 index 0000000000000000000000000000000000000000..a26c628dd9718a086b5f1998211e62dd21e91cb5 --- /dev/null +++ b/tools/ui/node_modules/vfile-message/package.json @@ -0,0 +1,85 @@ +{ + "name": "vfile-message", + "version": "2.0.4", + "description": "vfile utility to create a virtual message", + "license": "MIT", + "keywords": [ + "vfile", + "vfile-util", + "util", + "utility", + "virtual", + "file", + "message" + ], + "repository": "vfile/vfile-message", + "bugs": "https://github.com/vfile/vfile-message/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "types": "types/index.d.ts", + "files": [ + "types/index.d.ts", + "index.js" + ], + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + }, + "devDependencies": { + "browserify": "^16.0.0", + "dtslint": "^3.0.0", + "nyc": "^15.0.0", + "prettier": "^2.0.0", + "remark-cli": "^7.0.0", + "remark-preset-wooorm": "^6.0.0", + "tape": "^4.0.0", + "tinyify": "^2.0.0", + "xo": "^0.28.0" + }, + "scripts": { + "format": "remark . -qfo && prettier --write \"**/*.{js,ts}\" && xo --fix", + "build-bundle": "browserify . -s vfileMessage > vfile-message.js", + "build-mangle": "browserify . -s vfileMessage -p tinyify > vfile-message.min.js", + "build": "npm run build-bundle && npm run build-mangle", + "test-api": "node test", + "test-coverage": "nyc --reporter lcov tape test.js", + "test-types": "dtslint types", + "test": "npm run format && npm run build && npm run test-coverage && npm run test-types" + }, + "nyc": { + "check-coverage": true, + "lines": 100, + "functions": 100, + "branches": 100 + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "prettier": true, + "esnext": false, + "rules": { + "@typescript-eslint/member-ordering": "off" + }, + "ignores": [ + "types", + "vfile-message.js" + ] + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + } +} diff --git a/tools/ui/node_modules/vfile-message/readme.md b/tools/ui/node_modules/vfile-message/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..894504a24af33b12960990c74255fe5105ad2caf --- /dev/null +++ b/tools/ui/node_modules/vfile-message/readme.md @@ -0,0 +1,214 @@ +# vfile-message + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +Create [vfile][] messages. + +## Install + +[npm][]: + +```bash +npm install vfile-message +``` + +## Use + +```js +var VMessage = require('vfile-message') + +var message = new VMessage( + '`braavo` is misspelt; did you mean `bravo`?', + {line: 1, column: 8}, + 'spell:typo' +) + +console.log(message) +``` + +Yields: + +```js +{ [1:8: `braavo` is misspelt; did you mean `bravo`?] + reason: '`braavo` is misspelt; did you mean `bravo`?', + fatal: null, + line: 1, + column: 8, + location: + { start: { line: 1, column: 8 }, + end: { line: null, column: null } }, + source: 'spell', + ruleId: 'typo' } +``` + +## API + +### `VMessage(reason[, position][, origin])` + +Constructor of a message for `reason` at `position` from `origin`. +When an error is passed in as `reason`, copies the stack. + +##### Parameters + +###### `reason` + +Reason for message (`string` or `Error`). +Uses the stack and message of the error if given. + +###### `position` + +Place at which the message occurred in a file ([`Node`][node], +[`Position`][position], or [`Point`][point], optional). + +###### `origin` + +Place in code the message originates from (`string`, optional). + +Can either be the [`ruleId`][ruleid] (`'rule'`), or a string with both a +[`source`][source] and a [`ruleId`][ruleid] delimited with a colon +(`'source:rule'`). + +##### Extends + +[`Error`][error]. + +##### Returns + +An instance of itself. + +##### Properties + +###### `reason` + +Reason for message (`string`). + +###### `fatal` + +If `true`, marks associated file as no longer processable (`boolean?`). +If `false`, necessitates a (potential) change. +The value can also be `null` or `undefined`. + +###### `line` + +Starting line of error (`number?`). + +###### `column` + +Starting column of error (`number?`). + +###### `location` + +Full range information, when available ([`Position`][position]). +Has `start` and `end` properties, both set to an object with `line` and +`column`, set to `number?`. + +###### `source` + +Namespace of warning (`string?`). + +###### `ruleId` + +Category of message (`string?`). + +###### `stack` + +Stack of message (`string?`). + +##### Custom properties + +It’s OK to store custom data directly on the `VMessage`, some of those are +handled by [utilities][util]. + +###### `file` + +You may add a `file` property with a path of a file (used throughout the +[**VFile**][vfile] ecosystem). + +###### `note` + +You may add a `note` property with a long form description of the message +(supported by [`vfile-reporter`][reporter]). + +###### `url` + +You may add a `url` property with a link to documentation for the message. + +## Contribute + +See [`contributing.md`][contributing] in [`vfile/.github`][health] for ways to +get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://img.shields.io/travis/vfile/vfile-message.svg + +[build]: https://travis-ci.org/vfile/vfile-message + +[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile-message.svg + +[coverage]: https://codecov.io/github/vfile/vfile-message + +[downloads-badge]: https://img.shields.io/npm/dm/vfile-message.svg + +[downloads]: https://www.npmjs.com/package/vfile-message + +[size-badge]: https://img.shields.io/bundlephobia/minzip/vfile-message.svg + +[size]: https://bundlephobia.com/result?p=vfile-message + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-spectrum-7b16ff.svg + +[chat]: https://spectrum.chat/unified/vfile + +[npm]: https://docs.npmjs.com/cli/install + +[contributing]: https://github.com/vfile/.github/blob/master/contributing.md + +[support]: https://github.com/vfile/.github/blob/master/support.md + +[health]: https://github.com/vfile/.github + +[coc]: https://github.com/vfile/.github/blob/master/code-of-conduct.md + +[license]: license + +[author]: https://wooorm.com + +[error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error + +[node]: https://github.com/syntax-tree/unist#node + +[position]: https://github.com/syntax-tree/unist#position + +[point]: https://github.com/syntax-tree/unist#point + +[vfile]: https://github.com/vfile/vfile + +[util]: https://github.com/vfile/vfile#utilities + +[reporter]: https://github.com/vfile/vfile-reporter + +[ruleid]: #ruleid + +[source]: #source diff --git a/tools/ui/node_modules/vfile-message/types/index.d.ts b/tools/ui/node_modules/vfile-message/types/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d2178431aff30958ade705bcc9604b89b4a8be96 --- /dev/null +++ b/tools/ui/node_modules/vfile-message/types/index.d.ts @@ -0,0 +1,98 @@ +// TypeScript Version: 3.0 + +import * as Unist from 'unist' + +declare namespace vfileMessage { + /** + * Create a virtual message. + */ + interface VFileMessage extends Error { + /** + * Constructor of a message for `reason` at `position` from `origin`. + * When an error is passed in as `reason`, copies the `stack`. + * + * @param reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given. + * @param position Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional). + * @param origin Place in code the message originates from (`string`, optional). + */ + ( + reason: string | Error, + position?: Unist.Node | Unist.Position | Unist.Point, + origin?: string + ): VFileMessage + + /** + * Constructor of a message for `reason` at `position` from `origin`. + * When an error is passed in as `reason`, copies the `stack`. + * + * @param reason Reason for message (`string` or `Error`). Uses the stack and message of the error if given. + * @param position Place at which the message occurred in a file (`Node`, `Position`, or `Point`, optional). + * @param origin Place in code the message originates from (`string`, optional). + */ + new ( + reason: string | Error, + position?: Unist.Node | Unist.Position | Unist.Point, + origin?: string + ): VFileMessage + + /** + * Category of message. + */ + ruleId: string | null + + /** + * Reason for message. + */ + reason: string + + /** + * Starting line of error. + */ + line: number | null + + /** + * Starting column of error. + */ + column: number | null + + /** + * Full range information, when available. + * Has start and end properties, both set to an object with line and column, set to number?. + */ + location: Unist.Position + + /** + * Namespace of warning. + */ + source: string | null + + /** + * If true, marks associated file as no longer processable. + */ + fatal?: boolean | null + + /** + * You may add a file property with a path of a file (used throughout the VFile ecosystem). + */ + file?: string + + /** + * You may add a note property with a long form description of the message (supported by vfile-reporter). + */ + note?: string + + /** + * You may add a url property with a link to documentation for the message. + */ + url?: string + + /** + * It’s OK to store custom data directly on the VMessage, some of those are handled by utilities. + */ + [key: string]: unknown + } +} + +declare const vfileMessage: vfileMessage.VFileMessage + +export = vfileMessage diff --git a/tools/ui/node_modules/vfile/index.d.ts b/tools/ui/node_modules/vfile/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3d87485dabb7cbc56452e906a6776157af04bdf2 --- /dev/null +++ b/tools/ui/node_modules/vfile/index.d.ts @@ -0,0 +1,153 @@ +import type {VFile} from './lib/index.js' + +// See: +declare const emptyObjectSymbol: unique symbol + +// To do: next major: remove. +export type {Options as MessageOptions} from 'vfile-message' + +export {VFile} from './lib/index.js' + +// To do: next major: remove. +// Deprecated names (w/ prefix): +export type { + Compatible as VFileCompatible, + DataMap as VFileDataMap, + Data as VFileData, + Options as VFileOptions, + ReporterSettings as VFileReporterSettings, + Reporter as VFileReporter, + Value as VFileValue +} + +/** + * Things that can be passed to the constructor. + */ +export type Compatible = Options | URL | VFile | Value + +/** + * Raw source map. + * + * See: + * . + */ +export interface Map { + /** + * The generated file this source map is associated with. + */ + file: string + /** + * A string of base64 VLQs which contain the actual mappings. + */ + mappings: string + /** + * An array of identifiers which can be referenced by individual mappings. + */ + names: Array + /** + * An array of contents of the original source files. + */ + sourcesContent?: Array | undefined + /** + * The URL root from which all sources are relative. + */ + sourceRoot?: string | undefined + /** + * An array of URLs to the original source files. + */ + sources: Array + /** + * Which version of the source map spec this map is following. + */ + version: number +} + +/** + * This map registers the type of the `data` key of a `VFile`. + * + * This type can be augmented to register custom `data` types. + * + * @example + * declare module 'vfile' { + * interface DataMap { + * // `file.data.name` is typed as `string` + * name: string + * } + * } + */ +export interface DataMap { + [emptyObjectSymbol]?: never +} + +/** + * Custom info. + * + * Known attributes can be added to {@linkcode DataMap} + */ +export type Data = Record & Partial + +/** + * Configuration. + */ +export interface Options { + /** + * Arbitrary fields that will be shallow copied over to the new file. + */ + [key: string]: unknown + /** + * Set `basename` (name). + */ + basename?: string | null | undefined + /** + * Set `cwd` (working directory). + */ + cwd?: string | null | undefined + /** + * Set `data` (associated info). + */ + data?: Data | null | undefined + /** + * Set `dirname` (path w/o basename). + */ + dirname?: string | null | undefined + /** + * Set `extname` (extension with dot). + */ + extname?: string | null | undefined + /** + * Set `history` (paths the file moved between). + */ + history?: Array | null | undefined + /** + * Set `path` (current path). + */ + path?: URL | string | null | undefined + /** + * Set `stem` (name without extension). + */ + stem?: string | null | undefined + /** + * Set `value` (the contents of the file). + */ + value?: Value | null | undefined +} + +/** + * Configuration for reporters. + */ +export type ReporterSettings = Record + +/** + * Type for a reporter. + */ +export type Reporter = ( + files: Array, + options: Settings +) => string + +/** + * Contents of the file. + * + * Can either be text or a `Uint8Array` structure. + */ +export type Value = Uint8Array | string diff --git a/tools/ui/node_modules/vfile/index.js b/tools/ui/node_modules/vfile/index.js new file mode 100644 index 0000000000000000000000000000000000000000..329a4dcc6be578a3bb1f7d17309649aeb9614f52 --- /dev/null +++ b/tools/ui/node_modules/vfile/index.js @@ -0,0 +1,2 @@ +// More types exposed from `index.d.ts`. +export {VFile} from './lib/index.js' diff --git a/tools/ui/node_modules/vfile/lib/index.d.ts b/tools/ui/node_modules/vfile/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c1e2a87e31ce6a2463d0dc6f927c601e4214b748 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/index.d.ts @@ -0,0 +1,1465 @@ +export class VFile { + /** + * Create a new virtual file. + * + * `options` is treated as: + * + * * `string` or `Uint8Array` — `{value: options}` + * * `URL` — `{path: options}` + * * `VFile` — shallow copies its data over to the new file + * * `object` — all fields are shallow copied over to the new file + * + * Path related fields are set in the following order (least specific to + * most specific): `history`, `path`, `basename`, `stem`, `extname`, + * `dirname`. + * + * You cannot set `dirname` or `extname` without setting either `history`, + * `path`, `basename`, or `stem` too. + * + * @param {Compatible | null | undefined} [value] + * File value. + * @returns + * New instance. + */ + constructor(value?: Compatible | null | undefined); + /** + * Base of `path` (default: `process.cwd()` or `'/'` in browsers). + * + * @type {string} + */ + cwd: string; + /** + * Place to store custom info (default: `{}`). + * + * It’s OK to store custom data directly on the file but moving it to + * `data` is recommended. + * + * @type {Data} + */ + data: Data; + /** + * List of file paths the file moved between. + * + * The first is the original path and the last is the current path. + * + * @type {Array} + */ + history: Array; + /** + * List of messages associated with the file. + * + * @type {Array} + */ + messages: Array; + /** + * Raw value. + * + * @type {Value} + */ + value: Value; + /** + * Source map. + * + * This type is equivalent to the `RawSourceMap` type from the `source-map` + * module. + * + * @type {Map | null | undefined} + */ + map: Map | null | undefined; + /** + * Custom, non-string, compiled, representation. + * + * This is used by unified to store non-string results. + * One example is when turning markdown into React nodes. + * + * @type {unknown} + */ + result: unknown; + /** + * Whether a file was saved to disk. + * + * This is used by vfile reporters. + * + * @type {boolean} + */ + stored: boolean; + /** + * Set basename (including extname) (`'index.min.js'`). + * + * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` + * on windows). + * Cannot be nullified (use `file.path = file.dirname` instead). + * + * @param {string} basename + * Basename. + * @returns {undefined} + * Nothing. + */ + set basename(basename: string); + /** + * Get the basename (including extname) (example: `'index.min.js'`). + * + * @returns {string | undefined} + * Basename. + */ + get basename(): string | undefined; + /** + * Set the full path (example: `'~/index.min.js'`). + * + * Cannot be nullified. + * You can set a file URL (a `URL` object with a `file:` protocol) which will + * be turned into a path with `url.fileURLToPath`. + * + * @param {URL | string} path + * Path. + * @returns {undefined} + * Nothing. + */ + set path(path: string | URL); + /** + * Get the full path (example: `'~/index.min.js'`). + * + * @returns {string} + * Path. + */ + get path(): string; + /** + * Set the parent path (example: `'~'`). + * + * Cannot be set if there’s no `path` yet. + * + * @param {string | undefined} dirname + * Dirname. + * @returns {undefined} + * Nothing. + */ + set dirname(dirname: string | undefined); + /** + * Get the parent path (example: `'~'`). + * + * @returns {string | undefined} + * Dirname. + */ + get dirname(): string | undefined; + /** + * Set the extname (including dot) (example: `'.js'`). + * + * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` + * on windows). + * Cannot be set if there’s no `path` yet. + * + * @param {string | undefined} extname + * Extname. + * @returns {undefined} + * Nothing. + */ + set extname(extname: string | undefined); + /** + * Get the extname (including dot) (example: `'.js'`). + * + * @returns {string | undefined} + * Extname. + */ + get extname(): string | undefined; + /** + * Set the stem (basename w/o extname) (example: `'index.min'`). + * + * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` + * on windows). + * Cannot be nullified (use `file.path = file.dirname` instead). + * + * @param {string} stem + * Stem. + * @returns {undefined} + * Nothing. + */ + set stem(stem: string); + /** + * Get the stem (basename w/o extname) (example: `'index.min'`). + * + * @returns {string | undefined} + * Stem. + */ + get stem(): string | undefined; + /** + * Create a fatal message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `true` (error; file not usable) + * and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {never} + * Never. + * @throws {VFileMessage} + * Message. + */ + fail(reason: string, options?: MessageOptions | null | undefined): never; + /** + * Create a fatal message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `true` (error; file not usable) + * and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {never} + * Never. + * @throws {VFileMessage} + * Message. + */ + fail(reason: string, parent: Node | NodeLike | null | undefined, origin?: string | null | undefined): never; + /** + * Create a fatal message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `true` (error; file not usable) + * and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {never} + * Never. + * @throws {VFileMessage} + * Message. + */ + fail(reason: string, place: Point | Position | null | undefined, origin?: string | null | undefined): never; + /** + * Create a fatal message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `true` (error; file not usable) + * and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {never} + * Never. + * @throws {VFileMessage} + * Message. + */ + fail(reason: string, origin?: string | null | undefined): never; + /** + * Create a fatal message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `true` (error; file not usable) + * and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {never} + * Never. + * @throws {VFileMessage} + * Message. + */ + fail(cause: Error | VFileMessage, parent: Node | NodeLike | null | undefined, origin?: string | null | undefined): never; + /** + * Create a fatal message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `true` (error; file not usable) + * and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {never} + * Never. + * @throws {VFileMessage} + * Message. + */ + fail(cause: Error | VFileMessage, place: Point | Position | null | undefined, origin?: string | null | undefined): never; + /** + * Create a fatal message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `true` (error; file not usable) + * and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {never} + * Never. + * @throws {VFileMessage} + * Message. + */ + fail(cause: Error | VFileMessage, origin?: string | null | undefined): never; + /** + * Create an info message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `undefined` (info; change + * likely not needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + info(reason: string, options?: MessageOptions | null | undefined): VFileMessage; + /** + * Create an info message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `undefined` (info; change + * likely not needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + info(reason: string, parent: Node | NodeLike | null | undefined, origin?: string | null | undefined): VFileMessage; + /** + * Create an info message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `undefined` (info; change + * likely not needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + info(reason: string, place: Point | Position | null | undefined, origin?: string | null | undefined): VFileMessage; + /** + * Create an info message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `undefined` (info; change + * likely not needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + info(reason: string, origin?: string | null | undefined): VFileMessage; + /** + * Create an info message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `undefined` (info; change + * likely not needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + info(cause: Error | VFileMessage, parent: Node | NodeLike | null | undefined, origin?: string | null | undefined): VFileMessage; + /** + * Create an info message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `undefined` (info; change + * likely not needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + info(cause: Error | VFileMessage, place: Point | Position | null | undefined, origin?: string | null | undefined): VFileMessage; + /** + * Create an info message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `undefined` (info; change + * likely not needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + info(cause: Error | VFileMessage, origin?: string | null | undefined): VFileMessage; + /** + * Create a message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `false` (warning; change may be + * needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + message(reason: string, options?: MessageOptions | null | undefined): VFileMessage; + /** + * Create a message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `false` (warning; change may be + * needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + message(reason: string, parent: Node | NodeLike | null | undefined, origin?: string | null | undefined): VFileMessage; + /** + * Create a message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `false` (warning; change may be + * needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + message(reason: string, place: Point | Position | null | undefined, origin?: string | null | undefined): VFileMessage; + /** + * Create a message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `false` (warning; change may be + * needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + message(reason: string, origin?: string | null | undefined): VFileMessage; + /** + * Create a message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `false` (warning; change may be + * needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + message(cause: Error | VFileMessage, parent: Node | NodeLike | null | undefined, origin?: string | null | undefined): VFileMessage; + /** + * Create a message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `false` (warning; change may be + * needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + message(cause: Error | VFileMessage, place: Point | Position | null | undefined, origin?: string | null | undefined): VFileMessage; + /** + * Create a message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `false` (warning; change may be + * needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + message(cause: Error | VFileMessage, origin?: string | null | undefined): VFileMessage; + /** + * Serialize the file. + * + * > **Note**: which encodings are supported depends on the engine. + * > For info on Node.js, see: + * > . + * + * @param {string | null | undefined} [encoding='utf8'] + * Character encoding to understand `value` as when it’s a `Uint8Array` + * (default: `'utf-8'`). + * @returns {string} + * Serialized file. + */ + toString(encoding?: string | null | undefined): string; +} +export type NodeLike = object & { + type: string; + position?: Position | undefined; +}; +import type { Data } from 'vfile'; +import { VFileMessage } from 'vfile-message'; +import type { Value } from 'vfile'; +import type { Map } from 'vfile'; +import type { Options as MessageOptions } from 'vfile-message'; +import type { Node } from 'unist'; +import type { Point } from 'unist'; +import type { Position } from 'unist'; +import type { Compatible } from 'vfile'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/index.d.ts.map b/tools/ui/node_modules/vfile/lib/index.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..5e75a040cdf2f4efc2dd8ef356924ff6e7a034b2 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA6BA;IACE;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,oBALW,UAAU,GAAG,IAAI,GAAG,SAAS,EA4HvC;IAvGC;;;;OAIG;IAGH,KAJU,MAAM,CAIgC;IAEhD;;;;;;;OAOG;IACH,MAFU,IAAI,CAEA;IAEd;;;;;;OAMG;IACH,SAFU,KAAK,CAAC,MAAM,CAAC,CAEN;IAEjB;;;;OAIG;IACH,UAFU,KAAK,CAAC,YAAY,CAAC,CAEX;IAElB;;;;OAIG;IACH,OAFU,KAAK,CAEL;IAIV;;;;;;;OAOG;IACH,KAFU,GAAG,GAAG,IAAI,GAAG,SAAS,CAExB;IAER;;;;;;;OAOG;IACH,QAFU,OAAO,CAEN;IAEX;;;;;;OAMG;IACH,QAFU,OAAO,CAEN;IA8Cb;;;;;;;;;;;OAWG;IACH,+BAIC;IA5BD;;;;;OAKG;IACH,mCAIC;IAkGD;;;;;;;;;;;OAWG;IACH,6BAUC;IAhCD;;;;;OAKG;IACH,mBAEC;IAhED;;;;;;;;;OASG;IACH,yCAGC;IAzBD;;;;;OAKG;IACH,kCAIC;IA6BD;;;;;;;;;;;OAWG;IACH,yCAeC;IAvCD;;;;;OAKG;IACH,kCAIC;IA6ED;;;;;;;;;;;OAWG;IACH,uBAIC;IA5BD;;;;;OAKG;IACH,+BAIC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8BE,aACQ,MAAM,YACN,cAAc,GAAG,IAAI,GAAG,SAAS,GAC/B,KAAK,CAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,aACQ,MAAM,UACN,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,WAClC,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,KAAK,CAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,aACQ,MAAM,SACN,KAAK,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,WACnC,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,KAAK,CAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,aACQ,MAAM,WACN,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,KAAK,CAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,YACQ,KAAK,GAAG,YAAY,UACpB,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,WAClC,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,KAAK,CAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,YACQ,KAAK,GAAG,YAAY,SACpB,KAAK,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,WACnC,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,KAAK,CAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,YACQ,KAAK,GAAG,YAAY,WACpB,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,KAAK,CAEf;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8BA,aACQ,MAAM,YACN,cAAc,GAAG,IAAI,GAAG,SAAS,GAC/B,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,aACQ,MAAM,UACN,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,WAClC,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,aACQ,MAAM,SACN,KAAK,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,WACnC,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,aACQ,MAAM,WACN,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,YACQ,KAAK,GAAG,YAAY,UACpB,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,WAClC,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,YACQ,KAAK,GAAG,YAAY,SACpB,KAAK,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,WACnC,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,YACQ,KAAK,GAAG,YAAY,WACpB,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA4BA,gBACQ,MAAM,YACN,cAAc,GAAG,IAAI,GAAG,SAAS,GAC/B,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,gBACQ,MAAM,UACN,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,WAClC,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,gBACQ,MAAM,SACN,KAAK,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,WACnC,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,gBACQ,MAAM,WACN,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,eACQ,KAAK,GAAG,YAAY,UACpB,IAAI,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,WAClC,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,eACQ,KAAK,GAAG,YAAY,SACpB,KAAK,GAAG,QAAQ,GAAG,IAAI,GAAG,SAAS,WACnC,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,YAAY,CAEtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,eACQ,KAAK,GAAG,YAAY,WACpB,MAAM,GAAG,IAAI,GAAG,SAAS,GACvB,YAAY,CAEtB;IA8BH;;;;;;;;;;;;OAYG;IACH,oBANW,MAAM,GAAG,IAAI,GAAG,SAAS,GAGvB,MAAM,CAclB;CACF;uBAxjBY,MAAM,GAAG;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAAC;0BAJb,OAAO;6BAOpC,eAAe;2BAPc,OAAO;yBAAP,OAAO;+CADnB,eAAe;0BADnB,OAAO;2BAAP,OAAO;8BAAP,OAAO;gCAES,OAAO"} \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/index.js b/tools/ui/node_modules/vfile/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..68db7f9f1f201104cd9970078a524473cfc24acf --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/index.js @@ -0,0 +1,643 @@ +/** + * @import {Node, Point, Position} from 'unist' + * @import {Options as MessageOptions} from 'vfile-message' + * @import {Compatible, Data, Map, Options, Value} from 'vfile' + */ + +/** + * @typedef {object & {type: string, position?: Position | undefined}} NodeLike + */ + +import {VFileMessage} from 'vfile-message' +import {minpath} from '#minpath' +import {minproc} from '#minproc' +import {urlToPath, isUrl} from '#minurl' + +/** + * Order of setting (least specific to most), we need this because otherwise + * `{stem: 'a', path: '~/b.js'}` would throw, as a path is needed before a + * stem can be set. + */ +const order = /** @type {const} */ ([ + 'history', + 'path', + 'basename', + 'stem', + 'extname', + 'dirname' +]) + +export class VFile { + /** + * Create a new virtual file. + * + * `options` is treated as: + * + * * `string` or `Uint8Array` — `{value: options}` + * * `URL` — `{path: options}` + * * `VFile` — shallow copies its data over to the new file + * * `object` — all fields are shallow copied over to the new file + * + * Path related fields are set in the following order (least specific to + * most specific): `history`, `path`, `basename`, `stem`, `extname`, + * `dirname`. + * + * You cannot set `dirname` or `extname` without setting either `history`, + * `path`, `basename`, or `stem` too. + * + * @param {Compatible | null | undefined} [value] + * File value. + * @returns + * New instance. + */ + constructor(value) { + /** @type {Options | VFile} */ + let options + + if (!value) { + options = {} + } else if (isUrl(value)) { + options = {path: value} + } else if (typeof value === 'string' || isUint8Array(value)) { + options = {value} + } else { + options = value + } + + /* eslint-disable no-unused-expressions */ + + /** + * Base of `path` (default: `process.cwd()` or `'/'` in browsers). + * + * @type {string} + */ + // Prevent calling `cwd` (which could be expensive) if it’s not needed; + // the empty string will be overridden in the next block. + this.cwd = 'cwd' in options ? '' : minproc.cwd() + + /** + * Place to store custom info (default: `{}`). + * + * It’s OK to store custom data directly on the file but moving it to + * `data` is recommended. + * + * @type {Data} + */ + this.data = {} + + /** + * List of file paths the file moved between. + * + * The first is the original path and the last is the current path. + * + * @type {Array} + */ + this.history = [] + + /** + * List of messages associated with the file. + * + * @type {Array} + */ + this.messages = [] + + /** + * Raw value. + * + * @type {Value} + */ + this.value + + // The below are non-standard, they are “well-known”. + // As in, used in several tools. + /** + * Source map. + * + * This type is equivalent to the `RawSourceMap` type from the `source-map` + * module. + * + * @type {Map | null | undefined} + */ + this.map + + /** + * Custom, non-string, compiled, representation. + * + * This is used by unified to store non-string results. + * One example is when turning markdown into React nodes. + * + * @type {unknown} + */ + this.result + + /** + * Whether a file was saved to disk. + * + * This is used by vfile reporters. + * + * @type {boolean} + */ + this.stored + /* eslint-enable no-unused-expressions */ + + // Set path related properties in the correct order. + let index = -1 + + while (++index < order.length) { + const field = order[index] + + // Note: we specifically use `in` instead of `hasOwnProperty` to accept + // `vfile`s too. + if ( + field in options && + options[field] !== undefined && + options[field] !== null + ) { + // @ts-expect-error: TS doesn’t understand basic reality. + this[field] = field === 'history' ? [...options[field]] : options[field] + } + } + + /** @type {string} */ + let field + + // Set non-path related properties. + for (field in options) { + // @ts-expect-error: fine to set other things. + if (!order.includes(field)) { + // @ts-expect-error: fine to set other things. + this[field] = options[field] + } + } + } + + /** + * Get the basename (including extname) (example: `'index.min.js'`). + * + * @returns {string | undefined} + * Basename. + */ + get basename() { + return typeof this.path === 'string' + ? minpath.basename(this.path) + : undefined + } + + /** + * Set basename (including extname) (`'index.min.js'`). + * + * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` + * on windows). + * Cannot be nullified (use `file.path = file.dirname` instead). + * + * @param {string} basename + * Basename. + * @returns {undefined} + * Nothing. + */ + set basename(basename) { + assertNonEmpty(basename, 'basename') + assertPart(basename, 'basename') + this.path = minpath.join(this.dirname || '', basename) + } + + /** + * Get the parent path (example: `'~'`). + * + * @returns {string | undefined} + * Dirname. + */ + get dirname() { + return typeof this.path === 'string' + ? minpath.dirname(this.path) + : undefined + } + + /** + * Set the parent path (example: `'~'`). + * + * Cannot be set if there’s no `path` yet. + * + * @param {string | undefined} dirname + * Dirname. + * @returns {undefined} + * Nothing. + */ + set dirname(dirname) { + assertPath(this.basename, 'dirname') + this.path = minpath.join(dirname || '', this.basename) + } + + /** + * Get the extname (including dot) (example: `'.js'`). + * + * @returns {string | undefined} + * Extname. + */ + get extname() { + return typeof this.path === 'string' + ? minpath.extname(this.path) + : undefined + } + + /** + * Set the extname (including dot) (example: `'.js'`). + * + * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` + * on windows). + * Cannot be set if there’s no `path` yet. + * + * @param {string | undefined} extname + * Extname. + * @returns {undefined} + * Nothing. + */ + set extname(extname) { + assertPart(extname, 'extname') + assertPath(this.dirname, 'extname') + + if (extname) { + if (extname.codePointAt(0) !== 46 /* `.` */) { + throw new Error('`extname` must start with `.`') + } + + if (extname.includes('.', 1)) { + throw new Error('`extname` cannot contain multiple dots') + } + } + + this.path = minpath.join(this.dirname, this.stem + (extname || '')) + } + + /** + * Get the full path (example: `'~/index.min.js'`). + * + * @returns {string} + * Path. + */ + get path() { + return this.history[this.history.length - 1] + } + + /** + * Set the full path (example: `'~/index.min.js'`). + * + * Cannot be nullified. + * You can set a file URL (a `URL` object with a `file:` protocol) which will + * be turned into a path with `url.fileURLToPath`. + * + * @param {URL | string} path + * Path. + * @returns {undefined} + * Nothing. + */ + set path(path) { + if (isUrl(path)) { + path = urlToPath(path) + } + + assertNonEmpty(path, 'path') + + if (this.path !== path) { + this.history.push(path) + } + } + + /** + * Get the stem (basename w/o extname) (example: `'index.min'`). + * + * @returns {string | undefined} + * Stem. + */ + get stem() { + return typeof this.path === 'string' + ? minpath.basename(this.path, this.extname) + : undefined + } + + /** + * Set the stem (basename w/o extname) (example: `'index.min'`). + * + * Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` + * on windows). + * Cannot be nullified (use `file.path = file.dirname` instead). + * + * @param {string} stem + * Stem. + * @returns {undefined} + * Nothing. + */ + set stem(stem) { + assertNonEmpty(stem, 'stem') + assertPart(stem, 'stem') + this.path = minpath.join(this.dirname || '', stem + (this.extname || '')) + } + + // Normal prototypal methods. + /** + * Create a fatal message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `true` (error; file not usable) + * and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {never} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {never} + * Never. + * @throws {VFileMessage} + * Message. + */ + fail(causeOrReason, optionsOrParentOrPlace, origin) { + // @ts-expect-error: the overloads are fine. + const message = this.message(causeOrReason, optionsOrParentOrPlace, origin) + + message.fatal = true + + throw message + } + + /** + * Create an info message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `undefined` (info; change + * likely not needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + info(causeOrReason, optionsOrParentOrPlace, origin) { + // @ts-expect-error: the overloads are fine. + const message = this.message(causeOrReason, optionsOrParentOrPlace, origin) + + message.fatal = undefined + + return message + } + + /** + * Create a message for `reason` associated with the file. + * + * The `fatal` field of the message is set to `false` (warning; change may be + * needed) and the `file` field is set to the current file path. + * The message is added to the `messages` field on `file`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {MessageOptions | null | undefined} [options] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns {VFileMessage} + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | MessageOptions | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns {VFileMessage} + * Message. + */ + message(causeOrReason, optionsOrParentOrPlace, origin) { + const message = new VFileMessage( + // @ts-expect-error: the overloads are fine. + causeOrReason, + optionsOrParentOrPlace, + origin + ) + + if (this.path) { + message.name = this.path + ':' + message.name + message.file = this.path + } + + message.fatal = false + + this.messages.push(message) + + return message + } + + /** + * Serialize the file. + * + * > **Note**: which encodings are supported depends on the engine. + * > For info on Node.js, see: + * > . + * + * @param {string | null | undefined} [encoding='utf8'] + * Character encoding to understand `value` as when it’s a `Uint8Array` + * (default: `'utf-8'`). + * @returns {string} + * Serialized file. + */ + toString(encoding) { + if (this.value === undefined) { + return '' + } + + if (typeof this.value === 'string') { + return this.value + } + + const decoder = new TextDecoder(encoding || undefined) + return decoder.decode(this.value) + } +} + +/** + * Assert that `part` is not a path (as in, does not contain `path.sep`). + * + * @param {string | null | undefined} part + * File path part. + * @param {string} name + * Part name. + * @returns {undefined} + * Nothing. + */ +function assertPart(part, name) { + if (part && part.includes(minpath.sep)) { + throw new Error( + '`' + name + '` cannot be a path: did not expect `' + minpath.sep + '`' + ) + } +} + +/** + * Assert that `part` is not empty. + * + * @param {string | undefined} part + * Thing. + * @param {string} name + * Part name. + * @returns {asserts part is string} + * Nothing. + */ +function assertNonEmpty(part, name) { + if (!part) { + throw new Error('`' + name + '` cannot be empty') + } +} + +/** + * Assert `path` exists. + * + * @param {string | undefined} path + * Path. + * @param {string} name + * Dependency name. + * @returns {asserts path is string} + * Nothing. + */ +function assertPath(path, name) { + if (!path) { + throw new Error('Setting `' + name + '` requires `path` to be set too') + } +} + +/** + * Assert `value` is an `Uint8Array`. + * + * @param {unknown} value + * thing. + * @returns {value is Uint8Array} + * Whether `value` is an `Uint8Array`. + */ +function isUint8Array(value) { + return Boolean( + value && + typeof value === 'object' && + 'byteLength' in value && + 'byteOffset' in value + ) +} diff --git a/tools/ui/node_modules/vfile/lib/minpath.browser.d.ts b/tools/ui/node_modules/vfile/lib/minpath.browser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ee1dcc45f18d12bf882c151bbe7c09e68993cde2 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minpath.browser.d.ts @@ -0,0 +1,47 @@ +export namespace minpath { + export { basename }; + export { dirname }; + export { extname }; + export { join }; + export let sep: string; +} +/** + * Get the basename from a path. + * + * @param {string} path + * File path. + * @param {string | null | undefined} [extname] + * Extension to strip. + * @returns {string} + * Stem or basename. + */ +declare function basename(path: string, extname?: string | null | undefined): string; +/** + * Get the dirname from a path. + * + * @param {string} path + * File path. + * @returns {string} + * File path. + */ +declare function dirname(path: string): string; +/** + * Get an extname from a path. + * + * @param {string} path + * File path. + * @returns {string} + * Extname. + */ +declare function extname(path: string): string; +/** + * Join segments from a path. + * + * @param {Array} segments + * Path segments. + * @returns {string} + * File path. + */ +declare function join(...segments: Array): string; +export {}; +//# sourceMappingURL=minpath.browser.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minpath.browser.d.ts.map b/tools/ui/node_modules/vfile/lib/minpath.browser.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..d2ff5f3acfcfce7cedfb0176a2c24f28e3ea7cca --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minpath.browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"minpath.browser.d.ts","sourceRoot":"","sources":["minpath.browser.js"],"names":[],"mappings":";;;;;;;AAuDA;;;;;;;;;GASG;AACH,gCAPW,MAAM,YAEN,MAAM,GAAG,IAAI,GAAG,SAAS,GAEvB,MAAM,CAuFlB;AAED;;;;;;;GAOG;AACH,+BALW,MAAM,GAEJ,MAAM,CAmClB;AAED;;;;;;;GAOG;AACH,+BALW,MAAM,GAEJ,MAAM,CAgElB;AAED;;;;;;;GAOG;AACH,mCALW,KAAK,CAAC,MAAM,CAAC,GAEX,MAAM,CAkBlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minpath.browser.js b/tools/ui/node_modules/vfile/lib/minpath.browser.js new file mode 100644 index 0000000000000000000000000000000000000000..83bcb1a849563c650db583630dcecb5b70dd0163 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minpath.browser.js @@ -0,0 +1,426 @@ +// A derivative work based on: +// . +// Which is licensed: +// +// MIT License +// +// Copyright (c) 2013 James Halliday +// +// 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. +// A derivative work based on: +// +// Parts of that are extracted from Node’s internal `path` module: +// . +// Which is licensed: +// +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +export const minpath = {basename, dirname, extname, join, sep: '/'} + +/* eslint-disable max-depth, complexity */ + +/** + * Get the basename from a path. + * + * @param {string} path + * File path. + * @param {string | null | undefined} [extname] + * Extension to strip. + * @returns {string} + * Stem or basename. + */ +function basename(path, extname) { + if (extname !== undefined && typeof extname !== 'string') { + throw new TypeError('"ext" argument must be a string') + } + + assertPath(path) + let start = 0 + let end = -1 + let index = path.length + /** @type {boolean | undefined} */ + let seenNonSlash + + if ( + extname === undefined || + extname.length === 0 || + extname.length > path.length + ) { + while (index--) { + if (path.codePointAt(index) === 47 /* `/` */) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now. + if (seenNonSlash) { + start = index + 1 + break + } + } else if (end < 0) { + // We saw the first non-path separator, mark this as the end of our + // path component. + seenNonSlash = true + end = index + 1 + } + } + + return end < 0 ? '' : path.slice(start, end) + } + + if (extname === path) { + return '' + } + + let firstNonSlashEnd = -1 + let extnameIndex = extname.length - 1 + + while (index--) { + if (path.codePointAt(index) === 47 /* `/` */) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now. + if (seenNonSlash) { + start = index + 1 + break + } + } else { + if (firstNonSlashEnd < 0) { + // We saw the first non-path separator, remember this index in case + // we need it if the extension ends up not matching. + seenNonSlash = true + firstNonSlashEnd = index + 1 + } + + if (extnameIndex > -1) { + // Try to match the explicit extension. + if (path.codePointAt(index) === extname.codePointAt(extnameIndex--)) { + if (extnameIndex < 0) { + // We matched the extension, so mark this as the end of our path + // component + end = index + } + } else { + // Extension does not match, so our result is the entire path + // component + extnameIndex = -1 + end = firstNonSlashEnd + } + } + } + } + + if (start === end) { + end = firstNonSlashEnd + } else if (end < 0) { + end = path.length + } + + return path.slice(start, end) +} + +/** + * Get the dirname from a path. + * + * @param {string} path + * File path. + * @returns {string} + * File path. + */ +function dirname(path) { + assertPath(path) + + if (path.length === 0) { + return '.' + } + + let end = -1 + let index = path.length + /** @type {boolean | undefined} */ + let unmatchedSlash + + // Prefix `--` is important to not run on `0`. + while (--index) { + if (path.codePointAt(index) === 47 /* `/` */) { + if (unmatchedSlash) { + end = index + break + } + } else if (!unmatchedSlash) { + // We saw the first non-path separator + unmatchedSlash = true + } + } + + return end < 0 + ? path.codePointAt(0) === 47 /* `/` */ + ? '/' + : '.' + : end === 1 && path.codePointAt(0) === 47 /* `/` */ + ? '//' + : path.slice(0, end) +} + +/** + * Get an extname from a path. + * + * @param {string} path + * File path. + * @returns {string} + * Extname. + */ +function extname(path) { + assertPath(path) + + let index = path.length + + let end = -1 + let startPart = 0 + let startDot = -1 + // Track the state of characters (if any) we see before our first dot and + // after any path separator we find. + let preDotState = 0 + /** @type {boolean | undefined} */ + let unmatchedSlash + + while (index--) { + const code = path.codePointAt(index) + + if (code === 47 /* `/` */) { + // If we reached a path separator that was not part of a set of path + // separators at the end of the string, stop now. + if (unmatchedSlash) { + startPart = index + 1 + break + } + + continue + } + + if (end < 0) { + // We saw the first non-path separator, mark this as the end of our + // extension. + unmatchedSlash = true + end = index + 1 + } + + if (code === 46 /* `.` */) { + // If this is our first dot, mark it as the start of our extension. + if (startDot < 0) { + startDot = index + } else if (preDotState !== 1) { + preDotState = 1 + } + } else if (startDot > -1) { + // We saw a non-dot and non-path separator before our dot, so we should + // have a good chance at having a non-empty extension. + preDotState = -1 + } + } + + if ( + startDot < 0 || + end < 0 || + // We saw a non-dot character immediately before the dot. + preDotState === 0 || + // The (right-most) trimmed path component is exactly `..`. + (preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) + ) { + return '' + } + + return path.slice(startDot, end) +} + +/** + * Join segments from a path. + * + * @param {Array} segments + * Path segments. + * @returns {string} + * File path. + */ +function join(...segments) { + let index = -1 + /** @type {string | undefined} */ + let joined + + while (++index < segments.length) { + assertPath(segments[index]) + + if (segments[index]) { + joined = + joined === undefined ? segments[index] : joined + '/' + segments[index] + } + } + + return joined === undefined ? '.' : normalize(joined) +} + +/** + * Normalize a basic file path. + * + * @param {string} path + * File path. + * @returns {string} + * File path. + */ +// Note: `normalize` is not exposed as `path.normalize`, so some code is +// manually removed from it. +function normalize(path) { + assertPath(path) + + const absolute = path.codePointAt(0) === 47 /* `/` */ + + // Normalize the path according to POSIX rules. + let value = normalizeString(path, !absolute) + + if (value.length === 0 && !absolute) { + value = '.' + } + + if (value.length > 0 && path.codePointAt(path.length - 1) === 47 /* / */) { + value += '/' + } + + return absolute ? '/' + value : value +} + +/** + * Resolve `.` and `..` elements in a path with directory names. + * + * @param {string} path + * File path. + * @param {boolean} allowAboveRoot + * Whether `..` can move above root. + * @returns {string} + * File path. + */ +function normalizeString(path, allowAboveRoot) { + let result = '' + let lastSegmentLength = 0 + let lastSlash = -1 + let dots = 0 + let index = -1 + /** @type {number | undefined} */ + let code + /** @type {number} */ + let lastSlashIndex + + while (++index <= path.length) { + if (index < path.length) { + code = path.codePointAt(index) + } else if (code === 47 /* `/` */) { + break + } else { + code = 47 /* `/` */ + } + + if (code === 47 /* `/` */) { + if (lastSlash === index - 1 || dots === 1) { + // Empty. + } else if (lastSlash !== index - 1 && dots === 2) { + if ( + result.length < 2 || + lastSegmentLength !== 2 || + result.codePointAt(result.length - 1) !== 46 /* `.` */ || + result.codePointAt(result.length - 2) !== 46 /* `.` */ + ) { + if (result.length > 2) { + lastSlashIndex = result.lastIndexOf('/') + + if (lastSlashIndex !== result.length - 1) { + if (lastSlashIndex < 0) { + result = '' + lastSegmentLength = 0 + } else { + result = result.slice(0, lastSlashIndex) + lastSegmentLength = result.length - 1 - result.lastIndexOf('/') + } + + lastSlash = index + dots = 0 + continue + } + } else if (result.length > 0) { + result = '' + lastSegmentLength = 0 + lastSlash = index + dots = 0 + continue + } + } + + if (allowAboveRoot) { + result = result.length > 0 ? result + '/..' : '..' + lastSegmentLength = 2 + } + } else { + if (result.length > 0) { + result += '/' + path.slice(lastSlash + 1, index) + } else { + result = path.slice(lastSlash + 1, index) + } + + lastSegmentLength = index - lastSlash - 1 + } + + lastSlash = index + dots = 0 + } else if (code === 46 /* `.` */ && dots > -1) { + dots++ + } else { + dots = -1 + } + } + + return result +} + +/** + * Make sure `path` is a string. + * + * @param {string} path + * File path. + * @returns {asserts path is string} + * Nothing. + */ +function assertPath(path) { + if (typeof path !== 'string') { + throw new TypeError( + 'Path must be a string. Received ' + JSON.stringify(path) + ) + } +} + +/* eslint-enable max-depth, complexity */ diff --git a/tools/ui/node_modules/vfile/lib/minpath.d.ts b/tools/ui/node_modules/vfile/lib/minpath.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..00c33d3bca687788c700dc90e4ed467b1b6a6188 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minpath.d.ts @@ -0,0 +1,2 @@ +export { default as minpath } from "node:path"; +//# sourceMappingURL=minpath.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minpath.d.ts.map b/tools/ui/node_modules/vfile/lib/minpath.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..fb5977582937f21ab65dad25bcb9b4c2b3c8624e --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minpath.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"minpath.d.ts","sourceRoot":"","sources":["minpath.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minpath.js b/tools/ui/node_modules/vfile/lib/minpath.js new file mode 100644 index 0000000000000000000000000000000000000000..9226294b38cca87025883d07a1a99108f66f5b74 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minpath.js @@ -0,0 +1 @@ +export {default as minpath} from 'node:path' diff --git a/tools/ui/node_modules/vfile/lib/minproc.browser.d.ts b/tools/ui/node_modules/vfile/lib/minproc.browser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0d5846e88c289aff489b37065c76515fec884c90 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minproc.browser.d.ts @@ -0,0 +1,6 @@ +export namespace minproc { + export { cwd }; +} +declare function cwd(): string; +export {}; +//# sourceMappingURL=minproc.browser.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minproc.browser.d.ts.map b/tools/ui/node_modules/vfile/lib/minproc.browser.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..09e1fd749e1a83e2235973cd050f6c51d3e4540d --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minproc.browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"minproc.browser.d.ts","sourceRoot":"","sources":["minproc.browser.js"],"names":[],"mappings":";;;AAKA,+BAEC"} \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minproc.browser.js b/tools/ui/node_modules/vfile/lib/minproc.browser.js new file mode 100644 index 0000000000000000000000000000000000000000..8deea298761c7892f34172637e50f569af0e7f4c --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minproc.browser.js @@ -0,0 +1,8 @@ +// Somewhat based on: +// . +// But I don’t think one tiny line of code can be copyrighted. 😅 +export const minproc = {cwd} + +function cwd() { + return '/' +} diff --git a/tools/ui/node_modules/vfile/lib/minproc.d.ts b/tools/ui/node_modules/vfile/lib/minproc.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c5a95925d5875dbb631c478635d6f10d2e2a4925 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minproc.d.ts @@ -0,0 +1,2 @@ +export { default as minproc } from "node:process"; +//# sourceMappingURL=minproc.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minproc.d.ts.map b/tools/ui/node_modules/vfile/lib/minproc.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..c8cdc6414e19690fb7fa56ed1d47671e48bacf20 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minproc.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"minproc.d.ts","sourceRoot":"","sources":["minproc.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minproc.js b/tools/ui/node_modules/vfile/lib/minproc.js new file mode 100644 index 0000000000000000000000000000000000000000..ba7662027f82e976702c1dbb28ea8ee09abef03b --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minproc.js @@ -0,0 +1 @@ +export {default as minproc} from 'node:process' diff --git a/tools/ui/node_modules/vfile/lib/minurl.browser.d.ts b/tools/ui/node_modules/vfile/lib/minurl.browser.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bdcc1cbb41f92555db982a739945593c9097a14d --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minurl.browser.d.ts @@ -0,0 +1,9 @@ +/** + * @param {URL | string} path + * File URL. + * @returns {string} + * File URL. + */ +export function urlToPath(path: URL | string): string; +export { isUrl } from "./minurl.shared.js"; +//# sourceMappingURL=minurl.browser.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minurl.browser.d.ts.map b/tools/ui/node_modules/vfile/lib/minurl.browser.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..799adfe79220ee5a3a5ec0afb8ab3dcf406ac1c8 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minurl.browser.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"minurl.browser.d.ts","sourceRoot":"","sources":["minurl.browser.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,gCALW,GAAG,GAAG,MAAM,GAEV,MAAM,CAyBlB"} \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minurl.browser.js b/tools/ui/node_modules/vfile/lib/minurl.browser.js new file mode 100644 index 0000000000000000000000000000000000000000..2eeed90e15901b54cdab340d2c7204264d6de131 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minurl.browser.js @@ -0,0 +1,76 @@ +import {isUrl} from './minurl.shared.js' + +export {isUrl} from './minurl.shared.js' + +// See: + +/** + * @param {URL | string} path + * File URL. + * @returns {string} + * File URL. + */ +export function urlToPath(path) { + if (typeof path === 'string') { + path = new URL(path) + } else if (!isUrl(path)) { + /** @type {NodeJS.ErrnoException} */ + const error = new TypeError( + 'The "path" argument must be of type string or an instance of URL. Received `' + + path + + '`' + ) + error.code = 'ERR_INVALID_ARG_TYPE' + throw error + } + + if (path.protocol !== 'file:') { + /** @type {NodeJS.ErrnoException} */ + const error = new TypeError('The URL must be of scheme file') + error.code = 'ERR_INVALID_URL_SCHEME' + throw error + } + + return getPathFromURLPosix(path) +} + +/** + * Get a path from a POSIX URL. + * + * @param {URL} url + * URL. + * @returns {string} + * File path. + */ +function getPathFromURLPosix(url) { + if (url.hostname !== '') { + /** @type {NodeJS.ErrnoException} */ + const error = new TypeError( + 'File URL host must be "localhost" or empty on darwin' + ) + error.code = 'ERR_INVALID_FILE_URL_HOST' + throw error + } + + const pathname = url.pathname + let index = -1 + + while (++index < pathname.length) { + if ( + pathname.codePointAt(index) === 37 /* `%` */ && + pathname.codePointAt(index + 1) === 50 /* `2` */ + ) { + const third = pathname.codePointAt(index + 2) + if (third === 70 /* `F` */ || third === 102 /* `f` */) { + /** @type {NodeJS.ErrnoException} */ + const error = new TypeError( + 'File URL path must not include encoded / characters' + ) + error.code = 'ERR_INVALID_FILE_URL_PATH' + throw error + } + } + } + + return decodeURIComponent(pathname) +} diff --git a/tools/ui/node_modules/vfile/lib/minurl.d.ts b/tools/ui/node_modules/vfile/lib/minurl.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..91a9c3e506de2cc11136a36c8f894dc71967d738 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minurl.d.ts @@ -0,0 +1,3 @@ +export { fileURLToPath as urlToPath } from "node:url"; +export { isUrl } from "./minurl.shared.js"; +//# sourceMappingURL=minurl.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minurl.d.ts.map b/tools/ui/node_modules/vfile/lib/minurl.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..52f521f580fdf7202f5de983c35eda571a06752e --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minurl.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"minurl.d.ts","sourceRoot":"","sources":["minurl.js"],"names":[],"mappings":""} \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minurl.js b/tools/ui/node_modules/vfile/lib/minurl.js new file mode 100644 index 0000000000000000000000000000000000000000..c3f81dff8ddbd0c4c5fa7be2ea8775a320afb015 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minurl.js @@ -0,0 +1,2 @@ +export {fileURLToPath as urlToPath} from 'node:url' +export {isUrl} from './minurl.shared.js' diff --git a/tools/ui/node_modules/vfile/lib/minurl.shared.d.ts b/tools/ui/node_modules/vfile/lib/minurl.shared.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3d1438319291b14a4f41e148c0823b2bea72419 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minurl.shared.d.ts @@ -0,0 +1,20 @@ +/** + * Checks if a value has the shape of a WHATWG URL object. + * + * Using a symbol or instanceof would not be able to recognize URL objects + * coming from other implementations (e.g. in Electron), so instead we are + * checking some well known properties for a lack of a better test. + * + * We use `href` and `protocol` as they are the only properties that are + * easy to retrieve and calculate due to the lazy nature of the getters. + * + * We check for auth attribute to distinguish legacy url instance with + * WHATWG URL instance. + * + * @param {unknown} fileUrlOrPath + * File path or URL. + * @returns {fileUrlOrPath is URL} + * Whether it’s a URL. + */ +export function isUrl(fileUrlOrPath: unknown): fileUrlOrPath is URL; +//# sourceMappingURL=minurl.shared.d.ts.map \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minurl.shared.d.ts.map b/tools/ui/node_modules/vfile/lib/minurl.shared.d.ts.map new file mode 100644 index 0000000000000000000000000000000000000000..406ea07830a80aeb4e3056fb66276b3f4980aae0 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minurl.shared.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"minurl.shared.d.ts","sourceRoot":"","sources":["minurl.shared.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,qCANW,OAAO,GAEL,aAAa,IAAI,GAAG,CAehC"} \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/lib/minurl.shared.js b/tools/ui/node_modules/vfile/lib/minurl.shared.js new file mode 100644 index 0000000000000000000000000000000000000000..c8085e0cf4a3c09c035eb7777be299f809557114 --- /dev/null +++ b/tools/ui/node_modules/vfile/lib/minurl.shared.js @@ -0,0 +1,31 @@ +/** + * Checks if a value has the shape of a WHATWG URL object. + * + * Using a symbol or instanceof would not be able to recognize URL objects + * coming from other implementations (e.g. in Electron), so instead we are + * checking some well known properties for a lack of a better test. + * + * We use `href` and `protocol` as they are the only properties that are + * easy to retrieve and calculate due to the lazy nature of the getters. + * + * We check for auth attribute to distinguish legacy url instance with + * WHATWG URL instance. + * + * @param {unknown} fileUrlOrPath + * File path or URL. + * @returns {fileUrlOrPath is URL} + * Whether it’s a URL. + */ +// From: +export function isUrl(fileUrlOrPath) { + return Boolean( + fileUrlOrPath !== null && + typeof fileUrlOrPath === 'object' && + 'href' in fileUrlOrPath && + fileUrlOrPath.href && + 'protocol' in fileUrlOrPath && + fileUrlOrPath.protocol && + // @ts-expect-error: indexing is fine. + fileUrlOrPath.auth === undefined + ) +} diff --git a/tools/ui/node_modules/vfile/license b/tools/ui/node_modules/vfile/license new file mode 100644 index 0000000000000000000000000000000000000000..f3722d94b38121d45d5851b905ae3aaa63184cb8 --- /dev/null +++ b/tools/ui/node_modules/vfile/license @@ -0,0 +1,21 @@ +(The MIT License) + +Copyright (c) 2015 Titus Wormer + +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/vfile/node_modules/@types/unist/LICENSE b/tools/ui/node_modules/vfile/node_modules/@types/unist/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9e841e7a26e4eb057b24511e7b92d42b257a80e5 --- /dev/null +++ b/tools/ui/node_modules/vfile/node_modules/@types/unist/LICENSE @@ -0,0 +1,21 @@ + MIT License + + Copyright (c) Microsoft Corporation. + + 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/vfile/node_modules/@types/unist/README.md b/tools/ui/node_modules/vfile/node_modules/@types/unist/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b84e51bfb836f999b47b6d8e233b64cb372e48df --- /dev/null +++ b/tools/ui/node_modules/vfile/node_modules/@types/unist/README.md @@ -0,0 +1,15 @@ +# Installation +> `npm install --save @types/unist` + +# Summary +This package contains type definitions for unist (https://github.com/syntax-tree/unist). + +# Details +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist. + +### Additional Details + * Last updated: Thu, 15 Aug 2024 02:18:53 GMT + * Dependencies: none + +# Credits +These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), [JounQin](https://github.com/JounQin), and [Remco Haszing](https://github.com/remcohaszing). diff --git a/tools/ui/node_modules/vfile/node_modules/@types/unist/index.d.ts b/tools/ui/node_modules/vfile/node_modules/@types/unist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..513ddee5e9e2acb1e5c88c26da384212e52ed90b --- /dev/null +++ b/tools/ui/node_modules/vfile/node_modules/@types/unist/index.d.ts @@ -0,0 +1,119 @@ +// ## Interfaces + +/** + * Info associated with nodes by the ecosystem. + * + * This space is guaranteed to never be specified by unist or specifications + * implementing unist. + * But you can use it in utilities and plugins to store data. + * + * This type can be augmented to register custom data. + * For example: + * + * ```ts + * declare module 'unist' { + * interface Data { + * // `someNode.data.myId` is typed as `number | undefined` + * myId?: number | undefined + * } + * } + * ``` + */ +export interface Data {} + +/** + * One place in a source file. + */ +export interface Point { + /** + * Line in a source file (1-indexed integer). + */ + line: number; + + /** + * Column in a source file (1-indexed integer). + */ + column: number; + /** + * Character in a source file (0-indexed integer). + */ + offset?: number | undefined; +} + +/** + * Position of a node in a source document. + * + * A position is a range between two points. + */ +export interface Position { + /** + * Place of the first character of the parsed source region. + */ + start: Point; + + /** + * Place of the first character after the parsed source region. + */ + end: Point; +} + +// ## Abstract nodes + +/** + * Abstract unist node that contains the smallest possible value. + * + * This interface is supposed to be extended. + * + * For example, in HTML, a `text` node is a leaf that contains text. + */ +export interface Literal extends Node { + /** + * Plain value. + */ + value: unknown; +} + +/** + * Abstract unist node. + * + * The syntactic unit in unist syntax trees are called nodes. + * + * This interface is supposed to be extended. + * If you can use {@link Literal} or {@link Parent}, you should. + * But for example in markdown, a `thematicBreak` (`***`), is neither literal + * nor parent, but still a node. + */ +export interface Node { + /** + * Node type. + */ + type: string; + + /** + * Info from the ecosystem. + */ + data?: Data | undefined; + + /** + * Position of a node in a source document. + * + * Nodes that are generated (not in the original source document) must not + * have a position. + */ + position?: Position | undefined; +} + +/** + * Abstract unist node that contains other nodes (*children*). + * + * This interface is supposed to be extended. + * + * For example, in XML, an element is a parent of different things, such as + * comments, text, and further elements. + */ +export interface Parent extends Node { + /** + * List of children. + */ + children: Node[]; +} diff --git a/tools/ui/node_modules/vfile/node_modules/@types/unist/package.json b/tools/ui/node_modules/vfile/node_modules/@types/unist/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d2092dba8f2208817af3e1811569d90b6358ad8f --- /dev/null +++ b/tools/ui/node_modules/vfile/node_modules/@types/unist/package.json @@ -0,0 +1,60 @@ +{ + "name": "@types/unist", + "version": "3.0.3", + "description": "TypeScript definitions for unist", + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist", + "license": "MIT", + "contributors": [ + { + "name": "bizen241", + "githubUsername": "bizen241", + "url": "https://github.com/bizen241" + }, + { + "name": "Jun Lu", + "githubUsername": "lujun2", + "url": "https://github.com/lujun2" + }, + { + "name": "Hernan Rajchert", + "githubUsername": "hrajchert", + "url": "https://github.com/hrajchert" + }, + { + "name": "Titus Wormer", + "githubUsername": "wooorm", + "url": "https://github.com/wooorm" + }, + { + "name": "Junyoung Choi", + "githubUsername": "rokt33r", + "url": "https://github.com/rokt33r" + }, + { + "name": "Ben Moon", + "githubUsername": "GuiltyDolphin", + "url": "https://github.com/GuiltyDolphin" + }, + { + "name": "JounQin", + "githubUsername": "JounQin", + "url": "https://github.com/JounQin" + }, + { + "name": "Remco Haszing", + "githubUsername": "remcohaszing", + "url": "https://github.com/remcohaszing" + } + ], + "main": "", + "types": "index.d.ts", + "repository": { + "type": "git", + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", + "directory": "types/unist" + }, + "scripts": {}, + "dependencies": {}, + "typesPublisherContentHash": "7f3d5ce8d56003f3583a5317f98d444bdc99910c7b486c6b10af4f38694e61fe", + "typeScriptVersion": "4.8" +} \ No newline at end of file diff --git a/tools/ui/node_modules/vfile/node_modules/vfile-message/index.d.ts b/tools/ui/node_modules/vfile/node_modules/vfile-message/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6013369e5defc30d8c15fc1913a41d8c887d9bb --- /dev/null +++ b/tools/ui/node_modules/vfile/node_modules/vfile-message/index.d.ts @@ -0,0 +1,2 @@ +export { VFileMessage } from "./lib/index.js"; +export type Options = import("./lib/index.js").Options; diff --git a/tools/ui/node_modules/vfile/node_modules/vfile-message/index.js b/tools/ui/node_modules/vfile/node_modules/vfile-message/index.js new file mode 100644 index 0000000000000000000000000000000000000000..61f33bd66d1935b86b18f0ac4e7196df8d404eaa --- /dev/null +++ b/tools/ui/node_modules/vfile/node_modules/vfile-message/index.js @@ -0,0 +1,5 @@ +/** + * @typedef {import('./lib/index.js').Options} Options + */ + +export {VFileMessage} from './lib/index.js' diff --git a/tools/ui/node_modules/vfile/node_modules/vfile-message/lib/index.d.ts b/tools/ui/node_modules/vfile/node_modules/vfile-message/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..bb233685589d791d8723c1e10f9af76960ffd47a --- /dev/null +++ b/tools/ui/node_modules/vfile/node_modules/vfile-message/lib/index.d.ts @@ -0,0 +1,508 @@ +/** + * Message. + */ +export class VFileMessage extends Error { + /** + * Create a message for `reason`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {Options | null | undefined} [options] + * @returns + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns + * Instance of `VFileMessage`. + */ + constructor(reason: string, options?: Options | null | undefined); + /** + * Create a message for `reason`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {Options | null | undefined} [options] + * @returns + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns + * Instance of `VFileMessage`. + */ + constructor(reason: string, parent: Node | NodeLike | null | undefined, origin?: string | null | undefined); + /** + * Create a message for `reason`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {Options | null | undefined} [options] + * @returns + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns + * Instance of `VFileMessage`. + */ + constructor(reason: string, place: Point | Position | null | undefined, origin?: string | null | undefined); + /** + * Create a message for `reason`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {Options | null | undefined} [options] + * @returns + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns + * Instance of `VFileMessage`. + */ + constructor(reason: string, origin?: string | null | undefined); + /** + * Create a message for `reason`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {Options | null | undefined} [options] + * @returns + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns + * Instance of `VFileMessage`. + */ + constructor(cause: Error | VFileMessage, parent: Node | NodeLike | null | undefined, origin?: string | null | undefined); + /** + * Create a message for `reason`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {Options | null | undefined} [options] + * @returns + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns + * Instance of `VFileMessage`. + */ + constructor(cause: Error | VFileMessage, place: Point | Position | null | undefined, origin?: string | null | undefined); + /** + * Create a message for `reason`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {Options | null | undefined} [options] + * @returns + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns + * Instance of `VFileMessage`. + */ + constructor(cause: Error | VFileMessage, origin?: string | null | undefined); + /** + * Stack of ancestor nodes surrounding the message. + * + * @type {Array | undefined} + */ + ancestors: Array | undefined; + /** + * Starting column of message. + * + * @type {number | undefined} + */ + column: number | undefined; + /** + * State of problem. + * + * * `true` — error, file not usable + * * `false` — warning, change may be needed + * * `undefined` — change likely not needed + * + * @type {boolean | null | undefined} + */ + fatal: boolean | null | undefined; + /** + * Path of a file (used throughout the `VFile` ecosystem). + * + * @type {string | undefined} + */ + file: string | undefined; + /** + * Starting line of error. + * + * @type {number | undefined} + */ + line: number | undefined; + /** + * Place of message. + * + * @type {Point | Position | undefined} + */ + place: Point | Position | undefined; + /** + * Reason for message, should use markdown. + * + * @type {string} + */ + reason: string; + /** + * Category of message (example: `'my-rule'`). + * + * @type {string | undefined} + */ + ruleId: string | undefined; + /** + * Namespace of message (example: `'my-package'`). + * + * @type {string | undefined} + */ + source: string | undefined; + /** + * Specify the source value that’s being reported, which is deemed + * incorrect. + * + * @type {string | undefined} + */ + actual: string | undefined; + /** + * Suggest acceptable values that can be used instead of `actual`. + * + * @type {Array | undefined} + */ + expected: Array | undefined; + /** + * Long form description of the message (you should use markdown). + * + * @type {string | undefined} + */ + note: string | undefined; + /** + * Link to docs for the message. + * + * > 👉 **Note**: this must be an absolute URL that can be passed as `x` + * > to `new URL(x)`. + * + * @type {string | undefined} + */ + url: string | undefined; +} +export type NodeLike = object & { + type: string; + position?: Position | undefined; +}; +/** + * Configuration. + */ +export type Options = { + /** + * Stack of (inclusive) ancestor nodes surrounding the message (optional). + */ + ancestors?: Array | null | undefined; + /** + * Original error cause of the message (optional). + */ + cause?: Error | null | undefined; + /** + * Place of message (optional). + */ + place?: Point | Position | null | undefined; + /** + * Category of message (optional, example: `'my-rule'`). + */ + ruleId?: string | null | undefined; + /** + * Namespace of who sent the message (optional, example: `'my-package'`). + */ + source?: string | null | undefined; +}; +import type { Node } from 'unist'; +import type { Point } from 'unist'; +import type { Position } from 'unist'; diff --git a/tools/ui/node_modules/vfile/node_modules/vfile-message/lib/index.js b/tools/ui/node_modules/vfile/node_modules/vfile-message/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b51817e5be3ba02a3c30a660b0f214981730667d --- /dev/null +++ b/tools/ui/node_modules/vfile/node_modules/vfile-message/lib/index.js @@ -0,0 +1,314 @@ +/** + * @import {Node, Point, Position} from 'unist' + */ + +/** + * @typedef {object & {type: string, position?: Position | undefined}} NodeLike + * + * @typedef Options + * Configuration. + * @property {Array | null | undefined} [ancestors] + * Stack of (inclusive) ancestor nodes surrounding the message (optional). + * @property {Error | null | undefined} [cause] + * Original error cause of the message (optional). + * @property {Point | Position | null | undefined} [place] + * Place of message (optional). + * @property {string | null | undefined} [ruleId] + * Category of message (optional, example: `'my-rule'`). + * @property {string | null | undefined} [source] + * Namespace of who sent the message (optional, example: `'my-package'`). + */ + +import {stringifyPosition} from 'unist-util-stringify-position' + +/** + * Message. + */ +export class VFileMessage extends Error { + /** + * Create a message for `reason`. + * + * > 🪦 **Note**: also has obsolete signatures. + * + * @overload + * @param {string} reason + * @param {Options | null | undefined} [options] + * @returns + * + * @overload + * @param {string} reason + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {string} reason + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Node | NodeLike | null | undefined} parent + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {Point | Position | null | undefined} place + * @param {string | null | undefined} [origin] + * @returns + * + * @overload + * @param {Error | VFileMessage} cause + * @param {string | null | undefined} [origin] + * @returns + * + * @param {Error | VFileMessage | string} causeOrReason + * Reason for message, should use markdown. + * @param {Node | NodeLike | Options | Point | Position | string | null | undefined} [optionsOrParentOrPlace] + * Configuration (optional). + * @param {string | null | undefined} [origin] + * Place in code where the message originates (example: + * `'my-package:my-rule'` or `'my-rule'`). + * @returns + * Instance of `VFileMessage`. + */ + // eslint-disable-next-line complexity + constructor(causeOrReason, optionsOrParentOrPlace, origin) { + super() + + if (typeof optionsOrParentOrPlace === 'string') { + origin = optionsOrParentOrPlace + optionsOrParentOrPlace = undefined + } + + /** @type {string} */ + let reason = '' + /** @type {Options} */ + let options = {} + let legacyCause = false + + if (optionsOrParentOrPlace) { + // Point. + if ( + 'line' in optionsOrParentOrPlace && + 'column' in optionsOrParentOrPlace + ) { + options = {place: optionsOrParentOrPlace} + } + // Position. + else if ( + 'start' in optionsOrParentOrPlace && + 'end' in optionsOrParentOrPlace + ) { + options = {place: optionsOrParentOrPlace} + } + // Node. + else if ('type' in optionsOrParentOrPlace) { + options = { + ancestors: [optionsOrParentOrPlace], + place: optionsOrParentOrPlace.position + } + } + // Options. + else { + options = {...optionsOrParentOrPlace} + } + } + + if (typeof causeOrReason === 'string') { + reason = causeOrReason + } + // Error. + else if (!options.cause && causeOrReason) { + legacyCause = true + reason = causeOrReason.message + options.cause = causeOrReason + } + + if (!options.ruleId && !options.source && typeof origin === 'string') { + const index = origin.indexOf(':') + + if (index === -1) { + options.ruleId = origin + } else { + options.source = origin.slice(0, index) + options.ruleId = origin.slice(index + 1) + } + } + + if (!options.place && options.ancestors && options.ancestors) { + const parent = options.ancestors[options.ancestors.length - 1] + + if (parent) { + options.place = parent.position + } + } + + const start = + options.place && 'start' in options.place + ? options.place.start + : options.place + + /** + * Stack of ancestor nodes surrounding the message. + * + * @type {Array | undefined} + */ + this.ancestors = options.ancestors || undefined + + /** + * Original error cause of the message. + * + * @type {Error | undefined} + */ + this.cause = options.cause || undefined + + /** + * Starting column of message. + * + * @type {number | undefined} + */ + this.column = start ? start.column : undefined + + /** + * State of problem. + * + * * `true` — error, file not usable + * * `false` — warning, change may be needed + * * `undefined` — change likely not needed + * + * @type {boolean | null | undefined} + */ + this.fatal = undefined + + /** + * Path of a file (used throughout the `VFile` ecosystem). + * + * @type {string | undefined} + */ + this.file = '' + + // Field from `Error`. + /** + * Reason for message. + * + * @type {string} + */ + this.message = reason + + /** + * Starting line of error. + * + * @type {number | undefined} + */ + this.line = start ? start.line : undefined + + // Field from `Error`. + /** + * Serialized positional info of message. + * + * On normal errors, this would be something like `ParseError`, buit in + * `VFile` messages we use this space to show where an error happened. + */ + this.name = stringifyPosition(options.place) || '1:1' + + /** + * Place of message. + * + * @type {Point | Position | undefined} + */ + this.place = options.place || undefined + + /** + * Reason for message, should use markdown. + * + * @type {string} + */ + this.reason = this.message + + /** + * Category of message (example: `'my-rule'`). + * + * @type {string | undefined} + */ + this.ruleId = options.ruleId || undefined + + /** + * Namespace of message (example: `'my-package'`). + * + * @type {string | undefined} + */ + this.source = options.source || undefined + + // Field from `Error`. + /** + * Stack of message. + * + * This is used by normal errors to show where something happened in + * programming code, irrelevant for `VFile` messages, + * + * @type {string} + */ + this.stack = + legacyCause && options.cause && typeof options.cause.stack === 'string' + ? options.cause.stack + : '' + + // The following fields are “well known”. + // Not standard. + // Feel free to add other non-standard fields to your messages. + + /** + * Specify the source value that’s being reported, which is deemed + * incorrect. + * + * @type {string | undefined} + */ + this.actual = undefined + + /** + * Suggest acceptable values that can be used instead of `actual`. + * + * @type {Array | undefined} + */ + this.expected = undefined + + /** + * Long form description of the message (you should use markdown). + * + * @type {string | undefined} + */ + this.note = undefined + + /** + * Link to docs for the message. + * + * > 👉 **Note**: this must be an absolute URL that can be passed as `x` + * > to `new URL(x)`. + * + * @type {string | undefined} + */ + this.url = undefined + } +} + +VFileMessage.prototype.file = '' +VFileMessage.prototype.name = '' +VFileMessage.prototype.reason = '' +VFileMessage.prototype.message = '' +VFileMessage.prototype.stack = '' +VFileMessage.prototype.column = undefined +VFileMessage.prototype.line = undefined +VFileMessage.prototype.ancestors = undefined +VFileMessage.prototype.cause = undefined +VFileMessage.prototype.fatal = undefined +VFileMessage.prototype.place = undefined +VFileMessage.prototype.ruleId = undefined +VFileMessage.prototype.source = undefined diff --git a/tools/ui/node_modules/vfile/node_modules/vfile-message/license b/tools/ui/node_modules/vfile/node_modules/vfile-message/license new file mode 100644 index 0000000000000000000000000000000000000000..bc8f165a62768a19de38901d81ac662c51ff29db --- /dev/null +++ b/tools/ui/node_modules/vfile/node_modules/vfile-message/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) Titus Wormer + +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/vfile/node_modules/vfile-message/package.json b/tools/ui/node_modules/vfile/node_modules/vfile-message/package.json new file mode 100644 index 0000000000000000000000000000000000000000..5c6f9b0720b9005d1e8dd758d96ef4f0dab4dfd0 --- /dev/null +++ b/tools/ui/node_modules/vfile/node_modules/vfile-message/package.json @@ -0,0 +1,80 @@ +{ + "author": "Titus Wormer (https://wooorm.com)", + "bugs": "https://github.com/vfile/vfile-message/issues", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "dependencies": { + "@types/unist": "^3.0.0", + "unist-util-stringify-position": "^4.0.0" + }, + "description": "vfile utility to create a virtual message", + "devDependencies": { + "@types/node": "^24.0.0", + "c8": "^10.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^11.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^1.0.0" + }, + "exports": "./index.js", + "files": [ + "index.d.ts", + "index.js", + "lib/" + ], + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "keywords": [ + "file", + "message", + "utility", + "util", + "vfile-util", + "vfile", + "virtual" + ], + "license": "MIT", + "name": "vfile-message", + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm" + ] + }, + "repository": "vfile/vfile-message", + "scripts": { + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix", + "prepack": "npm run build && npm run format", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --reporter lcov -- npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "sideEffects": false, + "typeCoverage": { + "atLeast": 100, + "ignoreCatch": true + }, + "type": "module", + "version": "4.0.3", + "xo": { + "prettier": true, + "rules": { + "prefer-destructuring": "off", + "unicorn/prefer-at": "off" + }, + "space": true + } +} diff --git a/tools/ui/node_modules/vfile/node_modules/vfile-message/readme.md b/tools/ui/node_modules/vfile/node_modules/vfile-message/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..1ecccc0e5b165ca8782b8883c2601b3def612d41 --- /dev/null +++ b/tools/ui/node_modules/vfile/node_modules/vfile-message/readme.md @@ -0,0 +1,252 @@ +# vfile-message + +[![Build][badge-build-image]][badge-build-url] +[![Coverage][badge-coverage-image]][badge-coverage-url] +[![Downloads][badge-downloads-image]][badge-downloads-url] +[![Size][badge-size-image]][badge-size-url] + +Create [vfile][github-vfile] messages. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`VFileMessage(reason[, options])`](#vfilemessagereason-options) + * [`Options`](#options) + * [Well-known](#well-known) +* [Compatibility](#compatibility) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package provides a (lint) message format. + +## When should I use this? + +In most cases, +you can use `file.message` from `VFile` itself, +but in some cases you might not have a file, +and still want to emit warnings or errors, +in which case this can be used directly. + +## Install + +This package is [ESM only][github-gist-esm]. +In Node.js (version 16+), +install with [npm][npmjs-install]: + +```sh +npm install vfile-message +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {VFileMessage} from 'https://esm.sh/vfile-message@4' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {VFileMessage} from 'vfile-message' + +const message = new VFileMessage( + 'Unexpected unknown word `braavo`, did you mean `bravo`?', + {place: {column: 8, line: 1}, ruleId: 'typo', source: 'spell'} +) + +console.log(message) +``` + +Yields: + +```text +[1:8: Unexpected unknown word `braavo`, did you mean `bravo`?] { + reason: 'Unexpected unknown word `braavo`, did you mean `bravo`?', + line: 1, + column: 8, + ancestors: undefined, + cause: undefined, + fatal: undefined, + place: {line: 1, column: 8}, + ruleId: 'typo', + source: 'spell' +} +``` + +## API + +This package exports the identifier [`VFileMessage`][api-vfile-message]. +There is no default export. +It exports the additional [TypeScript][] type [`Options`][api-options]. + +### `VFileMessage(reason[, options])` + +Create a message for `reason`. + +> 🪦 **Note**: also has obsolete signatures. + +###### Parameters + +* `reason` (`string`) + — reason for message (should use markdown) +* `options` ([`Options`][api-options], optional) + — configuration. + +###### Extends + +[`Error`][developer-mozilla-error]. + +###### Returns + +Instance of `VFileMessage`. + +###### Fields + +* `ancestors` ([`Array`][github-unist-node] or `undefined`) + — stack of (inclusive) ancestor nodes surrounding the message +* `cause` ([`Error`][developer-mozilla-error] or `undefined`) + — original error cause of the message +* `column` (`number` or `undefined`) + — starting column of message +* `fatal` (`boolean` or `undefined`) + — state of problem; `true`: error, file not usable; `false`: warning, + change may be needed; `undefined`: info, change likely not needed +* `line` (`number` or `undefined`) + — starting line of message +* `place` ([`Point`][github-unist-point], [`Position`][github-unist-position] + or `undefined`) + — place of message +* `reason` (`string`) + — reason for message (should use markdown) +* `ruleId` (`string` or `undefined`, example: `'my-rule'`) + — category of message +* `source` (`string` or `undefined`, example: `'my-package'`) + — namespace of message + +### `Options` + +Configuration (TypeScript type). + +###### Fields + +* `ancestors` ([`Array`][github-unist-node], optional) + — stack of (inclusive) ancestor nodes surrounding the message +* `cause` ([`Error`][developer-mozilla-error], optional) + — original error cause of the message +* `place` ([`Point`][github-unist-point] or [`Position`][github-unist-position], + optional) + — place of message +* `ruleId` (`string`, optional, example: `'my-rule'`) + — category of message +* `source` (`string`, optional, , example: `'my-package'`) + — namespace of who sent the message + +### Well-known + +It’s OK to store custom data directly on the `VFileMessage`, some of those are +handled by [utilities][github-vfile-util]. +The following fields are documented and typed here. + +###### Fields + +* `actual` (`string`, optional) + — specify the source value that’s being reported, which is deemed incorrect +* `expected` (`Array`, optional) + — suggest acceptable values that can be used instead of `actual` +* `url` (`string`, optional) + — link to docs for the message (this must be an absolute URL that can be + passed as `x` to `new URL(x)`) +* `note` (`string`, optional) + — long form description of the message (you should use markdown) + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `vfile-message@^4`, +compatible with Node.js 16. + +## Contribute + +See [`contributing.md`][health-contributing] in [`vfile/.github`][health] +for ways to get started. +See [`support.md`][health-support] for ways to get help. + +This project has a [code of conduct][health-coc]. +By interacting with this repository, +organization, +or community you agree to abide by its terms. + +## License + +[MIT][file-license] © [Titus Wormer][wooorm] + + + +[api-options]: #options + +[api-vfile-message]: #vfilemessagereason-options + +[badge-build-image]: https://github.com/vfile/vfile-message/workflows/main/badge.svg + +[badge-build-url]: https://github.com/vfile/vfile-message/actions + +[badge-coverage-image]: https://img.shields.io/codecov/c/github/vfile/vfile-message.svg + +[badge-coverage-url]: https://codecov.io/github/vfile/vfile-message + +[badge-downloads-image]: https://img.shields.io/npm/dm/vfile-message.svg + +[badge-downloads-url]: https://www.npmjs.com/package/vfile-message + +[badge-size-image]: https://img.shields.io/bundlejs/size/vfile-message + +[badge-size-url]: https://bundlejs.com/?q=vfile-message + +[developer-mozilla-error]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error + +[esmsh]: https://esm.sh + +[file-license]: license + +[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[github-unist-node]: https://github.com/syntax-tree/unist#node + +[github-unist-point]: https://github.com/syntax-tree/unist#point + +[github-unist-position]: https://github.com/syntax-tree/unist#position + +[github-vfile]: https://github.com/vfile/vfile + +[github-vfile-util]: https://github.com/vfile/vfile#utilities + +[health]: https://github.com/vfile/.github + +[health-coc]: https://github.com/vfile/.github/blob/main/code-of-conduct.md + +[health-contributing]: https://github.com/vfile/.github/blob/main/contributing.md + +[health-support]: https://github.com/vfile/.github/blob/main/support.md + +[npmjs-install]: https://docs.npmjs.com/cli/install + +[typescript]: https://www.typescriptlang.org + +[wooorm]: https://wooorm.com diff --git a/tools/ui/node_modules/vfile/package.json b/tools/ui/node_modules/vfile/package.json new file mode 100644 index 0000000000000000000000000000000000000000..cd5868232ab2b5a8c21bdd8245d03985665f838d --- /dev/null +++ b/tools/ui/node_modules/vfile/package.json @@ -0,0 +1,134 @@ +{ + "name": "vfile", + "version": "6.0.3", + "description": "Virtual file format for text processing", + "license": "MIT", + "keywords": [ + "vfile", + "virtual", + "file", + "text", + "processing", + "message", + "warning", + "error", + "remark", + "retext", + "rehype" + ], + "repository": "vfile/vfile", + "bugs": "https://github.com/vfile/vfile/issues", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)", + "Brendan Abbott ", + "Denys Dovhan ", + "Kyle Mathews ", + "Shinnosuke Watanabe ", + "Sindre Sorhus " + ], + "sideEffects": false, + "type": "module", + "exports": "./index.js", + "imports": { + "#minpath": { + "node": "./lib/minpath.js", + "default": "./lib/minpath.browser.js" + }, + "#minproc": { + "node": "./lib/minproc.js", + "default": "./lib/minproc.browser.js" + }, + "#minurl": { + "node": "./lib/minurl.js", + "default": "./lib/minurl.browser.js" + } + }, + "files": [ + "lib/", + "index.d.ts", + "index.js" + ], + "dependencies": { + "@types/unist": "^3.0.0", + "vfile-message": "^4.0.0" + }, + "devDependencies": { + "@types/node": "^22.0.0", + "c8": "^10.0.0", + "prettier": "^3.0.0", + "remark-cli": "^12.0.0", + "remark-preset-wooorm": "^10.0.0", + "type-coverage": "^2.0.0", + "typescript": "^5.0.0", + "xo": "^0.59.0" + }, + "scripts": { + "prepack": "npm run build && npm run format", + "build": "tsc --build --clean && tsc --build && type-coverage", + "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --100 --reporter lcov npm run test-api", + "test": "npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "bracketSpacing": false, + "semi": false, + "singleQuote": true, + "tabWidth": 2, + "trailingComma": "none", + "useTabs": false + }, + "remarkConfig": { + "plugins": [ + "remark-preset-wooorm", + [ + "remark-lint-no-html", + false + ] + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "ignoreCatch": true, + "strict": true + }, + "xo": { + "overrides": [ + { + "files": [ + "**/*.d.ts" + ], + "rules": { + "@typescript-eslint/array-type": [ + "error", + { + "default": "generic" + } + ], + "@typescript-eslint/ban-types": [ + "error", + { + "extendDefaults": true + } + ], + "@typescript-eslint/consistent-type-definitions": [ + "error", + "interface" + ] + } + } + ], + "prettier": true, + "rules": { + "logical-assignment-operators": "off", + "unicorn/prefer-at": "off", + "unicorn/prefer-string-replace-all": "off" + } + } +} diff --git a/tools/ui/node_modules/vfile/readme.md b/tools/ui/node_modules/vfile/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..e5127c750b54d3e0291e87fcba65a99083da547f --- /dev/null +++ b/tools/ui/node_modules/vfile/readme.md @@ -0,0 +1,785 @@ +

+ vfile +

+ +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +**vfile** is a small and browser friendly virtual file format that tracks +metadata about files (such as its `path` and `value`) and lint +[messages][api-vfile-messages]. + +## Contents + +* [unified](#unified) +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`VFile(options?)`](#vfileoptions) + * [`file.cwd`](#filecwd) + * [`file.data`](#filedata) + * [`file.history`](#filehistory) + * [`file.messages`](#filemessages) + * [`file.value`](#filevalue) + * [`file.basename`](#filebasename) + * [`file.dirname`](#filedirname) + * [`file.extname`](#fileextname) + * [`file.path`](#filepath) + * [`file.stem`](#filestem) + * [`VFile#fail(reason[, options])`](#vfilefailreason-options) + * [`VFile#info(reason[, options])`](#vfileinforeason-options) + * [`VFile#message(reason[, options])`](#vfilemessagereason-options) + * [`VFile#toString(encoding?)`](#vfiletostringencoding) + * [`Compatible`](#compatible) + * [`Data`](#data) + * [`DataMap`](#datamap) + * [`Map`](#map) + * [`MessageOptions`](#messageoptions) + * [`Options`](#options) + * [`Reporter`](#reporter) + * [`ReporterSettings`](#reportersettings) + * [`Value`](#value) + * [Well-known](#well-known) +* [List of utilities](#list-of-utilities) +* [Reporters](#reporters) +* [Types](#types) +* [Compatibility](#compatibility) +* [Contribute](#contribute) +* [Sponsor](#sponsor) +* [Acknowledgments](#acknowledgments) +* [License](#license) + +## unified + +**vfile** is part of the unified collective. + +* for more about us, see [`unifiedjs.com`][site] +* for how the collective is governed, see [`unifiedjs/collective`][governance] +* for updates, see [@unifiedjs][twitter] on Twitter + +## What is this? + +This package provides a virtual file format. +It exposes an API to access the file value, path, metadata about the file, and +specifically supports attaching lint messages and errors to certain places in +these files. + +## When should I use this? + +The virtual file format is useful when dealing with the concept of files in +places where you might not be able to access the file system. +The message API is particularly useful when making things that check files (as +in, linting). + +vfile is made for [unified][], which amongst other things checks files. +However, vfile can be used in other projects that deal with parsing, +transforming, and serializing data, to build linters, compilers, static site +generators, and other build tools. + +This is different from the excellent [`vinyl`][vinyl] in that vfile has a +smaller API, a smaller size, and focuses on messages. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install vfile +``` + +In Deno with [`esm.sh`][esmsh]: + +```js +import {VFile} from 'https://esm.sh/vfile@6' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```js +import {VFile} from 'vfile' + +const file = new VFile({ + path: '~/example.txt', + value: 'Alpha *braavo* charlie.' +}) + +console.log(file.path) // => '~/example.txt' +console.log(file.dirname) // => '~' + +file.extname = '.md' + +console.log(file.basename) // => 'example.md' + +file.basename = 'index.text' + +console.log(file.history) // => ['~/example.txt', '~/example.md', '~/index.text'] + +file.message('Unexpected unknown word `braavo`, did you mean `bravo`?', { + place: {line: 1, column: 8}, + source: 'spell', + ruleId: 'typo' +}) + +console.log(file.messages) +``` + +Yields: + +```txt +[ + [~/index.text:1:8: Unexpected unknown word `braavo`, did you mean `bravo`?] { + ancestors: undefined, + cause: undefined, + column: 8, + fatal: false, + line: 1, + place: { line: 1, column: 8 }, + reason: 'Unexpected unknown word `braavo`, did you mean `bravo`?', + ruleId: 'typo', + source: 'spell', + file: '~/index.text' + } +] +``` + +## API + +This package exports the identifier [`VFile`][api-vfile]. +There is no default export. + +### `VFile(options?)` + +Create a new virtual file. + +`options` is treated as: + +* `string` or [`Uint8Array`][mdn-uint8-array] — `{value: options}` +* `URL` — `{path: options}` +* `VFile` — shallow copies its data over to the new file +* `object` — all fields are shallow copied over to the new file + +Path related fields are set in the following order (least specific to +most specific): `history`, `path`, `basename`, `stem`, `extname`, +`dirname`. + +You cannot set `dirname` or `extname` without setting either `history`, +`path`, `basename`, or `stem` too. + +###### Parameters + +* `options` ([`Compatible`][api-compatible], optional) + — file value + +###### Returns + +New instance (`VFile`). + +###### Example + +```js +new VFile() +new VFile('console.log("alpha");') +new VFile(new Uint8Array([0x65, 0x78, 0x69, 0x74, 0x20, 0x31])) +new VFile({path: path.join('path', 'to', 'readme.md')}) +new VFile({stem: 'readme', extname: '.md', dirname: path.join('path', 'to')}) +new VFile({other: 'properties', are: 'copied', ov: {e: 'r'}}) +``` + +### `file.cwd` + +Base of `path` (`string`, default: `process.cwd()` or `'/'` in browsers). + +### `file.data` + +Place to store custom info (`Record`, default: `{}`). + +It’s OK to store custom data directly on the file but moving it to `data` is +recommended. + +### `file.history` + +List of file paths the file moved between (`Array`). + +The first is the original path and the last is the current path. + +### `file.messages` + +List of messages associated with the file +([`Array`][api-vfile-message]). + +### `file.value` + +Raw value ([`Uint8Array`][mdn-uint8-array], `string`, `undefined`). + +### `file.basename` + +Get or set the basename (including extname) (`string?`, example: `'index.min.js'`). + +Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` on +windows). +Cannot be nullified (use `file.path = file.dirname` instead). + +### `file.dirname` + +Get or set the parent path (`string?`, example: `'~'`). + +Cannot be set if there’s no `path` yet. + +### `file.extname` + +Get or set the extname (including dot) (`string?`, example: `'.js'`). + +Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` on +windows). +Cannot be set if there’s no `path` yet. + +### `file.path` + +Get or set the full path (`string?`, example: `'~/index.min.js'`). + +Cannot be nullified. +You can set a file URL (a `URL` object with a `file:` protocol) which will be +turned into a path with [`url.fileURLToPath`][file-url-to-path]. + +### `file.stem` + +Get or set the stem (basename w/o extname) (`string?`, example: `'index.min'`). + +Cannot contain path separators (`'/'` on unix, macOS, and browsers, `'\'` on +windows). +Cannot be nullified. + +### `VFile#fail(reason[, options])` + +Create a fatal message for `reason` associated with the file. + +The `fatal` field of the message is set to `true` (error; file not usable) and +the `file` field is set to the current file path. +The message is added to the `messages` field on `file`. + +> 🪦 **Note**: also has obsolete signatures. + +###### Parameters + +* `reason` (`string`) + — reason for message, should use markdown +* `options` ([`MessageOptions`][api-message-options], optional) + — configuration + +###### Returns + +Nothing (`never`). + +###### Throws + +Message ([`VFileMessage`][vmessage]). + +### `VFile#info(reason[, options])` + +Create an info message for `reason` associated with the file. + +The `fatal` field of the message is set to `undefined` (info; change likely not +needed) and the `file` field is set to the current file path. +The message is added to the `messages` field on `file`. + +> 🪦 **Note**: also has obsolete signatures. + +###### Parameters + +* `reason` (`string`) + — reason for message, should use markdown +* `options` ([`MessageOptions`][api-message-options], optional) + — configuration + +###### Returns + +Message ([`VFileMessage`][vmessage]). + +### `VFile#message(reason[, options])` + +Create a message for `reason` associated with the file. + +The `fatal` field of the message is set to `false` (warning; change may be +needed) and the `file` field is set to the current file path. +The message is added to the `messages` field on `file`. + +> 🪦 **Note**: also has obsolete signatures. + +###### Parameters + +* `reason` (`string`) + — reason for message, should use markdown +* `options` ([`MessageOptions`][api-message-options], optional) + — configuration + +###### Returns + +Message ([`VFileMessage`][vmessage]). + +### `VFile#toString(encoding?)` + +Serialize the file. + +> **Note**: which encodings are supported depends on the engine. +> For info on Node.js, see: +> . + +###### Parameters + +* `encoding` (`string`, default: `'utf8'`) + — character encoding to understand `value` as when it’s a + [`Uint8Array`][mdn-uint8-array] + +###### Returns + +Serialized file (`string`). + +### `Compatible` + +Things that can be passed to the constructor (TypeScript type). + +###### Type + +```ts +type Compatible = Options | URL | VFile | Value +``` + +### `Data` + +Custom info (TypeScript type). + +Known attributes can be added to [`DataMap`][api-data-map]. + +###### Type + +```ts +type Data = Record & Partial +``` + +### `DataMap` + +This map registers the type of the `data` key of a `VFile` (TypeScript type). + +This type can be augmented to register custom `data` types. + +###### Type + +```ts +interface DataMap {} +``` + +###### Example + +```ts +declare module 'vfile' { + interface DataMap { + // `file.data.name` is typed as `string` + name: string + } +} +``` + +### `Map` + +Raw source map (TypeScript type). + +See [`source-map`][source-map]. + +###### Fields + +* `version` (`number`) + — which version of the source map spec this map is following +* `sources` (`Array`) + — an array of URLs to the original source files +* `names` (`Array`) + — an array of identifiers which can be referenced by individual mappings +* `sourceRoot` (`string`, optional) + — the URL root from which all sources are relative +* `sourcesContent` (`Array`, optional) + — an array of contents of the original source files +* `mappings` (`string`) + — a string of base64 VLQs which contain the actual mappings +* `file` (`string`) + — the generated file this source map is associated with + +### `MessageOptions` + +Options to create messages (TypeScript type). + +See [`Options` in `vfile-message`][vfile-message-options]. + +### `Options` + +An object with arbitrary fields and the following known fields (TypeScript +type). + +###### Fields + +* `basename` (`string`, optional) + — set `basename` (name) +* `cwd` (`string`, optional) + — set `cwd` (working directory) +* `data` ([`Data`][api-data], optional) + — set `data` (associated info) +* `dirname` (`string`, optional) + — set `dirname` (path w/o basename) +* `extname` (`string`, optional) + — set `extname` (extension with dot) +* `history` (`Array`, optional) + — set `history` (paths the file moved between) +* `path` (`URL | string`, optional) + — set `path` (current path) +* `stem` (`string`, optional) + — set `stem` (name without extension) +* `value` ([`Value`][api-value], optional) + — set `value` (the contents of the file) + +### `Reporter` + +Type for a reporter (TypeScript type). + +###### Type + +```ts +type Reporter = ( + files: Array, + options: Settings +) => string +``` + +### `ReporterSettings` + +Configuration for reporters (TypeScript type). + +###### Type + +```ts +type ReporterSettings = Record +``` + +### `Value` + +Contents of the file (TypeScript type). + +Can either be text or a [`Uint8Array`][mdn-uint8-array] structure. + +###### Type + +```ts +type Value = Uint8Array | string +``` + +### Well-known + +The following fields are considered “non-standard”, but they are allowed, and +some utilities use them: + +* `map` ([`Map`][api-map]) + — source map; this type is equivalent to the `RawSourceMap` type from the + `source-map` module +* `result` (`unknown`) + — custom, non-string, compiled, representation; this is used by unified to + store non-string results; one example is when turning markdown into React + nodes +* `stored` (`boolean`) + — whether a file was saved to disk; this is used by vfile reporters + +There are also well-known fields on messages, see +[them in a similar section of +`vfile-message`](https://github.com/vfile/vfile-message#well-known). + + + +## List of utilities + +* [`convert-vinyl-to-vfile`](https://github.com/dustinspecker/convert-vinyl-to-vfile) + — transform from [Vinyl][] +* [`to-vfile`](https://github.com/vfile/to-vfile) + — create a file from a file path and read and write to the file system +* [`vfile-find-down`](https://github.com/vfile/vfile-find-down) + — find files by searching the file system downwards +* [`vfile-find-up`](https://github.com/vfile/vfile-find-up) + — find files by searching the file system upwards +* [`vfile-glob`](https://github.com/shinnn/vfile-glob) + — find files by glob patterns +* [`vfile-is`](https://github.com/vfile/vfile-is) + — check if a file passes a test +* [`vfile-location`](https://github.com/vfile/vfile-location) + — convert between positional and offset locations +* [`vfile-matter`](https://github.com/vfile/vfile-matter) + — parse the YAML front matter +* [`vfile-message`](https://github.com/vfile/vfile-message) + — create a file message +* [`vfile-messages-to-vscode-diagnostics`](https://github.com/shinnn/vfile-messages-to-vscode-diagnostics) + — transform file messages to VS Code diagnostics +* [`vfile-mkdirp`](https://github.com/vfile/vfile-mkdirp) + — make sure the directory of a file exists on the file system +* [`vfile-rename`](https://github.com/vfile/vfile-rename) + — rename the path parts of a file +* [`vfile-sort`](https://github.com/vfile/vfile-sort) + — sort messages by line/column +* [`vfile-statistics`](https://github.com/vfile/vfile-statistics) + — count messages per category: failures, warnings, etc +* [`vfile-to-eslint`](https://github.com/vfile/vfile-to-eslint) + — convert to ESLint formatter compatible output + +> 👉 **Note**: see [unist][] for projects that work with nodes. + +## Reporters + +* [`vfile-reporter`][reporter] + — create a report +* [`vfile-reporter-json`](https://github.com/vfile/vfile-reporter-json) + — create a JSON report +* [`vfile-reporter-folder-json`](https://github.com/vfile/vfile-reporter-folder-json) + — create a JSON representation of vfiles +* [`vfile-reporter-pretty`](https://github.com/vfile/vfile-reporter-pretty) + — create a pretty report +* [`vfile-reporter-junit`](https://github.com/kellyselden/vfile-reporter-junit) + — create a jUnit report +* [`vfile-reporter-position`](https://github.com/Hocdoc/vfile-reporter-position) + — create a report with content excerpts + +> 👉 **Note**: want to make your own reporter? +> Reporters *must* accept `Array` as their first argument, and return +> `string`. +> Reporters *may* accept other values too, in which case it’s suggested to stick +> to `vfile-reporter`s interface. + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional types +[`Compatible`][api-compatible], +[`Data`][api-data], +[`DataMap`][api-data-map], +[`Map`][api-map], +[`MessageOptions`][api-message-options], +[`Options`][api-options], +[`Reporter`][api-reporter], +[`ReporterSettings`][api-reporter-settings], and +[`Value`][api-value]. + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `vfile@^6`, +compatible with Node.js 16. + +## Contribute + +See [`contributing.md`][contributing] in [`vfile/.github`][health] for ways to +get started. +See [`support.md`][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## Sponsor + +Support this effort and give back by sponsoring on [OpenCollective][collective]! + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Vercel

+ +
+ Motif

+ +
+ HashiCorp

+ +
+ GitBook

+ +
+ Gatsby

+ +
+ Netlify

+ + +
+ Coinbase

+ +
+ ThemeIsle

+ +
+ Expo

+ +
+ Boost Note

+ +
+ Markdown Space

+ +
+ Holloway

+ +
+
+ You? +

+
+ +## Acknowledgments + +The initial release of this project was authored by +[**@wooorm**](https://github.com/wooorm). + +Thanks to [**@contra**](https://github.com/contra), +[**@phated**](https://github.com/phated), and others for their work on +[Vinyl][], which was a huge inspiration. + +Thanks to +[**@brendo**](https://github.com/brendo), +[**@shinnn**](https://github.com/shinnn), +[**@KyleAMathews**](https://github.com/KyleAMathews), +[**@sindresorhus**](https://github.com/sindresorhus), and +[**@denysdovhan**](https://github.com/denysdovhan) +for contributing commits since! + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/vfile/vfile/workflows/main/badge.svg + +[build]: https://github.com/vfile/vfile/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/vfile/vfile.svg + +[coverage]: https://codecov.io/github/vfile/vfile + +[downloads-badge]: https://img.shields.io/npm/dm/vfile.svg + +[downloads]: https://www.npmjs.com/package/vfile + +[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=vfile + +[size]: https://bundlejs.com/?q=vfile + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[collective]: https://opencollective.com/unified + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[chat]: https://github.com/vfile/vfile/discussions + +[npm]: https://docs.npmjs.com/cli/install + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[typescript]: https://www.typescriptlang.org + +[health]: https://github.com/vfile/.github + +[contributing]: https://github.com/vfile/.github/blob/main/contributing.md + +[support]: https://github.com/vfile/.github/blob/main/support.md + +[coc]: https://github.com/vfile/.github/blob/main/code-of-conduct.md + +[license]: license + +[author]: https://wooorm.com + +[unified]: https://github.com/unifiedjs/unified + +[vinyl]: https://github.com/gulpjs/vinyl + +[site]: https://unifiedjs.com + +[twitter]: https://twitter.com/unifiedjs + +[unist]: https://github.com/syntax-tree/unist#list-of-utilities + +[reporter]: https://github.com/vfile/vfile-reporter + +[vmessage]: https://github.com/vfile/vfile-message + +[vfile-message-options]: https://github.com/vfile/vfile-message#options + +[mdn-uint8-array]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array + +[source-map]: https://github.com/mozilla/source-map/blob/58819f0/source-map.d.ts#L15-L23 + +[file-url-to-path]: https://nodejs.org/api/url.html#url_url_fileurltopath_url + +[governance]: https://github.com/unifiedjs/collective + +[api-vfile-messages]: #filemessages + +[api-vfile-message]: #vfilemessagereason-options + +[api-vfile]: #vfileoptions + +[api-compatible]: #compatible + +[api-data]: #data + +[api-data-map]: #datamap + +[api-map]: #map + +[api-message-options]: #messageoptions + +[api-options]: #options + +[api-reporter]: #reporter + +[api-reporter-settings]: #reportersettings + +[api-value]: #value diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/LICENSE b/tools/ui/node_modules/vite-plugin-devtools-json/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..9bb0d146b844a4b6f7176b5ddf9c4de62b0839c8 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 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/vite-plugin-devtools-json/README.md b/tools/ui/node_modules/vite-plugin-devtools-json/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5433497e16ed338246ea520d01a4f3a8bcfaa282 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/README.md @@ -0,0 +1,72 @@ +# Vite Plugin for DevTools Project Settings (devtools.json) + +Vite plugin for generating the Chrome DevTools project settings file on-the-fly +in the devserver. + +This enables seamless integration with the new Chrome DevTools features + +1. [DevTools Project Settings (devtools.json)](https://goo.gle/devtools-json-design), and +1. [Automatic Workspace folders](http://goo.gle/devtools-automatic-workspace-folders). + +## Installation + +```bash +npm install -D vite-plugin-devtools-json +``` + +## Usage + +Add it to your Vite config + +```js +import {defineConfig} from 'vite'; +import devtoolsJson from 'vite-plugin-devtools-json'; + +export default defineConfig({ + plugins: [ + devtoolsJson(), + // ... + ] +}); +``` + +While the plugin can generate a UUID and save it in vite cache, you can also +specify it in the options like in the following: + +``` + plugins: [ + devtoolsJson({ uuid: "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b" }), + // ... + ] +``` + + +The `/.well-known/appspecific/com.chrome.devtools.json` endpoint will serve the +project settings as JSON with the following structure + +```json +{ + "workspace": { + "root": "/path/to/project/root", + "uuid": "6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b" + } +} +``` + +where `root` is the absolute path to your `{projectRoot}` folder, and `uuid` is +a random v4 UUID, generated the first time that you start the Vite devserver +with the plugin installed (it is henceforth cached in the Vite cache folder). + +Checkout [bmeurer/automatic-workspace-folders-vanilla] for a trivial example +project illustrating how to use the plugin in practice. + +## Publishing + +**Googlers:** We use [go/wombat-dressing-room](http://go/wombat-dressing-room) +for publishing. + +## License + +The code is under [MIT License](LICENSE). + +[bmeurer/automatic-workspace-folders-vanilla]: https://github.com/bmeurer/automatic-workspace-folders-vanilla diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/dist/index.cjs b/tools/ui/node_modules/vite-plugin-devtools-json/dist/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..eac1f876fdea73d4f5c88d240e6caa07e1ae25c6 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/dist/index.cjs @@ -0,0 +1,67 @@ +'use strict'; + +Object.defineProperty(exports, '__esModule', { value: true }); + +var fs = require('fs'); +var path = require('path'); +var uuid = require('uuid'); + +const ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json"; +const plugin = (options) => ({ + name: "devtools-json", + enforce: "post", + configureServer(server) { + const { config } = server; + const { logger } = config; + if (!config.env.DEV) { + return; + } + const getOrCreateUUID = () => { + if (options?.uuid) { + return options.uuid; + } + let { cacheDir } = config; + if (!path.isAbsolute(cacheDir)) { + let { root } = config; + if (!path.isAbsolute(root)) { + root = path.resolve(process.cwd(), root); + } + cacheDir = path.resolve(root, cacheDir); + } + const uuidPath = path.resolve(cacheDir, "uuid.json"); + if (fs.existsSync(uuidPath)) { + const uuid2 = fs.readFileSync(uuidPath, { encoding: "utf-8" }); + if (uuid.validate(uuid2)) { + return uuid2; + } + } + if (!fs.existsSync(cacheDir)) { + fs.mkdirSync(cacheDir, { recursive: true }); + } + const uuid$1 = uuid.v4(); + fs.writeFileSync(uuidPath, uuid$1, { encoding: "utf-8" }); + logger.info(`Generated UUID '${uuid$1}' for DevTools project settings.`); + return uuid$1; + }; + server.middlewares.use(ENDPOINT, async (req, res) => { + let { root } = config; + if (!path.isAbsolute(root)) { + root = path.resolve(process.cwd(), root); + } + if (process.env.WSL_DISTRO_NAME) { + root = path.join("\\\\wsl.localhost", process.env.WSL_DISTRO_NAME, root).replace(/\//g, "\\"); + } + const uuid = getOrCreateUUID(); + const devtoolsJson = { + workspace: { + root, + uuid + } + }; + res.setHeader("Content-Type", "application/json"); + res.end(JSON.stringify(devtoolsJson, null, 2)); + }); + } +}); + +exports.default = plugin; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/dist/index.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/dist/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..51dd0819adb5f514692f92c3fb16b13dce5e06da --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/dist/index.d.ts @@ -0,0 +1,7 @@ +import { Plugin } from 'vite'; + +declare const plugin: (options?: { + uuid: string; +}) => Plugin; + +export { plugin as default }; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/dist/index.mjs b/tools/ui/node_modules/vite-plugin-devtools-json/dist/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..b001461b6cd338a7b1c97033d257991d50fd3655 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/dist/index.mjs @@ -0,0 +1,63 @@ +import fs from 'fs'; +import path from 'path'; +import { validate, v4 } from 'uuid'; + +const ENDPOINT = "/.well-known/appspecific/com.chrome.devtools.json"; +const plugin = (options) => ({ + name: "devtools-json", + enforce: "post", + configureServer(server) { + const { config } = server; + const { logger } = config; + if (!config.env.DEV) { + return; + } + const getOrCreateUUID = () => { + if (options?.uuid) { + return options.uuid; + } + let { cacheDir } = config; + if (!path.isAbsolute(cacheDir)) { + let { root } = config; + if (!path.isAbsolute(root)) { + root = path.resolve(process.cwd(), root); + } + cacheDir = path.resolve(root, cacheDir); + } + const uuidPath = path.resolve(cacheDir, "uuid.json"); + if (fs.existsSync(uuidPath)) { + const uuid2 = fs.readFileSync(uuidPath, { encoding: "utf-8" }); + if (validate(uuid2)) { + return uuid2; + } + } + if (!fs.existsSync(cacheDir)) { + fs.mkdirSync(cacheDir, { recursive: true }); + } + const uuid = v4(); + fs.writeFileSync(uuidPath, uuid, { encoding: "utf-8" }); + logger.info(`Generated UUID '${uuid}' for DevTools project settings.`); + return uuid; + }; + server.middlewares.use(ENDPOINT, async (req, res) => { + let { root } = config; + if (!path.isAbsolute(root)) { + root = path.resolve(process.cwd(), root); + } + if (process.env.WSL_DISTRO_NAME) { + root = path.join("\\\\wsl.localhost", process.env.WSL_DISTRO_NAME, root).replace(/\//g, "\\"); + } + const uuid = getOrCreateUUID(); + const devtoolsJson = { + workspace: { + root, + uuid + } + }; + res.setHeader("Content-Type", "application/json"); + res.end(JSON.stringify(devtoolsJson, null, 2)); + }); + } +}); + +export { plugin as default }; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/.bin/uuid b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/.bin/uuid new file mode 100644 index 0000000000000000000000000000000000000000..b4f612d447167233cc1473bf54424766c54bc243 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/.bin/uuid @@ -0,0 +1,2 @@ +#!/usr/bin/env node +import '../uuid-bin.js'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/LICENSE.md b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..3934168364063216aa8805f06e3a1a8605133d68 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/LICENSE.md @@ -0,0 +1,9 @@ +The MIT License (MIT) + +Copyright (c) 2010-2020 Robert Kieffer and other contributors + +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/vite-plugin-devtools-json/node_modules/uuid/README.md b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/README.md new file mode 100644 index 0000000000000000000000000000000000000000..83ae737eb9314373b5a7cd982f129bc7b3654810 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/README.md @@ -0,0 +1,510 @@ + + +# uuid [![CI](https://github.com/uuidjs/uuid/workflows/CI/badge.svg)](https://github.com/uuidjs/uuid/actions?query=workflow%3ACI) [![Browser](https://github.com/uuidjs/uuid/workflows/Browser/badge.svg)](https://github.com/uuidjs/uuid/actions/workflows/browser.yml) + +For the creation of [RFC9562](https://www.rfc-editor.org/rfc/rfc9562.html) (formerly [RFC4122](https://www.rfc-editor.org/rfc/rfc4122.html)) UUIDs + +- **Complete** - Support for all RFC9562 UUID versions +- **Cross-platform** - Support for... + - ESM & Common JS + - [Typescript](#support) + - [Chrome, Safari, Firefox, and Edge](#support) + - [NodeJS](#support) + - [React Native / Expo](#react-native--expo) +- **Secure** - Uses modern `crypto` API for random values +- **Compact** - Zero-dependency, [tree-shakable](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking) +- **CLI** - [`uuid` command line](#command-line) utility + + +> [!NOTE] +> `uuid@11` is now available: See the [CHANGELOG](./CHANGELOG.md) for details. TL;DR: +> * TypeScript support is now included (remove `@types/uuid` from your dependencies) +> * Subtle changes to how the `options` arg is interpreted for `v1()`, `v6()`, and `v7()`. [See details](#options-handling-for-timestamp-uuids) +> * Binary UUIDs are now `Uint8Array`s. (May impact callers of `parse()`, `stringify()`, or that pass an `option#buf` argument to `v1()`-`v7()`.) + +## Quickstart + +**1. Install** + +```shell +npm install uuid +``` + +**2. Create a UUID** + +ESM-syntax (must use named exports): + +```javascript +import { v4 as uuidv4 } from 'uuid'; +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' +``` + +... CommonJS: + +```javascript +const { v4: uuidv4 } = require('uuid'); +uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' +``` + +For timestamp UUIDs, namespace UUIDs, and other options read on ... + +## API Summary + +| | | | +| --- | --- | --- | +| [`uuid.NIL`](#uuidnil) | The nil UUID string (all zeros) | New in `uuid@8.3` | +| [`uuid.MAX`](#uuidmax) | The max UUID string (all ones) | New in `uuid@9.1` | +| [`uuid.parse()`](#uuidparsestr) | Convert UUID string to array of bytes | New in `uuid@8.3` | +| [`uuid.stringify()`](#uuidstringifyarr-offset) | Convert array of bytes to UUID string | New in `uuid@8.3` | +| [`uuid.v1()`](#uuidv1options-buffer-offset) | Create a version 1 (timestamp) UUID | | +| [`uuid.v1ToV6()`](#uuidv1tov6uuid) | Create a version 6 UUID from a version 1 UUID | New in `uuid@10` | +| [`uuid.v3()`](#uuidv3name-namespace-buffer-offset) | Create a version 3 (namespace w/ MD5) UUID | | +| [`uuid.v4()`](#uuidv4options-buffer-offset) | Create a version 4 (random) UUID | | +| [`uuid.v5()`](#uuidv5name-namespace-buffer-offset) | Create a version 5 (namespace w/ SHA-1) UUID | | +| [`uuid.v6()`](#uuidv6options-buffer-offset) | Create a version 6 (timestamp, reordered) UUID | New in `uuid@10` | +| [`uuid.v6ToV1()`](#uuidv6tov1uuid) | Create a version 1 UUID from a version 6 UUID | New in `uuid@10` | +| [`uuid.v7()`](#uuidv7options-buffer-offset) | Create a version 7 (Unix Epoch time-based) UUID | New in `uuid@10` | +| ~~[`uuid.v8()`](#uuidv8)~~ | "Intentionally left blank" | | +| [`uuid.validate()`](#uuidvalidatestr) | Test a string to see if it is a valid UUID | New in `uuid@8.3` | +| [`uuid.version()`](#uuidversionstr) | Detect RFC version of a UUID | New in `uuid@8.3` | + +## API + +### uuid.NIL + +The nil UUID string (all zeros). + +Example: + +```javascript +import { NIL as NIL_UUID } from 'uuid'; + +NIL_UUID; // ⇨ '00000000-0000-0000-0000-000000000000' +``` + +### uuid.MAX + +The max UUID string (all ones). + +Example: + +```javascript +import { MAX as MAX_UUID } from 'uuid'; + +MAX_UUID; // ⇨ 'ffffffff-ffff-ffff-ffff-ffffffffffff' +``` + +### uuid.parse(str) + +Convert UUID string to array of bytes + +| | | +| --------- | ---------------------------------------- | +| `str` | A valid UUID `String` | +| _returns_ | `Uint8Array[16]` | +| _throws_ | `TypeError` if `str` is not a valid UUID | + + +> [!NOTE] +> Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below. + +Example: + +```javascript +import { parse as uuidParse } from 'uuid'; + +// Parse a UUID +uuidParse('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ +// Uint8Array(16) [ +// 110, 192, 189, 127, 17, +// 192, 67, 218, 151, 94, +// 42, 138, 217, 235, 174, +// 11 +// ] +``` + +### uuid.stringify(arr[, offset]) + +Convert array of bytes to UUID string + +| | | +| -------------- | ---------------------------------------------------------------------------- | +| `arr` | `Array`-like collection of 16 values (starting from `offset`) between 0-255. | +| [`offset` = 0] | `Number` Starting index in the Array | +| _returns_ | `String` | +| _throws_ | `TypeError` if a valid UUID string cannot be generated | + + +> [!NOTE] +> Ordering of values in the byte arrays used by `parse()` and `stringify()` follows the left ↠ right order of hex-pairs in UUID strings. As shown in the example below. + +Example: + +```javascript +import { stringify as uuidStringify } from 'uuid'; + +const uuidBytes = Uint8Array.of( + 0x6e, + 0xc0, + 0xbd, + 0x7f, + 0x11, + 0xc0, + 0x43, + 0xda, + 0x97, + 0x5e, + 0x2a, + 0x8a, + 0xd9, + 0xeb, + 0xae, + 0x0b +); + +uuidStringify(uuidBytes); // ⇨ '6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b' +``` + +### uuid.v1([options[, buffer[, offset]]]) + +Create an RFC version 1 (timestamp) UUID + +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.node = (random)` ] | RFC "node" field as an `Array[6]` of byte values (per 4.1.6) | +| [`options.clockseq = (random)`] | RFC "clock sequence" as a `Number` between 0 - 0x3fff | +| [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) | +| [`options.nsecs = 0`] | RFC "timestamp" field (`Number` of nanoseconds to add to `msecs`, should be 0-10,000) | +| [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | +| _throws_ | `Error` if more than 10M UUIDs/sec are requested | + + +> [!NOTE] +> The default [node id](https://datatracker.ietf.org/doc/html/rfc9562#section-5.1) (the last 12 digits in the UUID) is generated once, randomly, on process startup, and then remains unchanged for the duration of the process. + + +> [!NOTE] +> `options.random` and `options.rng` are only meaningful on the very first call to `v1()`, where they may be passed to initialize the internal `node` and `clockseq` fields. + +Example: + +```javascript +import { v1 as uuidv1 } from 'uuid'; + +uuidv1(); // ⇨ '2c5ea4c0-4067-11e9-9bdd-2b0d7b3dcb6d' +``` + +Example using `options`: + +```javascript +import { v1 as uuidv1 } from 'uuid'; + +const options = { + node: Uint8Array.of(0x01, 0x23, 0x45, 0x67, 0x89, 0xab), + clockseq: 0x1234, + msecs: new Date('2011-11-01').getTime(), + nsecs: 5678, +}; +uuidv1(options); // ⇨ '710b962e-041c-11e1-9234-0123456789ab' +``` + +### uuid.v1ToV6(uuid) + +Convert a UUID from version 1 to version 6 + +```javascript +import { v1ToV6 } from 'uuid'; + +v1ToV6('92f62d9e-22c4-11ef-97e9-325096b39f47'); // ⇨ '1ef22c49-2f62-6d9e-97e9-325096b39f47' +``` + +### uuid.v3(name, namespace[, buffer[, offset]]) + +Create an RFC version 3 (namespace w/ MD5) UUID + +API is identical to `v5()`, but uses "v3" instead. + + +> [!IMPORTANT] +> Per the RFC, "_If backward compatibility is not an issue, SHA-1 [Version 5] is preferred_." + +### uuid.v4([options[, buffer[, offset]]]) + +Create an RFC version 4 (random) UUID + +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.random`] | `Array` of 16 random bytes (0-255) | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | + +Example: + +```javascript +import { v4 as uuidv4 } from 'uuid'; + +uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' +``` + +Example using predefined `random` values: + +```javascript +import { v4 as uuidv4 } from 'uuid'; + +const v4options = { + random: Uint8Array.of( + 0x10, + 0x91, + 0x56, + 0xbe, + 0xc4, + 0xfb, + 0xc1, + 0xea, + 0x71, + 0xb4, + 0xef, + 0xe1, + 0x67, + 0x1c, + 0x58, + 0x36 + ), +}; +uuidv4(v4options); // ⇨ '109156be-c4fb-41ea-b1b4-efe1671c5836' +``` + +### uuid.v5(name, namespace[, buffer[, offset]]) + +Create an RFC version 5 (namespace w/ SHA-1) UUID + +| | | +| --- | --- | +| `name` | `String \| Array` | +| `namespace` | `String \| Array[16]` Namespace UUID | +| [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | + + +> [!NOTE] +> The RFC `DNS` and `URL` namespaces are available as `v5.DNS` and `v5.URL`. + +Example with custom namespace: + +```javascript +import { v5 as uuidv5 } from 'uuid'; + +// Define a custom namespace. Readers, create your own using something like +// https://www.uuidgenerator.net/ +const MY_NAMESPACE = '1b671a64-40d5-491e-99b0-da01ff1f3341'; + +uuidv5('Hello, World!', MY_NAMESPACE); // ⇨ '630eb68f-e0fa-5ecc-887a-7c7a62614681' +``` + +Example with RFC `URL` namespace: + +```javascript +import { v5 as uuidv5 } from 'uuid'; + +uuidv5('https://www.w3.org/', uuidv5.URL); // ⇨ 'c106a26a-21bb-5538-8bf2-57095d1976c1' +``` + +### uuid.v6([options[, buffer[, offset]]]) + +Create an RFC version 6 (timestamp, reordered) UUID + +This method takes the same arguments as uuid.v1(). + +```javascript +import { v6 as uuidv6 } from 'uuid'; + +uuidv6(); // ⇨ '1e940672-c5ea-64c0-9b5d-ab8dfbbd4bed' +``` + +Example using `options`: + +```javascript +import { v6 as uuidv6 } from 'uuid'; + +const options = { + node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], + clockseq: 0x1234, + msecs: new Date('2011-11-01').getTime(), + nsecs: 5678, +}; +uuidv6(options); // ⇨ '1e1041c7-10b9-662e-9234-0123456789ab' +``` + +### uuid.v6ToV1(uuid) + +Convert a UUID from version 6 to version 1 + +```javascript +import { v6ToV1 } from 'uuid'; + +v6ToV1('1ef22c49-2f62-6d9e-97e9-325096b39f47'); // ⇨ '92f62d9e-22c4-11ef-97e9-325096b39f47' +``` + +### uuid.v7([options[, buffer[, offset]]]) + +Create an RFC version 7 (random) UUID + +| | | +| --- | --- | +| [`options`] | `Object` with one or more of the following properties: | +| [`options.msecs = (current time)`] | RFC "timestamp" field (`Number` of milliseconds, unix epoch) | +| [`options.random = (random)`] | `Array` of 16 random bytes (0-255) used to generate other fields, above | +| [`options.rng`] | Alternative to `options.random`, a `Function` that returns an `Array` of 16 random bytes (0-255) | +| [`options.seq = (random)`] | 32-bit sequence `Number` between 0 - 0xffffffff. This may be provided to help ensure uniqueness for UUIDs generated within the same millisecond time interval. Default = random value. | +| [`buffer`] | `Uint8Array` or `Uint8Array` subtype (e.g. Node.js `Buffer`). If provided, binary UUID is written into the array, starting at `offset` | +| [`offset` = 0] | `Number` Index to start writing UUID bytes in `buffer` | +| _returns_ | UUID `String` if no `buffer` is specified, otherwise returns `buffer` | + +Example: + +```javascript +import { v7 as uuidv7 } from 'uuid'; + +uuidv7(); // ⇨ '01695553-c90c-705a-b56d-778dfbbd4bed' +``` + +### ~~uuid.v8()~~ + +**_"Intentionally left blank"_** + + +> [!NOTE] +> Version 8 (experimental) UUIDs are "[for experimental or vendor-specific use cases](https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-8)". The RFC does not define a creation algorithm for them, which is why this package does not offer a `v8()` method. The `validate()` and `version()` methods do work with such UUIDs, however. + +### uuid.validate(str) + +Test a string to see if it is a valid UUID + +| | | +| --------- | --------------------------------------------------- | +| `str` | `String` to validate | +| _returns_ | `true` if string is a valid UUID, `false` otherwise | + +Example: + +```javascript +import { validate as uuidValidate } from 'uuid'; + +uuidValidate('not a UUID'); // ⇨ false +uuidValidate('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ true +``` + +Using `validate` and `version` together it is possible to do per-version validation, e.g. validate for only v4 UUIds. + +```javascript +import { version as uuidVersion } from 'uuid'; +import { validate as uuidValidate } from 'uuid'; + +function uuidValidateV4(uuid) { + return uuidValidate(uuid) && uuidVersion(uuid) === 4; +} + +const v1Uuid = 'd9428888-122b-11e1-b85c-61cd3cbb3210'; +const v4Uuid = '109156be-c4fb-41ea-b1b4-efe1671c5836'; + +uuidValidateV4(v4Uuid); // ⇨ true +uuidValidateV4(v1Uuid); // ⇨ false +``` + +### uuid.version(str) + +Detect RFC version of a UUID + +| | | +| --------- | ---------------------------------------- | +| `str` | A valid UUID `String` | +| _returns_ | `Number` The RFC version of the UUID | +| _throws_ | `TypeError` if `str` is not a valid UUID | + +Example: + +```javascript +import { version as uuidVersion } from 'uuid'; + +uuidVersion('45637ec4-c85f-11ea-87d0-0242ac130003'); // ⇨ 1 +uuidVersion('6ec0bd7f-11c0-43da-975e-2a8ad9ebae0b'); // ⇨ 4 +``` + + +> [!NOTE] +> This method returns `0` for the `NIL` UUID, and `15` for the `MAX` UUID. + +## Command Line + +UUIDs can be generated from the command line using `uuid`. + +```shell +$ npx uuid +ddeb27fb-d9a0-4624-be4d-4615062daed4 +``` + +The default is to generate version 4 UUIDS, however the other versions are supported. Type `uuid --help` for details: + +```shell +$ npx uuid --help + +Usage: + uuid + uuid v1 + uuid v3 + uuid v4 + uuid v5 + uuid v7 + uuid --help + +Note: may be "URL" or "DNS" to use the corresponding UUIDs +defined by RFC9562 +``` + +## `options` Handling for Timestamp UUIDs + +Prior to `uuid@11`, it was possible for `options` state to interfere with the internal state used to ensure uniqueness of timestamp-based UUIDs (the `v1()`, `v6()`, and `v7()` methods). Starting with `uuid@11`, this issue has been addressed by using the presence of the `options` argument as a flag to select between two possible behaviors: + +- Without `options`: Internal state is utilized to improve UUID uniqueness. +- With `options`: Internal state is **NOT** used and, instead, appropriate defaults are applied as needed. + +## Support + +**Browsers**: `uuid` [builds are tested](/uuidjs/uuid/blob/main/wdio.conf.js) against the latest version of desktop Chrome, Safari, Firefox, and Edge. Mobile versions of these same browsers are expected to work but aren't currently tested. + +**Node**: `uuid` [builds are tested](https://github.com/uuidjs/uuid/blob/main/.github/workflows/ci.yml#L26-L27) against node ([LTS releases](https://github.com/nodejs/Release)), plus one prior. E.g. `node@18` is in maintainence mode, and `node@22` is the current LTS release. So `uuid` supports `node@16`-`node@22`. + +**Typescript**: TS versions released within the past two years are supported. [source](https://github.com/microsoft/TypeScript/issues/49088#issuecomment-2468723715) + +## Known issues + + + +### "getRandomValues() not supported" + +This error occurs in environments where the standard [`crypto.getRandomValues()`](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues) API is not supported. This issue can be resolved by adding an appropriate polyfill: + +#### React Native / Expo + +1. Install [`react-native-get-random-values`](https://github.com/LinusU/react-native-get-random-values#readme) +1. Import it _before_ `uuid`. Since `uuid` might also appear as a transitive dependency of some other imports it's safest to just import `react-native-get-random-values` as the very first thing in your entry point: + +```javascript +import 'react-native-get-random-values'; +import { v4 as uuidv4 } from 'uuid'; +``` + +--- + +Markdown generated from [README_js.md](README_js.md) by diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/index.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7d4edc392e85770f0b5cc66a045393e83e44dba --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/index.d.ts @@ -0,0 +1,15 @@ +export type * from './types.js'; +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/index.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6148ea47807b3c85e301d442180c8bd90f059665 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/index.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.version = exports.validate = exports.v7 = exports.v6ToV1 = exports.v6 = exports.v5 = exports.v4 = exports.v3 = exports.v1ToV6 = exports.v1 = exports.stringify = exports.parse = exports.NIL = exports.MAX = void 0; +var max_js_1 = require("./max.js"); +Object.defineProperty(exports, "MAX", { enumerable: true, get: function () { return max_js_1.default; } }); +var nil_js_1 = require("./nil.js"); +Object.defineProperty(exports, "NIL", { enumerable: true, get: function () { return nil_js_1.default; } }); +var parse_js_1 = require("./parse.js"); +Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_js_1.default; } }); +var stringify_js_1 = require("./stringify.js"); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return stringify_js_1.default; } }); +var v1_js_1 = require("./v1.js"); +Object.defineProperty(exports, "v1", { enumerable: true, get: function () { return v1_js_1.default; } }); +var v1ToV6_js_1 = require("./v1ToV6.js"); +Object.defineProperty(exports, "v1ToV6", { enumerable: true, get: function () { return v1ToV6_js_1.default; } }); +var v3_js_1 = require("./v3.js"); +Object.defineProperty(exports, "v3", { enumerable: true, get: function () { return v3_js_1.default; } }); +var v4_js_1 = require("./v4.js"); +Object.defineProperty(exports, "v4", { enumerable: true, get: function () { return v4_js_1.default; } }); +var v5_js_1 = require("./v5.js"); +Object.defineProperty(exports, "v5", { enumerable: true, get: function () { return v5_js_1.default; } }); +var v6_js_1 = require("./v6.js"); +Object.defineProperty(exports, "v6", { enumerable: true, get: function () { return v6_js_1.default; } }); +var v6ToV1_js_1 = require("./v6ToV1.js"); +Object.defineProperty(exports, "v6ToV1", { enumerable: true, get: function () { return v6ToV1_js_1.default; } }); +var v7_js_1 = require("./v7.js"); +Object.defineProperty(exports, "v7", { enumerable: true, get: function () { return v7_js_1.default; } }); +var validate_js_1 = require("./validate.js"); +Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_js_1.default; } }); +var version_js_1 = require("./version.js"); +Object.defineProperty(exports, "version", { enumerable: true, get: function () { return version_js_1.default; } }); diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/max.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/max.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a1e972af402b95f8fd07daa402b3f628c51f0c9 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/max.d.ts @@ -0,0 +1,2 @@ +declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff"; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/max.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/max.js new file mode 100644 index 0000000000000000000000000000000000000000..7ba71eff1f7efa7b51207c84ef477702721d1f8d --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/max.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = 'ffffffff-ffff-ffff-ffff-ffffffffffff'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/md5.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/md5.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a55f51ebdf22d0479e086d30ecca2552fbd7f48 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/md5.d.ts @@ -0,0 +1,2 @@ +declare function md5(bytes: Uint8Array): Uint8Array; +export default md5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/md5.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/md5.js new file mode 100644 index 0000000000000000000000000000000000000000..004b3d68453f74c269c525c0dcf58f6a08774280 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/md5.js @@ -0,0 +1,137 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function md5(bytes) { + const words = uint8ToUint32(bytes); + const md5Bytes = wordsToMd5(words, bytes.length * 8); + return uint32ToUint8(md5Bytes); +} +function uint32ToUint8(input) { + const bytes = new Uint8Array(input.length * 4); + for (let i = 0; i < input.length * 4; i++) { + bytes[i] = (input[i >> 2] >>> ((i % 4) * 8)) & 0xff; + } + return bytes; +} +function getOutputLength(inputLength8) { + return (((inputLength8 + 64) >>> 9) << 4) + 14 + 1; +} +function wordsToMd5(x, len) { + const xpad = new Uint32Array(getOutputLength(len)).fill(0); + xpad.set(x); + xpad[len >> 5] |= 0x80 << len % 32; + xpad[xpad.length - 1] = len; + x = xpad; + let a = 1732584193; + let b = -271733879; + let c = -1732584194; + let d = 271733878; + for (let i = 0; i < x.length; i += 16) { + const olda = a; + const oldb = b; + const oldc = c; + const oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + return Uint32Array.of(a, b, c, d); +} +function uint8ToUint32(input) { + if (input.length === 0) { + return new Uint32Array(); + } + const output = new Uint32Array(getOutputLength(input.length * 8)).fill(0); + for (let i = 0; i < input.length; i++) { + output[i >> 2] |= (input[i] & 0xff) << ((i % 4) * 8); + } + return output; +} +function safeAdd(x, y) { + const lsw = (x & 0xffff) + (y & 0xffff); + const msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xffff); +} +function bitRotateLeft(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); +} +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} +function md5ff(a, b, c, d, x, s, t) { + return md5cmn((b & c) | (~b & d), a, b, x, s, t); +} +function md5gg(a, b, c, d, x, s, t) { + return md5cmn((b & d) | (c & ~d), a, b, x, s, t); +} +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} +exports.default = md5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/native.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/native.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9418fd3a4b74ce18be454686aef0fc70c084f6b2 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/native.d.ts @@ -0,0 +1,4 @@ +declare const _default: { + randomUUID: false | (() => `${string}-${string}-${string}-${string}-${string}`); +}; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/native.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/native.js new file mode 100644 index 0000000000000000000000000000000000000000..7e31a2adf626a4191d494436ba23fa327f6952b7 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/native.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); +exports.default = { randomUUID }; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/nil.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/nil.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b03bb98efded8bfe1c4f25a48b2bc8f99626c968 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/nil.d.ts @@ -0,0 +1,2 @@ +declare const _default: "00000000-0000-0000-0000-000000000000"; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/nil.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/nil.js new file mode 100644 index 0000000000000000000000000000000000000000..5828aa4cda82befda94d1815a25b820abd03ed4e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/nil.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = '00000000-0000-0000-0000-000000000000'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/package.json b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/package.json new file mode 100644 index 0000000000000000000000000000000000000000..729ac4d93b7f2d9be36b44525f02ff6555f9383a --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/parse.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/parse.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a316fb1178e124153d05b4af1792425790396e2e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/parse.d.ts @@ -0,0 +1,2 @@ +declare function parse(uuid: string): Uint8Array; +export default parse; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/parse.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..d2fa8cac25c9c9669c5f375441522ab366941da2 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/parse.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const validate_js_1 = require("./validate.js"); +function parse(uuid) { + if (!(0, validate_js_1.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + let v; + return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff); +} +exports.default = parse; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/regex.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/regex.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d39fa3f6a8024c9630bdff1602a6388b4d88f046 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/regex.d.ts @@ -0,0 +1,2 @@ +declare const _default: RegExp; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/regex.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/regex.js new file mode 100644 index 0000000000000000000000000000000000000000..e3dde2aeffa434aa5262b8199f4bc48852432420 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/regex.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/rng.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/rng.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..73e60cf3482580b42f2d5ab912ef9d26117dafbf --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/rng.d.ts @@ -0,0 +1 @@ +export default function rng(): Uint8Array; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/rng.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/rng.js new file mode 100644 index 0000000000000000000000000000000000000000..155bcd7dfecd124dcfe2a53d7cdd54007038769e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/rng.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +let getRandomValues; +const rnds8 = new Uint8Array(16); +function rng() { + if (!getRandomValues) { + if (typeof crypto === 'undefined' || !crypto.getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + getRandomValues = crypto.getRandomValues.bind(crypto); + } + return getRandomValues(rnds8); +} +exports.default = rng; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/sha1.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/sha1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a6552e5d11ef244f44b2c681a1233f4a7444964e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/sha1.d.ts @@ -0,0 +1,2 @@ +declare function sha1(bytes: Uint8Array): Uint8Array; +export default sha1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/sha1.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/sha1.js new file mode 100644 index 0000000000000000000000000000000000000000..031c42ccbdd6251fa10d5aaa3fa9962091d64777 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/sha1.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +function f(s, x, y, z) { + switch (s) { + case 0: + return (x & y) ^ (~x & z); + case 1: + return x ^ y ^ z; + case 2: + return (x & y) ^ (x & z) ^ (y & z); + case 3: + return x ^ y ^ z; + } +} +function ROTL(x, n) { + return (x << n) | (x >>> (32 - n)); +} +function sha1(bytes) { + const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + const newBytes = new Uint8Array(bytes.length + 1); + newBytes.set(bytes); + newBytes[bytes.length] = 0x80; + bytes = newBytes; + const l = bytes.length / 4 + 2; + const N = Math.ceil(l / 16); + const M = new Array(N); + for (let i = 0; i < N; ++i) { + const arr = new Uint32Array(16); + for (let j = 0; j < 16; ++j) { + arr[j] = + (bytes[i * 64 + j * 4] << 24) | + (bytes[i * 64 + j * 4 + 1] << 16) | + (bytes[i * 64 + j * 4 + 2] << 8) | + bytes[i * 64 + j * 4 + 3]; + } + M[i] = arr; + } + M[N - 1][14] = ((bytes.length - 1) * 8) / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff; + for (let i = 0; i < N; ++i) { + const W = new Uint32Array(80); + for (let t = 0; t < 16; ++t) { + W[t] = M[i][t]; + } + for (let t = 16; t < 80; ++t) { + W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); + } + let a = H[0]; + let b = H[1]; + let c = H[2]; + let d = H[3]; + let e = H[4]; + for (let t = 0; t < 80; ++t) { + const s = Math.floor(t / 20); + const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + H[0] = (H[0] + a) >>> 0; + H[1] = (H[1] + b) >>> 0; + H[2] = (H[2] + c) >>> 0; + H[3] = (H[3] + d) >>> 0; + H[4] = (H[4] + e) >>> 0; + } + return Uint8Array.of(H[0] >> 24, H[0] >> 16, H[0] >> 8, H[0], H[1] >> 24, H[1] >> 16, H[1] >> 8, H[1], H[2] >> 24, H[2] >> 16, H[2] >> 8, H[2], H[3] >> 24, H[3] >> 16, H[3] >> 8, H[3], H[4] >> 24, H[4] >> 16, H[4] >> 8, H[4]); +} +exports.default = sha1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/stringify.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/stringify.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..16cb0088333c77894fefc4e4716312a40997a1fb --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/stringify.d.ts @@ -0,0 +1,3 @@ +export declare function unsafeStringify(arr: Uint8Array, offset?: number): string; +declare function stringify(arr: Uint8Array, offset?: number): string; +export default stringify; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/stringify.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/stringify.js new file mode 100644 index 0000000000000000000000000000000000000000..2ba27bbd5d541800e30783c91d18b5d9c3ca10de --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/stringify.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unsafeStringify = void 0; +const validate_js_1 = require("./validate.js"); +const byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} +function unsafeStringify(arr, offset = 0) { + return (byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + '-' + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + '-' + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + '-' + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + '-' + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]]).toLowerCase(); +} +exports.unsafeStringify = unsafeStringify; +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); + if (!(0, validate_js_1.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + return uuid; +} +exports.default = stringify; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/types.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ecaed97ce0eedfa5931d6ec71bf038cab4cb21e0 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/types.d.ts @@ -0,0 +1,21 @@ +export type UUIDTypes = string | TBuf; +export type Version1Options = { + node?: Uint8Array; + clockseq?: number; + random?: Uint8Array; + rng?: () => Uint8Array; + msecs?: number; + nsecs?: number; + _v6?: boolean; +}; +export type Version4Options = { + random?: Uint8Array; + rng?: () => Uint8Array; +}; +export type Version6Options = Version1Options; +export type Version7Options = { + random?: Uint8Array; + msecs?: number; + seq?: number; + rng?: () => Uint8Array; +}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/types.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/types.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/uuid-bin.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/uuid-bin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/uuid-bin.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/uuid-bin.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/uuid-bin.js new file mode 100644 index 0000000000000000000000000000000000000000..d613137af27214e461019c6736028b65dcbe82b4 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/uuid-bin.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert = require("assert"); +const v1_js_1 = require("./v1.js"); +const v3_js_1 = require("./v3.js"); +const v4_js_1 = require("./v4.js"); +const v5_js_1 = require("./v5.js"); +const v6_js_1 = require("./v6.js"); +const v7_js_1 = require("./v7.js"); +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid v6'); + console.log(' uuid v7'); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562'); +} +const args = process.argv.slice(2); +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} +const version = args.shift() || 'v4'; +switch (version) { + case 'v1': + console.log((0, v1_js_1.default)()); + break; + case 'v3': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v3 name not specified'); + assert.ok(namespace != null, 'v3 namespace not specified'); + if (namespace === 'URL') { + namespace = v3_js_1.default.URL; + } + if (namespace === 'DNS') { + namespace = v3_js_1.default.DNS; + } + console.log((0, v3_js_1.default)(name, namespace)); + break; + } + case 'v4': + console.log((0, v4_js_1.default)()); + break; + case 'v5': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v5 name not specified'); + assert.ok(namespace != null, 'v5 namespace not specified'); + if (namespace === 'URL') { + namespace = v5_js_1.default.URL; + } + if (namespace === 'DNS') { + namespace = v5_js_1.default.DNS; + } + console.log((0, v5_js_1.default)(name, namespace)); + break; + } + case 'v6': + console.log((0, v6_js_1.default)()); + break; + case 'v7': + console.log((0, v7_js_1.default)()); + break; + default: + usage(); + process.exit(1); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v1.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8ecee0cd996079d82cb7c712355ea7675fb4c0e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v1.d.ts @@ -0,0 +1,11 @@ +import { Version1Options } from './types.js'; +type V1State = { + node?: Uint8Array; + clockseq?: number; + msecs?: number; + nsecs?: number; +}; +declare function v1(options?: Version1Options, buf?: undefined, offset?: number): string; +declare function v1(options: Version1Options | undefined, buf: Buf, offset?: number): Buf; +export declare function updateV1State(state: V1State, now: number, rnds: Uint8Array): V1State; +export default v1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v1.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v1.js new file mode 100644 index 0000000000000000000000000000000000000000..155b80d01954c79bc6cbaf1786ef1da0f473c733 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v1.js @@ -0,0 +1,87 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateV1State = void 0; +const rng_js_1 = require("./rng.js"); +const stringify_js_1 = require("./stringify.js"); +const _state = {}; +function v1(options, buf, offset) { + let bytes; + const isV6 = options?._v6 ?? false; + if (options) { + const optionsKeys = Object.keys(options); + if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') { + options = undefined; + } + } + if (options) { + bytes = v1Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset); + } + else { + const now = Date.now(); + const rnds = (0, rng_js_1.default)(); + updateV1State(_state, now, rnds); + bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset); + } + return buf ?? (0, stringify_js_1.unsafeStringify)(bytes); +} +function updateV1State(state, now, rnds) { + state.msecs ??= -Infinity; + state.nsecs ??= 0; + if (now === state.msecs) { + state.nsecs++; + if (state.nsecs >= 10000) { + state.node = undefined; + state.nsecs = 0; + } + } + else if (now > state.msecs) { + state.nsecs = 0; + } + else if (now < state.msecs) { + state.node = undefined; + } + if (!state.node) { + state.node = rnds.slice(10, 16); + state.node[0] |= 0x01; + state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff; + } + state.msecs = now; + return state; +} +exports.updateV1State = updateV1State; +function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + nsecs ??= 0; + clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff; + node ??= rnds.slice(10, 16); + msecs += 12219292800000; + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + buf[offset++] = (tl >>> 24) & 0xff; + buf[offset++] = (tl >>> 16) & 0xff; + buf[offset++] = (tl >>> 8) & 0xff; + buf[offset++] = tl & 0xff; + const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; + buf[offset++] = (tmh >>> 8) & 0xff; + buf[offset++] = tmh & 0xff; + buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10; + buf[offset++] = (tmh >>> 16) & 0xff; + buf[offset++] = (clockseq >>> 8) | 0x80; + buf[offset++] = clockseq & 0xff; + for (let n = 0; n < 6; ++n) { + buf[offset++] = node[n]; + } + return buf; +} +exports.default = v1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v1ToV6.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v1ToV6.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..38eaaf0c260e5e8ee1cc554fee0399cfb0b19a16 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v1ToV6.d.ts @@ -0,0 +1,2 @@ +export default function v1ToV6(uuid: string): string; +export default function v1ToV6(uuid: Uint8Array): Uint8Array; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v1ToV6.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v1ToV6.js new file mode 100644 index 0000000000000000000000000000000000000000..daba2c326c1b5989b118db7f8f9a3ac3a83cf435 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v1ToV6.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const parse_js_1 = require("./parse.js"); +const stringify_js_1 = require("./stringify.js"); +function v1ToV6(uuid) { + const v1Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid; + const v6Bytes = _v1ToV6(v1Bytes); + return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v6Bytes) : v6Bytes; +} +exports.default = v1ToV6; +function _v1ToV6(v1Bytes) { + return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v3.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v3.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d1c434ddbcf621df7db9d9b4f293ca61eb96750 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v3.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v3 { + var DNS: string; + var URL: string; +} +export default v3; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v3.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v3.js new file mode 100644 index 0000000000000000000000000000000000000000..d318d2ab0aee09df4a9451cb48e7e8c2e7136efb --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v3.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = exports.DNS = void 0; +const md5_js_1 = require("./md5.js"); +const v35_js_1 = require("./v35.js"); +var v35_js_2 = require("./v35.js"); +Object.defineProperty(exports, "DNS", { enumerable: true, get: function () { return v35_js_2.DNS; } }); +Object.defineProperty(exports, "URL", { enumerable: true, get: function () { return v35_js_2.URL; } }); +function v3(value, namespace, buf, offset) { + return (0, v35_js_1.default)(0x30, md5_js_1.default, value, namespace, buf, offset); +} +v3.DNS = v35_js_1.DNS; +v3.URL = v35_js_1.URL; +exports.default = v3; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v35.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v35.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e6e9d5982fb10b50224ae97d1488e1ed93b14cc --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v35.d.ts @@ -0,0 +1,7 @@ +import { UUIDTypes } from './types.js'; +export declare function stringToBytes(str: string): Uint8Array; +export declare const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; +export declare const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; +type HashFunction = (bytes: Uint8Array) => Uint8Array; +export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: TBuf, offset?: number): UUIDTypes; +export {}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v35.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v35.js new file mode 100644 index 0000000000000000000000000000000000000000..b8b8e09ad1831b7c09ef7b26b2de954580c082a0 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v35.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = exports.DNS = exports.stringToBytes = void 0; +const parse_js_1 = require("./parse.js"); +const stringify_js_1 = require("./stringify.js"); +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + const bytes = new Uint8Array(str.length); + for (let i = 0; i < str.length; ++i) { + bytes[i] = str.charCodeAt(i); + } + return bytes; +} +exports.stringToBytes = stringToBytes; +exports.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +function v35(version, hash, value, namespace, buf, offset) { + const valueBytes = typeof value === 'string' ? stringToBytes(value) : value; + const namespaceBytes = typeof namespace === 'string' ? (0, parse_js_1.default)(namespace) : namespace; + if (typeof namespace === 'string') { + namespace = (0, parse_js_1.default)(namespace); + } + if (namespace?.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } + let bytes = new Uint8Array(16 + valueBytes.length); + bytes.set(namespaceBytes); + bytes.set(valueBytes, namespaceBytes.length); + bytes = hash(bytes); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return (0, stringify_js_1.unsafeStringify)(bytes); +} +exports.default = v35; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v4.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v4.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8205333fd5d2f871b2a221bcf720ac7c134ec5ba --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v4.d.ts @@ -0,0 +1,4 @@ +import { Version4Options } from './types.js'; +declare function v4(options?: Version4Options, buf?: undefined, offset?: number): string; +declare function v4(options: Version4Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v4; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v4.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v4.js new file mode 100644 index 0000000000000000000000000000000000000000..69c975e48d89432327e84a54b18325dc4b638f3c --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v4.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const native_js_1 = require("./native.js"); +const rng_js_1 = require("./rng.js"); +const stringify_js_1 = require("./stringify.js"); +function v4(options, buf, offset) { + if (native_js_1.default.randomUUID && !buf && !options) { + return native_js_1.default.randomUUID(); + } + options = options || {}; + const rnds = options.random ?? options.rng?.() ?? (0, rng_js_1.default)(); + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return (0, stringify_js_1.unsafeStringify)(rnds); +} +exports.default = v4; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v5.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v5.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e2ff2f34d3b6fc92cadf7bc5afccb789c624c6e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v5.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v5 { + var DNS: string; + var URL: string; +} +export default v5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v5.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v5.js new file mode 100644 index 0000000000000000000000000000000000000000..c4239c2fbe67aae304dc455d5bb718218a5b2333 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v5.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = exports.DNS = void 0; +const sha1_js_1 = require("./sha1.js"); +const v35_js_1 = require("./v35.js"); +var v35_js_2 = require("./v35.js"); +Object.defineProperty(exports, "DNS", { enumerable: true, get: function () { return v35_js_2.DNS; } }); +Object.defineProperty(exports, "URL", { enumerable: true, get: function () { return v35_js_2.URL; } }); +function v5(value, namespace, buf, offset) { + return (0, v35_js_1.default)(0x50, sha1_js_1.default, value, namespace, buf, offset); +} +v5.DNS = v35_js_1.DNS; +v5.URL = v35_js_1.URL; +exports.default = v5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v6.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v6.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cabf4a0d13b36ac6bbc0ef03500dd4d64d1351c9 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v6.d.ts @@ -0,0 +1,4 @@ +import { Version6Options } from './types.js'; +declare function v6(options?: Version6Options, buf?: undefined, offset?: number): string; +declare function v6(options: Version6Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v6; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v6.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v6.js new file mode 100644 index 0000000000000000000000000000000000000000..a566d0a5e8d4d678b656be12fad8a9c390fffc0e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v6.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const stringify_js_1 = require("./stringify.js"); +const v1_js_1 = require("./v1.js"); +const v1ToV6_js_1 = require("./v1ToV6.js"); +function v6(options, buf, offset) { + options ??= {}; + offset ??= 0; + let bytes = (0, v1_js_1.default)({ ...options, _v6: true }, new Uint8Array(16)); + bytes = (0, v1ToV6_js_1.default)(bytes); + if (buf) { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; i++) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return (0, stringify_js_1.unsafeStringify)(bytes); +} +exports.default = v6; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v6ToV1.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v6ToV1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b3ffc2113edc98b12972bcb73302a5c7fb10dec --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v6ToV1.d.ts @@ -0,0 +1,2 @@ +export default function v6ToV1(uuid: string): string; +export default function v6ToV1(uuid: Uint8Array): Uint8Array; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v6ToV1.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v6ToV1.js new file mode 100644 index 0000000000000000000000000000000000000000..9dcb6615c81c6488b140c55848230c3c10d556bf --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v6ToV1.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const parse_js_1 = require("./parse.js"); +const stringify_js_1 = require("./stringify.js"); +function v6ToV1(uuid) { + const v6Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid; + const v1Bytes = _v6ToV1(v6Bytes); + return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v1Bytes) : v1Bytes; +} +exports.default = v6ToV1; +function _v6ToV1(v6Bytes) { + return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v7.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v7.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f49b03d55f2c7f99fd7d21e2b1755282bac165b4 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v7.d.ts @@ -0,0 +1,9 @@ +import { Version7Options } from './types.js'; +type V7State = { + msecs?: number; + seq?: number; +}; +declare function v7(options?: Version7Options, buf?: undefined, offset?: number): string; +declare function v7(options: Version7Options | undefined, buf: TBuf, offset?: number): TBuf; +export declare function updateV7State(state: V7State, now: number, rnds: Uint8Array): V7State; +export default v7; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v7.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v7.js new file mode 100644 index 0000000000000000000000000000000000000000..697fe342b3e9eb914df60ead9aed268272626cb0 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/v7.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateV7State = void 0; +const rng_js_1 = require("./rng.js"); +const stringify_js_1 = require("./stringify.js"); +const _state = {}; +function v7(options, buf, offset) { + let bytes; + if (options) { + bytes = v7Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.seq, buf, offset); + } + else { + const now = Date.now(); + const rnds = (0, rng_js_1.default)(); + updateV7State(_state, now, rnds); + bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset); + } + return buf ?? (0, stringify_js_1.unsafeStringify)(bytes); +} +function updateV7State(state, now, rnds) { + state.msecs ??= -Infinity; + state.seq ??= 0; + if (now > state.msecs) { + state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + state.msecs = now; + } + else { + state.seq = (state.seq + 1) | 0; + if (state.seq === 0) { + state.msecs++; + } + } + return state; +} +exports.updateV7State = updateV7State; +function v7Bytes(rnds, msecs, seq, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + buf[offset++] = (msecs / 0x10000000000) & 0xff; + buf[offset++] = (msecs / 0x100000000) & 0xff; + buf[offset++] = (msecs / 0x1000000) & 0xff; + buf[offset++] = (msecs / 0x10000) & 0xff; + buf[offset++] = (msecs / 0x100) & 0xff; + buf[offset++] = msecs & 0xff; + buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f); + buf[offset++] = (seq >>> 20) & 0xff; + buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f); + buf[offset++] = (seq >>> 6) & 0xff; + buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03); + buf[offset++] = rnds[11]; + buf[offset++] = rnds[12]; + buf[offset++] = rnds[13]; + buf[offset++] = rnds[14]; + buf[offset++] = rnds[15]; + return buf; +} +exports.default = v7; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/validate.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/validate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..57da03d7d9d569a5ee5c901956de67773ad83d46 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/validate.d.ts @@ -0,0 +1,2 @@ +declare function validate(uuid: unknown): boolean; +export default validate; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/validate.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/validate.js new file mode 100644 index 0000000000000000000000000000000000000000..89733b069aea87436f3c96a6e35f72232e9b8fbd --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/validate.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const regex_js_1 = require("./regex.js"); +function validate(uuid) { + return typeof uuid === 'string' && regex_js_1.default.test(uuid); +} +exports.default = validate; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/version.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/version.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f1948dc805f934ed2941636085cab037c3e4b649 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/version.d.ts @@ -0,0 +1,2 @@ +declare function version(uuid: string): number; +export default version; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/version.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/version.js new file mode 100644 index 0000000000000000000000000000000000000000..05ecd00d46386d71e124ae8bb46a3ee134f31452 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs-browser/version.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const validate_js_1 = require("./validate.js"); +function version(uuid) { + if (!(0, validate_js_1.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + return parseInt(uuid.slice(14, 15), 16); +} +exports.default = version; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/index.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7d4edc392e85770f0b5cc66a045393e83e44dba --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/index.d.ts @@ -0,0 +1,15 @@ +export type * from './types.js'; +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/index.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/index.js new file mode 100644 index 0000000000000000000000000000000000000000..6148ea47807b3c85e301d442180c8bd90f059665 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/index.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.version = exports.validate = exports.v7 = exports.v6ToV1 = exports.v6 = exports.v5 = exports.v4 = exports.v3 = exports.v1ToV6 = exports.v1 = exports.stringify = exports.parse = exports.NIL = exports.MAX = void 0; +var max_js_1 = require("./max.js"); +Object.defineProperty(exports, "MAX", { enumerable: true, get: function () { return max_js_1.default; } }); +var nil_js_1 = require("./nil.js"); +Object.defineProperty(exports, "NIL", { enumerable: true, get: function () { return nil_js_1.default; } }); +var parse_js_1 = require("./parse.js"); +Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_js_1.default; } }); +var stringify_js_1 = require("./stringify.js"); +Object.defineProperty(exports, "stringify", { enumerable: true, get: function () { return stringify_js_1.default; } }); +var v1_js_1 = require("./v1.js"); +Object.defineProperty(exports, "v1", { enumerable: true, get: function () { return v1_js_1.default; } }); +var v1ToV6_js_1 = require("./v1ToV6.js"); +Object.defineProperty(exports, "v1ToV6", { enumerable: true, get: function () { return v1ToV6_js_1.default; } }); +var v3_js_1 = require("./v3.js"); +Object.defineProperty(exports, "v3", { enumerable: true, get: function () { return v3_js_1.default; } }); +var v4_js_1 = require("./v4.js"); +Object.defineProperty(exports, "v4", { enumerable: true, get: function () { return v4_js_1.default; } }); +var v5_js_1 = require("./v5.js"); +Object.defineProperty(exports, "v5", { enumerable: true, get: function () { return v5_js_1.default; } }); +var v6_js_1 = require("./v6.js"); +Object.defineProperty(exports, "v6", { enumerable: true, get: function () { return v6_js_1.default; } }); +var v6ToV1_js_1 = require("./v6ToV1.js"); +Object.defineProperty(exports, "v6ToV1", { enumerable: true, get: function () { return v6ToV1_js_1.default; } }); +var v7_js_1 = require("./v7.js"); +Object.defineProperty(exports, "v7", { enumerable: true, get: function () { return v7_js_1.default; } }); +var validate_js_1 = require("./validate.js"); +Object.defineProperty(exports, "validate", { enumerable: true, get: function () { return validate_js_1.default; } }); +var version_js_1 = require("./version.js"); +Object.defineProperty(exports, "version", { enumerable: true, get: function () { return version_js_1.default; } }); diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/max.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/max.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a1e972af402b95f8fd07daa402b3f628c51f0c9 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/max.d.ts @@ -0,0 +1,2 @@ +declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff"; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/max.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/max.js new file mode 100644 index 0000000000000000000000000000000000000000..7ba71eff1f7efa7b51207c84ef477702721d1f8d --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/max.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = 'ffffffff-ffff-ffff-ffff-ffffffffffff'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/md5.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/md5.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f8f6ecf3b813d2b3dee17d15360386bf15742126 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/md5.d.ts @@ -0,0 +1,4 @@ +/// +/// +declare function md5(bytes: Uint8Array): Buffer; +export default md5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/md5.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/md5.js new file mode 100644 index 0000000000000000000000000000000000000000..76650130593073d55dce4b795070d52881fa0400 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/md5.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const crypto_1 = require("crypto"); +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } + else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + return (0, crypto_1.createHash)('md5').update(bytes).digest(); +} +exports.default = md5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/native.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/native.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2b6c756ee7de22395756da611e776232236ef812 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/native.d.ts @@ -0,0 +1,6 @@ +/// +import { randomUUID } from 'crypto'; +declare const _default: { + randomUUID: typeof randomUUID; +}; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/native.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/native.js new file mode 100644 index 0000000000000000000000000000000000000000..1013e98da42b62e365ba245a962872867970d55e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/native.js @@ -0,0 +1,4 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const crypto_1 = require("crypto"); +exports.default = { randomUUID: crypto_1.randomUUID }; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/nil.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/nil.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b03bb98efded8bfe1c4f25a48b2bc8f99626c968 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/nil.d.ts @@ -0,0 +1,2 @@ +declare const _default: "00000000-0000-0000-0000-000000000000"; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/nil.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/nil.js new file mode 100644 index 0000000000000000000000000000000000000000..5828aa4cda82befda94d1815a25b820abd03ed4e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/nil.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = '00000000-0000-0000-0000-000000000000'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/package.json b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/package.json new file mode 100644 index 0000000000000000000000000000000000000000..729ac4d93b7f2d9be36b44525f02ff6555f9383a --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/package.json @@ -0,0 +1 @@ +{"type":"commonjs"} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/parse.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/parse.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a316fb1178e124153d05b4af1792425790396e2e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/parse.d.ts @@ -0,0 +1,2 @@ +declare function parse(uuid: string): Uint8Array; +export default parse; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/parse.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..d2fa8cac25c9c9669c5f375441522ab366941da2 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/parse.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const validate_js_1 = require("./validate.js"); +function parse(uuid) { + if (!(0, validate_js_1.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + let v; + return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff); +} +exports.default = parse; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/regex.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/regex.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d39fa3f6a8024c9630bdff1602a6388b4d88f046 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/regex.d.ts @@ -0,0 +1,2 @@ +declare const _default: RegExp; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/regex.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/regex.js new file mode 100644 index 0000000000000000000000000000000000000000..e3dde2aeffa434aa5262b8199f4bc48852432420 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/regex.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/rng.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/rng.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..73e60cf3482580b42f2d5ab912ef9d26117dafbf --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/rng.d.ts @@ -0,0 +1 @@ +export default function rng(): Uint8Array; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/rng.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/rng.js new file mode 100644 index 0000000000000000000000000000000000000000..8f5458eb03eeb4aabe4569be1066991491937cce --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/rng.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const crypto_1 = require("crypto"); +const rnds8Pool = new Uint8Array(256); +let poolPtr = rnds8Pool.length; +function rng() { + if (poolPtr > rnds8Pool.length - 16) { + (0, crypto_1.randomFillSync)(rnds8Pool); + poolPtr = 0; + } + return rnds8Pool.slice(poolPtr, (poolPtr += 16)); +} +exports.default = rng; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/sha1.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/sha1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..dfdc2ea03b13810d603a9bf6656dfef4e3d034f6 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/sha1.d.ts @@ -0,0 +1,4 @@ +/// +/// +declare function sha1(bytes: Uint8Array): Buffer; +export default sha1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/sha1.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/sha1.js new file mode 100644 index 0000000000000000000000000000000000000000..dccedf58e688b4640e169bc8ad28e4e84637c3f4 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/sha1.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const crypto_1 = require("crypto"); +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } + else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + return (0, crypto_1.createHash)('sha1').update(bytes).digest(); +} +exports.default = sha1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/stringify.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/stringify.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..16cb0088333c77894fefc4e4716312a40997a1fb --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/stringify.d.ts @@ -0,0 +1,3 @@ +export declare function unsafeStringify(arr: Uint8Array, offset?: number): string; +declare function stringify(arr: Uint8Array, offset?: number): string; +export default stringify; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/stringify.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/stringify.js new file mode 100644 index 0000000000000000000000000000000000000000..2ba27bbd5d541800e30783c91d18b5d9c3ca10de --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/stringify.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unsafeStringify = void 0; +const validate_js_1 = require("./validate.js"); +const byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} +function unsafeStringify(arr, offset = 0) { + return (byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + '-' + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + '-' + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + '-' + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + '-' + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]]).toLowerCase(); +} +exports.unsafeStringify = unsafeStringify; +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); + if (!(0, validate_js_1.default)(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + return uuid; +} +exports.default = stringify; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/types.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ecaed97ce0eedfa5931d6ec71bf038cab4cb21e0 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/types.d.ts @@ -0,0 +1,21 @@ +export type UUIDTypes = string | TBuf; +export type Version1Options = { + node?: Uint8Array; + clockseq?: number; + random?: Uint8Array; + rng?: () => Uint8Array; + msecs?: number; + nsecs?: number; + _v6?: boolean; +}; +export type Version4Options = { + random?: Uint8Array; + rng?: () => Uint8Array; +}; +export type Version6Options = Version1Options; +export type Version7Options = { + random?: Uint8Array; + msecs?: number; + seq?: number; + rng?: () => Uint8Array; +}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/types.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/types.js new file mode 100644 index 0000000000000000000000000000000000000000..c8ad2e549bdc6801e0d1c80b0308d4b9bd4985ce --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/types.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/uuid-bin.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/uuid-bin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/uuid-bin.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/uuid-bin.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/uuid-bin.js new file mode 100644 index 0000000000000000000000000000000000000000..d613137af27214e461019c6736028b65dcbe82b4 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/uuid-bin.js @@ -0,0 +1,72 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const assert = require("assert"); +const v1_js_1 = require("./v1.js"); +const v3_js_1 = require("./v3.js"); +const v4_js_1 = require("./v4.js"); +const v5_js_1 = require("./v5.js"); +const v6_js_1 = require("./v6.js"); +const v7_js_1 = require("./v7.js"); +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid v6'); + console.log(' uuid v7'); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562'); +} +const args = process.argv.slice(2); +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} +const version = args.shift() || 'v4'; +switch (version) { + case 'v1': + console.log((0, v1_js_1.default)()); + break; + case 'v3': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v3 name not specified'); + assert.ok(namespace != null, 'v3 namespace not specified'); + if (namespace === 'URL') { + namespace = v3_js_1.default.URL; + } + if (namespace === 'DNS') { + namespace = v3_js_1.default.DNS; + } + console.log((0, v3_js_1.default)(name, namespace)); + break; + } + case 'v4': + console.log((0, v4_js_1.default)()); + break; + case 'v5': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v5 name not specified'); + assert.ok(namespace != null, 'v5 namespace not specified'); + if (namespace === 'URL') { + namespace = v5_js_1.default.URL; + } + if (namespace === 'DNS') { + namespace = v5_js_1.default.DNS; + } + console.log((0, v5_js_1.default)(name, namespace)); + break; + } + case 'v6': + console.log((0, v6_js_1.default)()); + break; + case 'v7': + console.log((0, v7_js_1.default)()); + break; + default: + usage(); + process.exit(1); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v1.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8ecee0cd996079d82cb7c712355ea7675fb4c0e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v1.d.ts @@ -0,0 +1,11 @@ +import { Version1Options } from './types.js'; +type V1State = { + node?: Uint8Array; + clockseq?: number; + msecs?: number; + nsecs?: number; +}; +declare function v1(options?: Version1Options, buf?: undefined, offset?: number): string; +declare function v1(options: Version1Options | undefined, buf: Buf, offset?: number): Buf; +export declare function updateV1State(state: V1State, now: number, rnds: Uint8Array): V1State; +export default v1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v1.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v1.js new file mode 100644 index 0000000000000000000000000000000000000000..155b80d01954c79bc6cbaf1786ef1da0f473c733 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v1.js @@ -0,0 +1,87 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateV1State = void 0; +const rng_js_1 = require("./rng.js"); +const stringify_js_1 = require("./stringify.js"); +const _state = {}; +function v1(options, buf, offset) { + let bytes; + const isV6 = options?._v6 ?? false; + if (options) { + const optionsKeys = Object.keys(options); + if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') { + options = undefined; + } + } + if (options) { + bytes = v1Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset); + } + else { + const now = Date.now(); + const rnds = (0, rng_js_1.default)(); + updateV1State(_state, now, rnds); + bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset); + } + return buf ?? (0, stringify_js_1.unsafeStringify)(bytes); +} +function updateV1State(state, now, rnds) { + state.msecs ??= -Infinity; + state.nsecs ??= 0; + if (now === state.msecs) { + state.nsecs++; + if (state.nsecs >= 10000) { + state.node = undefined; + state.nsecs = 0; + } + } + else if (now > state.msecs) { + state.nsecs = 0; + } + else if (now < state.msecs) { + state.node = undefined; + } + if (!state.node) { + state.node = rnds.slice(10, 16); + state.node[0] |= 0x01; + state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff; + } + state.msecs = now; + return state; +} +exports.updateV1State = updateV1State; +function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + nsecs ??= 0; + clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff; + node ??= rnds.slice(10, 16); + msecs += 12219292800000; + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + buf[offset++] = (tl >>> 24) & 0xff; + buf[offset++] = (tl >>> 16) & 0xff; + buf[offset++] = (tl >>> 8) & 0xff; + buf[offset++] = tl & 0xff; + const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; + buf[offset++] = (tmh >>> 8) & 0xff; + buf[offset++] = tmh & 0xff; + buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10; + buf[offset++] = (tmh >>> 16) & 0xff; + buf[offset++] = (clockseq >>> 8) | 0x80; + buf[offset++] = clockseq & 0xff; + for (let n = 0; n < 6; ++n) { + buf[offset++] = node[n]; + } + return buf; +} +exports.default = v1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v1ToV6.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v1ToV6.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..38eaaf0c260e5e8ee1cc554fee0399cfb0b19a16 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v1ToV6.d.ts @@ -0,0 +1,2 @@ +export default function v1ToV6(uuid: string): string; +export default function v1ToV6(uuid: Uint8Array): Uint8Array; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v1ToV6.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v1ToV6.js new file mode 100644 index 0000000000000000000000000000000000000000..daba2c326c1b5989b118db7f8f9a3ac3a83cf435 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v1ToV6.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const parse_js_1 = require("./parse.js"); +const stringify_js_1 = require("./stringify.js"); +function v1ToV6(uuid) { + const v1Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid; + const v6Bytes = _v1ToV6(v1Bytes); + return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v6Bytes) : v6Bytes; +} +exports.default = v1ToV6; +function _v1ToV6(v1Bytes) { + return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v3.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v3.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d1c434ddbcf621df7db9d9b4f293ca61eb96750 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v3.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v3 { + var DNS: string; + var URL: string; +} +export default v3; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v3.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v3.js new file mode 100644 index 0000000000000000000000000000000000000000..d318d2ab0aee09df4a9451cb48e7e8c2e7136efb --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v3.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = exports.DNS = void 0; +const md5_js_1 = require("./md5.js"); +const v35_js_1 = require("./v35.js"); +var v35_js_2 = require("./v35.js"); +Object.defineProperty(exports, "DNS", { enumerable: true, get: function () { return v35_js_2.DNS; } }); +Object.defineProperty(exports, "URL", { enumerable: true, get: function () { return v35_js_2.URL; } }); +function v3(value, namespace, buf, offset) { + return (0, v35_js_1.default)(0x30, md5_js_1.default, value, namespace, buf, offset); +} +v3.DNS = v35_js_1.DNS; +v3.URL = v35_js_1.URL; +exports.default = v3; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v35.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v35.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e6e9d5982fb10b50224ae97d1488e1ed93b14cc --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v35.d.ts @@ -0,0 +1,7 @@ +import { UUIDTypes } from './types.js'; +export declare function stringToBytes(str: string): Uint8Array; +export declare const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; +export declare const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; +type HashFunction = (bytes: Uint8Array) => Uint8Array; +export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: TBuf, offset?: number): UUIDTypes; +export {}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v35.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v35.js new file mode 100644 index 0000000000000000000000000000000000000000..b8b8e09ad1831b7c09ef7b26b2de954580c082a0 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v35.js @@ -0,0 +1,44 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = exports.DNS = exports.stringToBytes = void 0; +const parse_js_1 = require("./parse.js"); +const stringify_js_1 = require("./stringify.js"); +function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + const bytes = new Uint8Array(str.length); + for (let i = 0; i < str.length; ++i) { + bytes[i] = str.charCodeAt(i); + } + return bytes; +} +exports.stringToBytes = stringToBytes; +exports.DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +exports.URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +function v35(version, hash, value, namespace, buf, offset) { + const valueBytes = typeof value === 'string' ? stringToBytes(value) : value; + const namespaceBytes = typeof namespace === 'string' ? (0, parse_js_1.default)(namespace) : namespace; + if (typeof namespace === 'string') { + namespace = (0, parse_js_1.default)(namespace); + } + if (namespace?.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } + let bytes = new Uint8Array(16 + valueBytes.length); + bytes.set(namespaceBytes); + bytes.set(valueBytes, namespaceBytes.length); + bytes = hash(bytes); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return (0, stringify_js_1.unsafeStringify)(bytes); +} +exports.default = v35; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v4.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v4.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8205333fd5d2f871b2a221bcf720ac7c134ec5ba --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v4.d.ts @@ -0,0 +1,4 @@ +import { Version4Options } from './types.js'; +declare function v4(options?: Version4Options, buf?: undefined, offset?: number): string; +declare function v4(options: Version4Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v4; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v4.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v4.js new file mode 100644 index 0000000000000000000000000000000000000000..69c975e48d89432327e84a54b18325dc4b638f3c --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v4.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const native_js_1 = require("./native.js"); +const rng_js_1 = require("./rng.js"); +const stringify_js_1 = require("./stringify.js"); +function v4(options, buf, offset) { + if (native_js_1.default.randomUUID && !buf && !options) { + return native_js_1.default.randomUUID(); + } + options = options || {}; + const rnds = options.random ?? options.rng?.() ?? (0, rng_js_1.default)(); + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return (0, stringify_js_1.unsafeStringify)(rnds); +} +exports.default = v4; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v5.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v5.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e2ff2f34d3b6fc92cadf7bc5afccb789c624c6e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v5.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v5 { + var DNS: string; + var URL: string; +} +export default v5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v5.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v5.js new file mode 100644 index 0000000000000000000000000000000000000000..c4239c2fbe67aae304dc455d5bb718218a5b2333 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v5.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.URL = exports.DNS = void 0; +const sha1_js_1 = require("./sha1.js"); +const v35_js_1 = require("./v35.js"); +var v35_js_2 = require("./v35.js"); +Object.defineProperty(exports, "DNS", { enumerable: true, get: function () { return v35_js_2.DNS; } }); +Object.defineProperty(exports, "URL", { enumerable: true, get: function () { return v35_js_2.URL; } }); +function v5(value, namespace, buf, offset) { + return (0, v35_js_1.default)(0x50, sha1_js_1.default, value, namespace, buf, offset); +} +v5.DNS = v35_js_1.DNS; +v5.URL = v35_js_1.URL; +exports.default = v5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v6.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v6.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cabf4a0d13b36ac6bbc0ef03500dd4d64d1351c9 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v6.d.ts @@ -0,0 +1,4 @@ +import { Version6Options } from './types.js'; +declare function v6(options?: Version6Options, buf?: undefined, offset?: number): string; +declare function v6(options: Version6Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v6; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v6.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v6.js new file mode 100644 index 0000000000000000000000000000000000000000..a566d0a5e8d4d678b656be12fad8a9c390fffc0e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v6.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const stringify_js_1 = require("./stringify.js"); +const v1_js_1 = require("./v1.js"); +const v1ToV6_js_1 = require("./v1ToV6.js"); +function v6(options, buf, offset) { + options ??= {}; + offset ??= 0; + let bytes = (0, v1_js_1.default)({ ...options, _v6: true }, new Uint8Array(16)); + bytes = (0, v1ToV6_js_1.default)(bytes); + if (buf) { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; i++) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return (0, stringify_js_1.unsafeStringify)(bytes); +} +exports.default = v6; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v6ToV1.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v6ToV1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b3ffc2113edc98b12972bcb73302a5c7fb10dec --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v6ToV1.d.ts @@ -0,0 +1,2 @@ +export default function v6ToV1(uuid: string): string; +export default function v6ToV1(uuid: Uint8Array): Uint8Array; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v6ToV1.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v6ToV1.js new file mode 100644 index 0000000000000000000000000000000000000000..9dcb6615c81c6488b140c55848230c3c10d556bf --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v6ToV1.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const parse_js_1 = require("./parse.js"); +const stringify_js_1 = require("./stringify.js"); +function v6ToV1(uuid) { + const v6Bytes = typeof uuid === 'string' ? (0, parse_js_1.default)(uuid) : uuid; + const v1Bytes = _v6ToV1(v6Bytes); + return typeof uuid === 'string' ? (0, stringify_js_1.unsafeStringify)(v1Bytes) : v1Bytes; +} +exports.default = v6ToV1; +function _v6ToV1(v6Bytes) { + return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v7.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v7.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f49b03d55f2c7f99fd7d21e2b1755282bac165b4 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v7.d.ts @@ -0,0 +1,9 @@ +import { Version7Options } from './types.js'; +type V7State = { + msecs?: number; + seq?: number; +}; +declare function v7(options?: Version7Options, buf?: undefined, offset?: number): string; +declare function v7(options: Version7Options | undefined, buf: TBuf, offset?: number): TBuf; +export declare function updateV7State(state: V7State, now: number, rnds: Uint8Array): V7State; +export default v7; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v7.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v7.js new file mode 100644 index 0000000000000000000000000000000000000000..697fe342b3e9eb914df60ead9aed268272626cb0 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/v7.js @@ -0,0 +1,69 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.updateV7State = void 0; +const rng_js_1 = require("./rng.js"); +const stringify_js_1 = require("./stringify.js"); +const _state = {}; +function v7(options, buf, offset) { + let bytes; + if (options) { + bytes = v7Bytes(options.random ?? options.rng?.() ?? (0, rng_js_1.default)(), options.msecs, options.seq, buf, offset); + } + else { + const now = Date.now(); + const rnds = (0, rng_js_1.default)(); + updateV7State(_state, now, rnds); + bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset); + } + return buf ?? (0, stringify_js_1.unsafeStringify)(bytes); +} +function updateV7State(state, now, rnds) { + state.msecs ??= -Infinity; + state.seq ??= 0; + if (now > state.msecs) { + state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + state.msecs = now; + } + else { + state.seq = (state.seq + 1) | 0; + if (state.seq === 0) { + state.msecs++; + } + } + return state; +} +exports.updateV7State = updateV7State; +function v7Bytes(rnds, msecs, seq, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + buf[offset++] = (msecs / 0x10000000000) & 0xff; + buf[offset++] = (msecs / 0x100000000) & 0xff; + buf[offset++] = (msecs / 0x1000000) & 0xff; + buf[offset++] = (msecs / 0x10000) & 0xff; + buf[offset++] = (msecs / 0x100) & 0xff; + buf[offset++] = msecs & 0xff; + buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f); + buf[offset++] = (seq >>> 20) & 0xff; + buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f); + buf[offset++] = (seq >>> 6) & 0xff; + buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03); + buf[offset++] = rnds[11]; + buf[offset++] = rnds[12]; + buf[offset++] = rnds[13]; + buf[offset++] = rnds[14]; + buf[offset++] = rnds[15]; + return buf; +} +exports.default = v7; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/validate.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/validate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..57da03d7d9d569a5ee5c901956de67773ad83d46 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/validate.d.ts @@ -0,0 +1,2 @@ +declare function validate(uuid: unknown): boolean; +export default validate; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/validate.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/validate.js new file mode 100644 index 0000000000000000000000000000000000000000..89733b069aea87436f3c96a6e35f72232e9b8fbd --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/validate.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const regex_js_1 = require("./regex.js"); +function validate(uuid) { + return typeof uuid === 'string' && regex_js_1.default.test(uuid); +} +exports.default = validate; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/version.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/version.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f1948dc805f934ed2941636085cab037c3e4b649 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/version.d.ts @@ -0,0 +1,2 @@ +declare function version(uuid: string): number; +export default version; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/version.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/version.js new file mode 100644 index 0000000000000000000000000000000000000000..05ecd00d46386d71e124ae8bb46a3ee134f31452 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/cjs/version.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const validate_js_1 = require("./validate.js"); +function version(uuid) { + if (!(0, validate_js_1.default)(uuid)) { + throw TypeError('Invalid UUID'); + } + return parseInt(uuid.slice(14, 15), 16); +} +exports.default = version; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/index.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7d4edc392e85770f0b5cc66a045393e83e44dba --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/index.d.ts @@ -0,0 +1,15 @@ +export type * from './types.js'; +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/index.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3193e9a3b3f8ec1095a347a0d4f58da9b448511e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/index.js @@ -0,0 +1,14 @@ +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/max.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/max.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a1e972af402b95f8fd07daa402b3f628c51f0c9 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/max.d.ts @@ -0,0 +1,2 @@ +declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff"; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/max.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/max.js new file mode 100644 index 0000000000000000000000000000000000000000..58951f653f3f0e9cb593d011b00fcdf23bec2aea --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/max.js @@ -0,0 +1 @@ +export default 'ffffffff-ffff-ffff-ffff-ffffffffffff'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/md5.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/md5.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a55f51ebdf22d0479e086d30ecca2552fbd7f48 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/md5.d.ts @@ -0,0 +1,2 @@ +declare function md5(bytes: Uint8Array): Uint8Array; +export default md5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/md5.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/md5.js new file mode 100644 index 0000000000000000000000000000000000000000..918be8c9b8b0ece11205108715b9f7b165eeb556 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/md5.js @@ -0,0 +1,135 @@ +function md5(bytes) { + const words = uint8ToUint32(bytes); + const md5Bytes = wordsToMd5(words, bytes.length * 8); + return uint32ToUint8(md5Bytes); +} +function uint32ToUint8(input) { + const bytes = new Uint8Array(input.length * 4); + for (let i = 0; i < input.length * 4; i++) { + bytes[i] = (input[i >> 2] >>> ((i % 4) * 8)) & 0xff; + } + return bytes; +} +function getOutputLength(inputLength8) { + return (((inputLength8 + 64) >>> 9) << 4) + 14 + 1; +} +function wordsToMd5(x, len) { + const xpad = new Uint32Array(getOutputLength(len)).fill(0); + xpad.set(x); + xpad[len >> 5] |= 0x80 << len % 32; + xpad[xpad.length - 1] = len; + x = xpad; + let a = 1732584193; + let b = -271733879; + let c = -1732584194; + let d = 271733878; + for (let i = 0; i < x.length; i += 16) { + const olda = a; + const oldb = b; + const oldc = c; + const oldd = d; + a = md5ff(a, b, c, d, x[i], 7, -680876936); + d = md5ff(d, a, b, c, x[i + 1], 12, -389564586); + c = md5ff(c, d, a, b, x[i + 2], 17, 606105819); + b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330); + a = md5ff(a, b, c, d, x[i + 4], 7, -176418897); + d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426); + c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341); + b = md5ff(b, c, d, a, x[i + 7], 22, -45705983); + a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416); + d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417); + c = md5ff(c, d, a, b, x[i + 10], 17, -42063); + b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162); + a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682); + d = md5ff(d, a, b, c, x[i + 13], 12, -40341101); + c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290); + b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329); + a = md5gg(a, b, c, d, x[i + 1], 5, -165796510); + d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632); + c = md5gg(c, d, a, b, x[i + 11], 14, 643717713); + b = md5gg(b, c, d, a, x[i], 20, -373897302); + a = md5gg(a, b, c, d, x[i + 5], 5, -701558691); + d = md5gg(d, a, b, c, x[i + 10], 9, 38016083); + c = md5gg(c, d, a, b, x[i + 15], 14, -660478335); + b = md5gg(b, c, d, a, x[i + 4], 20, -405537848); + a = md5gg(a, b, c, d, x[i + 9], 5, 568446438); + d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690); + c = md5gg(c, d, a, b, x[i + 3], 14, -187363961); + b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501); + a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467); + d = md5gg(d, a, b, c, x[i + 2], 9, -51403784); + c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473); + b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734); + a = md5hh(a, b, c, d, x[i + 5], 4, -378558); + d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463); + c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562); + b = md5hh(b, c, d, a, x[i + 14], 23, -35309556); + a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060); + d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353); + c = md5hh(c, d, a, b, x[i + 7], 16, -155497632); + b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640); + a = md5hh(a, b, c, d, x[i + 13], 4, 681279174); + d = md5hh(d, a, b, c, x[i], 11, -358537222); + c = md5hh(c, d, a, b, x[i + 3], 16, -722521979); + b = md5hh(b, c, d, a, x[i + 6], 23, 76029189); + a = md5hh(a, b, c, d, x[i + 9], 4, -640364487); + d = md5hh(d, a, b, c, x[i + 12], 11, -421815835); + c = md5hh(c, d, a, b, x[i + 15], 16, 530742520); + b = md5hh(b, c, d, a, x[i + 2], 23, -995338651); + a = md5ii(a, b, c, d, x[i], 6, -198630844); + d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415); + c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905); + b = md5ii(b, c, d, a, x[i + 5], 21, -57434055); + a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571); + d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606); + c = md5ii(c, d, a, b, x[i + 10], 15, -1051523); + b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799); + a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359); + d = md5ii(d, a, b, c, x[i + 15], 10, -30611744); + c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380); + b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649); + a = md5ii(a, b, c, d, x[i + 4], 6, -145523070); + d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379); + c = md5ii(c, d, a, b, x[i + 2], 15, 718787259); + b = md5ii(b, c, d, a, x[i + 9], 21, -343485551); + a = safeAdd(a, olda); + b = safeAdd(b, oldb); + c = safeAdd(c, oldc); + d = safeAdd(d, oldd); + } + return Uint32Array.of(a, b, c, d); +} +function uint8ToUint32(input) { + if (input.length === 0) { + return new Uint32Array(); + } + const output = new Uint32Array(getOutputLength(input.length * 8)).fill(0); + for (let i = 0; i < input.length; i++) { + output[i >> 2] |= (input[i] & 0xff) << ((i % 4) * 8); + } + return output; +} +function safeAdd(x, y) { + const lsw = (x & 0xffff) + (y & 0xffff); + const msw = (x >> 16) + (y >> 16) + (lsw >> 16); + return (msw << 16) | (lsw & 0xffff); +} +function bitRotateLeft(num, cnt) { + return (num << cnt) | (num >>> (32 - cnt)); +} +function md5cmn(q, a, b, x, s, t) { + return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b); +} +function md5ff(a, b, c, d, x, s, t) { + return md5cmn((b & c) | (~b & d), a, b, x, s, t); +} +function md5gg(a, b, c, d, x, s, t) { + return md5cmn((b & d) | (c & ~d), a, b, x, s, t); +} +function md5hh(a, b, c, d, x, s, t) { + return md5cmn(b ^ c ^ d, a, b, x, s, t); +} +function md5ii(a, b, c, d, x, s, t) { + return md5cmn(c ^ (b | ~d), a, b, x, s, t); +} +export default md5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/native.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/native.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9418fd3a4b74ce18be454686aef0fc70c084f6b2 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/native.d.ts @@ -0,0 +1,4 @@ +declare const _default: { + randomUUID: false | (() => `${string}-${string}-${string}-${string}-${string}`); +}; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/native.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/native.js new file mode 100644 index 0000000000000000000000000000000000000000..76f44f91ffbd98b1cea83202dc814072c9d58353 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/native.js @@ -0,0 +1,2 @@ +const randomUUID = typeof crypto !== 'undefined' && crypto.randomUUID && crypto.randomUUID.bind(crypto); +export default { randomUUID }; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/nil.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/nil.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b03bb98efded8bfe1c4f25a48b2bc8f99626c968 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/nil.d.ts @@ -0,0 +1,2 @@ +declare const _default: "00000000-0000-0000-0000-000000000000"; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/nil.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/nil.js new file mode 100644 index 0000000000000000000000000000000000000000..de6f830ee5d3455947380272a0e717023b09b3f9 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/nil.js @@ -0,0 +1 @@ +export default '00000000-0000-0000-0000-000000000000'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/parse.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/parse.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a316fb1178e124153d05b4af1792425790396e2e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/parse.d.ts @@ -0,0 +1,2 @@ +declare function parse(uuid: string): Uint8Array; +export default parse; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/parse.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..64ac401a2d6158ee54eb7317d88dcad91e328d21 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/parse.js @@ -0,0 +1,9 @@ +import validate from './validate.js'; +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + let v; + return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff); +} +export default parse; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/regex.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/regex.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d39fa3f6a8024c9630bdff1602a6388b4d88f046 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/regex.d.ts @@ -0,0 +1,2 @@ +declare const _default: RegExp; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/regex.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/regex.js new file mode 100644 index 0000000000000000000000000000000000000000..3e385919064ddbb53a45ac41064d3470b6ad4d99 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/regex.js @@ -0,0 +1 @@ +export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/rng.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/rng.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..73e60cf3482580b42f2d5ab912ef9d26117dafbf --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/rng.d.ts @@ -0,0 +1 @@ +export default function rng(): Uint8Array; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/rng.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/rng.js new file mode 100644 index 0000000000000000000000000000000000000000..770f2e271786c463033d363e54265ffdc8791778 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/rng.js @@ -0,0 +1,11 @@ +let getRandomValues; +const rnds8 = new Uint8Array(16); +export default function rng() { + if (!getRandomValues) { + if (typeof crypto === 'undefined' || !crypto.getRandomValues) { + throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported'); + } + getRandomValues = crypto.getRandomValues.bind(crypto); + } + return getRandomValues(rnds8); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/sha1.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/sha1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a6552e5d11ef244f44b2c681a1233f4a7444964e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/sha1.d.ts @@ -0,0 +1,2 @@ +declare function sha1(bytes: Uint8Array): Uint8Array; +export default sha1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/sha1.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/sha1.js new file mode 100644 index 0000000000000000000000000000000000000000..dbb78aeac3b44aa2296d8e3521c425ef57c15657 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/sha1.js @@ -0,0 +1,70 @@ +function f(s, x, y, z) { + switch (s) { + case 0: + return (x & y) ^ (~x & z); + case 1: + return x ^ y ^ z; + case 2: + return (x & y) ^ (x & z) ^ (y & z); + case 3: + return x ^ y ^ z; + } +} +function ROTL(x, n) { + return (x << n) | (x >>> (32 - n)); +} +function sha1(bytes) { + const K = [0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6]; + const H = [0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]; + const newBytes = new Uint8Array(bytes.length + 1); + newBytes.set(bytes); + newBytes[bytes.length] = 0x80; + bytes = newBytes; + const l = bytes.length / 4 + 2; + const N = Math.ceil(l / 16); + const M = new Array(N); + for (let i = 0; i < N; ++i) { + const arr = new Uint32Array(16); + for (let j = 0; j < 16; ++j) { + arr[j] = + (bytes[i * 64 + j * 4] << 24) | + (bytes[i * 64 + j * 4 + 1] << 16) | + (bytes[i * 64 + j * 4 + 2] << 8) | + bytes[i * 64 + j * 4 + 3]; + } + M[i] = arr; + } + M[N - 1][14] = ((bytes.length - 1) * 8) / Math.pow(2, 32); + M[N - 1][14] = Math.floor(M[N - 1][14]); + M[N - 1][15] = ((bytes.length - 1) * 8) & 0xffffffff; + for (let i = 0; i < N; ++i) { + const W = new Uint32Array(80); + for (let t = 0; t < 16; ++t) { + W[t] = M[i][t]; + } + for (let t = 16; t < 80; ++t) { + W[t] = ROTL(W[t - 3] ^ W[t - 8] ^ W[t - 14] ^ W[t - 16], 1); + } + let a = H[0]; + let b = H[1]; + let c = H[2]; + let d = H[3]; + let e = H[4]; + for (let t = 0; t < 80; ++t) { + const s = Math.floor(t / 20); + const T = (ROTL(a, 5) + f(s, b, c, d) + e + K[s] + W[t]) >>> 0; + e = d; + d = c; + c = ROTL(b, 30) >>> 0; + b = a; + a = T; + } + H[0] = (H[0] + a) >>> 0; + H[1] = (H[1] + b) >>> 0; + H[2] = (H[2] + c) >>> 0; + H[3] = (H[3] + d) >>> 0; + H[4] = (H[4] + e) >>> 0; + } + return Uint8Array.of(H[0] >> 24, H[0] >> 16, H[0] >> 8, H[0], H[1] >> 24, H[1] >> 16, H[1] >> 8, H[1], H[2] >> 24, H[2] >> 16, H[2] >> 8, H[2], H[3] >> 24, H[3] >> 16, H[3] >> 8, H[3], H[4] >> 24, H[4] >> 16, H[4] >> 8, H[4]); +} +export default sha1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/stringify.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/stringify.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..16cb0088333c77894fefc4e4716312a40997a1fb --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/stringify.d.ts @@ -0,0 +1,3 @@ +export declare function unsafeStringify(arr: Uint8Array, offset?: number): string; +declare function stringify(arr: Uint8Array, offset?: number): string; +export default stringify; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/stringify.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/stringify.js new file mode 100644 index 0000000000000000000000000000000000000000..962738cb1442b7c7cd5e6a83aa5f78bc47093a59 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/stringify.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; +const byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} +export function unsafeStringify(arr, offset = 0) { + return (byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + '-' + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + '-' + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + '-' + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + '-' + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]]).toLowerCase(); +} +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + return uuid; +} +export default stringify; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/types.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ecaed97ce0eedfa5931d6ec71bf038cab4cb21e0 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/types.d.ts @@ -0,0 +1,21 @@ +export type UUIDTypes = string | TBuf; +export type Version1Options = { + node?: Uint8Array; + clockseq?: number; + random?: Uint8Array; + rng?: () => Uint8Array; + msecs?: number; + nsecs?: number; + _v6?: boolean; +}; +export type Version4Options = { + random?: Uint8Array; + rng?: () => Uint8Array; +}; +export type Version6Options = Version1Options; +export type Version7Options = { + random?: Uint8Array; + msecs?: number; + seq?: number; + rng?: () => Uint8Array; +}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/types.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/types.js new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/types.js @@ -0,0 +1 @@ +export {}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/uuid-bin.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/uuid-bin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/uuid-bin.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/uuid-bin.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/uuid-bin.js new file mode 100644 index 0000000000000000000000000000000000000000..30766fe1ede96e6ab8e940ba8a4e4d7f7937fb65 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/uuid-bin.js @@ -0,0 +1,70 @@ +import * as assert from 'assert'; +import v1 from './v1.js'; +import v3 from './v3.js'; +import v4 from './v4.js'; +import v5 from './v5.js'; +import v6 from './v6.js'; +import v7 from './v7.js'; +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid v6'); + console.log(' uuid v7'); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562'); +} +const args = process.argv.slice(2); +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} +const version = args.shift() || 'v4'; +switch (version) { + case 'v1': + console.log(v1()); + break; + case 'v3': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v3 name not specified'); + assert.ok(namespace != null, 'v3 namespace not specified'); + if (namespace === 'URL') { + namespace = v3.URL; + } + if (namespace === 'DNS') { + namespace = v3.DNS; + } + console.log(v3(name, namespace)); + break; + } + case 'v4': + console.log(v4()); + break; + case 'v5': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v5 name not specified'); + assert.ok(namespace != null, 'v5 namespace not specified'); + if (namespace === 'URL') { + namespace = v5.URL; + } + if (namespace === 'DNS') { + namespace = v5.DNS; + } + console.log(v5(name, namespace)); + break; + } + case 'v6': + console.log(v6()); + break; + case 'v7': + console.log(v7()); + break; + default: + usage(); + process.exit(1); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v1.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8ecee0cd996079d82cb7c712355ea7675fb4c0e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v1.d.ts @@ -0,0 +1,11 @@ +import { Version1Options } from './types.js'; +type V1State = { + node?: Uint8Array; + clockseq?: number; + msecs?: number; + nsecs?: number; +}; +declare function v1(options?: Version1Options, buf?: undefined, offset?: number): string; +declare function v1(options: Version1Options | undefined, buf: Buf, offset?: number): Buf; +export declare function updateV1State(state: V1State, now: number, rnds: Uint8Array): V1State; +export default v1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v1.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v1.js new file mode 100644 index 0000000000000000000000000000000000000000..65e3f68fb712d34bce12b141b4b2f04402d57f9c --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v1.js @@ -0,0 +1,83 @@ +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +const _state = {}; +function v1(options, buf, offset) { + let bytes; + const isV6 = options?._v6 ?? false; + if (options) { + const optionsKeys = Object.keys(options); + if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') { + options = undefined; + } + } + if (options) { + bytes = v1Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset); + } + else { + const now = Date.now(); + const rnds = rng(); + updateV1State(_state, now, rnds); + bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset); + } + return buf ?? unsafeStringify(bytes); +} +export function updateV1State(state, now, rnds) { + state.msecs ??= -Infinity; + state.nsecs ??= 0; + if (now === state.msecs) { + state.nsecs++; + if (state.nsecs >= 10000) { + state.node = undefined; + state.nsecs = 0; + } + } + else if (now > state.msecs) { + state.nsecs = 0; + } + else if (now < state.msecs) { + state.node = undefined; + } + if (!state.node) { + state.node = rnds.slice(10, 16); + state.node[0] |= 0x01; + state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff; + } + state.msecs = now; + return state; +} +function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + nsecs ??= 0; + clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff; + node ??= rnds.slice(10, 16); + msecs += 12219292800000; + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + buf[offset++] = (tl >>> 24) & 0xff; + buf[offset++] = (tl >>> 16) & 0xff; + buf[offset++] = (tl >>> 8) & 0xff; + buf[offset++] = tl & 0xff; + const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; + buf[offset++] = (tmh >>> 8) & 0xff; + buf[offset++] = tmh & 0xff; + buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10; + buf[offset++] = (tmh >>> 16) & 0xff; + buf[offset++] = (clockseq >>> 8) | 0x80; + buf[offset++] = clockseq & 0xff; + for (let n = 0; n < 6; ++n) { + buf[offset++] = node[n]; + } + return buf; +} +export default v1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v1ToV6.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v1ToV6.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..38eaaf0c260e5e8ee1cc554fee0399cfb0b19a16 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v1ToV6.d.ts @@ -0,0 +1,2 @@ +export default function v1ToV6(uuid: string): string; +export default function v1ToV6(uuid: Uint8Array): Uint8Array; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v1ToV6.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v1ToV6.js new file mode 100644 index 0000000000000000000000000000000000000000..da0f76341f6585d050022ac80e988b193a267f42 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v1ToV6.js @@ -0,0 +1,10 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export default function v1ToV6(uuid) { + const v1Bytes = typeof uuid === 'string' ? parse(uuid) : uuid; + const v6Bytes = _v1ToV6(v1Bytes); + return typeof uuid === 'string' ? unsafeStringify(v6Bytes) : v6Bytes; +} +function _v1ToV6(v1Bytes) { + return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v3.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v3.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d1c434ddbcf621df7db9d9b4f293ca61eb96750 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v3.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v3 { + var DNS: string; + var URL: string; +} +export default v3; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v3.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v3.js new file mode 100644 index 0000000000000000000000000000000000000000..b5c3781de7589f2cc36842bcac6211ce7430bcbf --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v3.js @@ -0,0 +1,9 @@ +import md5 from './md5.js'; +import v35, { DNS, URL } from './v35.js'; +export { DNS, URL } from './v35.js'; +function v3(value, namespace, buf, offset) { + return v35(0x30, md5, value, namespace, buf, offset); +} +v3.DNS = DNS; +v3.URL = URL; +export default v3; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v35.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v35.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e6e9d5982fb10b50224ae97d1488e1ed93b14cc --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v35.d.ts @@ -0,0 +1,7 @@ +import { UUIDTypes } from './types.js'; +export declare function stringToBytes(str: string): Uint8Array; +export declare const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; +export declare const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; +type HashFunction = (bytes: Uint8Array) => Uint8Array; +export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: TBuf, offset?: number): UUIDTypes; +export {}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v35.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v35.js new file mode 100644 index 0000000000000000000000000000000000000000..2e0284268d2d50894e00e273d07be5fffdbe8269 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v35.js @@ -0,0 +1,39 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + const bytes = new Uint8Array(str.length); + for (let i = 0; i < str.length; ++i) { + bytes[i] = str.charCodeAt(i); + } + return bytes; +} +export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +export default function v35(version, hash, value, namespace, buf, offset) { + const valueBytes = typeof value === 'string' ? stringToBytes(value) : value; + const namespaceBytes = typeof namespace === 'string' ? parse(namespace) : namespace; + if (typeof namespace === 'string') { + namespace = parse(namespace); + } + if (namespace?.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } + let bytes = new Uint8Array(16 + valueBytes.length); + bytes.set(namespaceBytes); + bytes.set(valueBytes, namespaceBytes.length); + bytes = hash(bytes); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return unsafeStringify(bytes); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v4.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v4.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8205333fd5d2f871b2a221bcf720ac7c134ec5ba --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v4.d.ts @@ -0,0 +1,4 @@ +import { Version4Options } from './types.js'; +declare function v4(options?: Version4Options, buf?: undefined, offset?: number): string; +declare function v4(options: Version4Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v4; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v4.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v4.js new file mode 100644 index 0000000000000000000000000000000000000000..dd9067a6e305c76cc7c444939cd0c6168c457473 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v4.js @@ -0,0 +1,27 @@ +import native from './native.js'; +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +function v4(options, buf, offset) { + if (native.randomUUID && !buf && !options) { + return native.randomUUID(); + } + options = options || {}; + const rnds = options.random ?? options.rng?.() ?? rng(); + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return unsafeStringify(rnds); +} +export default v4; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v5.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v5.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e2ff2f34d3b6fc92cadf7bc5afccb789c624c6e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v5.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v5 { + var DNS: string; + var URL: string; +} +export default v5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v5.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v5.js new file mode 100644 index 0000000000000000000000000000000000000000..bd470a4581f93d5c36b233d55c97fef43f7867ab --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v5.js @@ -0,0 +1,9 @@ +import sha1 from './sha1.js'; +import v35, { DNS, URL } from './v35.js'; +export { DNS, URL } from './v35.js'; +function v5(value, namespace, buf, offset) { + return v35(0x50, sha1, value, namespace, buf, offset); +} +v5.DNS = DNS; +v5.URL = URL; +export default v5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v6.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v6.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cabf4a0d13b36ac6bbc0ef03500dd4d64d1351c9 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v6.d.ts @@ -0,0 +1,4 @@ +import { Version6Options } from './types.js'; +declare function v6(options?: Version6Options, buf?: undefined, offset?: number): string; +declare function v6(options: Version6Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v6; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v6.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v6.js new file mode 100644 index 0000000000000000000000000000000000000000..bd1fc35ebebd8dd67061ff2553723ae7f645d0e4 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v6.js @@ -0,0 +1,20 @@ +import { unsafeStringify } from './stringify.js'; +import v1 from './v1.js'; +import v1ToV6 from './v1ToV6.js'; +function v6(options, buf, offset) { + options ??= {}; + offset ??= 0; + let bytes = v1({ ...options, _v6: true }, new Uint8Array(16)); + bytes = v1ToV6(bytes); + if (buf) { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; i++) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return unsafeStringify(bytes); +} +export default v6; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v6ToV1.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v6ToV1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b3ffc2113edc98b12972bcb73302a5c7fb10dec --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v6ToV1.d.ts @@ -0,0 +1,2 @@ +export default function v6ToV1(uuid: string): string; +export default function v6ToV1(uuid: Uint8Array): Uint8Array; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v6ToV1.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v6ToV1.js new file mode 100644 index 0000000000000000000000000000000000000000..bfd942fdafa88835e45d1743af2e48dbb13ed8f8 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v6ToV1.js @@ -0,0 +1,10 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export default function v6ToV1(uuid) { + const v6Bytes = typeof uuid === 'string' ? parse(uuid) : uuid; + const v1Bytes = _v6ToV1(v6Bytes); + return typeof uuid === 'string' ? unsafeStringify(v1Bytes) : v1Bytes; +} +function _v6ToV1(v6Bytes) { + return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v7.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v7.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f49b03d55f2c7f99fd7d21e2b1755282bac165b4 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v7.d.ts @@ -0,0 +1,9 @@ +import { Version7Options } from './types.js'; +type V7State = { + msecs?: number; + seq?: number; +}; +declare function v7(options?: Version7Options, buf?: undefined, offset?: number): string; +declare function v7(options: Version7Options | undefined, buf: TBuf, offset?: number): TBuf; +export declare function updateV7State(state: V7State, now: number, rnds: Uint8Array): V7State; +export default v7; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v7.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v7.js new file mode 100644 index 0000000000000000000000000000000000000000..276c9bf6f04fa4ba169eaed5a0931fe8912f2891 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/v7.js @@ -0,0 +1,65 @@ +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +const _state = {}; +function v7(options, buf, offset) { + let bytes; + if (options) { + bytes = v7Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.seq, buf, offset); + } + else { + const now = Date.now(); + const rnds = rng(); + updateV7State(_state, now, rnds); + bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset); + } + return buf ?? unsafeStringify(bytes); +} +export function updateV7State(state, now, rnds) { + state.msecs ??= -Infinity; + state.seq ??= 0; + if (now > state.msecs) { + state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + state.msecs = now; + } + else { + state.seq = (state.seq + 1) | 0; + if (state.seq === 0) { + state.msecs++; + } + } + return state; +} +function v7Bytes(rnds, msecs, seq, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + buf[offset++] = (msecs / 0x10000000000) & 0xff; + buf[offset++] = (msecs / 0x100000000) & 0xff; + buf[offset++] = (msecs / 0x1000000) & 0xff; + buf[offset++] = (msecs / 0x10000) & 0xff; + buf[offset++] = (msecs / 0x100) & 0xff; + buf[offset++] = msecs & 0xff; + buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f); + buf[offset++] = (seq >>> 20) & 0xff; + buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f); + buf[offset++] = (seq >>> 6) & 0xff; + buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03); + buf[offset++] = rnds[11]; + buf[offset++] = rnds[12]; + buf[offset++] = rnds[13]; + buf[offset++] = rnds[14]; + buf[offset++] = rnds[15]; + return buf; +} +export default v7; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/validate.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/validate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..57da03d7d9d569a5ee5c901956de67773ad83d46 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/validate.d.ts @@ -0,0 +1,2 @@ +declare function validate(uuid: unknown): boolean; +export default validate; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/validate.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/validate.js new file mode 100644 index 0000000000000000000000000000000000000000..444a1a2f904db825c3ed2ad4d4029ad0ecfb742c --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/validate.js @@ -0,0 +1,5 @@ +import REGEX from './regex.js'; +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} +export default validate; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/version.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/version.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f1948dc805f934ed2941636085cab037c3e4b649 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/version.d.ts @@ -0,0 +1,2 @@ +declare function version(uuid: string): number; +export default version; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/version.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/version.js new file mode 100644 index 0000000000000000000000000000000000000000..bae91d3fdd22481454ed12680dc43c43b2f99a62 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm-browser/version.js @@ -0,0 +1,8 @@ +import validate from './validate.js'; +function version(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + return parseInt(uuid.slice(14, 15), 16); +} +export default version; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/bin/uuid b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/bin/uuid new file mode 100644 index 0000000000000000000000000000000000000000..b4f612d447167233cc1473bf54424766c54bc243 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/bin/uuid @@ -0,0 +1,2 @@ +#!/usr/bin/env node +import '../uuid-bin.js'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/index.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d7d4edc392e85770f0b5cc66a045393e83e44dba --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/index.d.ts @@ -0,0 +1,15 @@ +export type * from './types.js'; +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/index.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3193e9a3b3f8ec1095a347a0d4f58da9b448511e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/index.js @@ -0,0 +1,14 @@ +export { default as MAX } from './max.js'; +export { default as NIL } from './nil.js'; +export { default as parse } from './parse.js'; +export { default as stringify } from './stringify.js'; +export { default as v1 } from './v1.js'; +export { default as v1ToV6 } from './v1ToV6.js'; +export { default as v3 } from './v3.js'; +export { default as v4 } from './v4.js'; +export { default as v5 } from './v5.js'; +export { default as v6 } from './v6.js'; +export { default as v6ToV1 } from './v6ToV1.js'; +export { default as v7 } from './v7.js'; +export { default as validate } from './validate.js'; +export { default as version } from './version.js'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/max.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/max.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a1e972af402b95f8fd07daa402b3f628c51f0c9 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/max.d.ts @@ -0,0 +1,2 @@ +declare const _default: "ffffffff-ffff-ffff-ffff-ffffffffffff"; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/max.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/max.js new file mode 100644 index 0000000000000000000000000000000000000000..58951f653f3f0e9cb593d011b00fcdf23bec2aea --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/max.js @@ -0,0 +1 @@ +export default 'ffffffff-ffff-ffff-ffff-ffffffffffff'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/md5.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/md5.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7d60244b3b9f63bd596755daaa6795805d0449df --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/md5.d.ts @@ -0,0 +1,4 @@ +/// +/// +declare function md5(bytes: Uint8Array): Buffer; +export default md5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/md5.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/md5.js new file mode 100644 index 0000000000000000000000000000000000000000..b922d98d3da8132e2e0b17d9c8a5d87b7fde7021 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/md5.js @@ -0,0 +1,11 @@ +import { createHash } from 'crypto'; +function md5(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } + else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + return createHash('md5').update(bytes).digest(); +} +export default md5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/native.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/native.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9e0d2ac5817000c3a056cc2aa4d56aca20073735 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/native.d.ts @@ -0,0 +1,6 @@ +/// +import { randomUUID } from 'crypto'; +declare const _default: { + randomUUID: typeof randomUUID; +}; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/native.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/native.js new file mode 100644 index 0000000000000000000000000000000000000000..ba74bcac5d9070c45c188f0b2b707df457418c40 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/native.js @@ -0,0 +1,2 @@ +import { randomUUID } from 'crypto'; +export default { randomUUID }; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/nil.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/nil.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b03bb98efded8bfe1c4f25a48b2bc8f99626c968 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/nil.d.ts @@ -0,0 +1,2 @@ +declare const _default: "00000000-0000-0000-0000-000000000000"; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/nil.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/nil.js new file mode 100644 index 0000000000000000000000000000000000000000..de6f830ee5d3455947380272a0e717023b09b3f9 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/nil.js @@ -0,0 +1 @@ +export default '00000000-0000-0000-0000-000000000000'; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/parse.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/parse.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a316fb1178e124153d05b4af1792425790396e2e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/parse.d.ts @@ -0,0 +1,2 @@ +declare function parse(uuid: string): Uint8Array; +export default parse; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/parse.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/parse.js new file mode 100644 index 0000000000000000000000000000000000000000..64ac401a2d6158ee54eb7317d88dcad91e328d21 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/parse.js @@ -0,0 +1,9 @@ +import validate from './validate.js'; +function parse(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + let v; + return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 0xff, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 0xff, ((v = parseInt(uuid.slice(24, 36), 16)) / 0x10000000000) & 0xff, (v / 0x100000000) & 0xff, (v >>> 24) & 0xff, (v >>> 16) & 0xff, (v >>> 8) & 0xff, v & 0xff); +} +export default parse; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/regex.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/regex.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d39fa3f6a8024c9630bdff1602a6388b4d88f046 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/regex.d.ts @@ -0,0 +1,2 @@ +declare const _default: RegExp; +export default _default; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/regex.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/regex.js new file mode 100644 index 0000000000000000000000000000000000000000..3e385919064ddbb53a45ac41064d3470b6ad4d99 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/regex.js @@ -0,0 +1 @@ +export default /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/rng.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/rng.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..73e60cf3482580b42f2d5ab912ef9d26117dafbf --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/rng.d.ts @@ -0,0 +1 @@ +export default function rng(): Uint8Array; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/rng.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/rng.js new file mode 100644 index 0000000000000000000000000000000000000000..54c1cfe9ea68a9bb7788e3b787947bd147c6219c --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/rng.js @@ -0,0 +1,10 @@ +import { randomFillSync } from 'crypto'; +const rnds8Pool = new Uint8Array(256); +let poolPtr = rnds8Pool.length; +export default function rng() { + if (poolPtr > rnds8Pool.length - 16) { + randomFillSync(rnds8Pool); + poolPtr = 0; + } + return rnds8Pool.slice(poolPtr, (poolPtr += 16)); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/sha1.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/sha1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ebb14045a7feb8ca7dd91e05c3e909862eecf813 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/sha1.d.ts @@ -0,0 +1,4 @@ +/// +/// +declare function sha1(bytes: Uint8Array): Buffer; +export default sha1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/sha1.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/sha1.js new file mode 100644 index 0000000000000000000000000000000000000000..fda4aa35747d8acdb68205361241ca737b67559b --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/sha1.js @@ -0,0 +1,11 @@ +import { createHash } from 'crypto'; +function sha1(bytes) { + if (Array.isArray(bytes)) { + bytes = Buffer.from(bytes); + } + else if (typeof bytes === 'string') { + bytes = Buffer.from(bytes, 'utf8'); + } + return createHash('sha1').update(bytes).digest(); +} +export default sha1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/stringify.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/stringify.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..16cb0088333c77894fefc4e4716312a40997a1fb --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/stringify.d.ts @@ -0,0 +1,3 @@ +export declare function unsafeStringify(arr: Uint8Array, offset?: number): string; +declare function stringify(arr: Uint8Array, offset?: number): string; +export default stringify; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/stringify.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/stringify.js new file mode 100644 index 0000000000000000000000000000000000000000..962738cb1442b7c7cd5e6a83aa5f78bc47093a59 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/stringify.js @@ -0,0 +1,35 @@ +import validate from './validate.js'; +const byteToHex = []; +for (let i = 0; i < 256; ++i) { + byteToHex.push((i + 0x100).toString(16).slice(1)); +} +export function unsafeStringify(arr, offset = 0) { + return (byteToHex[arr[offset + 0]] + + byteToHex[arr[offset + 1]] + + byteToHex[arr[offset + 2]] + + byteToHex[arr[offset + 3]] + + '-' + + byteToHex[arr[offset + 4]] + + byteToHex[arr[offset + 5]] + + '-' + + byteToHex[arr[offset + 6]] + + byteToHex[arr[offset + 7]] + + '-' + + byteToHex[arr[offset + 8]] + + byteToHex[arr[offset + 9]] + + '-' + + byteToHex[arr[offset + 10]] + + byteToHex[arr[offset + 11]] + + byteToHex[arr[offset + 12]] + + byteToHex[arr[offset + 13]] + + byteToHex[arr[offset + 14]] + + byteToHex[arr[offset + 15]]).toLowerCase(); +} +function stringify(arr, offset = 0) { + const uuid = unsafeStringify(arr, offset); + if (!validate(uuid)) { + throw TypeError('Stringified UUID is invalid'); + } + return uuid; +} +export default stringify; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/types.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ecaed97ce0eedfa5931d6ec71bf038cab4cb21e0 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/types.d.ts @@ -0,0 +1,21 @@ +export type UUIDTypes = string | TBuf; +export type Version1Options = { + node?: Uint8Array; + clockseq?: number; + random?: Uint8Array; + rng?: () => Uint8Array; + msecs?: number; + nsecs?: number; + _v6?: boolean; +}; +export type Version4Options = { + random?: Uint8Array; + rng?: () => Uint8Array; +}; +export type Version6Options = Version1Options; +export type Version7Options = { + random?: Uint8Array; + msecs?: number; + seq?: number; + rng?: () => Uint8Array; +}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/types.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/types.js new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/types.js @@ -0,0 +1 @@ +export {}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/uuid-bin.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/uuid-bin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cb0ff5c3b541f646105198ee23ac0fc3d805023e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/uuid-bin.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/uuid-bin.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/uuid-bin.js new file mode 100644 index 0000000000000000000000000000000000000000..30766fe1ede96e6ab8e940ba8a4e4d7f7937fb65 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/uuid-bin.js @@ -0,0 +1,70 @@ +import * as assert from 'assert'; +import v1 from './v1.js'; +import v3 from './v3.js'; +import v4 from './v4.js'; +import v5 from './v5.js'; +import v6 from './v6.js'; +import v7 from './v7.js'; +function usage() { + console.log('Usage:'); + console.log(' uuid'); + console.log(' uuid v1'); + console.log(' uuid v3 '); + console.log(' uuid v4'); + console.log(' uuid v5 '); + console.log(' uuid v6'); + console.log(' uuid v7'); + console.log(' uuid --help'); + console.log('\nNote: may be "URL" or "DNS" to use the corresponding UUIDs defined by RFC9562'); +} +const args = process.argv.slice(2); +if (args.indexOf('--help') >= 0) { + usage(); + process.exit(0); +} +const version = args.shift() || 'v4'; +switch (version) { + case 'v1': + console.log(v1()); + break; + case 'v3': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v3 name not specified'); + assert.ok(namespace != null, 'v3 namespace not specified'); + if (namespace === 'URL') { + namespace = v3.URL; + } + if (namespace === 'DNS') { + namespace = v3.DNS; + } + console.log(v3(name, namespace)); + break; + } + case 'v4': + console.log(v4()); + break; + case 'v5': { + const name = args.shift(); + let namespace = args.shift(); + assert.ok(name != null, 'v5 name not specified'); + assert.ok(namespace != null, 'v5 namespace not specified'); + if (namespace === 'URL') { + namespace = v5.URL; + } + if (namespace === 'DNS') { + namespace = v5.DNS; + } + console.log(v5(name, namespace)); + break; + } + case 'v6': + console.log(v6()); + break; + case 'v7': + console.log(v7()); + break; + default: + usage(); + process.exit(1); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v1.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d8ecee0cd996079d82cb7c712355ea7675fb4c0e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v1.d.ts @@ -0,0 +1,11 @@ +import { Version1Options } from './types.js'; +type V1State = { + node?: Uint8Array; + clockseq?: number; + msecs?: number; + nsecs?: number; +}; +declare function v1(options?: Version1Options, buf?: undefined, offset?: number): string; +declare function v1(options: Version1Options | undefined, buf: Buf, offset?: number): Buf; +export declare function updateV1State(state: V1State, now: number, rnds: Uint8Array): V1State; +export default v1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v1.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v1.js new file mode 100644 index 0000000000000000000000000000000000000000..65e3f68fb712d34bce12b141b4b2f04402d57f9c --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v1.js @@ -0,0 +1,83 @@ +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +const _state = {}; +function v1(options, buf, offset) { + let bytes; + const isV6 = options?._v6 ?? false; + if (options) { + const optionsKeys = Object.keys(options); + if (optionsKeys.length === 1 && optionsKeys[0] === '_v6') { + options = undefined; + } + } + if (options) { + bytes = v1Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.nsecs, options.clockseq, options.node, buf, offset); + } + else { + const now = Date.now(); + const rnds = rng(); + updateV1State(_state, now, rnds); + bytes = v1Bytes(rnds, _state.msecs, _state.nsecs, isV6 ? undefined : _state.clockseq, isV6 ? undefined : _state.node, buf, offset); + } + return buf ?? unsafeStringify(bytes); +} +export function updateV1State(state, now, rnds) { + state.msecs ??= -Infinity; + state.nsecs ??= 0; + if (now === state.msecs) { + state.nsecs++; + if (state.nsecs >= 10000) { + state.node = undefined; + state.nsecs = 0; + } + } + else if (now > state.msecs) { + state.nsecs = 0; + } + else if (now < state.msecs) { + state.node = undefined; + } + if (!state.node) { + state.node = rnds.slice(10, 16); + state.node[0] |= 0x01; + state.clockseq = ((rnds[8] << 8) | rnds[9]) & 0x3fff; + } + state.msecs = now; + return state; +} +function v1Bytes(rnds, msecs, nsecs, clockseq, node, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + nsecs ??= 0; + clockseq ??= ((rnds[8] << 8) | rnds[9]) & 0x3fff; + node ??= rnds.slice(10, 16); + msecs += 12219292800000; + const tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + buf[offset++] = (tl >>> 24) & 0xff; + buf[offset++] = (tl >>> 16) & 0xff; + buf[offset++] = (tl >>> 8) & 0xff; + buf[offset++] = tl & 0xff; + const tmh = ((msecs / 0x100000000) * 10000) & 0xfffffff; + buf[offset++] = (tmh >>> 8) & 0xff; + buf[offset++] = tmh & 0xff; + buf[offset++] = ((tmh >>> 24) & 0xf) | 0x10; + buf[offset++] = (tmh >>> 16) & 0xff; + buf[offset++] = (clockseq >>> 8) | 0x80; + buf[offset++] = clockseq & 0xff; + for (let n = 0; n < 6; ++n) { + buf[offset++] = node[n]; + } + return buf; +} +export default v1; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v1ToV6.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v1ToV6.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..38eaaf0c260e5e8ee1cc554fee0399cfb0b19a16 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v1ToV6.d.ts @@ -0,0 +1,2 @@ +export default function v1ToV6(uuid: string): string; +export default function v1ToV6(uuid: Uint8Array): Uint8Array; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v1ToV6.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v1ToV6.js new file mode 100644 index 0000000000000000000000000000000000000000..da0f76341f6585d050022ac80e988b193a267f42 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v1ToV6.js @@ -0,0 +1,10 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export default function v1ToV6(uuid) { + const v1Bytes = typeof uuid === 'string' ? parse(uuid) : uuid; + const v6Bytes = _v1ToV6(v1Bytes); + return typeof uuid === 'string' ? unsafeStringify(v6Bytes) : v6Bytes; +} +function _v1ToV6(v1Bytes) { + return Uint8Array.of(((v1Bytes[6] & 0x0f) << 4) | ((v1Bytes[7] >> 4) & 0x0f), ((v1Bytes[7] & 0x0f) << 4) | ((v1Bytes[4] & 0xf0) >> 4), ((v1Bytes[4] & 0x0f) << 4) | ((v1Bytes[5] & 0xf0) >> 4), ((v1Bytes[5] & 0x0f) << 4) | ((v1Bytes[0] & 0xf0) >> 4), ((v1Bytes[0] & 0x0f) << 4) | ((v1Bytes[1] & 0xf0) >> 4), ((v1Bytes[1] & 0x0f) << 4) | ((v1Bytes[2] & 0xf0) >> 4), 0x60 | (v1Bytes[2] & 0x0f), v1Bytes[3], v1Bytes[8], v1Bytes[9], v1Bytes[10], v1Bytes[11], v1Bytes[12], v1Bytes[13], v1Bytes[14], v1Bytes[15]); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v3.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v3.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d1c434ddbcf621df7db9d9b4f293ca61eb96750 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v3.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v3(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v3 { + var DNS: string; + var URL: string; +} +export default v3; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v3.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v3.js new file mode 100644 index 0000000000000000000000000000000000000000..b5c3781de7589f2cc36842bcac6211ce7430bcbf --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v3.js @@ -0,0 +1,9 @@ +import md5 from './md5.js'; +import v35, { DNS, URL } from './v35.js'; +export { DNS, URL } from './v35.js'; +function v3(value, namespace, buf, offset) { + return v35(0x30, md5, value, namespace, buf, offset); +} +v3.DNS = DNS; +v3.URL = URL; +export default v3; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v35.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v35.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e6e9d5982fb10b50224ae97d1488e1ed93b14cc --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v35.d.ts @@ -0,0 +1,7 @@ +import { UUIDTypes } from './types.js'; +export declare function stringToBytes(str: string): Uint8Array; +export declare const DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8"; +export declare const URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8"; +type HashFunction = (bytes: Uint8Array) => Uint8Array; +export default function v35(version: 0x30 | 0x50, hash: HashFunction, value: string | Uint8Array, namespace: UUIDTypes, buf?: TBuf, offset?: number): UUIDTypes; +export {}; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v35.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v35.js new file mode 100644 index 0000000000000000000000000000000000000000..2e0284268d2d50894e00e273d07be5fffdbe8269 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v35.js @@ -0,0 +1,39 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export function stringToBytes(str) { + str = unescape(encodeURIComponent(str)); + const bytes = new Uint8Array(str.length); + for (let i = 0; i < str.length; ++i) { + bytes[i] = str.charCodeAt(i); + } + return bytes; +} +export const DNS = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; +export const URL = '6ba7b811-9dad-11d1-80b4-00c04fd430c8'; +export default function v35(version, hash, value, namespace, buf, offset) { + const valueBytes = typeof value === 'string' ? stringToBytes(value) : value; + const namespaceBytes = typeof namespace === 'string' ? parse(namespace) : namespace; + if (typeof namespace === 'string') { + namespace = parse(namespace); + } + if (namespace?.length !== 16) { + throw TypeError('Namespace must be array-like (16 iterable integer values, 0-255)'); + } + let bytes = new Uint8Array(16 + valueBytes.length); + bytes.set(namespaceBytes); + bytes.set(valueBytes, namespaceBytes.length); + bytes = hash(bytes); + bytes[6] = (bytes[6] & 0x0f) | version; + bytes[8] = (bytes[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return unsafeStringify(bytes); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v4.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v4.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8205333fd5d2f871b2a221bcf720ac7c134ec5ba --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v4.d.ts @@ -0,0 +1,4 @@ +import { Version4Options } from './types.js'; +declare function v4(options?: Version4Options, buf?: undefined, offset?: number): string; +declare function v4(options: Version4Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v4; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v4.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v4.js new file mode 100644 index 0000000000000000000000000000000000000000..dd9067a6e305c76cc7c444939cd0c6168c457473 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v4.js @@ -0,0 +1,27 @@ +import native from './native.js'; +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +function v4(options, buf, offset) { + if (native.randomUUID && !buf && !options) { + return native.randomUUID(); + } + options = options || {}; + const rnds = options.random ?? options.rng?.() ?? rng(); + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + if (buf) { + offset = offset || 0; + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; ++i) { + buf[offset + i] = rnds[i]; + } + return buf; + } + return unsafeStringify(rnds); +} +export default v4; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v5.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v5.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e2ff2f34d3b6fc92cadf7bc5afccb789c624c6e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v5.d.ts @@ -0,0 +1,9 @@ +import { UUIDTypes } from './types.js'; +export { DNS, URL } from './v35.js'; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf?: undefined, offset?: number): string; +declare function v5(value: string | Uint8Array, namespace: UUIDTypes, buf: TBuf, offset?: number): TBuf; +declare namespace v5 { + var DNS: string; + var URL: string; +} +export default v5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v5.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v5.js new file mode 100644 index 0000000000000000000000000000000000000000..bd470a4581f93d5c36b233d55c97fef43f7867ab --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v5.js @@ -0,0 +1,9 @@ +import sha1 from './sha1.js'; +import v35, { DNS, URL } from './v35.js'; +export { DNS, URL } from './v35.js'; +function v5(value, namespace, buf, offset) { + return v35(0x50, sha1, value, namespace, buf, offset); +} +v5.DNS = DNS; +v5.URL = URL; +export default v5; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v6.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v6.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..cabf4a0d13b36ac6bbc0ef03500dd4d64d1351c9 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v6.d.ts @@ -0,0 +1,4 @@ +import { Version6Options } from './types.js'; +declare function v6(options?: Version6Options, buf?: undefined, offset?: number): string; +declare function v6(options: Version6Options | undefined, buf: TBuf, offset?: number): TBuf; +export default v6; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v6.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v6.js new file mode 100644 index 0000000000000000000000000000000000000000..bd1fc35ebebd8dd67061ff2553723ae7f645d0e4 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v6.js @@ -0,0 +1,20 @@ +import { unsafeStringify } from './stringify.js'; +import v1 from './v1.js'; +import v1ToV6 from './v1ToV6.js'; +function v6(options, buf, offset) { + options ??= {}; + offset ??= 0; + let bytes = v1({ ...options, _v6: true }, new Uint8Array(16)); + bytes = v1ToV6(bytes); + if (buf) { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + for (let i = 0; i < 16; i++) { + buf[offset + i] = bytes[i]; + } + return buf; + } + return unsafeStringify(bytes); +} +export default v6; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v6ToV1.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v6ToV1.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..3b3ffc2113edc98b12972bcb73302a5c7fb10dec --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v6ToV1.d.ts @@ -0,0 +1,2 @@ +export default function v6ToV1(uuid: string): string; +export default function v6ToV1(uuid: Uint8Array): Uint8Array; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v6ToV1.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v6ToV1.js new file mode 100644 index 0000000000000000000000000000000000000000..bfd942fdafa88835e45d1743af2e48dbb13ed8f8 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v6ToV1.js @@ -0,0 +1,10 @@ +import parse from './parse.js'; +import { unsafeStringify } from './stringify.js'; +export default function v6ToV1(uuid) { + const v6Bytes = typeof uuid === 'string' ? parse(uuid) : uuid; + const v1Bytes = _v6ToV1(v6Bytes); + return typeof uuid === 'string' ? unsafeStringify(v1Bytes) : v1Bytes; +} +function _v6ToV1(v6Bytes) { + return Uint8Array.of(((v6Bytes[3] & 0x0f) << 4) | ((v6Bytes[4] >> 4) & 0x0f), ((v6Bytes[4] & 0x0f) << 4) | ((v6Bytes[5] & 0xf0) >> 4), ((v6Bytes[5] & 0x0f) << 4) | (v6Bytes[6] & 0x0f), v6Bytes[7], ((v6Bytes[1] & 0x0f) << 4) | ((v6Bytes[2] & 0xf0) >> 4), ((v6Bytes[2] & 0x0f) << 4) | ((v6Bytes[3] & 0xf0) >> 4), 0x10 | ((v6Bytes[0] & 0xf0) >> 4), ((v6Bytes[0] & 0x0f) << 4) | ((v6Bytes[1] & 0xf0) >> 4), v6Bytes[8], v6Bytes[9], v6Bytes[10], v6Bytes[11], v6Bytes[12], v6Bytes[13], v6Bytes[14], v6Bytes[15]); +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v7.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v7.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f49b03d55f2c7f99fd7d21e2b1755282bac165b4 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v7.d.ts @@ -0,0 +1,9 @@ +import { Version7Options } from './types.js'; +type V7State = { + msecs?: number; + seq?: number; +}; +declare function v7(options?: Version7Options, buf?: undefined, offset?: number): string; +declare function v7(options: Version7Options | undefined, buf: TBuf, offset?: number): TBuf; +export declare function updateV7State(state: V7State, now: number, rnds: Uint8Array): V7State; +export default v7; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v7.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v7.js new file mode 100644 index 0000000000000000000000000000000000000000..276c9bf6f04fa4ba169eaed5a0931fe8912f2891 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/v7.js @@ -0,0 +1,65 @@ +import rng from './rng.js'; +import { unsafeStringify } from './stringify.js'; +const _state = {}; +function v7(options, buf, offset) { + let bytes; + if (options) { + bytes = v7Bytes(options.random ?? options.rng?.() ?? rng(), options.msecs, options.seq, buf, offset); + } + else { + const now = Date.now(); + const rnds = rng(); + updateV7State(_state, now, rnds); + bytes = v7Bytes(rnds, _state.msecs, _state.seq, buf, offset); + } + return buf ?? unsafeStringify(bytes); +} +export function updateV7State(state, now, rnds) { + state.msecs ??= -Infinity; + state.seq ??= 0; + if (now > state.msecs) { + state.seq = (rnds[6] << 23) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + state.msecs = now; + } + else { + state.seq = (state.seq + 1) | 0; + if (state.seq === 0) { + state.msecs++; + } + } + return state; +} +function v7Bytes(rnds, msecs, seq, buf, offset = 0) { + if (rnds.length < 16) { + throw new Error('Random bytes length must be >= 16'); + } + if (!buf) { + buf = new Uint8Array(16); + offset = 0; + } + else { + if (offset < 0 || offset + 16 > buf.length) { + throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`); + } + } + msecs ??= Date.now(); + seq ??= ((rnds[6] * 0x7f) << 24) | (rnds[7] << 16) | (rnds[8] << 8) | rnds[9]; + buf[offset++] = (msecs / 0x10000000000) & 0xff; + buf[offset++] = (msecs / 0x100000000) & 0xff; + buf[offset++] = (msecs / 0x1000000) & 0xff; + buf[offset++] = (msecs / 0x10000) & 0xff; + buf[offset++] = (msecs / 0x100) & 0xff; + buf[offset++] = msecs & 0xff; + buf[offset++] = 0x70 | ((seq >>> 28) & 0x0f); + buf[offset++] = (seq >>> 20) & 0xff; + buf[offset++] = 0x80 | ((seq >>> 14) & 0x3f); + buf[offset++] = (seq >>> 6) & 0xff; + buf[offset++] = ((seq << 2) & 0xff) | (rnds[10] & 0x03); + buf[offset++] = rnds[11]; + buf[offset++] = rnds[12]; + buf[offset++] = rnds[13]; + buf[offset++] = rnds[14]; + buf[offset++] = rnds[15]; + return buf; +} +export default v7; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/validate.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/validate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..57da03d7d9d569a5ee5c901956de67773ad83d46 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/validate.d.ts @@ -0,0 +1,2 @@ +declare function validate(uuid: unknown): boolean; +export default validate; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/validate.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/validate.js new file mode 100644 index 0000000000000000000000000000000000000000..444a1a2f904db825c3ed2ad4d4029ad0ecfb742c --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/validate.js @@ -0,0 +1,5 @@ +import REGEX from './regex.js'; +function validate(uuid) { + return typeof uuid === 'string' && REGEX.test(uuid); +} +export default validate; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/version.d.ts b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/version.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f1948dc805f934ed2941636085cab037c3e4b649 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/version.d.ts @@ -0,0 +1,2 @@ +declare function version(uuid: string): number; +export default version; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/version.js b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/version.js new file mode 100644 index 0000000000000000000000000000000000000000..bae91d3fdd22481454ed12680dc43c43b2f99a62 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/dist/esm/version.js @@ -0,0 +1,8 @@ +import validate from './validate.js'; +function version(uuid) { + if (!validate(uuid)) { + throw TypeError('Invalid UUID'); + } + return parseInt(uuid.slice(14, 15), 16); +} +export default version; diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/package.json b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d0af3f8595ce70be126bd42434f55da07fc36205 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/node_modules/uuid/package.json @@ -0,0 +1,132 @@ +{ + "name": "uuid", + "version": "11.1.1", + "description": "RFC9562 UUIDs", + "type": "module", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "keywords": [ + "uuid", + "guid", + "rfc4122", + "rfc9562" + ], + "license": "MIT", + "bin": { + "uuid": "./dist/esm/bin/uuid" + }, + "sideEffects": false, + "main": "./dist/cjs/index.js", + "exports": { + ".": { + "node": { + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" + }, + "browser": { + "import": "./dist/esm-browser/index.js", + "require": "./dist/cjs-browser/index.js" + }, + "default": "./dist/esm-browser/index.js" + }, + "./package.json": "./package.json" + }, + "module": "./dist/esm/index.js", + "browser": { + "./dist/esm/index.js": "./dist/esm-browser/index.js", + "./dist/cjs/index.js": "./dist/cjs-browser/index.js" + }, + "files": [ + "dist", + "!dist/**/test" + ], + "devDependencies": { + "@babel/eslint-parser": "7.25.9", + "@commitlint/cli": "19.6.1", + "@commitlint/config-conventional": "19.6.0", + "@eslint/js": "9.17.0", + "@types/eslint__js": "8.42.3", + "bundlewatch": "0.4.0", + "commander": "12.1.0", + "eslint": "9.17.0", + "eslint-config-prettier": "9.1.0", + "eslint-plugin-prettier": "5.2.1", + "globals": "15.14.0", + "husky": "9.1.7", + "jest": "29.7.0", + "lint-staged": "15.2.11", + "neostandard": "0.12.0", + "npm-run-all": "4.1.5", + "prettier": "3.4.2", + "release-please": "16.15.0", + "runmd": "1.4.1", + "standard-version": "9.5.0", + "typescript": "5.0.4", + "typescript-eslint": "8.18.2" + }, + "optionalDevDependencies": { + "@wdio/browserstack-service": "9.2.1", + "@wdio/cli": "9.2.1", + "@wdio/jasmine-framework": "9.2.1", + "@wdio/local-runner": "9.2.1", + "@wdio/spec-reporter": "9.1.3", + "@wdio/static-server-service": "9.1.3" + }, + "scripts": { + "build": "./scripts/build.sh", + "build:watch": "tsc --watch -p tsconfig.esm.json", + "bundlewatch": "npm run pretest:browser && bundlewatch --config bundlewatch.config.json", + "docs:diff": "npm run docs && git diff --quiet README.md", + "docs": "npm run build && npx runmd --output=README.md README_js.md", + "eslint:check": "eslint src/ test/ examples/ *.[jt]s", + "eslint:fix": "eslint --fix src/ test/ examples/ *.[jt]s", + "examples:browser:rollup:build": "cd examples/browser-rollup && npm run build", + "examples:browser:webpack:build": "cd examples/browser-webpack && npm run build", + "examples:node:commonjs:test": "cd examples/node-commonjs && npm test", + "examples:node:esmodules:test": "cd examples/node-esmodules && npm test", + "examples:node:jest:test": "cd examples/node-jest && npm test", + "examples:node:typescript:test": "cd examples/typescript && npm test", + "lint": "npm run eslint:check && npm run prettier:check", + "md": "runmd --watch --output=README.md README_js.md", + "prepack": "npm run build -- --no-pack", + "prepare": "husky", + "prepublishOnly": "npm run build", + "pretest:benchmark": "npm run build", + "pretest:browser": "./scripts/iodd && npm run build && npm-run-all --parallel examples:browser:**", + "pretest:node": "npm run build", + "pretest": "npm run build", + "prettier:check": "prettier --check .", + "prettier:fix": "prettier --write .", + "release": "standard-version --no-verify", + "test:benchmark": "cd examples/benchmark && npm test", + "test:browser": "wdio run ./wdio.conf.js", + "test:node": "npm-run-all --parallel examples:node:**", + "test:watch": "node --test --enable-source-maps --watch dist/esm/test/*.js", + "test": "node --test --enable-source-maps dist/esm/test/*.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/uuidjs/uuid.git" + }, + "lint-staged": { + "*": [ + "prettier --no-error-on-unmatched-pattern --write" + ], + "*.{js,jsx}": [ + "eslint --no-error-on-unmatched-pattern --fix" + ] + }, + "standard-version": { + "scripts": { + "postchangelog": "prettier --write CHANGELOG.md" + } + }, + "packageManager": "npm@11.0.0" +} diff --git a/tools/ui/node_modules/vite-plugin-devtools-json/package.json b/tools/ui/node_modules/vite-plugin-devtools-json/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ebc48a8844878b524b1d23a57060bd993b7ca35e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-devtools-json/package.json @@ -0,0 +1,66 @@ +{ + "name": "vite-plugin-devtools-json", + "version": "0.2.1", + "description": "Vite plugin for generating `com.chrome.devtools.json` on the fly in the devserver.", + "main": "dist/index.cjs", + "types": "dist/index.d.ts", + "module": "dist/index.mjs", + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + }, + "./*": "./dist/*" + }, + "files": [ + "/dist" + ], + "scripts": { + "build": "rollup -c rollup.config.ts --configPlugin typescript", + "clean": "rm -rf dist", + "dev": "rollup -c rollup.config.ts --configPlugin typescript", + "prepare": "npm run clean && npm run build", + "test": "vitest --no-watch", + "test:watch": "vitest --watch" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/ChromeDevTools/vite-plugin-devtools-json.git" + }, + "keywords": [ + "vite", + "vite-plugin", + "chrome-devtools", + "devtools", + "chrome" + ], + "author": "Benedikt Meurer ", + "bugs": { + "url": "https://github.com/ChromeDevTools/vite-plugin-devtools-json/issues" + }, + "homepage": "https://github.com/ChromeDevTools/vite-plugin-devtools-json#readme", + "license": "MIT", + "peerDependencies": { + "vite": "^2.7.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0" + }, + "dependencies": { + "uuid": "^11.1.0" + }, + "devDependencies": { + "@rollup/plugin-typescript": "^12.1.2", + "@types/node": "^22.13.5", + "@types/supertest": "^6.0.2", + "rollup": "^4.34.8", + "rollup-plugin-dts": "^6.1.1", + "rollup-plugin-esbuild": "^6.2.1", + "supertest": "^7.0.0", + "tslib": "^2.8.1", + "typescript": "^5.7.3", + "vite": "^6.2.0", + "vitest": "^3.0.8" + }, + "publishConfig": { + "registry": "https://wombat-dressing-room.appspot.com" + } +} diff --git a/tools/ui/node_modules/vite-plugin-pwa/LICENSE b/tools/ui/node_modules/vite-plugin-pwa/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..97b7cc87199ed2947e15ad3268d211dc3f245bd1 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020-PRESENT Anthony Fu + +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/vite-plugin-pwa/README.md b/tools/ui/node_modules/vite-plugin-pwa/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d6cd2b5093381e5ec1fc2de26063f3b49ff0b771 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/README.md @@ -0,0 +1,93 @@ +

+vite-plugin-pwa - Zero-config PWA for Vite
+Zero-config PWA Framework-agnostic Plugin for Vite +

+ +

+ +NPM version + + + NPM Downloads + + + Docs & Guides + +
+ +GitHub stars + +

+ +
+ +

+ + + +

+ +## 🚀 Features + +- 📖 [**Documentation & guides**](https://vite-pwa-org.netlify.app/) +- 👌 **Zero-Config**: sensible built-in default configs for common use cases +- 🔩 **Extensible**: expose the full ability to customize the behavior of the plugin +- 🦾 **Type Strong**: written in [TypeScript](https://www.typescriptlang.org/) +- 🔌 **Offline Support**: generate service worker with offline support (via Workbox) +- ⚡ **Fully tree shakable**: auto inject Web App Manifest +- 💬 **Prompt for new content**: built-in support for Vanilla JavaScript, Vue 3, React, Svelte, SolidJS and Preact +- ⚙️ **Stale-while-revalidate**: automatic reload when new content is available +- ✨ **Static assets handling**: configure static assets for offline support +- 🐞 **Development Support**: debug your custom service worker logic as you develop your application +- 🛠️ **Versatile**: integration with meta frameworks: [îles](https://github.com/ElMassimo/iles), [SvelteKit](https://github.com/sveltejs/kit), [VitePress](https://github.com/vuejs/vitepress), [Astro](https://github.com/withastro/astro), [Nuxt 3](https://github.com/nuxt/nuxt) and [Remix](https://github.com/remix-run/remix) +- 💥 **PWA Assets Generator**: generate all the PWA assets from a single command and a single source image +- 🚀 **PWA Assets Integration**: serving, generating and injecting PWA Assets on the fly in your application + +## 📦 Install + +> From v0.17, `vite-plugin-pwa` requires **Vite 5**. + +> From v0.16 `vite-plugin-pwa` requires **Node 16 or above**: `workbox v7` requires **Node 16 or above**. + +> From v0.13, `vite-plugin-pwa` requires **Vite 3.1 or above**. + +```bash +npm i vite-plugin-pwa -D + +# yarn +yarn add vite-plugin-pwa -D + +# pnpm +pnpm add vite-plugin-pwa -D +``` + +## 🦄 Usage + +Add `VitePWA` plugin to `vite.config.js / vite.config.ts` and configure it: + +```ts +// vite.config.js / vite.config.ts +import { VitePWA } from 'vite-plugin-pwa' + +export default { + plugins: [ + VitePWA() + ] +} +``` + +Read the [📖 documentation](https://vite-pwa-org.netlify.app/guide/) for a complete guide on how to configure and use +this plugin. + +Check out the client type declarations [client.d.ts](./client.d.ts) for built-in frameworks support. + +## 👀 Full config + +Check out the type declaration [src/types.ts](./src/types.ts) and the following links for more details. + +- [Web app manifests](https://developer.mozilla.org/en-US/docs/Web/Manifest) +- [Workbox](https://developers.google.com/web/tools/workbox) + +## 📄 License + +[MIT](./LICENSE) License © 2020-PRESENT [Anthony Fu](https://github.com/antfu) diff --git a/tools/ui/node_modules/vite-plugin-pwa/client.d.ts b/tools/ui/node_modules/vite-plugin-pwa/client.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d22890b2bf2ac84c8c8e721488d47dd3e53b7be0 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/client.d.ts @@ -0,0 +1,6 @@ +import './vue.d.ts' +import './preact.d.ts' +import './react.d.ts' +import './svelte.d.ts' +import './solid.d.ts' +import './vanillajs.d.ts' diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/chunk-G4TAN34B.js b/tools/ui/node_modules/vite-plugin-pwa/dist/chunk-G4TAN34B.js new file mode 100644 index 0000000000000000000000000000000000000000..4198f9e1d13d3eb7146d9793b47f9547a7f15f30 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/chunk-G4TAN34B.js @@ -0,0 +1,84 @@ +import { + cyan, + dim, + green, + magenta, + yellow +} from "./chunk-LKBIOQSP.js"; + +// src/utils.ts +function slash(str) { + return str.replace(/\\/g, "/"); +} +function resolveBasePath(base) { + if (isAbsolute(base)) + return base; + return !base.startsWith("/") && !base.startsWith("./") ? `/${base}` : base; +} +function isAbsolute(url) { + return url.match(/^(?:[a-z]+:)?\/\//i); +} +function normalizePath(path) { + return path.replace(/\\/g, "/"); +} + +// src/log.ts +import { relative } from "node:path"; +function logSWViteBuild(version, swName, viteOptions, format) { + const { logLevel = "info" } = viteOptions; + if (logLevel === "silent") + return; + if (logLevel === "info") { + console.info([ + "", + `${cyan(`PWA v${version}`)}`, + `Building ${magenta(swName)} service worker ("${magenta(format)}" format)...` + ].join("\n")); + } +} +function logWorkboxResult(version, throwMaximumFileSizeToCacheInBytes, strategy, buildResult, viteOptions, format = "none") { + if (throwMaximumFileSizeToCacheInBytes) { + const entries = buildResult.warnings.filter((w) => w.includes("maximumFileSizeToCacheInBytes")); + if (entries.length) { + const prefix = strategy === "generateSW" ? "workbox" : "injectManifest"; + throw new Error(` + Configure "${prefix}.maximumFileSizeToCacheInBytes" to change the limit: the default value is 2 MiB. + Check https://vite-pwa-org.netlify.app/guide/faq.html#missing-assets-from-sw-precache-manifest for more information. + Assets exceeding the limit: +${entries.map((w) => ` - ${w.replace(". Configure maximumFileSizeToCacheInBytes to change this limit", "")}`).join("\n")} +`); + } + } + const { root, logLevel = "info" } = viteOptions; + if (logLevel === "silent") + return; + const { count, size, filePaths, warnings } = buildResult; + if (logLevel === "info") { + const entries = [ + "", + `${cyan(`PWA v${version}`)}`, + `mode ${magenta(strategy)}` + ]; + if (strategy === "injectManifest") + entries.push(`format: ${magenta(format)}`); + entries.push( + `precache ${green(`${count} entries`)} ${dim(`(${(size / 1024).toFixed(2)} KiB)`)}`, + "files generated", + ...filePaths.map((p) => ` ${dim(normalizePath(relative(root, p)))}`) + ); + console.info(entries.join("\n")); + } + warnings && warnings.length > 0 && console.warn(yellow([ + "warnings", + ...warnings.map((w) => ` ${w}`), + "" + ].join("\n"))); +} + +export { + slash, + resolveBasePath, + normalizePath, + logSWViteBuild, + logWorkboxResult +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/chunk-I2Z7IWCN.js b/tools/ui/node_modules/vite-plugin-pwa/dist/chunk-I2Z7IWCN.js new file mode 100644 index 0000000000000000000000000000000000000000..dd03659a6533f4f4ad19607b297c0da6441ab9a5 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/chunk-I2Z7IWCN.js @@ -0,0 +1,252 @@ +import { + yellow +} from "./chunk-LKBIOQSP.js"; + +// src/constants.ts +var FILE_SW_REGISTER = "registerSW.js"; +var VIRTUAL_MODULES_MAP = { + "virtual:pwa-register": "register", + "virtual:pwa-register/vue": "vue", + "virtual:pwa-register/svelte": "svelte", + "virtual:pwa-register/react": "react", + "virtual:pwa-register/preact": "preact", + "virtual:pwa-register/solid": "solid" +}; +var VIRTUAL_MODULES_RESOLVE_PREFIX = "/@vite-plugin-pwa/"; +var VIRTUAL_MODULES = Object.keys(VIRTUAL_MODULES_MAP); +var defaultInjectManifestVitePlugins = [ + "alias", + "commonjs", + "vite:resolve", + "vite:esbuild", + "replace", + "vite:define", + "rollup-plugin-dynamic-import-variables", + "vite:esbuild-transpile", + "vite:json", + "vite:terser" +]; +var PWA_INFO_VIRTUAL = "virtual:pwa-info"; +var RESOLVED_PWA_INFO_VIRTUAL = `\0${PWA_INFO_VIRTUAL}`; +var PWA_ASSETS_HEAD_VIRTUAL = "virtual:pwa-assets/head"; +var RESOLVED_PWA_ASSETS_HEAD_VIRTUAL = `\0${PWA_ASSETS_HEAD_VIRTUAL}`; +var PWA_ASSETS_ICONS_VIRTUAL = "virtual:pwa-assets/icons"; +var RESOLVED_PWA_ASSETS_ICONS_VIRTUAL = `\0${PWA_ASSETS_ICONS_VIRTUAL}`; +var DEV_SW_NAME = "dev-sw.js?dev-sw"; +var DEV_SW_VIRTUAL = `${VIRTUAL_MODULES_RESOLVE_PREFIX}pwa-entry-point-loaded`; +var RESOLVED_DEV_SW_VIRTUAL = `\0${DEV_SW_VIRTUAL}`; +var DEV_READY_NAME = "vite-pwa-plugin:dev-ready"; +var DEV_REGISTER_SW_NAME = "vite-plugin-pwa:register-sw"; +var DEV_PWA_ASSETS_NAME = "vite-plugin-pwa:pwa-assets"; + +// src/pwa-assets/utils.ts +function mapLink(includeId, link) { + const linkObject = { + href: link.href, + rel: link.rel + }; + if (includeId && link.id) + linkObject.id = link.id; + if ("media" in link && link.media) + linkObject.media = link.media; + linkObject.href = link.href; + if ("sizes" in link && link.sizes) + linkObject.sizes = link.sizes; + if ("type" in link && link.type) + linkObject.type = link.type; + return linkObject; +} +function extractIcons(instructions) { + const icons = { + favicon: {}, + transparent: {}, + maskable: {}, + apple: {}, + appleSplashScreen: {} + }; + if (instructions) { + Array.from(Object.values(instructions.favicon)).forEach(({ buffer: _buffer, ...rest }) => { + if (rest.url) + icons.favicon[rest.url] = { ...rest }; + }); + Array.from(Object.values(instructions.transparent)).forEach(({ buffer: _buffer, ...rest }) => { + if (rest.url) + icons.transparent[rest.url] = { ...rest }; + }); + Array.from(Object.values(instructions.maskable)).forEach(({ buffer: _buffer, ...rest }) => { + if (rest.url) + icons.maskable[rest.url] = { ...rest }; + }); + Array.from(Object.values(instructions.apple)).forEach(({ buffer: _buffer, ...rest }) => { + if (rest.url) + icons.apple[rest.url] = { ...rest }; + }); + Array.from(Object.values(instructions.appleSplashScreen)).forEach(({ buffer: _buffer, ...rest }) => { + if (rest.url) + icons.appleSplashScreen[rest.url] = { ...rest }; + }); + } + return icons; +} + +// src/html.ts +function generateSimpleSWRegister(options, dev) { + const path = dev ? `${options.base}${DEV_SW_NAME}` : `${options.buildBase}${options.filename}`; + if (dev) { + const swType = options.devOptions.type ?? "classic"; + return `if('serviceWorker' in navigator) navigator.serviceWorker.register('${path}', { scope: '${options.scope}', type: '${swType}' })`; + } + return ` +if('serviceWorker' in navigator) { +window.addEventListener('load', () => { +navigator.serviceWorker.register('${path}', { scope: '${options.scope}' }) +}) +}`.replace(/\n/g, ""); +} +function checkForHtmlHead(html) { + if (!html.includes("")) { + if (!html.includes("")) { + console.warn([ + "", + yellow("PWA WARNING:"), + " and tags not found in the html, the service worker and web manifest will not be injected." + ].join("\n")); + return html; + } else { + console.warn([ + "", + yellow("PWA WARNING:"), + " not found in the html, adding it to the html tag: add empty to your html to remove this warning." + ].join("\n")); + } + return html.replace("", ` + +`); + } + return html; +} +function injectServiceWorker(html, options, dev) { + const manifest = generateWebManifest(options, dev); + if (!dev) { + const script = generateRegisterSW(options, dev); + if (script) { + return checkForHtmlHead(html).replace( + "", + `${manifest}${script}` + ); + } + } + return checkForHtmlHead(html).replace( + "", + `${manifest}` + ); +} +function generateWebManifest(options, dev) { + const crossorigin = options.useCredentials ? ' crossorigin="use-credentials"' : ""; + if (dev) { + const name = options.devOptions.webManifestUrl ?? `${options.base}${options.manifestFilename}`; + return options.manifest ? `` : ""; + } else { + return options.manifest ? `` : ""; + } +} +function generateRegisterSW(options, dev) { + if (options.injectRegister === "inline") { + return ``; + } else if (options.injectRegister === "script" || options.injectRegister === "script-defer") { + const hasDefer = options.injectRegister === "script-defer"; + return ``; + } + return void 0; +} +function generateRegisterDevSW(base) { + const path = `${base.endsWith("/") ? base : `${base}/`}${DEV_SW_VIRTUAL.slice(1)}`; + return ``; +} +function generateSWHMR() { + return ` +import.meta.hot.on('${DEV_REGISTER_SW_NAME}', ({ mode, inlinePath, registerPath, scope, swType = 'classic' }) => { + if (mode == 'inline') { + if('serviceWorker' in navigator) { + navigator.serviceWorker.register(inlinePath, { scope, type: swType }); + } + } + else { + const registerSW = document.createElement('script'); + registerSW.setAttribute('id', 'vite-plugin-pwa:register-sw'); + if (mode === 'script-defer') registerSW.setAttribute('defer', 'defer'); + registerSW.setAttribute('src', registerPath); + document.head.appendChild(registerSW); + } +}); +import.meta.hot.on('${DEV_PWA_ASSETS_NAME}', ({ themeColor, links }) => { + if (themeColor) { + const metaThemeColor = document.querySelector('meta[name="theme-color"]'); + if (metaThemeColor) { + metaThemeColor.content = themeColor.content; + } else { + const meta = document.createElement('meta'); + meta.setAttribute('name', 'theme-color'); + meta.setAttribute('content', themeColor.content); + document.head.appendChild(meta); + } + } + if (links) { + links.map((l) => { + const link = document.querySelector(\`link[href="\${l.href}"]\`) ?? document.createElement('link'); + if (l.id) link.setAttribute('id', l.id); + else link.removeAttribute('id'); + link.setAttribute('rel', l.rel); + link.setAttribute('href', l.href); + if (l.media) link.setAttribute('media', l.media); + else link.removeAttribute('media'); + if (l.sizes) link.setAttribute('sizes', l.sizes); + else link.removeAttribute('sizes'); + if (l.type) link.setAttribute('type', l.type); + else link.removeAttribute('type'); + if (!link.parentNode) document.head.appendChild(link); + }); + } +}); +function registerDevSW() { + try { + import.meta.hot.send('${DEV_READY_NAME}'); + } catch (e) { + console.error('unable to send ${DEV_READY_NAME} message to register service worker in dev mode!', e); + } +} +export default registerDevSW; +`; +} + +export { + FILE_SW_REGISTER, + VIRTUAL_MODULES_MAP, + VIRTUAL_MODULES_RESOLVE_PREFIX, + VIRTUAL_MODULES, + defaultInjectManifestVitePlugins, + PWA_INFO_VIRTUAL, + RESOLVED_PWA_INFO_VIRTUAL, + PWA_ASSETS_HEAD_VIRTUAL, + RESOLVED_PWA_ASSETS_HEAD_VIRTUAL, + PWA_ASSETS_ICONS_VIRTUAL, + RESOLVED_PWA_ASSETS_ICONS_VIRTUAL, + DEV_SW_NAME, + DEV_SW_VIRTUAL, + RESOLVED_DEV_SW_VIRTUAL, + DEV_READY_NAME, + DEV_REGISTER_SW_NAME, + DEV_PWA_ASSETS_NAME, + generateSimpleSWRegister, + checkForHtmlHead, + injectServiceWorker, + generateWebManifest, + generateRegisterSW, + generateRegisterDevSW, + generateSWHMR, + mapLink, + extractIcons +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/chunk-LKBIOQSP.js b/tools/ui/node_modules/vite-plugin-pwa/dist/chunk-LKBIOQSP.js new file mode 100644 index 0000000000000000000000000000000000000000..dfd6439fd83fb5e5e1e08bf785ba2ac4e99b68bd --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/chunk-LKBIOQSP.js @@ -0,0 +1,100 @@ +// node_modules/.pnpm/kolorist@1.8.0/node_modules/kolorist/dist/esm/index.mjs +var enabled = true; +var globalVar = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}; +var supportLevel = 0; +if (globalVar.process && globalVar.process.env && globalVar.process.stdout) { + const { FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, COLORTERM } = globalVar.process.env; + if (NODE_DISABLE_COLORS || NO_COLOR || FORCE_COLOR === "0") { + enabled = false; + } else if (FORCE_COLOR === "1" || FORCE_COLOR === "2" || FORCE_COLOR === "3") { + enabled = true; + } else if (TERM === "dumb") { + enabled = false; + } else if ("CI" in globalVar.process.env && [ + "TRAVIS", + "CIRCLECI", + "APPVEYOR", + "GITLAB_CI", + "GITHUB_ACTIONS", + "BUILDKITE", + "DRONE" + ].some((vendor) => vendor in globalVar.process.env)) { + enabled = true; + } else { + enabled = process.stdout.isTTY; + } + if (enabled) { + if (process.platform === "win32") { + supportLevel = 3; + } else { + if (COLORTERM && (COLORTERM === "truecolor" || COLORTERM === "24bit")) { + supportLevel = 3; + } else if (TERM && (TERM.endsWith("-256color") || TERM.endsWith("256"))) { + supportLevel = 2; + } else { + supportLevel = 1; + } + } + } +} +var options = { + enabled, + supportLevel +}; +function kolorist(start, end, level = 1) { + const open = `\x1B[${start}m`; + const close = `\x1B[${end}m`; + const regex = new RegExp(`\\x1b\\[${end}m`, "g"); + return (str) => { + return options.enabled && options.supportLevel >= level ? open + ("" + str).replace(regex, open) + close : "" + str; + }; +} +var reset = kolorist(0, 0); +var bold = kolorist(1, 22); +var dim = kolorist(2, 22); +var italic = kolorist(3, 23); +var underline = kolorist(4, 24); +var inverse = kolorist(7, 27); +var hidden = kolorist(8, 28); +var strikethrough = kolorist(9, 29); +var black = kolorist(30, 39); +var red = kolorist(31, 39); +var green = kolorist(32, 39); +var yellow = kolorist(33, 39); +var blue = kolorist(34, 39); +var magenta = kolorist(35, 39); +var cyan = kolorist(36, 39); +var white = kolorist(97, 39); +var gray = kolorist(90, 39); +var lightGray = kolorist(37, 39); +var lightRed = kolorist(91, 39); +var lightGreen = kolorist(92, 39); +var lightYellow = kolorist(93, 39); +var lightBlue = kolorist(94, 39); +var lightMagenta = kolorist(95, 39); +var lightCyan = kolorist(96, 39); +var bgBlack = kolorist(40, 49); +var bgRed = kolorist(41, 49); +var bgGreen = kolorist(42, 49); +var bgYellow = kolorist(43, 49); +var bgBlue = kolorist(44, 49); +var bgMagenta = kolorist(45, 49); +var bgCyan = kolorist(46, 49); +var bgWhite = kolorist(107, 49); +var bgGray = kolorist(100, 49); +var bgLightRed = kolorist(101, 49); +var bgLightGreen = kolorist(102, 49); +var bgLightYellow = kolorist(103, 49); +var bgLightBlue = kolorist(104, 49); +var bgLightMagenta = kolorist(105, 49); +var bgLightCyan = kolorist(106, 49); +var bgLightGray = kolorist(47, 49); + +export { + dim, + red, + green, + yellow, + magenta, + cyan +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/preact.js b/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/preact.js new file mode 100644 index 0000000000000000000000000000000000000000..0696978916172b4592839cf1f0ce2121395221e6 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/preact.js @@ -0,0 +1,139 @@ +// src/client/build/preact.ts +import { useState } from "preact/hooks"; + +// src/client/build/register.ts +var autoUpdateMode = "__SW_AUTO_UPDATE__"; +var selfDestroying = "__SW_SELF_DESTROYING__"; +var auto = autoUpdateMode === "true"; +var autoDestroy = selfDestroying === "true"; +function registerSW(options = {}) { + const { + immediate = false, + onNeedReload, + onNeedRefresh, + onOfflineReady, + onRegistered, + onRegisteredSW, + onRegisterError + } = options; + let wb; + let registerPromise; + let sendSkipWaitingMessage; + const updateServiceWorker = async (_reloadPage = true) => { + await registerPromise; + if (!auto) { + sendSkipWaitingMessage?.(); + } + }; + async function register() { + if ("serviceWorker" in navigator) { + wb = await import("workbox-window").then(({ Workbox }) => { + return new Workbox("__SW__", { scope: "__SCOPE__", type: "__TYPE__" }); + }).catch((e) => { + onRegisterError?.(e); + return void 0; + }); + if (!wb) + return; + sendSkipWaitingMessage = () => { + wb?.messageSkipWaiting(); + }; + if (!autoDestroy) { + if (auto) { + wb.addEventListener("activated", (event) => { + if (event.isUpdate || event.isExternal) { + if (onNeedReload) + onNeedReload(); + else + window.location.reload(); + } + }); + wb.addEventListener("installed", (event) => { + if (!event.isUpdate) { + onOfflineReady?.(); + } + }); + } else { + let onNeedRefreshCalled = false; + const showSkipWaitingPrompt = () => { + onNeedRefreshCalled = true; + wb?.addEventListener("controlling", (event) => { + if (event.isUpdate) { + if (onNeedReload) + onNeedReload(); + else + window.location.reload(); + } + }); + onNeedRefresh?.(); + }; + wb.addEventListener("installed", (event) => { + if (typeof event.isUpdate === "undefined") { + if (typeof event.isExternal !== "undefined") { + if (event.isExternal) + showSkipWaitingPrompt(); + else + !onNeedRefreshCalled && onOfflineReady?.(); + } else { + !onNeedRefreshCalled && onOfflineReady?.(); + } + } else if (!event.isUpdate) { + onOfflineReady?.(); + } + }); + wb.addEventListener("waiting", showSkipWaitingPrompt); + } + } + wb.register({ immediate }).then((r) => { + if (onRegisteredSW) + onRegisteredSW("__SW__", r); + else + onRegistered?.(r); + }).catch((e) => { + onRegisterError?.(e); + }); + } + } + registerPromise = register(); + return updateServiceWorker; +} + +// src/client/build/preact.ts +function useRegisterSW(options = {}) { + const { + immediate = true, + onNeedReload, + onNeedRefresh, + onOfflineReady, + onRegistered, + onRegisteredSW, + onRegisterError + } = options; + const [needRefresh, setNeedRefresh] = useState(false); + const [offlineReady, setOfflineReady] = useState(false); + const [updateServiceWorker] = useState(() => { + return registerSW({ + immediate, + onNeedReload, + onOfflineReady() { + setOfflineReady(true); + onOfflineReady?.(); + }, + onNeedRefresh() { + setNeedRefresh(true); + onNeedRefresh?.(); + }, + onRegistered, + onRegisteredSW, + onRegisterError + }); + }); + return { + needRefresh: [needRefresh, setNeedRefresh], + offlineReady: [offlineReady, setOfflineReady], + updateServiceWorker + }; +} +export { + useRegisterSW +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/react.js b/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/react.js new file mode 100644 index 0000000000000000000000000000000000000000..96e93802ef2ffe7bcbc32d59cbc8ed143b5b4247 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/react.js @@ -0,0 +1,139 @@ +// src/client/build/react.ts +import { useState } from "react"; + +// src/client/build/register.ts +var autoUpdateMode = "__SW_AUTO_UPDATE__"; +var selfDestroying = "__SW_SELF_DESTROYING__"; +var auto = autoUpdateMode === "true"; +var autoDestroy = selfDestroying === "true"; +function registerSW(options = {}) { + const { + immediate = false, + onNeedReload, + onNeedRefresh, + onOfflineReady, + onRegistered, + onRegisteredSW, + onRegisterError + } = options; + let wb; + let registerPromise; + let sendSkipWaitingMessage; + const updateServiceWorker = async (_reloadPage = true) => { + await registerPromise; + if (!auto) { + sendSkipWaitingMessage?.(); + } + }; + async function register() { + if ("serviceWorker" in navigator) { + wb = await import("workbox-window").then(({ Workbox }) => { + return new Workbox("__SW__", { scope: "__SCOPE__", type: "__TYPE__" }); + }).catch((e) => { + onRegisterError?.(e); + return void 0; + }); + if (!wb) + return; + sendSkipWaitingMessage = () => { + wb?.messageSkipWaiting(); + }; + if (!autoDestroy) { + if (auto) { + wb.addEventListener("activated", (event) => { + if (event.isUpdate || event.isExternal) { + if (onNeedReload) + onNeedReload(); + else + window.location.reload(); + } + }); + wb.addEventListener("installed", (event) => { + if (!event.isUpdate) { + onOfflineReady?.(); + } + }); + } else { + let onNeedRefreshCalled = false; + const showSkipWaitingPrompt = () => { + onNeedRefreshCalled = true; + wb?.addEventListener("controlling", (event) => { + if (event.isUpdate) { + if (onNeedReload) + onNeedReload(); + else + window.location.reload(); + } + }); + onNeedRefresh?.(); + }; + wb.addEventListener("installed", (event) => { + if (typeof event.isUpdate === "undefined") { + if (typeof event.isExternal !== "undefined") { + if (event.isExternal) + showSkipWaitingPrompt(); + else + !onNeedRefreshCalled && onOfflineReady?.(); + } else { + !onNeedRefreshCalled && onOfflineReady?.(); + } + } else if (!event.isUpdate) { + onOfflineReady?.(); + } + }); + wb.addEventListener("waiting", showSkipWaitingPrompt); + } + } + wb.register({ immediate }).then((r) => { + if (onRegisteredSW) + onRegisteredSW("__SW__", r); + else + onRegistered?.(r); + }).catch((e) => { + onRegisterError?.(e); + }); + } + } + registerPromise = register(); + return updateServiceWorker; +} + +// src/client/build/react.ts +function useRegisterSW(options = {}) { + const { + immediate = true, + onNeedReload, + onNeedRefresh, + onOfflineReady, + onRegistered, + onRegisteredSW, + onRegisterError + } = options; + const [needRefresh, setNeedRefresh] = useState(false); + const [offlineReady, setOfflineReady] = useState(false); + const [updateServiceWorker] = useState(() => { + return registerSW({ + immediate, + onNeedReload, + onOfflineReady() { + setOfflineReady(true); + onOfflineReady?.(); + }, + onNeedRefresh() { + setNeedRefresh(true); + onNeedRefresh?.(); + }, + onRegistered, + onRegisteredSW, + onRegisterError + }); + }); + return { + needRefresh: [needRefresh, setNeedRefresh], + offlineReady: [offlineReady, setOfflineReady], + updateServiceWorker + }; +} +export { + useRegisterSW +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/register.js b/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/register.js new file mode 100644 index 0000000000000000000000000000000000000000..3c7a97826e29c1d8bcbafa6afb88d2f87cb3da6e --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/register.js @@ -0,0 +1,99 @@ +// src/client/build/register.ts +var autoUpdateMode = "__SW_AUTO_UPDATE__"; +var selfDestroying = "__SW_SELF_DESTROYING__"; +var auto = autoUpdateMode === "true"; +var autoDestroy = selfDestroying === "true"; +function registerSW(options = {}) { + const { + immediate = false, + onNeedReload, + onNeedRefresh, + onOfflineReady, + onRegistered, + onRegisteredSW, + onRegisterError + } = options; + let wb; + let registerPromise; + let sendSkipWaitingMessage; + const updateServiceWorker = async (_reloadPage = true) => { + await registerPromise; + if (!auto) { + sendSkipWaitingMessage?.(); + } + }; + async function register() { + if ("serviceWorker" in navigator) { + wb = await import("workbox-window").then(({ Workbox }) => { + return new Workbox("__SW__", { scope: "__SCOPE__", type: "__TYPE__" }); + }).catch((e) => { + onRegisterError?.(e); + return void 0; + }); + if (!wb) + return; + sendSkipWaitingMessage = () => { + wb?.messageSkipWaiting(); + }; + if (!autoDestroy) { + if (auto) { + wb.addEventListener("activated", (event) => { + if (event.isUpdate || event.isExternal) { + if (onNeedReload) + onNeedReload(); + else + window.location.reload(); + } + }); + wb.addEventListener("installed", (event) => { + if (!event.isUpdate) { + onOfflineReady?.(); + } + }); + } else { + let onNeedRefreshCalled = false; + const showSkipWaitingPrompt = () => { + onNeedRefreshCalled = true; + wb?.addEventListener("controlling", (event) => { + if (event.isUpdate) { + if (onNeedReload) + onNeedReload(); + else + window.location.reload(); + } + }); + onNeedRefresh?.(); + }; + wb.addEventListener("installed", (event) => { + if (typeof event.isUpdate === "undefined") { + if (typeof event.isExternal !== "undefined") { + if (event.isExternal) + showSkipWaitingPrompt(); + else + !onNeedRefreshCalled && onOfflineReady?.(); + } else { + !onNeedRefreshCalled && onOfflineReady?.(); + } + } else if (!event.isUpdate) { + onOfflineReady?.(); + } + }); + wb.addEventListener("waiting", showSkipWaitingPrompt); + } + } + wb.register({ immediate }).then((r) => { + if (onRegisteredSW) + onRegisteredSW("__SW__", r); + else + onRegistered?.(r); + }).catch((e) => { + onRegisterError?.(e); + }); + } + } + registerPromise = register(); + return updateServiceWorker; +} +export { + registerSW +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/solid.js b/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/solid.js new file mode 100644 index 0000000000000000000000000000000000000000..75eee64333096e04f00002636a0d536fe58410ca --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/solid.js @@ -0,0 +1,137 @@ +// src/client/build/solid.ts +import { createSignal } from "solid-js"; + +// src/client/build/register.ts +var autoUpdateMode = "__SW_AUTO_UPDATE__"; +var selfDestroying = "__SW_SELF_DESTROYING__"; +var auto = autoUpdateMode === "true"; +var autoDestroy = selfDestroying === "true"; +function registerSW(options = {}) { + const { + immediate = false, + onNeedReload, + onNeedRefresh, + onOfflineReady, + onRegistered, + onRegisteredSW, + onRegisterError + } = options; + let wb; + let registerPromise; + let sendSkipWaitingMessage; + const updateServiceWorker = async (_reloadPage = true) => { + await registerPromise; + if (!auto) { + sendSkipWaitingMessage?.(); + } + }; + async function register() { + if ("serviceWorker" in navigator) { + wb = await import("workbox-window").then(({ Workbox }) => { + return new Workbox("__SW__", { scope: "__SCOPE__", type: "__TYPE__" }); + }).catch((e) => { + onRegisterError?.(e); + return void 0; + }); + if (!wb) + return; + sendSkipWaitingMessage = () => { + wb?.messageSkipWaiting(); + }; + if (!autoDestroy) { + if (auto) { + wb.addEventListener("activated", (event) => { + if (event.isUpdate || event.isExternal) { + if (onNeedReload) + onNeedReload(); + else + window.location.reload(); + } + }); + wb.addEventListener("installed", (event) => { + if (!event.isUpdate) { + onOfflineReady?.(); + } + }); + } else { + let onNeedRefreshCalled = false; + const showSkipWaitingPrompt = () => { + onNeedRefreshCalled = true; + wb?.addEventListener("controlling", (event) => { + if (event.isUpdate) { + if (onNeedReload) + onNeedReload(); + else + window.location.reload(); + } + }); + onNeedRefresh?.(); + }; + wb.addEventListener("installed", (event) => { + if (typeof event.isUpdate === "undefined") { + if (typeof event.isExternal !== "undefined") { + if (event.isExternal) + showSkipWaitingPrompt(); + else + !onNeedRefreshCalled && onOfflineReady?.(); + } else { + !onNeedRefreshCalled && onOfflineReady?.(); + } + } else if (!event.isUpdate) { + onOfflineReady?.(); + } + }); + wb.addEventListener("waiting", showSkipWaitingPrompt); + } + } + wb.register({ immediate }).then((r) => { + if (onRegisteredSW) + onRegisteredSW("__SW__", r); + else + onRegistered?.(r); + }).catch((e) => { + onRegisterError?.(e); + }); + } + } + registerPromise = register(); + return updateServiceWorker; +} + +// src/client/build/solid.ts +function useRegisterSW(options = {}) { + const { + immediate = true, + onNeedReload, + onNeedRefresh, + onOfflineReady, + onRegistered, + onRegisteredSW, + onRegisterError + } = options; + const [needRefresh, setNeedRefresh] = createSignal(false); + const [offlineReady, setOfflineReady] = createSignal(false); + const updateServiceWorker = registerSW({ + immediate, + onNeedReload, + onOfflineReady() { + setOfflineReady(true); + onOfflineReady?.(); + }, + onNeedRefresh() { + setNeedRefresh(true); + onNeedRefresh?.(); + }, + onRegistered, + onRegisteredSW, + onRegisterError + }); + return { + needRefresh: [needRefresh, setNeedRefresh], + offlineReady: [offlineReady, setOfflineReady], + updateServiceWorker + }; +} +export { + useRegisterSW +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/svelte.js b/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/svelte.js new file mode 100644 index 0000000000000000000000000000000000000000..9e09ef345557ded1427c83885a94ba1ff5bf85d8 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/svelte.js @@ -0,0 +1,137 @@ +// src/client/build/svelte.ts +import { writable } from "svelte/store"; + +// src/client/build/register.ts +var autoUpdateMode = "__SW_AUTO_UPDATE__"; +var selfDestroying = "__SW_SELF_DESTROYING__"; +var auto = autoUpdateMode === "true"; +var autoDestroy = selfDestroying === "true"; +function registerSW(options = {}) { + const { + immediate = false, + onNeedReload, + onNeedRefresh, + onOfflineReady, + onRegistered, + onRegisteredSW, + onRegisterError + } = options; + let wb; + let registerPromise; + let sendSkipWaitingMessage; + const updateServiceWorker = async (_reloadPage = true) => { + await registerPromise; + if (!auto) { + sendSkipWaitingMessage?.(); + } + }; + async function register() { + if ("serviceWorker" in navigator) { + wb = await import("workbox-window").then(({ Workbox }) => { + return new Workbox("__SW__", { scope: "__SCOPE__", type: "__TYPE__" }); + }).catch((e) => { + onRegisterError?.(e); + return void 0; + }); + if (!wb) + return; + sendSkipWaitingMessage = () => { + wb?.messageSkipWaiting(); + }; + if (!autoDestroy) { + if (auto) { + wb.addEventListener("activated", (event) => { + if (event.isUpdate || event.isExternal) { + if (onNeedReload) + onNeedReload(); + else + window.location.reload(); + } + }); + wb.addEventListener("installed", (event) => { + if (!event.isUpdate) { + onOfflineReady?.(); + } + }); + } else { + let onNeedRefreshCalled = false; + const showSkipWaitingPrompt = () => { + onNeedRefreshCalled = true; + wb?.addEventListener("controlling", (event) => { + if (event.isUpdate) { + if (onNeedReload) + onNeedReload(); + else + window.location.reload(); + } + }); + onNeedRefresh?.(); + }; + wb.addEventListener("installed", (event) => { + if (typeof event.isUpdate === "undefined") { + if (typeof event.isExternal !== "undefined") { + if (event.isExternal) + showSkipWaitingPrompt(); + else + !onNeedRefreshCalled && onOfflineReady?.(); + } else { + !onNeedRefreshCalled && onOfflineReady?.(); + } + } else if (!event.isUpdate) { + onOfflineReady?.(); + } + }); + wb.addEventListener("waiting", showSkipWaitingPrompt); + } + } + wb.register({ immediate }).then((r) => { + if (onRegisteredSW) + onRegisteredSW("__SW__", r); + else + onRegistered?.(r); + }).catch((e) => { + onRegisterError?.(e); + }); + } + } + registerPromise = register(); + return updateServiceWorker; +} + +// src/client/build/svelte.ts +function useRegisterSW(options = {}) { + const { + immediate = true, + onNeedReload, + onNeedRefresh, + onOfflineReady, + onRegistered, + onRegisteredSW, + onRegisterError + } = options; + const needRefresh = writable(false); + const offlineReady = writable(false); + const updateServiceWorker = registerSW({ + immediate, + onNeedReload, + onOfflineReady() { + offlineReady.set(true); + onOfflineReady?.(); + }, + onNeedRefresh() { + needRefresh.set(true); + onNeedRefresh?.(); + }, + onRegistered, + onRegisteredSW, + onRegisterError + }); + return { + needRefresh, + offlineReady, + updateServiceWorker + }; +} +export { + useRegisterSW +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/vue.js b/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/vue.js new file mode 100644 index 0000000000000000000000000000000000000000..ae4ec353fe0f6730b4e804afe9f2a2cb32f63b6b --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/client/build/vue.js @@ -0,0 +1,137 @@ +// src/client/build/vue.ts +import { ref } from "vue"; + +// src/client/build/register.ts +var autoUpdateMode = "__SW_AUTO_UPDATE__"; +var selfDestroying = "__SW_SELF_DESTROYING__"; +var auto = autoUpdateMode === "true"; +var autoDestroy = selfDestroying === "true"; +function registerSW(options = {}) { + const { + immediate = false, + onNeedReload, + onNeedRefresh, + onOfflineReady, + onRegistered, + onRegisteredSW, + onRegisterError + } = options; + let wb; + let registerPromise; + let sendSkipWaitingMessage; + const updateServiceWorker = async (_reloadPage = true) => { + await registerPromise; + if (!auto) { + sendSkipWaitingMessage?.(); + } + }; + async function register() { + if ("serviceWorker" in navigator) { + wb = await import("workbox-window").then(({ Workbox }) => { + return new Workbox("__SW__", { scope: "__SCOPE__", type: "__TYPE__" }); + }).catch((e) => { + onRegisterError?.(e); + return void 0; + }); + if (!wb) + return; + sendSkipWaitingMessage = () => { + wb?.messageSkipWaiting(); + }; + if (!autoDestroy) { + if (auto) { + wb.addEventListener("activated", (event) => { + if (event.isUpdate || event.isExternal) { + if (onNeedReload) + onNeedReload(); + else + window.location.reload(); + } + }); + wb.addEventListener("installed", (event) => { + if (!event.isUpdate) { + onOfflineReady?.(); + } + }); + } else { + let onNeedRefreshCalled = false; + const showSkipWaitingPrompt = () => { + onNeedRefreshCalled = true; + wb?.addEventListener("controlling", (event) => { + if (event.isUpdate) { + if (onNeedReload) + onNeedReload(); + else + window.location.reload(); + } + }); + onNeedRefresh?.(); + }; + wb.addEventListener("installed", (event) => { + if (typeof event.isUpdate === "undefined") { + if (typeof event.isExternal !== "undefined") { + if (event.isExternal) + showSkipWaitingPrompt(); + else + !onNeedRefreshCalled && onOfflineReady?.(); + } else { + !onNeedRefreshCalled && onOfflineReady?.(); + } + } else if (!event.isUpdate) { + onOfflineReady?.(); + } + }); + wb.addEventListener("waiting", showSkipWaitingPrompt); + } + } + wb.register({ immediate }).then((r) => { + if (onRegisteredSW) + onRegisteredSW("__SW__", r); + else + onRegistered?.(r); + }).catch((e) => { + onRegisterError?.(e); + }); + } + } + registerPromise = register(); + return updateServiceWorker; +} + +// src/client/build/vue.ts +function useRegisterSW(options = {}) { + const { + immediate = true, + onNeedReload, + onNeedRefresh, + onOfflineReady, + onRegistered, + onRegisteredSW, + onRegisterError + } = options; + const needRefresh = ref(false); + const offlineReady = ref(false); + const updateServiceWorker = registerSW({ + immediate, + onNeedReload, + onNeedRefresh() { + needRefresh.value = true; + onNeedRefresh?.(); + }, + onOfflineReady() { + offlineReady.value = true; + onOfflineReady?.(); + }, + onRegistered, + onRegisteredSW, + onRegisterError + }); + return { + updateServiceWorker, + offlineReady, + needRefresh + }; +} +export { + useRegisterSW +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/preact.js b/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/preact.js new file mode 100644 index 0000000000000000000000000000000000000000..ea8219c0715f9c9e286f5182790e2e20a188f382 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/preact.js @@ -0,0 +1,16 @@ +// src/client/dev/preact.ts +import { useState } from "preact/hooks"; +function useRegisterSW(_options = {}) { + const needRefresh = useState(false); + const offlineReady = useState(false); + const updateServiceWorker = (_reloadPage) => { + }; + return { + needRefresh, + offlineReady, + updateServiceWorker + }; +} +export { + useRegisterSW +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/react.js b/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/react.js new file mode 100644 index 0000000000000000000000000000000000000000..fa767299353c02fc9bf5024386805b1e0aad822d --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/react.js @@ -0,0 +1,16 @@ +// src/client/dev/react.ts +import { useState } from "react"; +function useRegisterSW(_options = {}) { + const needRefresh = useState(false); + const offlineReady = useState(false); + const updateServiceWorker = (_reloadPage) => { + }; + return { + needRefresh, + offlineReady, + updateServiceWorker + }; +} +export { + useRegisterSW +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/register.js b/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/register.js new file mode 100644 index 0000000000000000000000000000000000000000..0789b693f0dee164eed9e4e50af76b54bbcebb66 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/register.js @@ -0,0 +1,8 @@ +// src/client/dev/register.ts +function registerSW(_options = {}) { + return async (_reloadPage = true) => { + }; +} +export { + registerSW +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/solid.js b/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/solid.js new file mode 100644 index 0000000000000000000000000000000000000000..2e2176f4f047d85d2ced6435e12214f8deb994ee --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/solid.js @@ -0,0 +1,16 @@ +// src/client/dev/solid.ts +import { createSignal } from "solid-js"; +function useRegisterSW(_options = {}) { + const needRefresh = createSignal(false); + const offlineReady = createSignal(false); + const updateServiceWorker = (_reloadPage) => { + }; + return { + needRefresh, + offlineReady, + updateServiceWorker + }; +} +export { + useRegisterSW +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/svelte.js b/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/svelte.js new file mode 100644 index 0000000000000000000000000000000000000000..7b2df186ae51d0200690f673c3753a663b190735 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/svelte.js @@ -0,0 +1,16 @@ +// src/client/dev/svelte.ts +import { writable } from "svelte/store"; +function useRegisterSW(_options = {}) { + const needRefresh = writable(false); + const offlineReady = writable(false); + const updateServiceWorker = (_reloadPage) => { + }; + return { + needRefresh, + offlineReady, + updateServiceWorker + }; +} +export { + useRegisterSW +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/vue.js b/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/vue.js new file mode 100644 index 0000000000000000000000000000000000000000..4ba8f3b113bea1919590f05fec63d48932ede404 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/client/dev/vue.js @@ -0,0 +1,16 @@ +// src/client/dev/vue.ts +import { ref } from "vue"; +function useRegisterSW(_options = {}) { + const needRefresh = ref(false); + const offlineReady = ref(false); + const updateServiceWorker = (_reloadPage) => { + }; + return { + updateServiceWorker, + offlineReady, + needRefresh + }; +} +export { + useRegisterSW +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/generator-Q3R7VIEH.js b/tools/ui/node_modules/vite-plugin-pwa/dist/generator-Q3R7VIEH.js new file mode 100644 index 0000000000000000000000000000000000000000..91336fce62621cda209635cf684afa26759ef24c --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/generator-Q3R7VIEH.js @@ -0,0 +1,267 @@ +import { + checkForHtmlHead, + extractIcons, + mapLink +} from "./chunk-I2Z7IWCN.js"; +import { + cyan, + red +} from "./chunk-LKBIOQSP.js"; + +// src/pwa-assets/build.ts +import { mkdir } from "node:fs/promises"; +import { generateAssets } from "@vite-pwa/assets-generator/api/generate-assets"; +async function generate(assetsGeneratorContext) { + await mkdir(assetsGeneratorContext.imageOutDir, { recursive: true }); + await generateAssets(assetsGeneratorContext.assetsInstructions, true, assetsGeneratorContext.imageOutDir); +} + +// src/pwa-assets/config.ts +import fs from "node:fs"; +import { access, readFile } from "node:fs/promises"; +import { basename, dirname, relative, resolve } from "node:path"; +import { instructions } from "@vite-pwa/assets-generator/api/instructions"; +import { loadConfig } from "@vite-pwa/assets-generator/config"; +async function loadAssetsGeneratorContext(ctx, assetsGeneratorContext) { + const root = ctx.viteConfig.root ?? process.cwd(); + const { config, sources } = await loadConfiguration(root, ctx); + if (!config.preset) { + console.error([ + "", + cyan(`PWA v${ctx.version}`), + red("ERROR: No preset for assets generator found") + ].join("\n")); + return; + } + const { + preset, + images, + headLinkOptions: userHeadLinkOptions + } = config; + if (!images) { + console.error([ + "", + cyan(`PWA v${ctx.version}`), + red("ERROR: No image provided for assets generator") + ].join("\n")); + return; + } + if (Array.isArray(images)) { + if (!images.length) { + console.error([ + "", + cyan(`PWA v${ctx.version}`), + red("ERROR: No image provided for assets generator") + ].join("\n")); + return; + } + if (images.length > 1) { + console.error([ + "", + cyan(`PWA v${ctx.version}`), + red("ERROR: Only one image is supported for assets generator") + ].join("\n")); + return; + } + } + const pwaAssets = ctx.options.pwaAssets; + const useImage = Array.isArray(images) ? images[0] : images; + const imageFile = await tryToResolveImage(root, sources, useImage); + const publicDir = pwaAssets.integration?.publicDir ?? resolve(root, ctx.viteConfig.publicDir || "public"); + const outDir = pwaAssets.integration?.outDir ?? resolve(root, ctx.viteConfig.build?.outDir || "dist"); + const imageName = relative(publicDir, imageFile); + const imageOutDir = dirname(resolve(outDir, imageName)); + const xhtml = userHeadLinkOptions?.xhtml === true; + const includeId = userHeadLinkOptions?.includeId === true; + const assetsInstructions = await instructions({ + imageResolver: () => readFile(imageFile), + imageName, + preset, + faviconPreset: userHeadLinkOptions?.preset ?? pwaAssets.htmlPreset, + htmlLinks: { xhtml, includeId }, + basePath: pwaAssets.integration?.baseUrl || ctx.viteConfig.base || "/", + resolveSvgName: userHeadLinkOptions?.resolveSvgName ?? ((name) => basename(name)) + }); + const { + includeHtmlHeadLinks = true, + overrideManifestIcons: useOverrideManifestIcons, + injectThemeColor = false + } = pwaAssets; + const overrideManifestIcons = ctx.options.manifest === false || !ctx.options.manifest ? false : "icons" in ctx.options.manifest ? useOverrideManifestIcons : true; + if (assetsGeneratorContext === void 0) { + return { + lastModified: Date.now(), + assetsInstructions, + cache: /* @__PURE__ */ new Map(), + useImage, + imageFile, + publicDir, + outDir, + imageName, + imageOutDir, + xhtml, + includeId, + // normalize sources + sources: sources.map((source) => source.replace(/\\/g, "/")), + injectThemeColor, + includeHtmlHeadLinks, + overrideManifestIcons + }; + } + assetsGeneratorContext.lastModified = Date.now(); + assetsGeneratorContext.assetsInstructions = assetsInstructions; + assetsGeneratorContext.useImage = useImage; + assetsGeneratorContext.imageFile = imageFile; + assetsGeneratorContext.outDir = outDir; + assetsGeneratorContext.imageName = imageName; + assetsGeneratorContext.imageOutDir = imageOutDir; + assetsGeneratorContext.xhtml = xhtml; + assetsGeneratorContext.includeId = includeId; + assetsGeneratorContext.injectThemeColor = injectThemeColor; + assetsGeneratorContext.includeHtmlHeadLinks = includeHtmlHeadLinks; + assetsGeneratorContext.overrideManifestIcons = overrideManifestIcons; + assetsGeneratorContext.cache.clear(); +} +async function loadConfiguration(root, ctx) { + const pwaAssets = ctx.options.pwaAssets; + if (pwaAssets.config === false) { + return await loadConfig(root, { + config: false, + preset: pwaAssets.preset, + images: pwaAssets.images, + logLevel: "silent" + }); + } + return await loadConfig( + root, + typeof pwaAssets.config === "boolean" ? root : { config: pwaAssets.config } + ); +} +async function checkFileExists(pathname) { + try { + await access(pathname, fs.constants.R_OK); + } catch { + return false; + } + return true; +} +async function tryToResolveImage(root, sources, image) { + const imagePath = resolve(root, image); + if (await checkFileExists(imagePath)) { + return imagePath; + } + for (const source of sources) { + const sourceImage = resolve(dirname(source), image); + if (await checkFileExists(sourceImage)) { + return sourceImage; + } + } + return imagePath; +} + +// src/pwa-assets/dev.ts +async function findIconAsset(path, { assetsInstructions, cache, lastModified }) { + let resolved = cache.get(path); + if (resolved) { + resolved.age = Date.now() - lastModified; + return resolved; + } + const iconAsset = assetsInstructions.transparent[path] ?? assetsInstructions.maskable[path] ?? assetsInstructions.apple[path] ?? assetsInstructions.favicon[path] ?? assetsInstructions.appleSplashScreen[path]; + if (!iconAsset) + return; + if (iconAsset) { + resolved = { + path, + mimeType: iconAsset.mimeType, + buffer: iconAsset.buffer(), + lastModified: Date.now(), + age: 0 + }; + cache.set(path, resolved); + return resolved; + } +} +async function checkHotUpdate(file, ctx, assetsGeneratorContext) { + const result = assetsGeneratorContext.sources.includes(file); + if (result) + await loadAssetsGeneratorContext(ctx, assetsGeneratorContext); + return result; +} + +// src/pwa-assets/html.ts +import { generateHtmlMarkup } from "@vite-pwa/assets-generator/api/generate-html-markup"; +function transformIndexHtml(html, ctx, assetsGeneratorContext) { + if (assetsGeneratorContext.injectThemeColor) { + const manifest = ctx.options.manifest; + if (manifest && "theme_color" in manifest && manifest.theme_color) { + html = checkForHtmlHead(html).replace( + "", + ` +` + ); + } + } + if (assetsGeneratorContext.includeHtmlHeadLinks) { + const link = generateHtmlMarkup(assetsGeneratorContext.assetsInstructions); + if (link.length) + html = checkForHtmlHead(html).replace("", ` +${link.join("\n")}`); + } + return html; +} +function resolveHtmlAssets(ctx, assetsGeneratorContext) { + const header = { + links: [], + themeColor: void 0 + }; + if (assetsGeneratorContext.injectThemeColor) { + const manifest = ctx.options.manifest; + if (manifest && "theme_color" in manifest && manifest.theme_color) + header.themeColor = { name: "theme-color", content: manifest.theme_color }; + } + if (assetsGeneratorContext.includeHtmlHeadLinks) { + const includeId = assetsGeneratorContext.includeId; + const instruction = assetsGeneratorContext.assetsInstructions; + const favicon = Array.from(Object.values(instruction.favicon)); + const apple = Array.from(Object.values(instruction.apple)); + const appleSplashScreen = Array.from(Object.values(instruction.appleSplashScreen)); + favicon.forEach((icon) => icon.linkObject && header.links.push(mapLink(includeId, icon.linkObject))); + apple.forEach((icon) => icon.linkObject && header.links.push(mapLink(includeId, icon.linkObject))); + appleSplashScreen.forEach((icon) => icon.linkObject && header.links.push(mapLink(includeId, icon.linkObject))); + } + return header; +} + +// src/pwa-assets/manifest.ts +import { generateManifestIconsEntry } from "@vite-pwa/assets-generator/api/generate-manifest-icons-entry"; +function injectManifestIcons(ctx, assetsGeneratorContext) { + if (!assetsGeneratorContext.overrideManifestIcons) + return; + const manifest = ctx.options.manifest; + if (manifest) { + manifest.icons = generateManifestIconsEntry( + "object", + assetsGeneratorContext.assetsInstructions + ).icons; + } +} + +// src/pwa-assets/generator.ts +async function loadInstructions(ctx) { + const assetsGeneratorContext = await loadAssetsGeneratorContext(ctx); + if (!assetsGeneratorContext) + return; + return { + generate: () => generate(assetsGeneratorContext), + findIconAsset: (path) => findIconAsset(path, assetsGeneratorContext), + resolveHtmlAssets: () => resolveHtmlAssets(ctx, assetsGeneratorContext), + transformIndexHtml: (html) => transformIndexHtml(html, ctx, assetsGeneratorContext), + injectManifestIcons: () => injectManifestIcons(ctx, assetsGeneratorContext), + instructions: () => assetsGeneratorContext.assetsInstructions, + icons: () => extractIcons(assetsGeneratorContext.assetsInstructions), + checkHotUpdate: (file) => checkHotUpdate(file, ctx, assetsGeneratorContext) + }; +} +export { + loadInstructions +}; diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/index.cjs b/tools/ui/node_modules/vite-plugin-pwa/dist/index.cjs new file mode 100644 index 0000000000000000000000000000000000000000..61d52cbb39503c92fafb84e9207ba52d317aed97 --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/index.cjs @@ -0,0 +1,2166 @@ +"use strict"; +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// node_modules/.pnpm/kolorist@1.8.0/node_modules/kolorist/dist/esm/index.mjs +function kolorist(start, end, level = 1) { + const open = `\x1B[${start}m`; + const close = `\x1B[${end}m`; + const regex = new RegExp(`\\x1b\\[${end}m`, "g"); + return (str) => { + return options.enabled && options.supportLevel >= level ? open + ("" + str).replace(regex, open) + close : "" + str; + }; +} +var enabled, globalVar, supportLevel, options, reset, bold, dim, italic, underline, inverse, hidden, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, lightGray, lightRed, lightGreen, lightYellow, lightBlue, lightMagenta, lightCyan, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgLightRed, bgLightGreen, bgLightYellow, bgLightBlue, bgLightMagenta, bgLightCyan, bgLightGray; +var init_esm = __esm({ + "node_modules/.pnpm/kolorist@1.8.0/node_modules/kolorist/dist/esm/index.mjs"() { + "use strict"; + enabled = true; + globalVar = typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}; + supportLevel = 0; + if (globalVar.process && globalVar.process.env && globalVar.process.stdout) { + const { FORCE_COLOR, NODE_DISABLE_COLORS, NO_COLOR, TERM, COLORTERM } = globalVar.process.env; + if (NODE_DISABLE_COLORS || NO_COLOR || FORCE_COLOR === "0") { + enabled = false; + } else if (FORCE_COLOR === "1" || FORCE_COLOR === "2" || FORCE_COLOR === "3") { + enabled = true; + } else if (TERM === "dumb") { + enabled = false; + } else if ("CI" in globalVar.process.env && [ + "TRAVIS", + "CIRCLECI", + "APPVEYOR", + "GITLAB_CI", + "GITHUB_ACTIONS", + "BUILDKITE", + "DRONE" + ].some((vendor) => vendor in globalVar.process.env)) { + enabled = true; + } else { + enabled = process.stdout.isTTY; + } + if (enabled) { + if (process.platform === "win32") { + supportLevel = 3; + } else { + if (COLORTERM && (COLORTERM === "truecolor" || COLORTERM === "24bit")) { + supportLevel = 3; + } else if (TERM && (TERM.endsWith("-256color") || TERM.endsWith("256"))) { + supportLevel = 2; + } else { + supportLevel = 1; + } + } + } + } + options = { + enabled, + supportLevel + }; + reset = kolorist(0, 0); + bold = kolorist(1, 22); + dim = kolorist(2, 22); + italic = kolorist(3, 23); + underline = kolorist(4, 24); + inverse = kolorist(7, 27); + hidden = kolorist(8, 28); + strikethrough = kolorist(9, 29); + black = kolorist(30, 39); + red = kolorist(31, 39); + green = kolorist(32, 39); + yellow = kolorist(33, 39); + blue = kolorist(34, 39); + magenta = kolorist(35, 39); + cyan = kolorist(36, 39); + white = kolorist(97, 39); + gray = kolorist(90, 39); + lightGray = kolorist(37, 39); + lightRed = kolorist(91, 39); + lightGreen = kolorist(92, 39); + lightYellow = kolorist(93, 39); + lightBlue = kolorist(94, 39); + lightMagenta = kolorist(95, 39); + lightCyan = kolorist(96, 39); + bgBlack = kolorist(40, 49); + bgRed = kolorist(41, 49); + bgGreen = kolorist(42, 49); + bgYellow = kolorist(43, 49); + bgBlue = kolorist(44, 49); + bgMagenta = kolorist(45, 49); + bgCyan = kolorist(46, 49); + bgWhite = kolorist(107, 49); + bgGray = kolorist(100, 49); + bgLightRed = kolorist(101, 49); + bgLightGreen = kolorist(102, 49); + bgLightYellow = kolorist(103, 49); + bgLightBlue = kolorist(104, 49); + bgLightMagenta = kolorist(105, 49); + bgLightCyan = kolorist(106, 49); + bgLightGray = kolorist(47, 49); + } +}); + +// src/constants.ts +var FILE_SW_REGISTER, VIRTUAL_MODULES_MAP, VIRTUAL_MODULES_RESOLVE_PREFIX, VIRTUAL_MODULES, defaultInjectManifestVitePlugins, PWA_INFO_VIRTUAL, RESOLVED_PWA_INFO_VIRTUAL, PWA_ASSETS_HEAD_VIRTUAL, RESOLVED_PWA_ASSETS_HEAD_VIRTUAL, PWA_ASSETS_ICONS_VIRTUAL, RESOLVED_PWA_ASSETS_ICONS_VIRTUAL, DEV_SW_NAME, DEV_SW_VIRTUAL, RESOLVED_DEV_SW_VIRTUAL, DEV_READY_NAME, DEV_REGISTER_SW_NAME, DEV_PWA_ASSETS_NAME; +var init_constants = __esm({ + "src/constants.ts"() { + "use strict"; + FILE_SW_REGISTER = "registerSW.js"; + VIRTUAL_MODULES_MAP = { + "virtual:pwa-register": "register", + "virtual:pwa-register/vue": "vue", + "virtual:pwa-register/svelte": "svelte", + "virtual:pwa-register/react": "react", + "virtual:pwa-register/preact": "preact", + "virtual:pwa-register/solid": "solid" + }; + VIRTUAL_MODULES_RESOLVE_PREFIX = "/@vite-plugin-pwa/"; + VIRTUAL_MODULES = Object.keys(VIRTUAL_MODULES_MAP); + defaultInjectManifestVitePlugins = [ + "alias", + "commonjs", + "vite:resolve", + "vite:esbuild", + "replace", + "vite:define", + "rollup-plugin-dynamic-import-variables", + "vite:esbuild-transpile", + "vite:json", + "vite:terser" + ]; + PWA_INFO_VIRTUAL = "virtual:pwa-info"; + RESOLVED_PWA_INFO_VIRTUAL = `\0${PWA_INFO_VIRTUAL}`; + PWA_ASSETS_HEAD_VIRTUAL = "virtual:pwa-assets/head"; + RESOLVED_PWA_ASSETS_HEAD_VIRTUAL = `\0${PWA_ASSETS_HEAD_VIRTUAL}`; + PWA_ASSETS_ICONS_VIRTUAL = "virtual:pwa-assets/icons"; + RESOLVED_PWA_ASSETS_ICONS_VIRTUAL = `\0${PWA_ASSETS_ICONS_VIRTUAL}`; + DEV_SW_NAME = "dev-sw.js?dev-sw"; + DEV_SW_VIRTUAL = `${VIRTUAL_MODULES_RESOLVE_PREFIX}pwa-entry-point-loaded`; + RESOLVED_DEV_SW_VIRTUAL = `\0${DEV_SW_VIRTUAL}`; + DEV_READY_NAME = "vite-pwa-plugin:dev-ready"; + DEV_REGISTER_SW_NAME = "vite-plugin-pwa:register-sw"; + DEV_PWA_ASSETS_NAME = "vite-plugin-pwa:pwa-assets"; + } +}); + +// src/html.ts +function generateSimpleSWRegister(options2, dev) { + const path = dev ? `${options2.base}${DEV_SW_NAME}` : `${options2.buildBase}${options2.filename}`; + if (dev) { + const swType = options2.devOptions.type ?? "classic"; + return `if('serviceWorker' in navigator) navigator.serviceWorker.register('${path}', { scope: '${options2.scope}', type: '${swType}' })`; + } + return ` +if('serviceWorker' in navigator) { +window.addEventListener('load', () => { +navigator.serviceWorker.register('${path}', { scope: '${options2.scope}' }) +}) +}`.replace(/\n/g, ""); +} +function checkForHtmlHead(html) { + if (!html.includes("")) { + if (!html.includes("")) { + console.warn([ + "", + yellow("PWA WARNING:"), + " and tags not found in the html, the service worker and web manifest will not be injected." + ].join("\n")); + return html; + } else { + console.warn([ + "", + yellow("PWA WARNING:"), + " not found in the html, adding it to the html tag: add empty to your html to remove this warning." + ].join("\n")); + } + return html.replace("", ` + +`); + } + return html; +} +function injectServiceWorker(html, options2, dev) { + const manifest = generateWebManifest(options2, dev); + if (!dev) { + const script = generateRegisterSW(options2, dev); + if (script) { + return checkForHtmlHead(html).replace( + "", + `${manifest}${script}` + ); + } + } + return checkForHtmlHead(html).replace( + "", + `${manifest}` + ); +} +function generateWebManifest(options2, dev) { + const crossorigin = options2.useCredentials ? ' crossorigin="use-credentials"' : ""; + if (dev) { + const name = options2.devOptions.webManifestUrl ?? `${options2.base}${options2.manifestFilename}`; + return options2.manifest ? `` : ""; + } else { + return options2.manifest ? `` : ""; + } +} +function generateRegisterSW(options2, dev) { + if (options2.injectRegister === "inline") { + return ``; + } else if (options2.injectRegister === "script" || options2.injectRegister === "script-defer") { + const hasDefer = options2.injectRegister === "script-defer"; + return ``; + } + return void 0; +} +function generateRegisterDevSW(base) { + const path = `${base.endsWith("/") ? base : `${base}/`}${DEV_SW_VIRTUAL.slice(1)}`; + return ``; +} +function generateSWHMR() { + return ` +import.meta.hot.on('${DEV_REGISTER_SW_NAME}', ({ mode, inlinePath, registerPath, scope, swType = 'classic' }) => { + if (mode == 'inline') { + if('serviceWorker' in navigator) { + navigator.serviceWorker.register(inlinePath, { scope, type: swType }); + } + } + else { + const registerSW = document.createElement('script'); + registerSW.setAttribute('id', 'vite-plugin-pwa:register-sw'); + if (mode === 'script-defer') registerSW.setAttribute('defer', 'defer'); + registerSW.setAttribute('src', registerPath); + document.head.appendChild(registerSW); + } +}); +import.meta.hot.on('${DEV_PWA_ASSETS_NAME}', ({ themeColor, links }) => { + if (themeColor) { + const metaThemeColor = document.querySelector('meta[name="theme-color"]'); + if (metaThemeColor) { + metaThemeColor.content = themeColor.content; + } else { + const meta = document.createElement('meta'); + meta.setAttribute('name', 'theme-color'); + meta.setAttribute('content', themeColor.content); + document.head.appendChild(meta); + } + } + if (links) { + links.map((l) => { + const link = document.querySelector(\`link[href="\${l.href}"]\`) ?? document.createElement('link'); + if (l.id) link.setAttribute('id', l.id); + else link.removeAttribute('id'); + link.setAttribute('rel', l.rel); + link.setAttribute('href', l.href); + if (l.media) link.setAttribute('media', l.media); + else link.removeAttribute('media'); + if (l.sizes) link.setAttribute('sizes', l.sizes); + else link.removeAttribute('sizes'); + if (l.type) link.setAttribute('type', l.type); + else link.removeAttribute('type'); + if (!link.parentNode) document.head.appendChild(link); + }); + } +}); +function registerDevSW() { + try { + import.meta.hot.send('${DEV_READY_NAME}'); + } catch (e) { + console.error('unable to send ${DEV_READY_NAME} message to register service worker in dev mode!', e); + } +} +export default registerDevSW; +`; +} +var init_html = __esm({ + "src/html.ts"() { + "use strict"; + init_esm(); + init_constants(); + } +}); + +// src/utils.ts +function slash(str) { + return str.replace(/\\/g, "/"); +} +function resolveBasePath(base) { + if (isAbsolute(base)) + return base; + return !base.startsWith("/") && !base.startsWith("./") ? `/${base}` : base; +} +function isAbsolute(url) { + return url.match(/^(?:[a-z]+:)?\/\//i); +} +function normalizePath(path) { + return path.replace(/\\/g, "/"); +} +var init_utils = __esm({ + "src/utils.ts"() { + "use strict"; + } +}); + +// src/log.ts +function logSWViteBuild(version, swName, viteOptions, format) { + const { logLevel = "info" } = viteOptions; + if (logLevel === "silent") + return; + if (logLevel === "info") { + console.info([ + "", + `${cyan(`PWA v${version}`)}`, + `Building ${magenta(swName)} service worker ("${magenta(format)}" format)...` + ].join("\n")); + } +} +function logWorkboxResult(version, throwMaximumFileSizeToCacheInBytes, strategy, buildResult, viteOptions, format = "none") { + if (throwMaximumFileSizeToCacheInBytes) { + const entries = buildResult.warnings.filter((w) => w.includes("maximumFileSizeToCacheInBytes")); + if (entries.length) { + const prefix = strategy === "generateSW" ? "workbox" : "injectManifest"; + throw new Error(` + Configure "${prefix}.maximumFileSizeToCacheInBytes" to change the limit: the default value is 2 MiB. + Check https://vite-pwa-org.netlify.app/guide/faq.html#missing-assets-from-sw-precache-manifest for more information. + Assets exceeding the limit: +${entries.map((w) => ` - ${w.replace(". Configure maximumFileSizeToCacheInBytes to change this limit", "")}`).join("\n")} +`); + } + } + const { root, logLevel = "info" } = viteOptions; + if (logLevel === "silent") + return; + const { count, size, filePaths, warnings } = buildResult; + if (logLevel === "info") { + const entries = [ + "", + `${cyan(`PWA v${version}`)}`, + `mode ${magenta(strategy)}` + ]; + if (strategy === "injectManifest") + entries.push(`format: ${magenta(format)}`); + entries.push( + `precache ${green(`${count} entries`)} ${dim(`(${(size / 1024).toFixed(2)} KiB)`)}`, + "files generated", + ...filePaths.map((p) => ` ${dim(normalizePath((0, import_node_path2.relative)(root, p)))}`) + ); + console.info(entries.join("\n")); + } + warnings && warnings.length > 0 && console.warn(yellow([ + "warnings", + ...warnings.map((w) => ` ${w}`), + "" + ].join("\n"))); +} +var import_node_path2; +var init_log = __esm({ + "src/log.ts"() { + "use strict"; + import_node_path2 = require("path"); + init_esm(); + init_utils(); + } +}); + +// src/vite-build.ts +var vite_build_exports = {}; +__export(vite_build_exports, { + buildSW: () => buildSW +}); +async function buildSW(version, options2, viteOptions, workboxPromise) { + await options2.integration?.beforeBuildServiceWorker?.(options2); + const { build } = await import("vite"); + const { + inlineConfig, + format, + swName, + swMjsName + } = prepareViteBuild(options2, viteOptions); + logSWViteBuild(version, normalizePath((0, import_node_path3.relative)(viteOptions.root, options2.swSrc)), viteOptions, format); + await options2.integration?.configureCustomSWViteBuild?.(inlineConfig); + await build(inlineConfig); + if (format !== "iife") { + const swDestDir = (0, import_node_path3.dirname)(options2.swDest); + const mjsPath = (0, import_node_path3.resolve)(swDestDir, swMjsName); + const jsPath = (0, import_node_path3.resolve)(swDestDir, swName); + await import_node_fs2.promises.rename(mjsPath, jsPath); + const mjsMapPath = `${mjsPath}.map`; + const sourceMap = await import_node_fs2.promises.lstat(mjsMapPath).then((s) => s.isFile()).catch(() => false); + if (sourceMap) { + await Promise.all([ + import_node_fs2.promises.readFile(jsPath, "utf-8").then((content) => import_node_fs2.promises.writeFile( + jsPath, + content.replace(`${swMjsName}.map`, `${swName}.map`), + "utf-8" + )), + import_node_fs2.promises.rename(mjsMapPath, `${jsPath}.map`) + ]); + } + } + if (!options2.injectManifest.injectionPoint) + return; + const injectManifestOptions = { + ...options2.injectManifest, + // this will not fail since there is an injectionPoint + swSrc: options2.injectManifest.swDest + }; + const { injectManifest } = await workboxPromise; + const buildResult = await injectManifest(injectManifestOptions); + logWorkboxResult( + version, + options2.throwMaximumFileSizeToCacheInBytes, + "injectManifest", + buildResult, + viteOptions, + format + ); +} +function prepareViteBuild(options2, viteOptions) { + const define = { ...viteOptions.define ?? {} }; + const nodeEnv = options2.injectManifestBuildOptions.enableWorkboxModulesLogs ? "development" : process["env"]["NODE_ENV"] || "production"; + define["process.env.NODE_ENV"] = JSON.stringify(nodeEnv); + const buildPlugins = options2.buildPlugins; + const { + format, + plugins, + rollupOptions + } = options2.injectManifestRollupOptions; + const inlineConfig = { + root: viteOptions.root, + base: viteOptions.base, + resolve: viteOptions.resolve, + mode: viteOptions.mode, + envDir: options2.injectManifestEnvOptions.envDir, + envPrefix: options2.injectManifestEnvOptions.envPrefix, + // don't copy anything from public folder + publicDir: false, + build: { + target: options2.injectManifestBuildOptions.target, + minify: options2.injectManifestBuildOptions.minify, + sourcemap: options2.injectManifestBuildOptions.sourcemap, + outDir: options2.outDir, + emptyOutDir: false + }, + configFile: false, + define, + plugins: buildPlugins?.vite + }; + const swName = (0, import_node_path3.basename)(options2.swDest); + const swMjsName = swName.replace(/\.js$/, ".mjs"); + if (format !== "iife") { + if (viteOptions.build.sourcemap) { + Object.assign(inlineConfig, { + ...inlineConfig, + esbuild: { + sourcemap: viteOptions.build.sourcemap === "hidden" ? true : viteOptions.build.sourcemap + } + }); + } + Object.assign(inlineConfig.build, { + ...inlineConfig.build, + modulePreload: false, + rollupOptions: { + ...rollupOptions, + plugins: buildPlugins?.rollup ?? plugins, + input: options2.swSrc, + output: { + entryFileNames: swMjsName, + inlineDynamicImports: true + } + } + }); + } else { + Object.assign(inlineConfig.build, { + ...inlineConfig.build, + lib: { + entry: options2.swSrc, + name: "app", + formats: [format] + }, + rollupOptions: { + ...rollupOptions, + plugins: buildPlugins?.rollup ?? plugins, + output: { + entryFileNames: swName + } + } + }); + } + return { + inlineConfig, + swName, + swMjsName, + format + }; +} +var import_node_fs2, import_node_path3; +var init_vite_build = __esm({ + "src/vite-build.ts"() { + "use strict"; + import_node_fs2 = require("fs"); + import_node_path3 = require("path"); + init_log(); + init_utils(); + } +}); + +// src/pwa-assets/build.ts +async function generate(assetsGeneratorContext) { + await (0, import_promises.mkdir)(assetsGeneratorContext.imageOutDir, { recursive: true }); + await (0, import_generate_assets.generateAssets)(assetsGeneratorContext.assetsInstructions, true, assetsGeneratorContext.imageOutDir); +} +var import_promises, import_generate_assets; +var init_build = __esm({ + "src/pwa-assets/build.ts"() { + "use strict"; + import_promises = require("fs/promises"); + import_generate_assets = require("@vite-pwa/assets-generator/api/generate-assets"); + } +}); + +// src/pwa-assets/config.ts +async function loadAssetsGeneratorContext(ctx, assetsGeneratorContext) { + const root = ctx.viteConfig.root ?? process.cwd(); + const { config, sources } = await loadConfiguration(root, ctx); + if (!config.preset) { + console.error([ + "", + cyan(`PWA v${ctx.version}`), + red("ERROR: No preset for assets generator found") + ].join("\n")); + return; + } + const { + preset, + images, + headLinkOptions: userHeadLinkOptions + } = config; + if (!images) { + console.error([ + "", + cyan(`PWA v${ctx.version}`), + red("ERROR: No image provided for assets generator") + ].join("\n")); + return; + } + if (Array.isArray(images)) { + if (!images.length) { + console.error([ + "", + cyan(`PWA v${ctx.version}`), + red("ERROR: No image provided for assets generator") + ].join("\n")); + return; + } + if (images.length > 1) { + console.error([ + "", + cyan(`PWA v${ctx.version}`), + red("ERROR: Only one image is supported for assets generator") + ].join("\n")); + return; + } + } + const pwaAssets = ctx.options.pwaAssets; + const useImage = Array.isArray(images) ? images[0] : images; + const imageFile = await tryToResolveImage(root, sources, useImage); + const publicDir = pwaAssets.integration?.publicDir ?? (0, import_node_path9.resolve)(root, ctx.viteConfig.publicDir || "public"); + const outDir = pwaAssets.integration?.outDir ?? (0, import_node_path9.resolve)(root, ctx.viteConfig.build?.outDir || "dist"); + const imageName = (0, import_node_path9.relative)(publicDir, imageFile); + const imageOutDir = (0, import_node_path9.dirname)((0, import_node_path9.resolve)(outDir, imageName)); + const xhtml = userHeadLinkOptions?.xhtml === true; + const includeId = userHeadLinkOptions?.includeId === true; + const assetsInstructions = await (0, import_instructions.instructions)({ + imageResolver: () => (0, import_promises2.readFile)(imageFile), + imageName, + preset, + faviconPreset: userHeadLinkOptions?.preset ?? pwaAssets.htmlPreset, + htmlLinks: { xhtml, includeId }, + basePath: pwaAssets.integration?.baseUrl || ctx.viteConfig.base || "/", + resolveSvgName: userHeadLinkOptions?.resolveSvgName ?? ((name) => (0, import_node_path9.basename)(name)) + }); + const { + includeHtmlHeadLinks = true, + overrideManifestIcons: useOverrideManifestIcons, + injectThemeColor = false + } = pwaAssets; + const overrideManifestIcons = ctx.options.manifest === false || !ctx.options.manifest ? false : "icons" in ctx.options.manifest ? useOverrideManifestIcons : true; + if (assetsGeneratorContext === void 0) { + return { + lastModified: Date.now(), + assetsInstructions, + cache: /* @__PURE__ */ new Map(), + useImage, + imageFile, + publicDir, + outDir, + imageName, + imageOutDir, + xhtml, + includeId, + // normalize sources + sources: sources.map((source) => source.replace(/\\/g, "/")), + injectThemeColor, + includeHtmlHeadLinks, + overrideManifestIcons + }; + } + assetsGeneratorContext.lastModified = Date.now(); + assetsGeneratorContext.assetsInstructions = assetsInstructions; + assetsGeneratorContext.useImage = useImage; + assetsGeneratorContext.imageFile = imageFile; + assetsGeneratorContext.outDir = outDir; + assetsGeneratorContext.imageName = imageName; + assetsGeneratorContext.imageOutDir = imageOutDir; + assetsGeneratorContext.xhtml = xhtml; + assetsGeneratorContext.includeId = includeId; + assetsGeneratorContext.injectThemeColor = injectThemeColor; + assetsGeneratorContext.includeHtmlHeadLinks = includeHtmlHeadLinks; + assetsGeneratorContext.overrideManifestIcons = overrideManifestIcons; + assetsGeneratorContext.cache.clear(); +} +async function loadConfiguration(root, ctx) { + const pwaAssets = ctx.options.pwaAssets; + if (pwaAssets.config === false) { + return await (0, import_config.loadConfig)(root, { + config: false, + preset: pwaAssets.preset, + images: pwaAssets.images, + logLevel: "silent" + }); + } + return await (0, import_config.loadConfig)( + root, + typeof pwaAssets.config === "boolean" ? root : { config: pwaAssets.config } + ); +} +async function checkFileExists(pathname) { + try { + await (0, import_promises2.access)(pathname, import_node_fs8.default.constants.R_OK); + } catch { + return false; + } + return true; +} +async function tryToResolveImage(root, sources, image) { + const imagePath = (0, import_node_path9.resolve)(root, image); + if (await checkFileExists(imagePath)) { + return imagePath; + } + for (const source of sources) { + const sourceImage = (0, import_node_path9.resolve)((0, import_node_path9.dirname)(source), image); + if (await checkFileExists(sourceImage)) { + return sourceImage; + } + } + return imagePath; +} +var import_node_fs8, import_promises2, import_node_path9, import_instructions, import_config; +var init_config = __esm({ + "src/pwa-assets/config.ts"() { + "use strict"; + import_node_fs8 = __toESM(require("fs"), 1); + import_promises2 = require("fs/promises"); + import_node_path9 = require("path"); + import_instructions = require("@vite-pwa/assets-generator/api/instructions"); + import_config = require("@vite-pwa/assets-generator/config"); + init_esm(); + } +}); + +// src/pwa-assets/dev.ts +async function findIconAsset(path, { assetsInstructions, cache, lastModified }) { + let resolved = cache.get(path); + if (resolved) { + resolved.age = Date.now() - lastModified; + return resolved; + } + const iconAsset = assetsInstructions.transparent[path] ?? assetsInstructions.maskable[path] ?? assetsInstructions.apple[path] ?? assetsInstructions.favicon[path] ?? assetsInstructions.appleSplashScreen[path]; + if (!iconAsset) + return; + if (iconAsset) { + resolved = { + path, + mimeType: iconAsset.mimeType, + buffer: iconAsset.buffer(), + lastModified: Date.now(), + age: 0 + }; + cache.set(path, resolved); + return resolved; + } +} +async function checkHotUpdate(file, ctx, assetsGeneratorContext) { + const result = assetsGeneratorContext.sources.includes(file); + if (result) + await loadAssetsGeneratorContext(ctx, assetsGeneratorContext); + return result; +} +var init_dev = __esm({ + "src/pwa-assets/dev.ts"() { + "use strict"; + init_config(); + } +}); + +// src/pwa-assets/utils.ts +function mapLink(includeId, link) { + const linkObject = { + href: link.href, + rel: link.rel + }; + if (includeId && link.id) + linkObject.id = link.id; + if ("media" in link && link.media) + linkObject.media = link.media; + linkObject.href = link.href; + if ("sizes" in link && link.sizes) + linkObject.sizes = link.sizes; + if ("type" in link && link.type) + linkObject.type = link.type; + return linkObject; +} +function extractIcons(instructions2) { + const icons = { + favicon: {}, + transparent: {}, + maskable: {}, + apple: {}, + appleSplashScreen: {} + }; + if (instructions2) { + Array.from(Object.values(instructions2.favicon)).forEach(({ buffer: _buffer, ...rest }) => { + if (rest.url) + icons.favicon[rest.url] = { ...rest }; + }); + Array.from(Object.values(instructions2.transparent)).forEach(({ buffer: _buffer, ...rest }) => { + if (rest.url) + icons.transparent[rest.url] = { ...rest }; + }); + Array.from(Object.values(instructions2.maskable)).forEach(({ buffer: _buffer, ...rest }) => { + if (rest.url) + icons.maskable[rest.url] = { ...rest }; + }); + Array.from(Object.values(instructions2.apple)).forEach(({ buffer: _buffer, ...rest }) => { + if (rest.url) + icons.apple[rest.url] = { ...rest }; + }); + Array.from(Object.values(instructions2.appleSplashScreen)).forEach(({ buffer: _buffer, ...rest }) => { + if (rest.url) + icons.appleSplashScreen[rest.url] = { ...rest }; + }); + } + return icons; +} +var init_utils2 = __esm({ + "src/pwa-assets/utils.ts"() { + "use strict"; + } +}); + +// src/pwa-assets/html.ts +function transformIndexHtml(html, ctx, assetsGeneratorContext) { + if (assetsGeneratorContext.injectThemeColor) { + const manifest = ctx.options.manifest; + if (manifest && "theme_color" in manifest && manifest.theme_color) { + html = checkForHtmlHead(html).replace( + "", + ` +` + ); + } + } + if (assetsGeneratorContext.includeHtmlHeadLinks) { + const link = (0, import_generate_html_markup.generateHtmlMarkup)(assetsGeneratorContext.assetsInstructions); + if (link.length) + html = checkForHtmlHead(html).replace("", ` +${link.join("\n")}`); + } + return html; +} +function resolveHtmlAssets(ctx, assetsGeneratorContext) { + const header = { + links: [], + themeColor: void 0 + }; + if (assetsGeneratorContext.injectThemeColor) { + const manifest = ctx.options.manifest; + if (manifest && "theme_color" in manifest && manifest.theme_color) + header.themeColor = { name: "theme-color", content: manifest.theme_color }; + } + if (assetsGeneratorContext.includeHtmlHeadLinks) { + const includeId = assetsGeneratorContext.includeId; + const instruction = assetsGeneratorContext.assetsInstructions; + const favicon = Array.from(Object.values(instruction.favicon)); + const apple = Array.from(Object.values(instruction.apple)); + const appleSplashScreen = Array.from(Object.values(instruction.appleSplashScreen)); + favicon.forEach((icon) => icon.linkObject && header.links.push(mapLink(includeId, icon.linkObject))); + apple.forEach((icon) => icon.linkObject && header.links.push(mapLink(includeId, icon.linkObject))); + appleSplashScreen.forEach((icon) => icon.linkObject && header.links.push(mapLink(includeId, icon.linkObject))); + } + return header; +} +var import_generate_html_markup; +var init_html2 = __esm({ + "src/pwa-assets/html.ts"() { + "use strict"; + import_generate_html_markup = require("@vite-pwa/assets-generator/api/generate-html-markup"); + init_html(); + init_utils2(); + } +}); + +// src/pwa-assets/manifest.ts +function injectManifestIcons(ctx, assetsGeneratorContext) { + if (!assetsGeneratorContext.overrideManifestIcons) + return; + const manifest = ctx.options.manifest; + if (manifest) { + manifest.icons = (0, import_generate_manifest_icons_entry.generateManifestIconsEntry)( + "object", + assetsGeneratorContext.assetsInstructions + ).icons; + } +} +var import_generate_manifest_icons_entry; +var init_manifest = __esm({ + "src/pwa-assets/manifest.ts"() { + "use strict"; + import_generate_manifest_icons_entry = require("@vite-pwa/assets-generator/api/generate-manifest-icons-entry"); + } +}); + +// src/pwa-assets/generator.ts +var generator_exports = {}; +__export(generator_exports, { + loadInstructions: () => loadInstructions +}); +async function loadInstructions(ctx) { + const assetsGeneratorContext = await loadAssetsGeneratorContext(ctx); + if (!assetsGeneratorContext) + return; + return { + generate: () => generate(assetsGeneratorContext), + findIconAsset: (path) => findIconAsset(path, assetsGeneratorContext), + resolveHtmlAssets: () => resolveHtmlAssets(ctx, assetsGeneratorContext), + transformIndexHtml: (html) => transformIndexHtml(html, ctx, assetsGeneratorContext), + injectManifestIcons: () => injectManifestIcons(ctx, assetsGeneratorContext), + instructions: () => assetsGeneratorContext.assetsInstructions, + icons: () => extractIcons(assetsGeneratorContext.assetsInstructions), + checkHotUpdate: (file) => checkHotUpdate(file, ctx, assetsGeneratorContext) + }; +} +var init_generator = __esm({ + "src/pwa-assets/generator.ts"() { + "use strict"; + init_build(); + init_config(); + init_dev(); + init_html2(); + init_manifest(); + init_utils2(); + } +}); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + VitePWA: () => VitePWA, + cachePreset: () => cachePreset, + defaultInjectManifestVitePlugins: () => defaultInjectManifestVitePlugins +}); +module.exports = __toCommonJS(src_exports); + +// src/api.ts +var import_node_fs4 = require("fs"); +var import_node_path5 = require("path"); +init_esm(); + +// src/assets.ts +var import_node_crypto = __toESM(require("crypto"), 1); +var import_node_fs = __toESM(require("fs"), 1); +var import_node_path = require("path"); +var import_tinyglobby = require("tinyglobby"); +function buildManifestEntry(publicDir, url) { + return new Promise((resolve8, reject) => { + const cHash = import_node_crypto.default.createHash("MD5"); + const stream = import_node_fs.default.createReadStream((0, import_node_path.resolve)(publicDir, url)); + stream.on("error", (err) => { + reject(err); + }); + stream.on("data", (chunk) => { + cHash.update(chunk); + }); + stream.on("end", () => { + return resolve8({ + url, + revision: `${cHash.digest("hex")}` + }); + }); + }); +} +function lookupAdditionalManifestEntries(useInjectManifest, injectManifest, workbox) { + return useInjectManifest ? injectManifest.additionalManifestEntries || [] : workbox.additionalManifestEntries || []; +} +function normalizeIconPath(path) { + return path.startsWith("/") ? path.substring(1) : path; +} +function includeIcons(icons, globs) { + Object.keys(icons).forEach((key) => { + const icon = icons[key]; + const src = normalizeIconPath(icon.src); + if (!globs.includes(src)) + globs.push(src); + }); +} +async function configureStaticAssets(resolvedVitePWAOptions, viteConfig) { + const { + manifest, + strategies, + injectManifest, + workbox, + includeAssets, + includeManifestIcons, + manifestFilename + } = resolvedVitePWAOptions; + const useInjectManifest = strategies === "injectManifest"; + const { publicDir } = viteConfig; + const globs = []; + const manifestEntries = lookupAdditionalManifestEntries( + useInjectManifest, + injectManifest, + workbox + ); + if (includeAssets) { + if (Array.isArray(includeAssets)) + globs.push(...includeAssets.map(normalizeIconPath)); + else + globs.push(normalizeIconPath(includeAssets)); + } + if (includeManifestIcons && manifest) { + manifest.icons && includeIcons(manifest.icons, globs); + manifest.shortcuts && manifest.shortcuts.forEach((s) => { + s.icons && includeIcons(s.icons, globs); + }); + } + if (globs.length > 0) { + let assets = await (0, import_tinyglobby.glob)({ + patterns: globs, + cwd: publicDir, + expandDirectories: false, + onlyFiles: true + }); + if (manifestEntries.length > 0) { + const included = manifestEntries.map((me) => { + if (typeof me === "string") + return me; + else + return me.url; + }); + assets = assets.filter((a) => !included.includes(a)); + } + const assetsEntries = await Promise.all(assets.map((a) => { + return buildManifestEntry(publicDir, a); + })); + manifestEntries.push(...assetsEntries); + } + if (manifest) { + const cHash = import_node_crypto.default.createHash("MD5"); + cHash.update(generateWebManifestFile(resolvedVitePWAOptions)); + manifestEntries.push({ + url: manifestFilename, + revision: `${cHash.digest("hex")}` + }); + } + if (manifestEntries.length > 0) { + if (useInjectManifest) + injectManifest.additionalManifestEntries = manifestEntries; + else + workbox.additionalManifestEntries = manifestEntries; + } +} +function generateWebManifestFile(options2) { + return `${JSON.stringify(options2.manifest, null, options2.minify ? 0 : 2)} +`; +} + +// src/api.ts +init_constants(); +init_html(); + +// src/modules.ts +var import_node_fs3 = require("fs"); +var import_node_module = require("module"); +var import_node_path4 = require("path"); +var import_node_url = require("url"); +init_log(); +var import_meta = {}; +var _dirname = typeof __dirname !== "undefined" ? __dirname : (0, import_node_path4.dirname)((0, import_node_url.fileURLToPath)(import_meta.url)); +var require2 = (0, import_node_module.createRequire)(_dirname); +async function loadWorkboxBuild() { + try { + const workbox = await import("workbox-build"); + return workbox.default ?? workbox; + } catch { + return require2("workbox-build"); + } +} +async function generateRegisterSW2(options2, mode, source = "register") { + const sw = options2.buildBase + options2.filename; + const scope = options2.scope; + const content = await import_node_fs3.promises.readFile((0, import_node_path4.resolve)(_dirname, `client/${mode}/${source}.js`), "utf-8"); + return content.replace(/__SW__/g, sw).replace("__SCOPE__", scope).replace("__SW_AUTO_UPDATE__", `${options2.registerType === "autoUpdate"}`).replace("__SW_SELF_DESTROYING__", `${options2.selfDestroying}`).replace("__TYPE__", `${options2.devOptions.enabled ? options2.devOptions.type : "classic"}`); +} +async function generateServiceWorker(version, options2, viteOptions) { + if (options2.selfDestroying) { + const selfDestroyingSW = ` +self.addEventListener('install', (e) => { + self.skipWaiting(); +}); +self.addEventListener('activate', (e) => { + self.registration.unregister() + .then(() => self.clients.matchAll()) + .then((clients) => { + clients.forEach((client) => { + if (client instanceof WindowClient) + client.navigate(client.url); + }); + return Promise.resolve(); + }) + .then(() => { + self.caches.keys().then((cacheNames) => { + Promise.all( + cacheNames.map((cacheName) => { + return self.caches.delete(cacheName); + }), + ); + }) + }); +}); + `; + await import_node_fs3.promises.writeFile(options2.swDest.replace(/\\/g, "/"), selfDestroyingSW, { encoding: "utf8" }); + return { + count: 1, + size: selfDestroyingSW.length, + warnings: [], + filePaths: [options2.filename] + }; + } + await options2.integration?.beforeBuildServiceWorker?.(options2); + const { generateSW } = await loadWorkboxBuild(); + const buildResult = await generateSW(options2.workbox); + logWorkboxResult( + version, + options2.throwMaximumFileSizeToCacheInBytes, + "generateSW", + buildResult, + viteOptions + ); + return buildResult; +} +async function generateInjectManifest(version, options2, viteOptions) { + const { selfDestroying } = options2; + if (selfDestroying) { + await generateServiceWorker(version, options2, viteOptions); + return; + } + await Promise.resolve().then(() => (init_vite_build(), vite_build_exports)).then(({ buildSW: buildSW2 }) => buildSW2(version, options2, viteOptions, loadWorkboxBuild())); +} + +// src/api.ts +async function _generateSW({ options: options2, version, viteConfig }) { + if (options2.disable) + return; + if (options2.strategies === "injectManifest") + await generateInjectManifest(version, options2, viteConfig); + else + await generateServiceWorker(version, options2, viteConfig); +} +function _generateBundle(ctx, bundle, pluginCtx) { + const { options: options2, viteConfig, useImportRegister } = ctx; + if (options2.disable || !bundle) + return; + if (options2.manifest) { + if (!options2.manifest.theme_color) { + console.warn([ + "", + `${cyan(`PWA v${ctx.version}`)}`, + `${yellow('WARNING: "theme_color" is missing from the web manifest, your application will not be able to be installed')}` + ].join("\n")); + } + emitFile({ + fileName: options2.manifestFilename, + source: generateWebManifestFile(options2) + }, bundle, pluginCtx); + } + if (options2.injectRegister === "auto") + options2.injectRegister = useImportRegister ? false : "script"; + if ((options2.injectRegister === "script" || options2.injectRegister === "script-defer") && !(0, import_node_fs4.existsSync)((0, import_node_path5.resolve)(viteConfig.publicDir, FILE_SW_REGISTER))) { + emitFile({ + fileName: FILE_SW_REGISTER, + source: generateSimpleSWRegister(options2, false) + }, bundle, pluginCtx); + } + return bundle; +} +function emitFile(asset, bundle, pluginCtx) { + if (pluginCtx) { + pluginCtx.emitFile({ + type: "asset", + fileName: asset.fileName, + source: asset.source + }); + } else { + bundle[asset.fileName] = { + // @ts-expect-error: for Vite 3 support, Vite 4 has removed `isAsset` property + isAsset: true, + type: "asset", + // vite 6 deprecation: replaced with names + name: void 0, + // fix vite 6 build with manifest enabled + names: [], + source: asset.source, + fileName: asset.fileName + }; + } +} +function createAPI(ctx) { + return { + get disabled() { + return ctx?.options?.disable; + }, + get pwaInDevEnvironment() { + return ctx?.devEnvironment === true; + }, + webManifestData() { + const options2 = ctx?.options; + if (!options2 || options2.disable || !options2.manifest || ctx.devEnvironment && !ctx.options.devOptions.enabled) + return void 0; + let url = options2.manifestFilename; + let manifest; + if (ctx.devEnvironment && ctx.options.devOptions.enabled === true) { + url = ctx.options.devOptions.webManifestUrl ?? options2.manifestFilename; + manifest = generateWebManifest(options2, true); + } else { + manifest = generateWebManifest(options2, false); + } + return { + href: `${ctx.devEnvironment ? options2.base : options2.buildBase}${url}`, + useCredentials: ctx.options.useCredentials, + toLinkTag() { + return manifest; + } + }; + }, + registerSWData() { + const options2 = ctx?.options; + if (!options2 || options2.disable || ctx.devEnvironment && !ctx.options.devOptions.enabled) + return void 0; + const mode = options2.injectRegister; + if (!mode || ctx.useImportRegister) + return void 0; + let type = "classic"; + let script; + let shouldRegisterSW = options2.injectRegister === "inline" || options2.injectRegister === "script" || options2.injectRegister === "script-defer"; + if (ctx.devEnvironment && ctx.options.devOptions.enabled === true) { + type = ctx.options.devOptions.type ?? "classic"; + script = generateRegisterDevSW(ctx.options.base); + shouldRegisterSW = true; + } else if (shouldRegisterSW) { + script = generateRegisterSW(options2, false); + } + const base = ctx.devEnvironment ? options2.base : options2.buildBase; + return { + // hint when required + shouldRegisterSW, + inline: options2.injectRegister === "inline", + mode: mode === "auto" ? "script" : mode, + scope: options2.scope, + inlinePath: `${base}${ctx.devEnvironment ? DEV_SW_NAME : options2.filename}`, + registerPath: `${base}${FILE_SW_REGISTER}`, + type, + toScriptTag() { + return script; + } + }; + }, + generateBundle(bundle, pluginCtx) { + return _generateBundle(ctx, bundle, pluginCtx); + }, + async generateSW() { + return await _generateSW(ctx); + }, + extendManifestEntries(fn) { + const { options: options2 } = ctx; + if (options2.disable) + return; + const configField = options2.strategies === "generateSW" ? "workbox" : "injectManifest"; + const result = fn(options2[configField].additionalManifestEntries || []); + if (result != null) + options2[configField].additionalManifestEntries = result; + }, + pwaAssetsGenerator() { + return ctx.pwaAssetsGenerator; + } + }; +} + +// src/context.ts +var import_node_fs5 = require("fs"); +var import_node_path6 = require("path"); +var import_node_url2 = require("url"); +var import_meta2 = {}; +function createContext(userOptions) { + const _dirname2 = typeof __dirname !== "undefined" ? __dirname : (0, import_node_path6.dirname)((0, import_node_url2.fileURLToPath)(import_meta2.url)); + const { version } = JSON.parse( + (0, import_node_fs5.readFileSync)((0, import_node_path6.resolve)(_dirname2, "../package.json"), "utf-8") + ); + return { + version, + userOptions, + options: void 0, + viteConfig: void 0, + useImportRegister: false, + devEnvironment: false, + pwaAssetsGenerator: Promise.resolve(void 0) + }; +} + +// src/plugins/build.ts +init_html(); +function BuildPlugin(ctx) { + const transformIndexHtmlHandler2 = (html) => { + const { options: options2, useImportRegister } = ctx; + if (options2.disable) + return html; + if (options2.injectRegister === "auto") + options2.injectRegister = useImportRegister ? null : "script"; + return injectServiceWorker(html, options2, false); + }; + return { + name: "vite-plugin-pwa:build", + enforce: "post", + apply: "build", + transformIndexHtml: { + order: "post", + handler(html) { + return transformIndexHtmlHandler2(html); + }, + enforce: "post", + // deprecated since Vite 4 + transform(html) { + return transformIndexHtmlHandler2(html); + } + }, + async generateBundle(_, bundle) { + const pwaAssetsGenerator = await ctx.pwaAssetsGenerator; + if (pwaAssetsGenerator) + pwaAssetsGenerator.injectManifestIcons(); + return _generateBundle(ctx, bundle, this); + }, + closeBundle: { + sequential: true, + order: ctx.userOptions?.integration?.closeBundleOrder, + async handler(error) { + if (error) + return; + if (!ctx.viteConfig.build.ssr) { + const pwaAssetsGenerator = await ctx.pwaAssetsGenerator; + if (pwaAssetsGenerator) + await pwaAssetsGenerator.generate(); + if (!ctx.options.disable) + await _generateSW(ctx); + } + } + }, + async buildEnd(error) { + if (error) + throw error; + } + }; +} + +// src/plugins/dev.ts +var import_node_fs6 = require("fs"); +var import_node_path7 = require("path"); + +// node_modules/.pnpm/@rolldown+pluginutils@1.0.0-beta.31/node_modules/@rolldown/pluginutils/dist/index.js +function exactRegex(str, flags) { + return new RegExp(`^${escapeRegex(str)}$`, flags); +} +function prefixRegex(str, flags) { + return new RegExp(`^${escapeRegex(str)}`, flags); +} +var escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g; +function escapeRegex(str) { + return str.replace(escapeRegexRE, "\\$&"); +} + +// src/plugins/dev.ts +init_esm(); +init_constants(); +init_html(); +init_utils(); +var swDevOptions = { + swUrl: DEV_SW_NAME, + swDevGenerated: false, + registerSWGenerated: false, + workboxPaths: /* @__PURE__ */ new Map() +}; +function DevPlugin(ctx) { + const transformIndexHtmlHandler2 = (html) => { + const { options: options2 } = ctx; + if (options2.disable || !options2.devOptions.enabled) + return html; + html = injectServiceWorker(html, options2, true); + return html.replace( + "", + `${generateRegisterDevSW(options2.base)} +` + ); + }; + const plugin = { + name: "vite-plugin-pwa:dev-sw", + apply: "serve", + options() { + const { options: options2 } = ctx; + if (!options2.disable && options2.devOptions.enabled) { + delete plugin.resolveId.filter; + delete plugin.load.filter; + } + }, + transformIndexHtml: { + order: "post", + async handler(html) { + return transformIndexHtmlHandler2(html); + }, + enforce: "post", + // deprecated since Vite 4 + async transform(html) { + return transformIndexHtmlHandler2(html); + } + }, + configureServer(server) { + ctx.devEnvironment = true; + const { options: options2 } = ctx; + if (!options2.disable && options2.devOptions.enabled) { + server.ws.on(DEV_READY_NAME, createWSResponseHandler(server, ctx)); + if (options2.manifest) { + const name = options2.devOptions.webManifestUrl ?? `${options2.base}${options2.manifestFilename}`; + server.middlewares.use(async (req, res, next) => { + if (req.url === name) { + const pwaAssetsGenerator = await ctx.pwaAssetsGenerator; + pwaAssetsGenerator?.injectManifestIcons(); + if (ctx.options.manifest && !ctx.options.manifest.theme_color) { + console.warn([ + "", + `${cyan(`PWA v${ctx.version}`)}`, + `${yellow('WARNING: "theme_color" is missing from the web manifest, your application will not be able to be installed')}` + ].join("\n")); + } + res.statusCode = 200; + res.setHeader("Content-Type", "application/manifest+json"); + res.write(generateWebManifestFile(options2), "utf-8"); + res.end(); + } else { + next(); + } + }); + } + } + }, + resolveId: { + // @ts-expect-error filter exists in Vite 6.3+ + filter: { id: exactRegex(DEV_SW_VIRTUAL) }, + // this is deleted if `!options.disable && options.devOptions.enabled` is true + handler(id) { + if (id === DEV_SW_VIRTUAL) + return RESOLVED_DEV_SW_VIRTUAL; + const { options: options2 } = ctx; + if (!options2.disable && options2.devOptions.enabled && options2.strategies === "injectManifest" && !options2.selfDestroying) { + let name = id.startsWith(options2.base) ? id.slice(options2.base.length) : id; + if (name.length && name[0] === "/") + name = name.slice(1); + return name === swDevOptions.swUrl || name === options2.injectManifest.swSrc ? options2.injectManifest.swSrc : void 0; + } + return void 0; + } + }, + load: { + // @ts-expect-error filter exists in Vite 6.3+ + filter: { id: exactRegex(RESOLVED_DEV_SW_VIRTUAL) }, + // this is deleted if `!options.disable && options.devOptions.enabled` is true + async handler(id) { + if (id === RESOLVED_DEV_SW_VIRTUAL) + return generateSWHMR(); + const { options: options2, viteConfig } = ctx; + if (!options2.disable && options2.devOptions.enabled) { + if (options2.strategies === "injectManifest" && !options2.selfDestroying) { + const swSrc = normalizePath(options2.injectManifest.swSrc); + if (id === swSrc) { + let content = await import_node_fs6.promises.readFile(options2.injectManifest.swSrc, "utf-8"); + const resolvedIP = options2.injectManifest.injectionPoint; + if (resolvedIP) { + const ip = new RegExp(resolvedIP, "g"); + const navigateFallback = options2.devOptions.navigateFallback; + if (navigateFallback) + content = content.replace(ip, `[{ url: '${navigateFallback}' }]`); + else + content = content.replace(ip, "[]"); + } + return content; + } + if (swDevOptions.workboxPaths.has(id)) + return await import_node_fs6.promises.readFile(swDevOptions.workboxPaths.get(id), "utf-8"); + return void 0; + } + if (id.endsWith(swDevOptions.swUrl)) { + const globDirectory = await resolveDevDistFolder(options2, viteConfig); + if (!(0, import_node_fs6.existsSync)(globDirectory)) + (0, import_node_fs6.mkdirSync)(globDirectory, { recursive: true }); + const swDest = (0, import_node_path7.resolve)(globDirectory, "sw.js"); + if (!swDevOptions.swDevGenerated) { + let suppressWarnings; + if (options2.devOptions.suppressWarnings === true) { + suppressWarnings = normalizePath((0, import_node_path7.resolve)(globDirectory, "suppress-warnings.js")); + await import_node_fs6.promises.writeFile(suppressWarnings, "", "utf-8"); + } + const globPatterns = options2.devOptions.suppressWarnings === true ? ["suppress-warnings.js"] : options2.workbox.globPatterns; + const navigateFallback = options2.workbox.navigateFallback; + const { filePaths } = await generateServiceWorker( + ctx.version, + Object.assign( + {}, + options2, + { + swDest: options2.selfDestroying ? swDest : options2.swDest, + workbox: { + ...options2.workbox, + navigateFallbackAllowlist: options2.devOptions.navigateFallbackAllowlist ?? [/^\/$/], + runtimeCaching: options2.devOptions.disableRuntimeConfig ? void 0 : options2.workbox.runtimeCaching, + // we only include navigateFallback: add revision to remove workbox-build warning + additionalManifestEntries: navigateFallback ? [{ + url: navigateFallback, + revision: Math.random().toString(32) + }] : void 0, + cleanupOutdatedCaches: true, + globDirectory: normalizePath(globDirectory), + globPatterns, + swDest: normalizePath(swDest) + } + } + ), + viteConfig + ); + filePaths.forEach((we) => { + const name = (0, import_node_path7.basename)(we); + if (name !== "sw.js") + swDevOptions.workboxPaths.set(normalizePath(`${options2.base}${name}`), we); + }); + if (suppressWarnings) { + swDevOptions.workboxPaths.set( + normalizePath(`${options2.base}${(0, import_node_path7.basename)(suppressWarnings)}`), + suppressWarnings + ); + } + swDevOptions.swDevGenerated = true; + } + return await import_node_fs6.promises.readFile(swDest, "utf-8"); + } + if (id.startsWith(options2.base)) { + const key = normalizePath(id); + if (swDevOptions.workboxPaths.has(key)) + return await import_node_fs6.promises.readFile(swDevOptions.workboxPaths.get(key), "utf-8"); + } else if (options2.base !== "/") { + const key = normalizePath(`${options2.base}${id.length > 0 && id[0] === "/" ? id.slice(1) : id}`); + if (swDevOptions.workboxPaths.has(key)) + return await import_node_fs6.promises.readFile(swDevOptions.workboxPaths.get(key), "utf-8"); + } + } + } + } + }; + return plugin; +} +async function resolveDevDistFolder(options2, viteConfig) { + return options2.devOptions.resolveTempFolder ? await options2.devOptions.resolveTempFolder() : (0, import_node_path7.resolve)(viteConfig.root, "dev-dist"); +} +async function createDevRegisterSW(options2, viteConfig) { + if (options2.injectRegister === "script" || options2.injectRegister === "script-defer") { + const devDist = await resolveDevDistFolder(options2, viteConfig); + if (!(0, import_node_fs6.existsSync)(devDist)) + (0, import_node_fs6.mkdirSync)(devDist, { recursive: true }); + const registerSW = (0, import_node_path7.resolve)(devDist, FILE_SW_REGISTER); + if (!swDevOptions.registerSWGenerated) { + await import_node_fs6.promises.writeFile(registerSW, generateSimpleSWRegister(options2, true), { encoding: "utf8" }); + swDevOptions.registerSWGenerated = true; + } + swDevOptions.workboxPaths.set(normalizePath(`${options2.base}${FILE_SW_REGISTER}`), registerSW); + } +} +function createWSResponseHandler(server, ctx) { + return async () => { + const { options: options2, useImportRegister } = ctx; + const { injectRegister, scope, base } = options2; + if (!useImportRegister && injectRegister) { + if (injectRegister === "auto") + options2.injectRegister = "script"; + await createDevRegisterSW(options2, ctx.viteConfig); + server.ws.send({ + type: "custom", + event: DEV_REGISTER_SW_NAME, + data: { + mode: options2.injectRegister, + scope, + inlinePath: `${base}${DEV_SW_NAME}`, + registerPath: `${base}${FILE_SW_REGISTER}`, + swType: options2.devOptions.type + } + }); + } + }; +} + +// src/plugins/info.ts +init_constants(); +function InfoPlugin(ctx, api) { + return { + name: "vite-plugin-pwa:info", + enforce: "post", + resolveId: { + filter: { id: exactRegex(PWA_INFO_VIRTUAL) }, + handler(id) { + if (id === PWA_INFO_VIRTUAL) + return RESOLVED_PWA_INFO_VIRTUAL; + return void 0; + } + }, + load: { + filter: { id: exactRegex(RESOLVED_PWA_INFO_VIRTUAL) }, + handler(id) { + if (id === RESOLVED_PWA_INFO_VIRTUAL) + return generatePwaInfo(ctx, api); + } + } + }; +} +function generatePwaInfo(ctx, api) { + const webManifestData = api.webManifestData(); + if (!webManifestData) + return "export const pwaInfo = undefined;"; + const { href, useCredentials, toLinkTag } = webManifestData; + const registerSWData = api.registerSWData(); + const entry = { + pwaInDevEnvironment: api.pwaInDevEnvironment, + webManifest: { + href, + useCredentials, + linkTag: toLinkTag() + } + }; + if (registerSWData) { + const scriptTag = registerSWData.toScriptTag(); + if (scriptTag) { + const { inline, mode, inlinePath, registerPath, type, scope } = registerSWData; + entry.registerSW = { + inline, + mode, + inlinePath, + registerPath, + type, + scope, + scriptTag + }; + } + } + return `export const pwaInfo = ${JSON.stringify(entry)};`; +} + +// src/plugins/main.ts +init_esm(); +init_constants(); + +// src/options.ts +var import_node_fs7 = __toESM(require("fs"), 1); +var import_node_path8 = require("path"); +var import_node_process = __toESM(require("process"), 1); +init_constants(); + +// src/pwa-assets/options.ts +function resolvePWAAssetsOptions(options2) { + if (!options2) + return false; + const { + disabled, + preset = "minimal-2023", + image = "public/favicon.svg", + htmlPreset = "2023", + overrideManifestIcons = false, + includeHtmlHeadLinks = true, + injectThemeColor = true, + integration + } = options2 ?? {}; + const resolvedConfiguration = { + disabled: true, + config: false, + preset: false, + images: [image], + htmlPreset, + overrideManifestIcons, + includeHtmlHeadLinks, + injectThemeColor, + integration + }; + if (disabled === true) + return resolvedConfiguration; + if ("config" in options2 && !!options2.config) { + resolvedConfiguration.disabled = false; + resolvedConfiguration.config = options2.config; + return resolvedConfiguration; + } + if (preset === false) + return resolvedConfiguration; + resolvedConfiguration.disabled = false; + resolvedConfiguration.preset = preset; + return resolvedConfiguration; +} + +// src/options.ts +init_utils(); +function resolveSwPaths(injectManifest, root, srcDir, outDir, filename) { + const swSrc = (0, import_node_path8.resolve)(root, srcDir, filename); + if (injectManifest && (0, import_node_path8.extname)(filename) === ".ts" && import_node_fs7.default.existsSync(swSrc)) { + const useFilename = `${filename.substring(0, filename.lastIndexOf("."))}.js`; + return { + swSrc, + swDest: (0, import_node_path8.resolve)(root, outDir, useFilename), + useFilename + }; + } + return { + swSrc, + swDest: (0, import_node_path8.resolve)(root, outDir, filename) + }; +} +async function resolveOptions(ctx) { + const { userOptions: options2, viteConfig } = ctx; + const root = viteConfig.root; + const pkg = import_node_fs7.default.existsSync("package.json") ? JSON.parse(import_node_fs7.default.readFileSync("package.json", "utf-8")) : {}; + const { + // prevent tsup replacing `process.env` + // eslint-disable-next-line dot-notation + mode = import_node_process.default["env"]["NODE_ENV"] || "production", + srcDir = "public", + outDir = viteConfig.build.outDir || "dist", + injectRegister = "auto", + registerType = "prompt", + filename = "sw.js", + manifestFilename = "manifest.webmanifest", + strategies = "generateSW", + minify = true, + base = viteConfig.base, + includeAssets = void 0, + includeManifestIcons = true, + useCredentials = false, + disable = false, + devOptions = { enabled: false, type: "classic", suppressWarnings: false }, + selfDestroying = false, + integration = {}, + buildBase, + pwaAssets, + showMaximumFileSizeToCacheInBytesWarning = false + } = options2; + const basePath = resolveBasePath(base); + const { swSrc, swDest, useFilename } = resolveSwPaths( + strategies === "injectManifest", + root, + srcDir, + outDir, + filename + ); + const outDirRoot = (0, import_node_path8.resolve)(root, outDir); + const scope = options2.scope || basePath; + let assetsDir = slash(viteConfig.build.assetsDir ?? "assets"); + if (assetsDir[assetsDir.length - 1] !== "/") + assetsDir += "/"; + const dontCacheBustURLsMatching = new RegExp(`^${assetsDir.replace(/^\.*\//, "")}`); + const defaultWorkbox = { + swDest, + globDirectory: outDirRoot, + offlineGoogleAnalytics: false, + cleanupOutdatedCaches: true, + dontCacheBustURLsMatching, + mode, + navigateFallback: "index.html" + }; + const defaultInjectManifest = { + swSrc, + swDest, + globDirectory: outDirRoot, + dontCacheBustURLsMatching, + injectionPoint: "self.__WB_MANIFEST" + }; + const defaultManifest = { + name: pkg.name, + short_name: pkg.name, + description: pkg.description, + start_url: basePath, + display: "standalone", + background_color: "#ffffff", + theme_color: "#42b883", + lang: "en", + scope + }; + const workbox = Object.assign({}, defaultWorkbox, options2.workbox || {}); + const manifest = typeof options2.manifest === "boolean" && !options2.manifest ? false : Object.assign({}, defaultManifest, options2.manifest || {}); + const { + vitePlugins = defaultInjectManifestVitePlugins, + plugins, + rollupOptions = {}, + rollupFormat = "es", + target = viteConfig.build.target, + minify: minifySW = viteConfig.build.minify, + sourcemap = viteConfig.build.sourcemap, + enableWorkboxModulesLogs, + buildPlugins, + envOptions = {}, + ...userInjectManifest + } = options2.injectManifest || {}; + const injectManifest = Object.assign({}, defaultInjectManifest, userInjectManifest); + if ((injectRegister === "auto" || injectRegister == null) && registerType === "autoUpdate") { + workbox.skipWaiting = true; + workbox.clientsClaim = true; + } + if (strategies === "generateSW" && workbox.sourcemap === void 0) { + const sourcemap2 = viteConfig.build?.sourcemap; + workbox.sourcemap = sourcemap2 === true || sourcemap2 === "inline" || sourcemap2 === "hidden"; + } + if (devOptions.enabled && viteConfig.command === "serve") { + if (strategies === "generateSW") + devOptions.type = "classic"; + } else { + devOptions.enabled = false; + devOptions.type = "classic"; + } + if (manifest) { + if (manifest.icons) { + manifest.icons = manifest.icons.map((icon) => { + if (icon.purpose && Array.isArray(icon.purpose)) + icon.purpose = icon.purpose.join(" "); + return icon; + }); + } + if (manifest.shortcuts) { + manifest.shortcuts.forEach((shortcut) => { + if (shortcut.icons) { + shortcut.icons = shortcut.icons.map((icon) => { + if (icon.purpose && Array.isArray(icon.purpose)) + icon.purpose = icon.purpose.join(" "); + return icon; + }); + } + }); + } + if (manifest.scope_extensions) { + manifest.scope_extensions = manifest.scope_extensions.map((scopeExtension) => { + return { + origin: scopeExtension.origin, + type: scopeExtension.type ?? "origin" + }; + }); + } + } + const { + envDir = viteConfig.envDir, + envPrefix = viteConfig.envPrefix + } = envOptions; + const resolvedVitePWAOptions = { + base: basePath, + mode, + swSrc, + swDest, + srcDir, + outDir, + injectRegister, + registerType, + filename: useFilename || filename, + manifestFilename, + strategies, + workbox, + manifest, + useCredentials, + injectManifest, + scope, + minify, + includeAssets, + includeManifestIcons, + disable, + integration, + devOptions, + rollupFormat, + vitePlugins, + buildPlugins, + selfDestroying, + buildBase: buildBase ?? basePath, + injectManifestRollupOptions: { + plugins, + rollupOptions, + format: rollupFormat + }, + injectManifestBuildOptions: { + target, + minify: minifySW, + sourcemap, + enableWorkboxModulesLogs + }, + injectManifestEnvOptions: { + envDir, + envPrefix + }, + pwaAssets: resolvePWAAssetsOptions(pwaAssets), + throwMaximumFileSizeToCacheInBytes: !showMaximumFileSizeToCacheInBytesWarning + }; + const calculateHash = !resolvedVitePWAOptions.disable && (resolvedVitePWAOptions.manifest || resolvedVitePWAOptions.includeAssets) && (viteConfig.command === "build" || resolvedVitePWAOptions.devOptions.enabled); + if (calculateHash) + await configureStaticAssets(resolvedVitePWAOptions, viteConfig); + return resolvedVitePWAOptions; +} + +// src/plugins/main.ts +function MainPlugin(ctx, api) { + return { + name: "vite-plugin-pwa", + enforce: "pre", + config() { + return { + ssr: { + // TODO: remove until workbox-window support native ESM + noExternal: ["workbox-window"] + } + }; + }, + async configResolved(config) { + ctx.useImportRegister = false; + ctx.viteConfig = config; + ctx.userOptions?.integration?.configureOptions?.(config, ctx.userOptions); + ctx.options = await resolveOptions(ctx); + if (ctx.options.pwaAssets && !ctx.options.pwaAssets.disabled) { + ctx.pwaAssetsGenerator = Promise.resolve().then(() => (init_generator(), generator_exports)).then(({ loadInstructions: loadInstructions2 }) => loadInstructions2(ctx)).catch((e) => { + console.error([ + "", + cyan(`PWA v${ctx.version}`), + yellow("WARNING: you must install the following dev dependencies to use the PWA assets generator:"), + yellow('- "@vite-pwa/assets-generator"'), + yellow('- "sharp" (should be installed when installing @vite-pwa/assets-generator)'), + yellow('- "sharp-ico" (should be installed when installing @vite-pwa/assets-generator)') + ].join("\n"), e); + return Promise.resolve(void 0); + }); + } + }, + resolveId: { + filter: { id: prefixRegex("virtual:pwa-register") }, + handler(id) { + return VIRTUAL_MODULES.includes(id) ? VIRTUAL_MODULES_RESOLVE_PREFIX + id : void 0; + } + }, + load: { + filter: { id: prefixRegex(VIRTUAL_MODULES_RESOLVE_PREFIX) }, + handler(id) { + if (id.startsWith(VIRTUAL_MODULES_RESOLVE_PREFIX)) + id = id.slice(VIRTUAL_MODULES_RESOLVE_PREFIX.length); + else + return; + if (VIRTUAL_MODULES.includes(id)) { + ctx.useImportRegister = true; + if (ctx.viteConfig.command === "serve" && ctx.options.devOptions.enabled) { + return generateRegisterSW2( + { ...ctx.options, filename: swDevOptions.swUrl }, + "build", + VIRTUAL_MODULES_MAP[id] + ); + } else { + return generateRegisterSW2( + ctx.options, + !ctx.options.disable && ctx.viteConfig.command === "build" ? "build" : "dev", + VIRTUAL_MODULES_MAP[id] + ); + } + } + } + }, + api + }; +} + +// src/plugins/pwa-assets.ts +init_constants(); +init_utils2(); +function AssetsPlugin(ctx) { + return { + name: "vite-plugin-pwa:pwa-assets", + enforce: "post", + transformIndexHtml: { + order: "post", + async handler(html) { + return await transformIndexHtmlHandler(html, ctx); + }, + enforce: "post", + // deprecated since Vite 4 + async transform(html) { + return await transformIndexHtmlHandler(html, ctx); + } + }, + resolveId: { + filter: { id: [exactRegex(PWA_ASSETS_HEAD_VIRTUAL), exactRegex(PWA_ASSETS_ICONS_VIRTUAL)] }, + handler(id) { + switch (true) { + case id === PWA_ASSETS_HEAD_VIRTUAL: + return RESOLVED_PWA_ASSETS_HEAD_VIRTUAL; + case id === PWA_ASSETS_ICONS_VIRTUAL: + return RESOLVED_PWA_ASSETS_ICONS_VIRTUAL; + default: + return void 0; + } + } + }, + load: { + filter: { id: [exactRegex(RESOLVED_PWA_ASSETS_HEAD_VIRTUAL), exactRegex(RESOLVED_PWA_ASSETS_ICONS_VIRTUAL)] }, + async handler(id) { + if (id === RESOLVED_PWA_ASSETS_HEAD_VIRTUAL) { + const pwaAssetsGenerator = await ctx.pwaAssetsGenerator; + const head = pwaAssetsGenerator?.resolveHtmlAssets() ?? { links: [], themeColor: void 0 }; + return `export const pwaAssetsHead = ${JSON.stringify(head)}`; + } + if (id === RESOLVED_PWA_ASSETS_ICONS_VIRTUAL) { + const pwaAssetsGenerator = await ctx.pwaAssetsGenerator; + const icons = extractIcons(pwaAssetsGenerator?.instructions()); + return `export const pwaAssetsIcons = ${JSON.stringify(icons)}`; + } + } + }, + async handleHotUpdate({ file, server }) { + const pwaAssetsGenerator = await ctx.pwaAssetsGenerator; + if (await pwaAssetsGenerator?.checkHotUpdate(file)) { + const modules = []; + const head = server.moduleGraph.getModuleById(RESOLVED_PWA_ASSETS_HEAD_VIRTUAL); + head && modules.push(head); + const icons = server.moduleGraph.getModuleById(RESOLVED_PWA_ASSETS_ICONS_VIRTUAL); + icons && modules.push(icons); + if (modules) + return modules; + server.ws.send({ type: "full-reload" }); + return []; + } + }, + configureServer(server) { + server.ws.on(DEV_READY_NAME, createWSResponseHandler2(ctx, server)); + server.middlewares.use(async (req, res, next) => { + const url = req.url; + if (!url) + return next(); + if (!/\.(?:ico|png|svg|webp)$/.test(url)) + return next(); + const pwaAssetsGenerator = await ctx.pwaAssetsGenerator; + if (!pwaAssetsGenerator) + return next(); + const icon = await pwaAssetsGenerator.findIconAsset(url); + if (!icon) + return next(); + if (icon.age > 0) { + const ifModifiedSince = req.headers["if-modified-since"] ?? req.headers["If-Modified-Since"]; + const useIfModifiedSince = ifModifiedSince ? Array.isArray(ifModifiedSince) ? ifModifiedSince[0] : ifModifiedSince : void 0; + if (useIfModifiedSince && new Date(icon.lastModified).getTime() / 1e3 >= new Date(useIfModifiedSince).getTime() / 1e3) { + res.statusCode = 304; + res.end(); + return; + } + } + const buffer = await icon.buffer; + res.setHeader("Age", icon.age / 1e3); + res.setHeader("Content-Type", icon.mimeType); + res.setHeader("Content-Length", buffer.length); + res.setHeader("Last-Modified", new Date(icon.lastModified).toUTCString()); + res.statusCode = 200; + res.end(buffer); + }); + } + }; +} +async function transformIndexHtmlHandler(html, ctx) { + if (ctx.devEnvironment && ctx.options.devOptions.enabled) + return html; + const pwaAssetsGenerator = await ctx.pwaAssetsGenerator; + if (!pwaAssetsGenerator) + return html; + return pwaAssetsGenerator.transformIndexHtml(html); +} +function createWSResponseHandler2(ctx, server) { + return async () => { + const pwaAssetsGenerator = await ctx.pwaAssetsGenerator; + if (pwaAssetsGenerator) { + const data = pwaAssetsGenerator.resolveHtmlAssets(); + server.ws.send({ + type: "custom", + event: DEV_PWA_ASSETS_NAME, + data + }); + } + }; +} + +// src/cache.ts +var cachePreset = [ + { + urlPattern: /^https:\/\/fonts\.(?:googleapis|gstatic)\.com\/.*/i, + handler: "CacheFirst", + options: { + cacheName: "google-fonts", + expiration: { + maxEntries: 4, + maxAgeSeconds: 365 * 24 * 60 * 60 + // 365 days + } + } + }, + { + urlPattern: /\.(?:eot|otf|ttc|ttf|woff|woff2|font.css)$/i, + handler: "StaleWhileRevalidate", + options: { + cacheName: "static-font-assets", + expiration: { + maxEntries: 4, + maxAgeSeconds: 7 * 24 * 60 * 60 + // 7 days + } + } + }, + { + urlPattern: /\.(?:jpg|jpeg|gif|png|svg|ico|webp)$/i, + handler: "StaleWhileRevalidate", + options: { + cacheName: "static-image-assets", + expiration: { + maxEntries: 64, + maxAgeSeconds: 24 * 60 * 60 + // 24 hours + } + } + }, + { + urlPattern: /\.js$/i, + handler: "StaleWhileRevalidate", + options: { + cacheName: "static-js-assets", + expiration: { + maxEntries: 32, + maxAgeSeconds: 24 * 60 * 60 + // 24 hours + } + } + }, + { + urlPattern: /\.(?:css|less)$/i, + handler: "StaleWhileRevalidate", + options: { + cacheName: "static-style-assets", + expiration: { + maxEntries: 32, + maxAgeSeconds: 24 * 60 * 60 + // 24 hours + } + } + }, + { + urlPattern: /\.(?:json|xml|csv)$/i, + handler: "NetworkFirst", + options: { + cacheName: "static-data-assets", + expiration: { + maxEntries: 32, + maxAgeSeconds: 24 * 60 * 60 + // 24 hours + } + } + }, + { + urlPattern: /\/api\/.*$/i, + handler: "NetworkFirst", + method: "GET", + options: { + cacheName: "apis", + expiration: { + maxEntries: 16, + maxAgeSeconds: 24 * 60 * 60 + // 24 hours + }, + networkTimeoutSeconds: 10 + // fall back to cache if api does not response within 10 seconds + } + }, + { + // eslint-disable-next-line regexp/no-useless-flag + urlPattern: /.*/i, + handler: "NetworkFirst", + options: { + cacheName: "others", + expiration: { + maxEntries: 32, + maxAgeSeconds: 24 * 60 * 60 + // 24 hours + }, + networkTimeoutSeconds: 10 + } + } +]; + +// src/index.ts +init_constants(); +function VitePWA(userOptions = {}) { + const ctx = createContext(userOptions); + const api = createAPI(ctx); + return [ + MainPlugin(ctx, api), + InfoPlugin(ctx, api), + BuildPlugin(ctx), + DevPlugin(ctx), + AssetsPlugin(ctx) + ]; +} +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + VitePWA, + cachePreset, + defaultInjectManifestVitePlugins +}); diff --git a/tools/ui/node_modules/vite-plugin-pwa/dist/index.d.cts b/tools/ui/node_modules/vite-plugin-pwa/dist/index.d.cts new file mode 100644 index 0000000000000000000000000000000000000000..aed43813fdeae312cccfd7383e1012d2665fdb7f --- /dev/null +++ b/tools/ui/node_modules/vite-plugin-pwa/dist/index.d.cts @@ -0,0 +1,820 @@ +import { BuildOptions, Plugin, UserConfig, ResolvedConfig, InlineConfig } from 'vite'; +import { ImageAssetsInstructions, IconAsset, FaviconLink, HtmlLink, AppleSplashScreenLink, HtmlLinkPreset } from '@vite-pwa/assets-generator/api'; +import { BuiltInPreset, Preset } from '@vite-pwa/assets-generator/config'; +import { RollupOptions, OutputBundle, PluginContext } from 'rollup'; +import { GenerateSWOptions, InjectManifestOptions, ManifestEntry, RuntimeCaching } from 'workbox-build'; + +interface PWAHtmlLink { + id?: string; + rel: 'apple-touch-startup-image' | 'apple-touch-icon' | 'icon'; + href: string; + media?: string; + sizes?: string; + type?: string; +} +interface ColorSchemeMeta { + name: string; + content: string; +} +interface ResolvedIconAsset { + path: string; + mimeType: string; + buffer: Promise; + age: number; + lastModified: number; +} +interface PWAHtmlAssets { + links: PWAHtmlLink[]; + themeColor?: ColorSchemeMeta; +} +interface PWAAssetsIcons { + favicon: Record, 'buffer'>>; + transparent: Record, 'buffer'>>; + maskable: Record, 'buffer'>>; + apple: Record, 'buffer'>>; + appleSplashScreen: Record, 'buffer'>>; +} +interface PWAAssetsGenerator { + generate: () => Promise; + findIconAsset: (path: string) => Promise; + resolveHtmlAssets: () => PWAHtmlAssets; + transformIndexHtml: (html: string) => string; + injectManifestIcons: () => void; + instructions: () => ImageAssetsInstructions; + icons: () => PWAAssetsIcons; + checkHotUpdate: (path: string) => Promise; +} + +type InjectManifestVitePlugins = string[] | ((vitePluginIds: string[]) => string[]); +type CustomInjectManifestOptions = InjectManifestOptions & { + /** + * Configure the format to use in the Rollup build. + * + * @default 'es' + */ + rollupFormat?: 'es' | 'iife'; + /** + * Configure the custom Vite build target option. + * + * @default Vite build target option + * @since v0.18.0 + */ + target?: BuildOptions['target']; + /** + * Configure the custom Vite build minify option. + * + * @default Vite build minify option + * @since v0.18.0 + */ + minify?: BuildOptions['minify']; + /** + * Configure the custom Vite build sourcemap option. + * + * @default Vite build sourcemap option + * @since v0.18.0 + */ + sourcemap?: BuildOptions['sourcemap']; + /** + * Should use `process.env.NODE_ENV` to remove dead code? + * + * If you want to keep logs from `workbox` modules, you can set this option to `true`, + * the plugin will configure `process.env.NODE_ENV` to `"development"`. + * + * If this option is not configured, the plugin will use `process.env.NODE_ENV`. + * + * @default `process.env.NODE_ENV === 'production'` + * @since v0.18.0 + */ + enableWorkboxModulesLogs?: true; + /** + * `Vite` plugin ids to use on `Rollup` build. + * + * **WARN**: this option is for advanced usage, beware, you can break your application build. + * + * @deprecated use `plugins` instead + */ + vitePlugins?: InjectManifestVitePlugins; + /** + * Since `v0.15.0` you can add plugins to build your service worker. + * + * When using `injectManifest` there are 2 builds, your application and the service worker. + * If you're using custom configuration for your service worker (for example custom plugins) you can use this option to configure the service worker build. + * Both configurations cannot be shared, and so you'll need to duplicate the configuration, with the exception of `define`. + * + * **WARN**: this option is for advanced usage, beware, you can break your application build. + * + * This option will be ignored if `buildPlugins.rollup` is configured. + * + * @deprecated use `buildPlugins` instead + */ + plugins?: Plugin[]; + /** + * Since `v0.18.0` you can add custom Rollup and/or Vite plugins to build your service worker. + * + * **WARN**: don't share plugins between the application and the service worker build, you need to include new plugins for each configuration. + * + * If you are using `plugins` option, use this option to configure the Rollup plugins or move them to `vite` option. + * + * **WARN**: this option is for advanced usage, beware, you can break your application build. + */ + buildPlugins?: { + rollup?: RollupOptions['plugins']; + vite?: UserConfig['plugins']; + }; + /** + * Since `v0.15.0` you can add custom Rollup options to build your service worker: we expose the same configuration to build a worker using Vite. + */ + rollupOptions?: Omit; + /** + * Environment options. + * + * @since v0.19.6 + */ + envOptions?: { + /** + * Configure Vite `envDir` option. + * + * @default Vite `envDir`. + */ + envDir?: UserConfig['envDir']; + /** + * Configure Vite `envPrefix` option. + * + * @default Vite `envPrefix`. + */ + envPrefix?: UserConfig['envPrefix']; + }; +}; +interface PWAIntegration { + beforeBuildServiceWorker?: (options: ResolvedVitePWAOptions) => void | Promise; + closeBundleOrder?: 'pre' | 'post' | null; + configureOptions?: (viteOptions: ResolvedConfig, options: Partial) => void | Promise; + /** + * Allow integrations to configure Vite options for custom service worker build. + * + * @param options Vite options for custom service worker build. + * @see src/vite-build.ts module + * @since v0.19.6 + */ + configureCustomSWViteBuild?: (options: InlineConfig) => void | Promise; +} +/** + * PWA assets generation and injection options. + */ +interface PWAAssetsOptions { + disabled?: boolean; + /** + * PWA assets generation and injection. + * + * By default, the plugin will search for the pwa assets generator configuration file in the root directory of your project: + * - pwa-assets.config.js + * - pwa-assets.config.mjs + * - pwa-assets.config.cjs + * - pwa-assets.config.ts + * - pwa-assets.config.cts + * - pwa-assets.config.mts + * + * If using a string path, it should be relative to the root directory of your project. + * + * Setting to `false` will disable config resolving. + * + * **WARNING**: You can use only one image in the configuration file. + * + * @default false + * @see https://vite-pwa-org.netlify.app/assets-generator/cli.html#configurations + */ + config?: string | boolean; + /** + * Preset to use. + * + * If the `config` option is enabled, this option will be ignored. + * + * Setting this option `false` will disable PWA assets generation (if the `config` option is also disabled). + * + * @default 'minimal-2023' + */ + preset?: false | BuiltInPreset | Preset; + /** + * Path relative to `root` folder where to find the image to use for generating PWA assets. + * + * Can be also relative to any of the PWA Assets configuration files. + * + * If the `config` option is enabled, this option will be ignored. + * + * @default `public/favicon.svg` + */ + image?: string; + /** + * The preset to use for head links (favicon links). + * + * If the `config` option is enabled, this option will be ignored. + * + * @see https://vite-pwa-org.netlify.app/assets-generator/#preset-minimal-2023 + * @see https://vite-pwa-org.netlify.app/assets-generator/#preset-minimal + * @default '2023' + */ + htmlPreset?: HtmlLinkPreset; + /** + * Should the plugin include html head links? + * + * @default true + */ + includeHtmlHeadLinks?: boolean; + /** + * Should the plugin override the PWA web manifest icons' entry? + * + * The plugin will auto-detect the icons from the manifest, if missing, then the plugin will ignore this option and will include the icons. + * + * @default false + */ + overrideManifestIcons?: boolean; + /** + * Should the PWA web manifest `theme_color` be injected in the html head? + * + * @default true + */ + injectThemeColor?: boolean; + /** + * PWA Assets integration support. + * + * This option should be only used by integrations, it is not meant to be used by end users. + */ + integration?: { + /** + * The base url for the PWA assets. + * + * @default `vite.base` + */ + baseUrl?: string; + /** + * The public directory to resolve the image: should be an absolute path. + * + * @default `vite.root/vite.publicDir` + */ + publicDir?: string; + /** + * The output directory: should be an absolute path. + * + * @default `vite.root/vite.build.outDir` + */ + outDir?: string; + }; +} +interface ResolvedPWAAssetsOptions extends Required> { + integration?: PWAAssetsOptions['integration']; + images: string[]; +} +/** + * Plugin options. + */ +interface VitePWAOptions { + /** + * Build mode. + * + * From `v0.18.0` this option is ignored when using `injectManifest` strategy: + * - the new Vite build will use the same mode as the application when using `injectManifest` strategy. + * - if you don't want to minify your service worker, configure `injectManifest.minify = false` in your PWA configuration. + * - if you want the sourcemap only for the service worker, configure `injectManifest.sourcemap = true` in your PWA configuration. + * - if you want workbox logs in your service worker when using production build, configure `injectManifest.enableWorkboxModulesLogs = true` in your PWA configuration. + * - you can use `import.meta.env.MODE` to access the Vite mode inside your service worker. + * - you can use `import.meta.env.DEV` or `import.meta.env.PROD` to check if the service worker is + * running on development or production (equivalent to `process.env.NODE_ENV`), + * check Vite [NODE_ENV and Modes](https://vitejs.dev/guide/env-and-mode#node-env-and-modes) docs. + * + * @see https://vitejs.dev/guide/env-and-mode#node-env-and-modes + * @default process.env.NODE_ENV or "production" + */ + mode?: 'development' | 'production'; + /** + * @default 'public' + */ + srcDir?: string; + /** + * @default 'dist' + */ + outDir?: string; + /** + * @default 'sw.js' + */ + filename?: string; + /** + * @default 'manifest.webmanifest' + */ + manifestFilename?: string; + /** + * @default 'generateSW' + */ + strategies?: 'generateSW' | 'injectManifest'; + /** + * The scope to register the Service Worker + * + * @default same as `base` of Vite's config + */ + scope?: string; + /** + * Inject the service worker register inlined in the index.html + * + * With `auto` set, depends on whether you used the `import { registerSW } from 'virtual:pwa-register'` + * it will do nothing or use the `script` mode + * + * `inline` - inject a simple register, inlined with the generated html + * + * `script` - inject ` +``` + +## Usage + +Import the library in your code, and then pick one of the styles you'd like to use - either `assert`, `expect` or `should`: + +```js +import { assert } from 'chai'; // Using Assert style +import { expect } from 'chai'; // Using Expect style +import { should } from 'chai'; // Using Should style +``` + +### Register the chai testing style globally + +```js +import 'chai/register-assert'; // Using Assert style +import 'chai/register-expect'; // Using Expect style +import 'chai/register-should'; // Using Should style +``` + +### Import assertion styles as local variables + +```js +import { assert } from 'chai'; // Using Assert style +import { expect } from 'chai'; // Using Expect style +import { should } from 'chai'; // Using Should style +should(); // Modifies `Object.prototype` + +import { expect, use } from 'chai'; // Creates local variables `expect` and `use`; useful for plugin use +``` + +### Usage with Mocha + +```bash +mocha spec.js --require chai/register-assert.js # Using Assert style +mocha spec.js --require chai/register-expect.js # Using Expect style +mocha spec.js --require chai/register-should.js # Using Should style +``` + +[Read more about these styles in our docs](http://chaijs.com/guide/styles/). + +## Plugins + +Chai offers a robust Plugin architecture for extending Chai's assertions and interfaces. + +- Need a plugin? View the [official plugin list](http://chaijs.com/plugins). +- Want to build a plugin? Read the [plugin api documentation](http://chaijs.com/guide/plugins/). +- Have a plugin and want it listed? Simply add the following keywords to your package.json: + - `chai-plugin` + - `browser` if your plugin works in the browser as well as Node.js + - `browser-only` if your plugin does not work with Node.js + +### Related Projects + +- [chaijs / chai-docs](https://github.com/chaijs/chai-docs): The chaijs.com website source code. +- [chaijs / assertion-error](https://github.com/chaijs/assertion-error): Custom `Error` constructor thrown upon an assertion failing. +- [chaijs / deep-eql](https://github.com/chaijs/deep-eql): Improved deep equality testing for Node.js and the browser. +- [chaijs / check-error](https://github.com/chaijs/check-error): Error comparison and information related utility for Node.js and the browser. +- [chaijs / loupe](https://github.com/chaijs/loupe): Inspect utility for Node.js and browsers. +- [chaijs / pathval](https://github.com/chaijs/pathval): Object value retrieval given a string path. + +### Contributing + +Thank you very much for considering to contribute! + +Please make sure you follow our [Code Of Conduct](https://github.com/chaijs/chai/blob/master/CODE_OF_CONDUCT.md) and we also strongly recommend reading our [Contributing Guide](https://github.com/chaijs/chai/blob/master/CONTRIBUTING.md). + +Here are a few issues other contributors frequently ran into when opening pull requests: + +- Please do not commit changes to the `chai.js` build. We do it once per release. +- Before pushing your commits, please make sure you [rebase](https://github.com/chaijs/chai/blob/master/CONTRIBUTING.md#pull-requests) them. + +### Contributors + +Please see the full +[Contributors Graph](https://github.com/chaijs/chai/graphs/contributors) for our +list of contributors. + +### Core Contributors + +Feel free to reach out to any of the core contributors with your questions or +concerns. We will do our best to respond in a timely manner. + +[![Keith Cirkel](https://avatars3.githubusercontent.com/u/118266?v=3&s=50)](https://github.com/keithamus) +[![James Garbutt](https://avatars3.githubusercontent.com/u/5677153?v=3&s=50)](https://github.com/43081j) +[![Kristján Oddsson](https://avatars3.githubusercontent.com/u/318208?v=3&s=50)](https://github.com/koddsson) + +### Core Contributor Alumni + +This project would not be what it is without the contributions from our prior +core contributors, for whom we are forever grateful: + +[![Jake Luer](https://avatars3.githubusercontent.com/u/58988?v=3&s=50)](https://github.com/logicalparadox) +[![Veselin Todorov](https://avatars3.githubusercontent.com/u/330048?v=3&s=50)](https://github.com/vesln) +[![Lucas Fernandes da Costa](https://avatars3.githubusercontent.com/u/6868147?v=3&s=50)](https://github.com/lucasfcosta) +[![Grant Snodgrass](https://avatars3.githubusercontent.com/u/17260989?v=3&s=50)](https://github.com/meeber) diff --git a/tools/ui/node_modules/vitest/node_modules/chai/index.js b/tools/ui/node_modules/vitest/node_modules/chai/index.js new file mode 100644 index 0000000000000000000000000000000000000000..601eb5351f16e9cca2f405ca9282f66457e5cea3 --- /dev/null +++ b/tools/ui/node_modules/vitest/node_modules/chai/index.js @@ -0,0 +1,4172 @@ +var __defProp = Object.defineProperty; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + +// lib/chai/utils/index.js +var utils_exports = {}; +__export(utils_exports, { + addChainableMethod: () => addChainableMethod, + addLengthGuard: () => addLengthGuard, + addMethod: () => addMethod, + addProperty: () => addProperty, + checkError: () => check_error_exports, + compareByInspect: () => compareByInspect, + eql: () => deep_eql_default, + events: () => events, + expectTypes: () => expectTypes, + flag: () => flag, + getActual: () => getActual, + getMessage: () => getMessage2, + getName: () => getName, + getOperator: () => getOperator, + getOwnEnumerableProperties: () => getOwnEnumerableProperties, + getOwnEnumerablePropertySymbols: () => getOwnEnumerablePropertySymbols, + getPathInfo: () => getPathInfo, + hasProperty: () => hasProperty, + inspect: () => inspect2, + isNaN: () => isNaN2, + isNumeric: () => isNumeric, + isProxyEnabled: () => isProxyEnabled, + isRegExp: () => isRegExp2, + objDisplay: () => objDisplay, + overwriteChainableMethod: () => overwriteChainableMethod, + overwriteMethod: () => overwriteMethod, + overwriteProperty: () => overwriteProperty, + proxify: () => proxify, + test: () => test, + transferFlags: () => transferFlags, + type: () => type +}); + +// node_modules/check-error/index.js +var check_error_exports = {}; +__export(check_error_exports, { + compatibleConstructor: () => compatibleConstructor, + compatibleInstance: () => compatibleInstance, + compatibleMessage: () => compatibleMessage, + getConstructorName: () => getConstructorName, + getMessage: () => getMessage +}); +function isErrorInstance(obj) { + return obj instanceof Error || Object.prototype.toString.call(obj) === "[object Error]"; +} +__name(isErrorInstance, "isErrorInstance"); +function isRegExp(obj) { + return Object.prototype.toString.call(obj) === "[object RegExp]"; +} +__name(isRegExp, "isRegExp"); +function compatibleInstance(thrown, errorLike) { + return isErrorInstance(errorLike) && thrown === errorLike; +} +__name(compatibleInstance, "compatibleInstance"); +function compatibleConstructor(thrown, errorLike) { + if (isErrorInstance(errorLike)) { + return thrown.constructor === errorLike.constructor || thrown instanceof errorLike.constructor; + } else if ((typeof errorLike === "object" || typeof errorLike === "function") && errorLike.prototype) { + return thrown.constructor === errorLike || thrown instanceof errorLike; + } + return false; +} +__name(compatibleConstructor, "compatibleConstructor"); +function compatibleMessage(thrown, errMatcher) { + const comparisonString = typeof thrown === "string" ? thrown : thrown.message; + if (isRegExp(errMatcher)) { + return errMatcher.test(comparisonString); + } else if (typeof errMatcher === "string") { + return comparisonString.indexOf(errMatcher) !== -1; + } + return false; +} +__name(compatibleMessage, "compatibleMessage"); +function getConstructorName(errorLike) { + let constructorName = errorLike; + if (isErrorInstance(errorLike)) { + constructorName = errorLike.constructor.name; + } else if (typeof errorLike === "function") { + constructorName = errorLike.name; + if (constructorName === "") { + const newConstructorName = new errorLike().name; + constructorName = newConstructorName || constructorName; + } + } + return constructorName; +} +__name(getConstructorName, "getConstructorName"); +function getMessage(errorLike) { + let msg = ""; + if (errorLike && errorLike.message) { + msg = errorLike.message; + } else if (typeof errorLike === "string") { + msg = errorLike; + } + return msg; +} +__name(getMessage, "getMessage"); + +// lib/chai/utils/flag.js +function flag(obj, key, value) { + let flags = obj.__flags || (obj.__flags = /* @__PURE__ */ Object.create(null)); + if (arguments.length === 3) { + flags[key] = value; + } else { + return flags[key]; + } +} +__name(flag, "flag"); + +// lib/chai/utils/test.js +function test(obj, args) { + let negate = flag(obj, "negate"), expr = args[0]; + return negate ? !expr : expr; +} +__name(test, "test"); + +// lib/chai/utils/type-detect.js +function type(obj) { + if (typeof obj === "undefined") { + return "undefined"; + } + if (obj === null) { + return "null"; + } + const stringTag = obj[Symbol.toStringTag]; + if (typeof stringTag === "string") { + return stringTag; + } + const type3 = Object.prototype.toString.call(obj).slice(8, -1); + return type3; +} +__name(type, "type"); + +// node_modules/assertion-error/index.js +var canElideFrames = "captureStackTrace" in Error; +var _AssertionError = class _AssertionError extends Error { + constructor(message = "Unspecified AssertionError", props, ssf) { + super(message); + __publicField(this, "message"); + this.message = message; + if (canElideFrames) { + Error.captureStackTrace(this, ssf || _AssertionError); + } + for (const key in props) { + if (!(key in this)) { + this[key] = props[key]; + } + } + } + get name() { + return "AssertionError"; + } + get ok() { + return false; + } + toJSON(stack) { + return { + ...this, + name: this.name, + message: this.message, + ok: false, + stack: stack !== false ? this.stack : void 0 + }; + } +}; +__name(_AssertionError, "AssertionError"); +var AssertionError = _AssertionError; + +// lib/chai/utils/expectTypes.js +function expectTypes(obj, types) { + let flagMsg = flag(obj, "message"); + let ssfi = flag(obj, "ssfi"); + flagMsg = flagMsg ? flagMsg + ": " : ""; + obj = flag(obj, "object"); + types = types.map(function(t) { + return t.toLowerCase(); + }); + types.sort(); + let str = types.map(function(t, index) { + let art = ~["a", "e", "i", "o", "u"].indexOf(t.charAt(0)) ? "an" : "a"; + let or = types.length > 1 && index === types.length - 1 ? "or " : ""; + return or + art + " " + t; + }).join(", "); + let objType = type(obj).toLowerCase(); + if (!types.some(function(expected) { + return objType === expected; + })) { + throw new AssertionError( + flagMsg + "object tested must be " + str + ", but " + objType + " given", + void 0, + ssfi + ); + } +} +__name(expectTypes, "expectTypes"); + +// lib/chai/utils/getActual.js +function getActual(obj, args) { + return args.length > 4 ? args[4] : obj._obj; +} +__name(getActual, "getActual"); + +// node_modules/loupe/lib/helpers.js +var ansiColors = { + bold: ["1", "22"], + dim: ["2", "22"], + italic: ["3", "23"], + underline: ["4", "24"], + // 5 & 6 are blinking + inverse: ["7", "27"], + hidden: ["8", "28"], + strike: ["9", "29"], + // 10-20 are fonts + // 21-29 are resets for 1-9 + black: ["30", "39"], + red: ["31", "39"], + green: ["32", "39"], + yellow: ["33", "39"], + blue: ["34", "39"], + magenta: ["35", "39"], + cyan: ["36", "39"], + white: ["37", "39"], + brightblack: ["30;1", "39"], + brightred: ["31;1", "39"], + brightgreen: ["32;1", "39"], + brightyellow: ["33;1", "39"], + brightblue: ["34;1", "39"], + brightmagenta: ["35;1", "39"], + brightcyan: ["36;1", "39"], + brightwhite: ["37;1", "39"], + grey: ["90", "39"] +}; +var styles = { + special: "cyan", + number: "yellow", + bigint: "yellow", + boolean: "yellow", + undefined: "grey", + null: "bold", + string: "green", + symbol: "green", + date: "magenta", + regexp: "red" +}; +var truncator = "\u2026"; +function colorise(value, styleType) { + const color = ansiColors[styles[styleType]] || ansiColors[styleType] || ""; + if (!color) { + return String(value); + } + return `\x1B[${color[0]}m${String(value)}\x1B[${color[1]}m`; +} +__name(colorise, "colorise"); +function normaliseOptions({ + showHidden = false, + depth = 2, + colors = false, + customInspect = true, + showProxy = false, + maxArrayLength = Infinity, + breakLength = Infinity, + seen = [], + // eslint-disable-next-line no-shadow + truncate: truncate2 = Infinity, + stylize = String +} = {}, inspect3) { + const options = { + showHidden: Boolean(showHidden), + depth: Number(depth), + colors: Boolean(colors), + customInspect: Boolean(customInspect), + showProxy: Boolean(showProxy), + maxArrayLength: Number(maxArrayLength), + breakLength: Number(breakLength), + truncate: Number(truncate2), + seen, + inspect: inspect3, + stylize + }; + if (options.colors) { + options.stylize = colorise; + } + return options; +} +__name(normaliseOptions, "normaliseOptions"); +function isHighSurrogate(char) { + return char >= "\uD800" && char <= "\uDBFF"; +} +__name(isHighSurrogate, "isHighSurrogate"); +function truncate(string, length, tail = truncator) { + string = String(string); + const tailLength = tail.length; + const stringLength = string.length; + if (tailLength > length && stringLength > tailLength) { + return tail; + } + if (stringLength > length && stringLength > tailLength) { + let end = length - tailLength; + if (end > 0 && isHighSurrogate(string[end - 1])) { + end = end - 1; + } + return `${string.slice(0, end)}${tail}`; + } + return string; +} +__name(truncate, "truncate"); +function inspectList(list, options, inspectItem, separator = ", ") { + inspectItem = inspectItem || options.inspect; + const size = list.length; + if (size === 0) + return ""; + const originalLength = options.truncate; + let output = ""; + let peek = ""; + let truncated = ""; + for (let i = 0; i < size; i += 1) { + const last = i + 1 === list.length; + const secondToLast = i + 2 === list.length; + truncated = `${truncator}(${list.length - i})`; + const value = list[i]; + options.truncate = originalLength - output.length - (last ? 0 : separator.length); + const string = peek || inspectItem(value, options) + (last ? "" : separator); + const nextLength = output.length + string.length; + const truncatedLength = nextLength + truncated.length; + if (last && nextLength > originalLength && output.length + truncated.length <= originalLength) { + break; + } + if (!last && !secondToLast && truncatedLength > originalLength) { + break; + } + peek = last ? "" : inspectItem(list[i + 1], options) + (secondToLast ? "" : separator); + if (!last && secondToLast && truncatedLength > originalLength && nextLength + peek.length > originalLength) { + break; + } + output += string; + if (!last && !secondToLast && nextLength + peek.length >= originalLength) { + truncated = `${truncator}(${list.length - i - 1})`; + break; + } + truncated = ""; + } + return `${output}${truncated}`; +} +__name(inspectList, "inspectList"); +function quoteComplexKey(key) { + if (key.match(/^[a-zA-Z_][a-zA-Z_0-9]*$/)) { + return key; + } + return JSON.stringify(key).replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); +} +__name(quoteComplexKey, "quoteComplexKey"); +function inspectProperty([key, value], options) { + options.truncate -= 2; + if (typeof key === "string") { + key = quoteComplexKey(key); + } else if (typeof key !== "number") { + key = `[${options.inspect(key, options)}]`; + } + options.truncate -= key.length; + value = options.inspect(value, options); + return `${key}: ${value}`; +} +__name(inspectProperty, "inspectProperty"); + +// node_modules/loupe/lib/array.js +function inspectArray(array, options) { + const nonIndexProperties = Object.keys(array).slice(array.length); + if (!array.length && !nonIndexProperties.length) + return "[]"; + options.truncate -= 4; + const listContents = inspectList(array, options); + options.truncate -= listContents.length; + let propertyContents = ""; + if (nonIndexProperties.length) { + propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty); + } + return `[ ${listContents}${propertyContents ? `, ${propertyContents}` : ""} ]`; +} +__name(inspectArray, "inspectArray"); + +// node_modules/loupe/lib/typedarray.js +var getArrayName = /* @__PURE__ */ __name((array) => { + if (typeof Buffer === "function" && array instanceof Buffer) { + return "Buffer"; + } + if (array[Symbol.toStringTag]) { + return array[Symbol.toStringTag]; + } + return array.constructor.name; +}, "getArrayName"); +function inspectTypedArray(array, options) { + const name = getArrayName(array); + options.truncate -= name.length + 4; + const nonIndexProperties = Object.keys(array).slice(array.length); + if (!array.length && !nonIndexProperties.length) + return `${name}[]`; + let output = ""; + for (let i = 0; i < array.length; i++) { + const string = `${options.stylize(truncate(array[i], options.truncate), "number")}${i === array.length - 1 ? "" : ", "}`; + options.truncate -= string.length; + if (array[i] !== array.length && options.truncate <= 3) { + output += `${truncator}(${array.length - array[i] + 1})`; + break; + } + output += string; + } + let propertyContents = ""; + if (nonIndexProperties.length) { + propertyContents = inspectList(nonIndexProperties.map((key) => [key, array[key]]), options, inspectProperty); + } + return `${name}[ ${output}${propertyContents ? `, ${propertyContents}` : ""} ]`; +} +__name(inspectTypedArray, "inspectTypedArray"); + +// node_modules/loupe/lib/date.js +function inspectDate(dateObject, options) { + const stringRepresentation = dateObject.toJSON(); + if (stringRepresentation === null) { + return "Invalid Date"; + } + const split = stringRepresentation.split("T"); + const date = split[0]; + return options.stylize(`${date}T${truncate(split[1], options.truncate - date.length - 1)}`, "date"); +} +__name(inspectDate, "inspectDate"); + +// node_modules/loupe/lib/function.js +function inspectFunction(func, options) { + const functionType = func[Symbol.toStringTag] || "Function"; + const name = func.name; + if (!name) { + return options.stylize(`[${functionType}]`, "special"); + } + return options.stylize(`[${functionType} ${truncate(name, options.truncate - 11)}]`, "special"); +} +__name(inspectFunction, "inspectFunction"); + +// node_modules/loupe/lib/map.js +function inspectMapEntry([key, value], options) { + options.truncate -= 4; + key = options.inspect(key, options); + options.truncate -= key.length; + value = options.inspect(value, options); + return `${key} => ${value}`; +} +__name(inspectMapEntry, "inspectMapEntry"); +function mapToEntries(map) { + const entries = []; + map.forEach((value, key) => { + entries.push([key, value]); + }); + return entries; +} +__name(mapToEntries, "mapToEntries"); +function inspectMap(map, options) { + if (map.size === 0) + return "Map{}"; + options.truncate -= 7; + return `Map{ ${inspectList(mapToEntries(map), options, inspectMapEntry)} }`; +} +__name(inspectMap, "inspectMap"); + +// node_modules/loupe/lib/number.js +var isNaN = Number.isNaN || ((i) => i !== i); +function inspectNumber(number, options) { + if (isNaN(number)) { + return options.stylize("NaN", "number"); + } + if (number === Infinity) { + return options.stylize("Infinity", "number"); + } + if (number === -Infinity) { + return options.stylize("-Infinity", "number"); + } + if (number === 0) { + return options.stylize(1 / number === Infinity ? "+0" : "-0", "number"); + } + return options.stylize(truncate(String(number), options.truncate), "number"); +} +__name(inspectNumber, "inspectNumber"); + +// node_modules/loupe/lib/bigint.js +function inspectBigInt(number, options) { + let nums = truncate(number.toString(), options.truncate - 1); + if (nums !== truncator) + nums += "n"; + return options.stylize(nums, "bigint"); +} +__name(inspectBigInt, "inspectBigInt"); + +// node_modules/loupe/lib/regexp.js +function inspectRegExp(value, options) { + const flags = value.toString().split("/")[2]; + const sourceLength = options.truncate - (2 + flags.length); + const source = value.source; + return options.stylize(`/${truncate(source, sourceLength)}/${flags}`, "regexp"); +} +__name(inspectRegExp, "inspectRegExp"); + +// node_modules/loupe/lib/set.js +function arrayFromSet(set2) { + const values = []; + set2.forEach((value) => { + values.push(value); + }); + return values; +} +__name(arrayFromSet, "arrayFromSet"); +function inspectSet(set2, options) { + if (set2.size === 0) + return "Set{}"; + options.truncate -= 7; + return `Set{ ${inspectList(arrayFromSet(set2), options)} }`; +} +__name(inspectSet, "inspectSet"); + +// node_modules/loupe/lib/string.js +var stringEscapeChars = new RegExp("['\\u0000-\\u001f\\u007f-\\u009f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]", "g"); +var escapeCharacters = { + "\b": "\\b", + " ": "\\t", + "\n": "\\n", + "\f": "\\f", + "\r": "\\r", + "'": "\\'", + "\\": "\\\\" +}; +var hex = 16; +var unicodeLength = 4; +function escape(char) { + return escapeCharacters[char] || `\\u${`0000${char.charCodeAt(0).toString(hex)}`.slice(-unicodeLength)}`; +} +__name(escape, "escape"); +function inspectString(string, options) { + if (stringEscapeChars.test(string)) { + string = string.replace(stringEscapeChars, escape); + } + return options.stylize(`'${truncate(string, options.truncate - 2)}'`, "string"); +} +__name(inspectString, "inspectString"); + +// node_modules/loupe/lib/symbol.js +function inspectSymbol(value) { + if ("description" in Symbol.prototype) { + return value.description ? `Symbol(${value.description})` : "Symbol()"; + } + return value.toString(); +} +__name(inspectSymbol, "inspectSymbol"); + +// node_modules/loupe/lib/promise.js +var getPromiseValue = /* @__PURE__ */ __name(() => "Promise{\u2026}", "getPromiseValue"); +var promise_default = getPromiseValue; + +// node_modules/loupe/lib/object.js +function inspectObject(object, options) { + const properties = Object.getOwnPropertyNames(object); + const symbols = Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(object) : []; + if (properties.length === 0 && symbols.length === 0) { + return "{}"; + } + options.truncate -= 4; + options.seen = options.seen || []; + if (options.seen.includes(object)) { + return "[Circular]"; + } + options.seen.push(object); + const propertyContents = inspectList(properties.map((key) => [key, object[key]]), options, inspectProperty); + const symbolContents = inspectList(symbols.map((key) => [key, object[key]]), options, inspectProperty); + options.seen.pop(); + let sep = ""; + if (propertyContents && symbolContents) { + sep = ", "; + } + return `{ ${propertyContents}${sep}${symbolContents} }`; +} +__name(inspectObject, "inspectObject"); + +// node_modules/loupe/lib/class.js +var toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag ? Symbol.toStringTag : false; +function inspectClass(value, options) { + let name = ""; + if (toStringTag && toStringTag in value) { + name = value[toStringTag]; + } + name = name || value.constructor.name; + if (!name || name === "_class") { + name = ""; + } + options.truncate -= name.length; + return `${name}${inspectObject(value, options)}`; +} +__name(inspectClass, "inspectClass"); + +// node_modules/loupe/lib/arguments.js +function inspectArguments(args, options) { + if (args.length === 0) + return "Arguments[]"; + options.truncate -= 13; + return `Arguments[ ${inspectList(args, options)} ]`; +} +__name(inspectArguments, "inspectArguments"); + +// node_modules/loupe/lib/error.js +var errorKeys = [ + "stack", + "line", + "column", + "name", + "message", + "fileName", + "lineNumber", + "columnNumber", + "number", + "description", + "cause" +]; +function inspectObject2(error, options) { + const properties = Object.getOwnPropertyNames(error).filter((key) => errorKeys.indexOf(key) === -1); + const name = error.name; + options.truncate -= name.length; + let message = ""; + if (typeof error.message === "string") { + message = truncate(error.message, options.truncate); + } else { + properties.unshift("message"); + } + message = message ? `: ${message}` : ""; + options.truncate -= message.length + 5; + options.seen = options.seen || []; + if (options.seen.includes(error)) { + return "[Circular]"; + } + options.seen.push(error); + const propertyContents = inspectList(properties.map((key) => [key, error[key]]), options, inspectProperty); + return `${name}${message}${propertyContents ? ` { ${propertyContents} }` : ""}`; +} +__name(inspectObject2, "inspectObject"); + +// node_modules/loupe/lib/html.js +function inspectAttribute([key, value], options) { + options.truncate -= 3; + if (!value) { + return `${options.stylize(String(key), "yellow")}`; + } + return `${options.stylize(String(key), "yellow")}=${options.stylize(`"${value}"`, "string")}`; +} +__name(inspectAttribute, "inspectAttribute"); +function inspectNodeCollection(collection, options) { + return inspectList(collection, options, inspectNode, "\n"); +} +__name(inspectNodeCollection, "inspectNodeCollection"); +function inspectNode(node, options) { + switch (node.nodeType) { + case 1: + return inspectHTML(node, options); + case 3: + return options.inspect(node.data, options); + default: + return options.inspect(node, options); + } +} +__name(inspectNode, "inspectNode"); +function inspectHTML(element, options) { + const properties = element.getAttributeNames(); + const name = element.tagName.toLowerCase(); + const head = options.stylize(`<${name}`, "special"); + const headClose = options.stylize(`>`, "special"); + const tail = options.stylize(``, "special"); + options.truncate -= name.length * 2 + 5; + let propertyContents = ""; + if (properties.length > 0) { + propertyContents += " "; + propertyContents += inspectList(properties.map((key) => [key, element.getAttribute(key)]), options, inspectAttribute, " "); + } + options.truncate -= propertyContents.length; + const truncate2 = options.truncate; + let children = inspectNodeCollection(element.children, options); + if (children && children.length > truncate2) { + children = `${truncator}(${element.children.length})`; + } + return `${head}${propertyContents}${headClose}${children}${tail}`; +} +__name(inspectHTML, "inspectHTML"); + +// node_modules/loupe/lib/index.js +var symbolsSupported = typeof Symbol === "function" && typeof Symbol.for === "function"; +var chaiInspect = symbolsSupported ? /* @__PURE__ */ Symbol.for("chai/inspect") : "@@chai/inspect"; +var nodeInspect = /* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom"); +var constructorMap = /* @__PURE__ */ new WeakMap(); +var stringTagMap = {}; +var baseTypesMap = { + undefined: /* @__PURE__ */ __name((value, options) => options.stylize("undefined", "undefined"), "undefined"), + null: /* @__PURE__ */ __name((value, options) => options.stylize("null", "null"), "null"), + boolean: /* @__PURE__ */ __name((value, options) => options.stylize(String(value), "boolean"), "boolean"), + Boolean: /* @__PURE__ */ __name((value, options) => options.stylize(String(value), "boolean"), "Boolean"), + number: inspectNumber, + Number: inspectNumber, + bigint: inspectBigInt, + BigInt: inspectBigInt, + string: inspectString, + String: inspectString, + function: inspectFunction, + Function: inspectFunction, + symbol: inspectSymbol, + // A Symbol polyfill will return `Symbol` not `symbol` from typedetect + Symbol: inspectSymbol, + Array: inspectArray, + Date: inspectDate, + Map: inspectMap, + Set: inspectSet, + RegExp: inspectRegExp, + Promise: promise_default, + // WeakSet, WeakMap are totally opaque to us + WeakSet: /* @__PURE__ */ __name((value, options) => options.stylize("WeakSet{\u2026}", "special"), "WeakSet"), + WeakMap: /* @__PURE__ */ __name((value, options) => options.stylize("WeakMap{\u2026}", "special"), "WeakMap"), + Arguments: inspectArguments, + Int8Array: inspectTypedArray, + Uint8Array: inspectTypedArray, + Uint8ClampedArray: inspectTypedArray, + Int16Array: inspectTypedArray, + Uint16Array: inspectTypedArray, + Int32Array: inspectTypedArray, + Uint32Array: inspectTypedArray, + Float32Array: inspectTypedArray, + Float64Array: inspectTypedArray, + Generator: /* @__PURE__ */ __name(() => "", "Generator"), + DataView: /* @__PURE__ */ __name(() => "", "DataView"), + ArrayBuffer: /* @__PURE__ */ __name(() => "", "ArrayBuffer"), + Error: inspectObject2, + HTMLCollection: inspectNodeCollection, + NodeList: inspectNodeCollection +}; +var inspectCustom = /* @__PURE__ */ __name((value, options, type3, inspectFn) => { + if (chaiInspect in value && typeof value[chaiInspect] === "function") { + return value[chaiInspect](options); + } + if (nodeInspect in value && typeof value[nodeInspect] === "function") { + return value[nodeInspect](options.depth, options, inspectFn); + } + if ("inspect" in value && typeof value.inspect === "function") { + return value.inspect(options.depth, options); + } + if ("constructor" in value && constructorMap.has(value.constructor)) { + return constructorMap.get(value.constructor)(value, options); + } + if (stringTagMap[type3]) { + return stringTagMap[type3](value, options); + } + return ""; +}, "inspectCustom"); +var toString = Object.prototype.toString; +function inspect(value, opts = {}) { + const options = normaliseOptions(opts, inspect); + const { customInspect } = options; + let type3 = value === null ? "null" : typeof value; + if (type3 === "object") { + type3 = toString.call(value).slice(8, -1); + } + if (type3 in baseTypesMap) { + return baseTypesMap[type3](value, options); + } + if (customInspect && value) { + const output = inspectCustom(value, options, type3, inspect); + if (output) { + if (typeof output === "string") + return output; + return inspect(output, options); + } + } + const proto = value ? Object.getPrototypeOf(value) : false; + if (proto === Object.prototype || proto === null) { + return inspectObject(value, options); + } + if (value && typeof HTMLElement === "function" && value instanceof HTMLElement) { + return inspectHTML(value, options); + } + if ("constructor" in value) { + if (value.constructor !== Object) { + return inspectClass(value, options); + } + return inspectObject(value, options); + } + if (value === Object(value)) { + return inspectObject(value, options); + } + return options.stylize(String(value), type3); +} +__name(inspect, "inspect"); + +// lib/chai/config.js +var config = { + /** + * ### config.includeStack + * + * User configurable property, influences whether stack trace + * is included in Assertion error message. Default of false + * suppresses stack trace in the error message. + * + * chai.config.includeStack = true; // enable stack on error + * + * @param {boolean} + * @public + */ + includeStack: false, + /** + * ### config.showDiff + * + * User configurable property, influences whether or not + * the `showDiff` flag should be included in the thrown + * AssertionErrors. `false` will always be `false`; `true` + * will be true when the assertion has requested a diff + * be shown. + * + * @param {boolean} + * @public + */ + showDiff: true, + /** + * ### config.truncateThreshold + * + * User configurable property, sets length threshold for actual and + * expected values in assertion errors. If this threshold is exceeded, for + * example for large data structures, the value is replaced with something + * like `[ Array(3) ]` or `{ Object (prop1, prop2) }`. + * + * Set it to zero if you want to disable truncating altogether. + * + * This is especially userful when doing assertions on arrays: having this + * set to a reasonable large value makes the failure messages readily + * inspectable. + * + * chai.config.truncateThreshold = 0; // disable truncating + * + * @param {number} + * @public + */ + truncateThreshold: 40, + /** + * ### config.useProxy + * + * User configurable property, defines if chai will use a Proxy to throw + * an error when a non-existent property is read, which protects users + * from typos when using property-based assertions. + * + * Set it to false if you want to disable this feature. + * + * chai.config.useProxy = false; // disable use of Proxy + * + * This feature is automatically disabled regardless of this config value + * in environments that don't support proxies. + * + * @param {boolean} + * @public + */ + useProxy: true, + /** + * ### config.proxyExcludedKeys + * + * User configurable property, defines which properties should be ignored + * instead of throwing an error if they do not exist on the assertion. + * This is only applied if the environment Chai is running in supports proxies and + * if the `useProxy` configuration setting is enabled. + * By default, `then` and `inspect` will not throw an error if they do not exist on the + * assertion object because the `.inspect` property is read by `util.inspect` (for example, when + * using `console.log` on the assertion object) and `.then` is necessary for promise type-checking. + * + * // By default these keys will not throw an error if they do not exist on the assertion object + * chai.config.proxyExcludedKeys = ['then', 'inspect']; + * + * @param {Array} + * @public + */ + proxyExcludedKeys: ["then", "catch", "inspect", "toJSON"], + /** + * ### config.deepEqual + * + * User configurable property, defines which a custom function to use for deepEqual + * comparisons. + * By default, the function used is the one from the `deep-eql` package without custom comparator. + * + * // use a custom comparator + * chai.config.deepEqual = (expected, actual) => { + * return chai.util.eql(expected, actual, { + * comparator: (expected, actual) => { + * // for non number comparison, use the default behavior + * if(typeof expected !== 'number') return null; + * // allow a difference of 10 between compared numbers + * return typeof actual === 'number' && Math.abs(actual - expected) < 10 + * } + * }) + * }; + * + * @param {Function} + * @public + */ + deepEqual: null +}; + +// lib/chai/utils/inspect.js +function inspect2(obj, showHidden, depth, colors) { + let options = { + colors, + depth: typeof depth === "undefined" ? 2 : depth, + showHidden, + truncate: config.truncateThreshold ? config.truncateThreshold : Infinity + }; + return inspect(obj, options); +} +__name(inspect2, "inspect"); + +// lib/chai/utils/objDisplay.js +function objDisplay(obj) { + let str = inspect2(obj), type3 = Object.prototype.toString.call(obj); + if (config.truncateThreshold && str.length >= config.truncateThreshold) { + if (type3 === "[object Function]") { + return !obj.name || obj.name === "" ? "[Function]" : "[Function: " + obj.name + "]"; + } else if (type3 === "[object Array]") { + return "[ Array(" + obj.length + ") ]"; + } else if (type3 === "[object Object]") { + let keys = Object.keys(obj), kstr = keys.length > 2 ? keys.splice(0, 2).join(", ") + ", ..." : keys.join(", "); + return "{ Object (" + kstr + ") }"; + } else { + return str; + } + } else { + return str; + } +} +__name(objDisplay, "objDisplay"); + +// lib/chai/utils/getMessage.js +function getMessage2(obj, args) { + let negate = flag(obj, "negate"); + let val = flag(obj, "object"); + let expected = args[3]; + let actual = getActual(obj, args); + let msg = negate ? args[2] : args[1]; + let flagMsg = flag(obj, "message"); + if (typeof msg === "function") msg = msg(); + msg = msg || ""; + msg = msg.replace(/#\{this\}/g, function() { + return objDisplay(val); + }).replace(/#\{act\}/g, function() { + return objDisplay(actual); + }).replace(/#\{exp\}/g, function() { + return objDisplay(expected); + }); + return flagMsg ? flagMsg + ": " + msg : msg; +} +__name(getMessage2, "getMessage"); + +// lib/chai/utils/transferFlags.js +function transferFlags(assertion, object, includeAll) { + let flags = assertion.__flags || (assertion.__flags = /* @__PURE__ */ Object.create(null)); + if (!object.__flags) { + object.__flags = /* @__PURE__ */ Object.create(null); + } + includeAll = arguments.length === 3 ? includeAll : true; + for (let flag3 in flags) { + if (includeAll || flag3 !== "object" && flag3 !== "ssfi" && flag3 !== "lockSsfi" && flag3 != "message") { + object.__flags[flag3] = flags[flag3]; + } + } +} +__name(transferFlags, "transferFlags"); + +// node_modules/deep-eql/index.js +function type2(obj) { + if (typeof obj === "undefined") { + return "undefined"; + } + if (obj === null) { + return "null"; + } + const stringTag = obj[Symbol.toStringTag]; + if (typeof stringTag === "string") { + return stringTag; + } + const sliceStart = 8; + const sliceEnd = -1; + return Object.prototype.toString.call(obj).slice(sliceStart, sliceEnd); +} +__name(type2, "type"); +function FakeMap() { + this._key = "chai/deep-eql__" + Math.random() + Date.now(); +} +__name(FakeMap, "FakeMap"); +FakeMap.prototype = { + get: /* @__PURE__ */ __name(function get(key) { + return key[this._key]; + }, "get"), + set: /* @__PURE__ */ __name(function set(key, value) { + if (Object.isExtensible(key)) { + Object.defineProperty(key, this._key, { + value, + configurable: true + }); + } + }, "set") +}; +var MemoizeMap = typeof WeakMap === "function" ? WeakMap : FakeMap; +function memoizeCompare(leftHandOperand, rightHandOperand, memoizeMap) { + if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) { + return null; + } + var leftHandMap = memoizeMap.get(leftHandOperand); + if (leftHandMap) { + var result = leftHandMap.get(rightHandOperand); + if (typeof result === "boolean") { + return result; + } + } + return null; +} +__name(memoizeCompare, "memoizeCompare"); +function memoizeSet(leftHandOperand, rightHandOperand, memoizeMap, result) { + if (!memoizeMap || isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) { + return; + } + var leftHandMap = memoizeMap.get(leftHandOperand); + if (leftHandMap) { + leftHandMap.set(rightHandOperand, result); + } else { + leftHandMap = new MemoizeMap(); + leftHandMap.set(rightHandOperand, result); + memoizeMap.set(leftHandOperand, leftHandMap); + } +} +__name(memoizeSet, "memoizeSet"); +var deep_eql_default = deepEqual; +function deepEqual(leftHandOperand, rightHandOperand, options) { + if (options && options.comparator) { + return extensiveDeepEqual(leftHandOperand, rightHandOperand, options); + } + var simpleResult = simpleEqual(leftHandOperand, rightHandOperand); + if (simpleResult !== null) { + return simpleResult; + } + return extensiveDeepEqual(leftHandOperand, rightHandOperand, options); +} +__name(deepEqual, "deepEqual"); +function simpleEqual(leftHandOperand, rightHandOperand) { + if (leftHandOperand === rightHandOperand) { + return leftHandOperand !== 0 || 1 / leftHandOperand === 1 / rightHandOperand; + } + if (leftHandOperand !== leftHandOperand && // eslint-disable-line no-self-compare + rightHandOperand !== rightHandOperand) { + return true; + } + if (isPrimitive(leftHandOperand) || isPrimitive(rightHandOperand)) { + return false; + } + return null; +} +__name(simpleEqual, "simpleEqual"); +function extensiveDeepEqual(leftHandOperand, rightHandOperand, options) { + options = options || {}; + options.memoize = options.memoize === false ? false : options.memoize || new MemoizeMap(); + var comparator = options && options.comparator; + var memoizeResultLeft = memoizeCompare(leftHandOperand, rightHandOperand, options.memoize); + if (memoizeResultLeft !== null) { + return memoizeResultLeft; + } + var memoizeResultRight = memoizeCompare(rightHandOperand, leftHandOperand, options.memoize); + if (memoizeResultRight !== null) { + return memoizeResultRight; + } + if (comparator) { + var comparatorResult = comparator(leftHandOperand, rightHandOperand); + if (comparatorResult === false || comparatorResult === true) { + memoizeSet(leftHandOperand, rightHandOperand, options.memoize, comparatorResult); + return comparatorResult; + } + var simpleResult = simpleEqual(leftHandOperand, rightHandOperand); + if (simpleResult !== null) { + return simpleResult; + } + } + var leftHandType = type2(leftHandOperand); + if (leftHandType !== type2(rightHandOperand)) { + memoizeSet(leftHandOperand, rightHandOperand, options.memoize, false); + return false; + } + memoizeSet(leftHandOperand, rightHandOperand, options.memoize, true); + var result = extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options); + memoizeSet(leftHandOperand, rightHandOperand, options.memoize, result); + return result; +} +__name(extensiveDeepEqual, "extensiveDeepEqual"); +function extensiveDeepEqualByType(leftHandOperand, rightHandOperand, leftHandType, options) { + switch (leftHandType) { + case "String": + case "Number": + case "Boolean": + case "Date": + return deepEqual(leftHandOperand.valueOf(), rightHandOperand.valueOf()); + case "Promise": + case "Symbol": + case "function": + case "WeakMap": + case "WeakSet": + return leftHandOperand === rightHandOperand; + case "Error": + return keysEqual(leftHandOperand, rightHandOperand, ["name", "message", "code"], options); + case "Arguments": + case "Int8Array": + case "Uint8Array": + case "Uint8ClampedArray": + case "Int16Array": + case "Uint16Array": + case "Int32Array": + case "Uint32Array": + case "Float32Array": + case "Float64Array": + case "Array": + return iterableEqual(leftHandOperand, rightHandOperand, options); + case "RegExp": + return regexpEqual(leftHandOperand, rightHandOperand); + case "Generator": + return generatorEqual(leftHandOperand, rightHandOperand, options); + case "DataView": + return iterableEqual(new Uint8Array(leftHandOperand.buffer), new Uint8Array(rightHandOperand.buffer), options); + case "ArrayBuffer": + return iterableEqual(new Uint8Array(leftHandOperand), new Uint8Array(rightHandOperand), options); + case "Set": + return entriesEqual(leftHandOperand, rightHandOperand, options); + case "Map": + return entriesEqual(leftHandOperand, rightHandOperand, options); + case "Temporal.PlainDate": + case "Temporal.PlainTime": + case "Temporal.PlainDateTime": + case "Temporal.Instant": + case "Temporal.ZonedDateTime": + case "Temporal.PlainYearMonth": + case "Temporal.PlainMonthDay": + return leftHandOperand.equals(rightHandOperand); + case "Temporal.Duration": + return leftHandOperand.total("nanoseconds") === rightHandOperand.total("nanoseconds"); + case "Temporal.TimeZone": + case "Temporal.Calendar": + return leftHandOperand.toString() === rightHandOperand.toString(); + default: + return objectEqual(leftHandOperand, rightHandOperand, options); + } +} +__name(extensiveDeepEqualByType, "extensiveDeepEqualByType"); +function regexpEqual(leftHandOperand, rightHandOperand) { + return leftHandOperand.toString() === rightHandOperand.toString(); +} +__name(regexpEqual, "regexpEqual"); +function entriesEqual(leftHandOperand, rightHandOperand, options) { + try { + if (leftHandOperand.size !== rightHandOperand.size) { + return false; + } + if (leftHandOperand.size === 0) { + return true; + } + } catch (sizeError) { + return false; + } + var leftHandItems = []; + var rightHandItems = []; + leftHandOperand.forEach(/* @__PURE__ */ __name(function gatherEntries(key, value) { + leftHandItems.push([key, value]); + }, "gatherEntries")); + rightHandOperand.forEach(/* @__PURE__ */ __name(function gatherEntries(key, value) { + rightHandItems.push([key, value]); + }, "gatherEntries")); + return iterableEqual(leftHandItems.sort(), rightHandItems.sort(), options); +} +__name(entriesEqual, "entriesEqual"); +function iterableEqual(leftHandOperand, rightHandOperand, options) { + var length = leftHandOperand.length; + if (length !== rightHandOperand.length) { + return false; + } + if (length === 0) { + return true; + } + var index = -1; + while (++index < length) { + if (deepEqual(leftHandOperand[index], rightHandOperand[index], options) === false) { + return false; + } + } + return true; +} +__name(iterableEqual, "iterableEqual"); +function generatorEqual(leftHandOperand, rightHandOperand, options) { + return iterableEqual(getGeneratorEntries(leftHandOperand), getGeneratorEntries(rightHandOperand), options); +} +__name(generatorEqual, "generatorEqual"); +function hasIteratorFunction(target) { + return typeof Symbol !== "undefined" && typeof target === "object" && typeof Symbol.iterator !== "undefined" && typeof target[Symbol.iterator] === "function"; +} +__name(hasIteratorFunction, "hasIteratorFunction"); +function getIteratorEntries(target) { + if (hasIteratorFunction(target)) { + try { + return getGeneratorEntries(target[Symbol.iterator]()); + } catch (iteratorError) { + return []; + } + } + return []; +} +__name(getIteratorEntries, "getIteratorEntries"); +function getGeneratorEntries(generator) { + var generatorResult = generator.next(); + var accumulator = [generatorResult.value]; + while (generatorResult.done === false) { + generatorResult = generator.next(); + accumulator.push(generatorResult.value); + } + return accumulator; +} +__name(getGeneratorEntries, "getGeneratorEntries"); +function getEnumerableKeys(target) { + var keys = []; + for (var key in target) { + keys.push(key); + } + return keys; +} +__name(getEnumerableKeys, "getEnumerableKeys"); +function getEnumerableSymbols(target) { + var keys = []; + var allKeys = Object.getOwnPropertySymbols(target); + for (var i = 0; i < allKeys.length; i += 1) { + var key = allKeys[i]; + if (Object.getOwnPropertyDescriptor(target, key).enumerable) { + keys.push(key); + } + } + return keys; +} +__name(getEnumerableSymbols, "getEnumerableSymbols"); +function keysEqual(leftHandOperand, rightHandOperand, keys, options) { + var length = keys.length; + if (length === 0) { + return true; + } + for (var i = 0; i < length; i += 1) { + if (deepEqual(leftHandOperand[keys[i]], rightHandOperand[keys[i]], options) === false) { + return false; + } + } + return true; +} +__name(keysEqual, "keysEqual"); +function objectEqual(leftHandOperand, rightHandOperand, options) { + var leftHandKeys = getEnumerableKeys(leftHandOperand); + var rightHandKeys = getEnumerableKeys(rightHandOperand); + var leftHandSymbols = getEnumerableSymbols(leftHandOperand); + var rightHandSymbols = getEnumerableSymbols(rightHandOperand); + leftHandKeys = leftHandKeys.concat(leftHandSymbols); + rightHandKeys = rightHandKeys.concat(rightHandSymbols); + if (leftHandKeys.length && leftHandKeys.length === rightHandKeys.length) { + if (iterableEqual(mapSymbols(leftHandKeys).sort(), mapSymbols(rightHandKeys).sort()) === false) { + return false; + } + return keysEqual(leftHandOperand, rightHandOperand, leftHandKeys, options); + } + var leftHandEntries = getIteratorEntries(leftHandOperand); + var rightHandEntries = getIteratorEntries(rightHandOperand); + if (leftHandEntries.length && leftHandEntries.length === rightHandEntries.length) { + leftHandEntries.sort(); + rightHandEntries.sort(); + return iterableEqual(leftHandEntries, rightHandEntries, options); + } + if (leftHandKeys.length === 0 && leftHandEntries.length === 0 && rightHandKeys.length === 0 && rightHandEntries.length === 0) { + return true; + } + return false; +} +__name(objectEqual, "objectEqual"); +function isPrimitive(value) { + return value === null || typeof value !== "object"; +} +__name(isPrimitive, "isPrimitive"); +function mapSymbols(arr) { + return arr.map(/* @__PURE__ */ __name(function mapSymbol(entry) { + if (typeof entry === "symbol") { + return entry.toString(); + } + return entry; + }, "mapSymbol")); +} +__name(mapSymbols, "mapSymbols"); + +// node_modules/pathval/index.js +function hasProperty(obj, name) { + if (typeof obj === "undefined" || obj === null) { + return false; + } + return name in Object(obj); +} +__name(hasProperty, "hasProperty"); +function parsePath(path) { + const str = path.replace(/([^\\])\[/g, "$1.["); + const parts = str.match(/(\\\.|[^.]+?)+/g); + return parts.map((value) => { + if (value === "constructor" || value === "__proto__" || value === "prototype") { + return {}; + } + const regexp = /^\[(\d+)\]$/; + const mArr = regexp.exec(value); + let parsed = null; + if (mArr) { + parsed = { i: parseFloat(mArr[1]) }; + } else { + parsed = { p: value.replace(/\\([.[\]])/g, "$1") }; + } + return parsed; + }); +} +__name(parsePath, "parsePath"); +function internalGetPathValue(obj, parsed, pathDepth) { + let temporaryValue = obj; + let res = null; + pathDepth = typeof pathDepth === "undefined" ? parsed.length : pathDepth; + for (let i = 0; i < pathDepth; i++) { + const part = parsed[i]; + if (temporaryValue) { + if (typeof part.p === "undefined") { + temporaryValue = temporaryValue[part.i]; + } else { + temporaryValue = temporaryValue[part.p]; + } + if (i === pathDepth - 1) { + res = temporaryValue; + } + } + } + return res; +} +__name(internalGetPathValue, "internalGetPathValue"); +function getPathInfo(obj, path) { + const parsed = parsePath(path); + const last = parsed[parsed.length - 1]; + const info = { + parent: parsed.length > 1 ? internalGetPathValue(obj, parsed, parsed.length - 1) : obj, + name: last.p || last.i, + value: internalGetPathValue(obj, parsed) + }; + info.exists = hasProperty(info.parent, info.name); + return info; +} +__name(getPathInfo, "getPathInfo"); + +// lib/chai/assertion.js +var _Assertion = class _Assertion { + /** + * Creates object for chaining. + * `Assertion` objects contain metadata in the form of flags. Three flags can + * be assigned during instantiation by passing arguments to this constructor: + * + * - `object`: This flag contains the target of the assertion. For example, in + * the assertion `expect(numKittens).to.equal(7);`, the `object` flag will + * contain `numKittens` so that the `equal` assertion can reference it when + * needed. + * + * - `message`: This flag contains an optional custom error message to be + * prepended to the error message that's generated by the assertion when it + * fails. + * + * - `ssfi`: This flag stands for "start stack function indicator". It + * contains a function reference that serves as the starting point for + * removing frames from the stack trace of the error that's created by the + * assertion when it fails. The goal is to provide a cleaner stack trace to + * end users by removing Chai's internal functions. Note that it only works + * in environments that support `Error.captureStackTrace`, and only when + * `Chai.config.includeStack` hasn't been set to `false`. + * + * - `lockSsfi`: This flag controls whether or not the given `ssfi` flag + * should retain its current value, even as assertions are chained off of + * this object. This is usually set to `true` when creating a new assertion + * from within another assertion. It's also temporarily set to `true` before + * an overwritten assertion gets called by the overwriting assertion. + * + * - `eql`: This flag contains the deepEqual function to be used by the assertion. + * + * @param {unknown} obj target of the assertion + * @param {string} [msg] (optional) custom error message + * @param {Function} [ssfi] (optional) starting point for removing stack frames + * @param {boolean} [lockSsfi] (optional) whether or not the ssfi flag is locked + */ + constructor(obj, msg, ssfi, lockSsfi) { + /** @type {{}} */ + __publicField(this, "__flags", {}); + flag(this, "ssfi", ssfi || _Assertion); + flag(this, "lockSsfi", lockSsfi); + flag(this, "object", obj); + flag(this, "message", msg); + flag(this, "eql", config.deepEqual || deep_eql_default); + return proxify(this); + } + /** @returns {boolean} */ + static get includeStack() { + console.warn( + "Assertion.includeStack is deprecated, use chai.config.includeStack instead." + ); + return config.includeStack; + } + /** @param {boolean} value */ + static set includeStack(value) { + console.warn( + "Assertion.includeStack is deprecated, use chai.config.includeStack instead." + ); + config.includeStack = value; + } + /** @returns {boolean} */ + static get showDiff() { + console.warn( + "Assertion.showDiff is deprecated, use chai.config.showDiff instead." + ); + return config.showDiff; + } + /** @param {boolean} value */ + static set showDiff(value) { + console.warn( + "Assertion.showDiff is deprecated, use chai.config.showDiff instead." + ); + config.showDiff = value; + } + /** + * @param {string} name + * @param {Function} fn + */ + static addProperty(name, fn) { + addProperty(this.prototype, name, fn); + } + /** + * @param {string} name + * @param {Function} fn + */ + static addMethod(name, fn) { + addMethod(this.prototype, name, fn); + } + /** + * @param {string} name + * @param {Function} fn + * @param {Function} chainingBehavior + */ + static addChainableMethod(name, fn, chainingBehavior) { + addChainableMethod(this.prototype, name, fn, chainingBehavior); + } + /** + * @param {string} name + * @param {Function} fn + */ + static overwriteProperty(name, fn) { + overwriteProperty(this.prototype, name, fn); + } + /** + * @param {string} name + * @param {Function} fn + */ + static overwriteMethod(name, fn) { + overwriteMethod(this.prototype, name, fn); + } + /** + * @param {string} name + * @param {Function} fn + * @param {Function} chainingBehavior + */ + static overwriteChainableMethod(name, fn, chainingBehavior) { + overwriteChainableMethod(this.prototype, name, fn, chainingBehavior); + } + /** + * ### .assert(expression, message, negateMessage, expected, actual, showDiff) + * + * Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass. + * + * @name assert + * @param {unknown} _expr to be tested + * @param {string | Function} msg or function that returns message to display if expression fails + * @param {string | Function} _negateMsg or function that returns negatedMessage to display if negated expression fails + * @param {unknown} expected value (remember to check for negation) + * @param {unknown} _actual (optional) will default to `this.obj` + * @param {boolean} showDiff (optional) when set to `true`, assert will display a diff in addition to the message if expression fails + * @returns {void} + */ + assert(_expr, msg, _negateMsg, expected, _actual, showDiff) { + const ok = test(this, arguments); + if (false !== showDiff) showDiff = true; + if (void 0 === expected && void 0 === _actual) showDiff = false; + if (true !== config.showDiff) showDiff = false; + if (!ok) { + msg = getMessage2(this, arguments); + const actual = getActual(this, arguments); + const assertionErrorObjectProperties = { + actual, + expected, + showDiff + }; + const operator = getOperator(this, arguments); + if (operator) { + assertionErrorObjectProperties.operator = operator; + } + throw new AssertionError( + msg, + assertionErrorObjectProperties, + // @ts-expect-error Not sure what to do about these types yet + config.includeStack ? this.assert : flag(this, "ssfi") + ); + } + } + /** + * Quick reference to stored `actual` value for plugin developers. + * + * @returns {unknown} + */ + get _obj() { + return flag(this, "object"); + } + /** + * Quick reference to stored `actual` value for plugin developers. + * + * @param {unknown} val + */ + set _obj(val) { + flag(this, "object", val); + } +}; +__name(_Assertion, "Assertion"); +var Assertion = _Assertion; + +// lib/chai/utils/events.js +var events = new EventTarget(); +var _PluginEvent = class _PluginEvent extends Event { + constructor(type3, name, fn) { + super(type3); + this.name = String(name); + this.fn = fn; + } +}; +__name(_PluginEvent, "PluginEvent"); +var PluginEvent = _PluginEvent; + +// lib/chai/utils/isProxyEnabled.js +function isProxyEnabled() { + return config.useProxy && typeof Proxy !== "undefined" && typeof Reflect !== "undefined"; +} +__name(isProxyEnabled, "isProxyEnabled"); + +// lib/chai/utils/addProperty.js +function addProperty(ctx, name, getter) { + getter = getter === void 0 ? function() { + } : getter; + Object.defineProperty(ctx, name, { + get: /* @__PURE__ */ __name(function propertyGetter() { + if (!isProxyEnabled() && !flag(this, "lockSsfi")) { + flag(this, "ssfi", propertyGetter); + } + let result = getter.call(this); + if (result !== void 0) return result; + let newAssertion = new Assertion(); + transferFlags(this, newAssertion); + return newAssertion; + }, "propertyGetter"), + configurable: true + }); + events.dispatchEvent(new PluginEvent("addProperty", name, getter)); +} +__name(addProperty, "addProperty"); + +// lib/chai/utils/addLengthGuard.js +var fnLengthDesc = Object.getOwnPropertyDescriptor(function() { +}, "length"); +function addLengthGuard(fn, assertionName, isChainable) { + if (!fnLengthDesc.configurable) return fn; + Object.defineProperty(fn, "length", { + get: /* @__PURE__ */ __name(function() { + if (isChainable) { + throw Error( + "Invalid Chai property: " + assertionName + '.length. Due to a compatibility issue, "length" cannot directly follow "' + assertionName + '". Use "' + assertionName + '.lengthOf" instead.' + ); + } + throw Error( + "Invalid Chai property: " + assertionName + '.length. See docs for proper usage of "' + assertionName + '".' + ); + }, "get") + }); + return fn; +} +__name(addLengthGuard, "addLengthGuard"); + +// lib/chai/utils/getProperties.js +function getProperties(object) { + let result = Object.getOwnPropertyNames(object); + function addProperty2(property) { + if (result.indexOf(property) === -1) { + result.push(property); + } + } + __name(addProperty2, "addProperty"); + let proto = Object.getPrototypeOf(object); + while (proto !== null) { + Object.getOwnPropertyNames(proto).forEach(addProperty2); + proto = Object.getPrototypeOf(proto); + } + return result; +} +__name(getProperties, "getProperties"); + +// lib/chai/utils/proxify.js +var builtins = ["__flags", "__methods", "_obj", "assert"]; +function proxify(obj, nonChainableMethodName) { + if (!isProxyEnabled()) return obj; + return new Proxy(obj, { + get: /* @__PURE__ */ __name(function proxyGetter(target, property) { + if (typeof property === "string" && config.proxyExcludedKeys.indexOf(property) === -1 && !Reflect.has(target, property)) { + if (nonChainableMethodName) { + throw Error( + "Invalid Chai property: " + nonChainableMethodName + "." + property + '. See docs for proper usage of "' + nonChainableMethodName + '".' + ); + } + let suggestion = null; + let suggestionDistance = 4; + getProperties(target).forEach(function(prop) { + if ( + // we actually mean to check `Object.prototype` here + // eslint-disable-next-line no-prototype-builtins + !Object.prototype.hasOwnProperty(prop) && builtins.indexOf(prop) === -1 + ) { + let dist = stringDistanceCapped(property, prop, suggestionDistance); + if (dist < suggestionDistance) { + suggestion = prop; + suggestionDistance = dist; + } + } + }); + if (suggestion !== null) { + throw Error( + "Invalid Chai property: " + property + '. Did you mean "' + suggestion + '"?' + ); + } else { + throw Error("Invalid Chai property: " + property); + } + } + if (builtins.indexOf(property) === -1 && !flag(target, "lockSsfi")) { + flag(target, "ssfi", proxyGetter); + } + return Reflect.get(target, property); + }, "proxyGetter") + }); +} +__name(proxify, "proxify"); +function stringDistanceCapped(strA, strB, cap) { + if (Math.abs(strA.length - strB.length) >= cap) { + return cap; + } + let memo = []; + for (let i = 0; i <= strA.length; i++) { + memo[i] = Array(strB.length + 1).fill(0); + memo[i][0] = i; + } + for (let j = 0; j < strB.length; j++) { + memo[0][j] = j; + } + for (let i = 1; i <= strA.length; i++) { + let ch = strA.charCodeAt(i - 1); + for (let j = 1; j <= strB.length; j++) { + if (Math.abs(i - j) >= cap) { + memo[i][j] = cap; + continue; + } + memo[i][j] = Math.min( + memo[i - 1][j] + 1, + memo[i][j - 1] + 1, + memo[i - 1][j - 1] + (ch === strB.charCodeAt(j - 1) ? 0 : 1) + ); + } + } + return memo[strA.length][strB.length]; +} +__name(stringDistanceCapped, "stringDistanceCapped"); + +// lib/chai/utils/addMethod.js +function addMethod(ctx, name, method) { + let methodWrapper = /* @__PURE__ */ __name(function() { + if (!flag(this, "lockSsfi")) { + flag(this, "ssfi", methodWrapper); + } + let result = method.apply(this, arguments); + if (result !== void 0) return result; + let newAssertion = new Assertion(); + transferFlags(this, newAssertion); + return newAssertion; + }, "methodWrapper"); + addLengthGuard(methodWrapper, name, false); + ctx[name] = proxify(methodWrapper, name); + events.dispatchEvent(new PluginEvent("addMethod", name, method)); +} +__name(addMethod, "addMethod"); + +// lib/chai/utils/overwriteProperty.js +function overwriteProperty(ctx, name, getter) { + let _get = Object.getOwnPropertyDescriptor(ctx, name), _super = /* @__PURE__ */ __name(function() { + }, "_super"); + if (_get && "function" === typeof _get.get) _super = _get.get; + Object.defineProperty(ctx, name, { + get: /* @__PURE__ */ __name(function overwritingPropertyGetter() { + if (!isProxyEnabled() && !flag(this, "lockSsfi")) { + flag(this, "ssfi", overwritingPropertyGetter); + } + let origLockSsfi = flag(this, "lockSsfi"); + flag(this, "lockSsfi", true); + let result = getter(_super).call(this); + flag(this, "lockSsfi", origLockSsfi); + if (result !== void 0) { + return result; + } + let newAssertion = new Assertion(); + transferFlags(this, newAssertion); + return newAssertion; + }, "overwritingPropertyGetter"), + configurable: true + }); +} +__name(overwriteProperty, "overwriteProperty"); + +// lib/chai/utils/overwriteMethod.js +function overwriteMethod(ctx, name, method) { + let _method = ctx[name], _super = /* @__PURE__ */ __name(function() { + throw new Error(name + " is not a function"); + }, "_super"); + if (_method && "function" === typeof _method) _super = _method; + let overwritingMethodWrapper = /* @__PURE__ */ __name(function() { + if (!flag(this, "lockSsfi")) { + flag(this, "ssfi", overwritingMethodWrapper); + } + let origLockSsfi = flag(this, "lockSsfi"); + flag(this, "lockSsfi", true); + let result = method(_super).apply(this, arguments); + flag(this, "lockSsfi", origLockSsfi); + if (result !== void 0) { + return result; + } + let newAssertion = new Assertion(); + transferFlags(this, newAssertion); + return newAssertion; + }, "overwritingMethodWrapper"); + addLengthGuard(overwritingMethodWrapper, name, false); + ctx[name] = proxify(overwritingMethodWrapper, name); +} +__name(overwriteMethod, "overwriteMethod"); + +// lib/chai/utils/addChainableMethod.js +var canSetPrototype = typeof Object.setPrototypeOf === "function"; +var testFn = /* @__PURE__ */ __name(function() { +}, "testFn"); +var excludeNames = Object.getOwnPropertyNames(testFn).filter(function(name) { + let propDesc = Object.getOwnPropertyDescriptor(testFn, name); + if (typeof propDesc !== "object") return true; + return !propDesc.configurable; +}); +var call = Function.prototype.call; +var apply = Function.prototype.apply; +var _PluginAddChainableMethodEvent = class _PluginAddChainableMethodEvent extends PluginEvent { + constructor(type3, name, fn, chainingBehavior) { + super(type3, name, fn); + this.chainingBehavior = chainingBehavior; + } +}; +__name(_PluginAddChainableMethodEvent, "PluginAddChainableMethodEvent"); +var PluginAddChainableMethodEvent = _PluginAddChainableMethodEvent; +function addChainableMethod(ctx, name, method, chainingBehavior) { + if (typeof chainingBehavior !== "function") { + chainingBehavior = /* @__PURE__ */ __name(function() { + }, "chainingBehavior"); + } + let chainableBehavior = { + method, + chainingBehavior + }; + if (!ctx.__methods) { + ctx.__methods = {}; + } + ctx.__methods[name] = chainableBehavior; + Object.defineProperty(ctx, name, { + get: /* @__PURE__ */ __name(function chainableMethodGetter() { + chainableBehavior.chainingBehavior.call(this); + let chainableMethodWrapper = /* @__PURE__ */ __name(function() { + if (!flag(this, "lockSsfi")) { + flag(this, "ssfi", chainableMethodWrapper); + } + let result = chainableBehavior.method.apply(this, arguments); + if (result !== void 0) { + return result; + } + let newAssertion = new Assertion(); + transferFlags(this, newAssertion); + return newAssertion; + }, "chainableMethodWrapper"); + addLengthGuard(chainableMethodWrapper, name, true); + if (canSetPrototype) { + let prototype = Object.create(this); + prototype.call = call; + prototype.apply = apply; + Object.setPrototypeOf(chainableMethodWrapper, prototype); + } else { + let asserterNames = Object.getOwnPropertyNames(ctx); + asserterNames.forEach(function(asserterName) { + if (excludeNames.indexOf(asserterName) !== -1) { + return; + } + let pd = Object.getOwnPropertyDescriptor(ctx, asserterName); + Object.defineProperty(chainableMethodWrapper, asserterName, pd); + }); + } + transferFlags(this, chainableMethodWrapper); + return proxify(chainableMethodWrapper); + }, "chainableMethodGetter"), + configurable: true + }); + events.dispatchEvent( + new PluginAddChainableMethodEvent( + "addChainableMethod", + name, + method, + chainingBehavior + ) + ); +} +__name(addChainableMethod, "addChainableMethod"); + +// lib/chai/utils/overwriteChainableMethod.js +function overwriteChainableMethod(ctx, name, method, chainingBehavior) { + let chainableBehavior = ctx.__methods[name]; + let _chainingBehavior = chainableBehavior.chainingBehavior; + chainableBehavior.chainingBehavior = /* @__PURE__ */ __name(function overwritingChainableMethodGetter() { + let result = chainingBehavior(_chainingBehavior).call(this); + if (result !== void 0) { + return result; + } + let newAssertion = new Assertion(); + transferFlags(this, newAssertion); + return newAssertion; + }, "overwritingChainableMethodGetter"); + let _method = chainableBehavior.method; + chainableBehavior.method = /* @__PURE__ */ __name(function overwritingChainableMethodWrapper() { + let result = method(_method).apply(this, arguments); + if (result !== void 0) { + return result; + } + let newAssertion = new Assertion(); + transferFlags(this, newAssertion); + return newAssertion; + }, "overwritingChainableMethodWrapper"); +} +__name(overwriteChainableMethod, "overwriteChainableMethod"); + +// lib/chai/utils/compareByInspect.js +function compareByInspect(a, b) { + return inspect2(a) < inspect2(b) ? -1 : 1; +} +__name(compareByInspect, "compareByInspect"); + +// lib/chai/utils/getOwnEnumerablePropertySymbols.js +function getOwnEnumerablePropertySymbols(obj) { + if (typeof Object.getOwnPropertySymbols !== "function") return []; + return Object.getOwnPropertySymbols(obj).filter(function(sym) { + return Object.getOwnPropertyDescriptor(obj, sym).enumerable; + }); +} +__name(getOwnEnumerablePropertySymbols, "getOwnEnumerablePropertySymbols"); + +// lib/chai/utils/getOwnEnumerableProperties.js +function getOwnEnumerableProperties(obj) { + return Object.keys(obj).concat(getOwnEnumerablePropertySymbols(obj)); +} +__name(getOwnEnumerableProperties, "getOwnEnumerableProperties"); + +// lib/chai/utils/isNaN.js +var isNaN2 = Number.isNaN; + +// lib/chai/utils/getOperator.js +function isObjectType(obj) { + let objectType = type(obj); + let objectTypes = ["Array", "Object", "Function"]; + return objectTypes.indexOf(objectType) !== -1; +} +__name(isObjectType, "isObjectType"); +function getOperator(obj, args) { + let operator = flag(obj, "operator"); + let negate = flag(obj, "negate"); + let expected = args[3]; + let msg = negate ? args[2] : args[1]; + if (operator) { + return operator; + } + if (typeof msg === "function") msg = msg(); + msg = msg || ""; + if (!msg) { + return void 0; + } + if (/\shave\s/.test(msg)) { + return void 0; + } + let isObject = isObjectType(expected); + if (/\snot\s/.test(msg)) { + return isObject ? "notDeepStrictEqual" : "notStrictEqual"; + } + return isObject ? "deepStrictEqual" : "strictEqual"; +} +__name(getOperator, "getOperator"); + +// lib/chai/utils/index.js +function getName(fn) { + return fn.name; +} +__name(getName, "getName"); +function isRegExp2(obj) { + return Object.prototype.toString.call(obj) === "[object RegExp]"; +} +__name(isRegExp2, "isRegExp"); +function isNumeric(obj) { + return ["Number", "BigInt"].includes(type(obj)); +} +__name(isNumeric, "isNumeric"); + +// lib/chai/core/assertions.js +var { flag: flag2 } = utils_exports; +[ + "to", + "be", + "been", + "is", + "and", + "has", + "have", + "with", + "that", + "which", + "at", + "of", + "same", + "but", + "does", + "still", + "also" +].forEach(function(chain) { + Assertion.addProperty(chain); +}); +Assertion.addProperty("not", function() { + flag2(this, "negate", true); +}); +Assertion.addProperty("deep", function() { + flag2(this, "deep", true); +}); +Assertion.addProperty("nested", function() { + flag2(this, "nested", true); +}); +Assertion.addProperty("own", function() { + flag2(this, "own", true); +}); +Assertion.addProperty("ordered", function() { + flag2(this, "ordered", true); +}); +Assertion.addProperty("any", function() { + flag2(this, "any", true); + flag2(this, "all", false); +}); +Assertion.addProperty("all", function() { + flag2(this, "all", true); + flag2(this, "any", false); +}); +var functionTypes = { + function: [ + "function", + "asyncfunction", + "generatorfunction", + "asyncgeneratorfunction" + ], + asyncfunction: ["asyncfunction", "asyncgeneratorfunction"], + generatorfunction: ["generatorfunction", "asyncgeneratorfunction"], + asyncgeneratorfunction: ["asyncgeneratorfunction"] +}; +function an(type3, msg) { + if (msg) flag2(this, "message", msg); + type3 = type3.toLowerCase(); + let obj = flag2(this, "object"), article = ~["a", "e", "i", "o", "u"].indexOf(type3.charAt(0)) ? "an " : "a "; + const detectedType = type(obj).toLowerCase(); + if (functionTypes["function"].includes(type3)) { + this.assert( + functionTypes[type3].includes(detectedType), + "expected #{this} to be " + article + type3, + "expected #{this} not to be " + article + type3 + ); + } else { + this.assert( + type3 === detectedType, + "expected #{this} to be " + article + type3, + "expected #{this} not to be " + article + type3 + ); + } +} +__name(an, "an"); +Assertion.addChainableMethod("an", an); +Assertion.addChainableMethod("a", an); +function SameValueZero(a, b) { + return isNaN2(a) && isNaN2(b) || a === b; +} +__name(SameValueZero, "SameValueZero"); +function includeChainingBehavior() { + flag2(this, "contains", true); +} +__name(includeChainingBehavior, "includeChainingBehavior"); +function include(val, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"), objType = type(obj).toLowerCase(), flagMsg = flag2(this, "message"), negate = flag2(this, "negate"), ssfi = flag2(this, "ssfi"), isDeep = flag2(this, "deep"), descriptor = isDeep ? "deep " : "", isEql = isDeep ? flag2(this, "eql") : SameValueZero; + flagMsg = flagMsg ? flagMsg + ": " : ""; + let included = false; + switch (objType) { + case "string": + included = obj.indexOf(val) !== -1; + break; + case "weakset": + if (isDeep) { + throw new AssertionError( + flagMsg + "unable to use .deep.include with WeakSet", + void 0, + ssfi + ); + } + included = obj.has(val); + break; + case "map": + obj.forEach(function(item) { + included = included || isEql(item, val); + }); + break; + case "set": + if (isDeep) { + obj.forEach(function(item) { + included = included || isEql(item, val); + }); + } else { + included = obj.has(val); + } + break; + case "array": + if (isDeep) { + included = obj.some(function(item) { + return isEql(item, val); + }); + } else { + included = obj.indexOf(val) !== -1; + } + break; + default: { + if (val !== Object(val)) { + throw new AssertionError( + flagMsg + "the given combination of arguments (" + objType + " and " + type(val).toLowerCase() + ") is invalid for this assertion. You can use an array, a map, an object, a set, a string, or a weakset instead of a " + type(val).toLowerCase(), + void 0, + ssfi + ); + } + let props = Object.keys(val); + let firstErr = null; + let numErrs = 0; + props.forEach(function(prop) { + let propAssertion = new Assertion(obj); + transferFlags(this, propAssertion, true); + flag2(propAssertion, "lockSsfi", true); + if (!negate || props.length === 1) { + propAssertion.property(prop, val[prop]); + return; + } + try { + propAssertion.property(prop, val[prop]); + } catch (err) { + if (!check_error_exports.compatibleConstructor(err, AssertionError)) { + throw err; + } + if (firstErr === null) firstErr = err; + numErrs++; + } + }, this); + if (negate && props.length > 1 && numErrs === props.length) { + throw firstErr; + } + return; + } + } + this.assert( + included, + "expected #{this} to " + descriptor + "include " + inspect2(val), + "expected #{this} to not " + descriptor + "include " + inspect2(val) + ); +} +__name(include, "include"); +Assertion.addChainableMethod("include", include, includeChainingBehavior); +Assertion.addChainableMethod("contain", include, includeChainingBehavior); +Assertion.addChainableMethod("contains", include, includeChainingBehavior); +Assertion.addChainableMethod("includes", include, includeChainingBehavior); +Assertion.addProperty("ok", function() { + this.assert( + flag2(this, "object"), + "expected #{this} to be truthy", + "expected #{this} to be falsy" + ); +}); +Assertion.addProperty("true", function() { + this.assert( + true === flag2(this, "object"), + "expected #{this} to be true", + "expected #{this} to be false", + flag2(this, "negate") ? false : true + ); +}); +Assertion.addProperty("numeric", function() { + const object = flag2(this, "object"); + this.assert( + ["Number", "BigInt"].includes(type(object)), + "expected #{this} to be numeric", + "expected #{this} to not be numeric", + flag2(this, "negate") ? false : true + ); +}); +Assertion.addProperty("callable", function() { + const val = flag2(this, "object"); + const ssfi = flag2(this, "ssfi"); + const message = flag2(this, "message"); + const msg = message ? `${message}: ` : ""; + const negate = flag2(this, "negate"); + const assertionMessage = negate ? `${msg}expected ${inspect2(val)} not to be a callable function` : `${msg}expected ${inspect2(val)} to be a callable function`; + const isCallable = [ + "Function", + "AsyncFunction", + "GeneratorFunction", + "AsyncGeneratorFunction" + ].includes(type(val)); + if (isCallable && negate || !isCallable && !negate) { + throw new AssertionError(assertionMessage, void 0, ssfi); + } +}); +Assertion.addProperty("false", function() { + this.assert( + false === flag2(this, "object"), + "expected #{this} to be false", + "expected #{this} to be true", + flag2(this, "negate") ? true : false + ); +}); +Assertion.addProperty("null", function() { + this.assert( + null === flag2(this, "object"), + "expected #{this} to be null", + "expected #{this} not to be null" + ); +}); +Assertion.addProperty("undefined", function() { + this.assert( + void 0 === flag2(this, "object"), + "expected #{this} to be undefined", + "expected #{this} not to be undefined" + ); +}); +Assertion.addProperty("NaN", function() { + this.assert( + isNaN2(flag2(this, "object")), + "expected #{this} to be NaN", + "expected #{this} not to be NaN" + ); +}); +function assertExist() { + let val = flag2(this, "object"); + this.assert( + val !== null && val !== void 0, + "expected #{this} to exist", + "expected #{this} to not exist" + ); +} +__name(assertExist, "assertExist"); +Assertion.addProperty("exist", assertExist); +Assertion.addProperty("exists", assertExist); +Assertion.addProperty("empty", function() { + let val = flag2(this, "object"), ssfi = flag2(this, "ssfi"), flagMsg = flag2(this, "message"), itemsCount; + flagMsg = flagMsg ? flagMsg + ": " : ""; + switch (type(val).toLowerCase()) { + case "array": + case "string": + itemsCount = val.length; + break; + case "map": + case "set": + itemsCount = val.size; + break; + case "weakmap": + case "weakset": + throw new AssertionError( + flagMsg + ".empty was passed a weak collection", + void 0, + ssfi + ); + case "function": { + const msg = flagMsg + ".empty was passed a function " + getName(val); + throw new AssertionError(msg.trim(), void 0, ssfi); + } + default: + if (val !== Object(val)) { + throw new AssertionError( + flagMsg + ".empty was passed non-string primitive " + inspect2(val), + void 0, + ssfi + ); + } + itemsCount = Object.keys(val).length; + } + this.assert( + 0 === itemsCount, + "expected #{this} to be empty", + "expected #{this} not to be empty" + ); +}); +function checkArguments() { + let obj = flag2(this, "object"), type3 = type(obj); + this.assert( + "Arguments" === type3, + "expected #{this} to be arguments but got " + type3, + "expected #{this} to not be arguments" + ); +} +__name(checkArguments, "checkArguments"); +Assertion.addProperty("arguments", checkArguments); +Assertion.addProperty("Arguments", checkArguments); +function assertEqual(val, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"); + if (flag2(this, "deep")) { + let prevLockSsfi = flag2(this, "lockSsfi"); + flag2(this, "lockSsfi", true); + this.eql(val); + flag2(this, "lockSsfi", prevLockSsfi); + } else { + this.assert( + val === obj, + "expected #{this} to equal #{exp}", + "expected #{this} to not equal #{exp}", + val, + this._obj, + true + ); + } +} +__name(assertEqual, "assertEqual"); +Assertion.addMethod("equal", assertEqual); +Assertion.addMethod("equals", assertEqual); +Assertion.addMethod("eq", assertEqual); +function assertEql(obj, msg) { + if (msg) flag2(this, "message", msg); + let eql = flag2(this, "eql"); + this.assert( + eql(obj, flag2(this, "object")), + "expected #{this} to deeply equal #{exp}", + "expected #{this} to not deeply equal #{exp}", + obj, + this._obj, + true + ); +} +__name(assertEql, "assertEql"); +Assertion.addMethod("eql", assertEql); +Assertion.addMethod("eqls", assertEql); +function assertAbove(n, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(); + if (doLength && objType !== "map" && objType !== "set") { + new Assertion(obj, flagMsg, ssfi, true).to.have.property("length"); + } + if (!doLength && objType === "date" && nType !== "date") { + throw new AssertionError( + msgPrefix + "the argument to above must be a date", + void 0, + ssfi + ); + } else if (!isNumeric(n) && (doLength || isNumeric(obj))) { + throw new AssertionError( + msgPrefix + "the argument to above must be a number", + void 0, + ssfi + ); + } else if (!doLength && objType !== "date" && !isNumeric(obj)) { + let printObj = objType === "string" ? "'" + obj + "'" : obj; + throw new AssertionError( + msgPrefix + "expected " + printObj + " to be a number or a date", + void 0, + ssfi + ); + } + if (doLength) { + let descriptor = "length", itemsCount; + if (objType === "map" || objType === "set") { + descriptor = "size"; + itemsCount = obj.size; + } else { + itemsCount = obj.length; + } + this.assert( + itemsCount > n, + "expected #{this} to have a " + descriptor + " above #{exp} but got #{act}", + "expected #{this} to not have a " + descriptor + " above #{exp}", + n, + itemsCount + ); + } else { + this.assert( + obj > n, + "expected #{this} to be above #{exp}", + "expected #{this} to be at most #{exp}", + n + ); + } +} +__name(assertAbove, "assertAbove"); +Assertion.addMethod("above", assertAbove); +Assertion.addMethod("gt", assertAbove); +Assertion.addMethod("greaterThan", assertAbove); +function assertLeast(n, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(), errorMessage, shouldThrow = true; + if (doLength && objType !== "map" && objType !== "set") { + new Assertion(obj, flagMsg, ssfi, true).to.have.property("length"); + } + if (!doLength && objType === "date" && nType !== "date") { + errorMessage = msgPrefix + "the argument to least must be a date"; + } else if (!isNumeric(n) && (doLength || isNumeric(obj))) { + errorMessage = msgPrefix + "the argument to least must be a number"; + } else if (!doLength && objType !== "date" && !isNumeric(obj)) { + let printObj = objType === "string" ? "'" + obj + "'" : obj; + errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; + } else { + shouldThrow = false; + } + if (shouldThrow) { + throw new AssertionError(errorMessage, void 0, ssfi); + } + if (doLength) { + let descriptor = "length", itemsCount; + if (objType === "map" || objType === "set") { + descriptor = "size"; + itemsCount = obj.size; + } else { + itemsCount = obj.length; + } + this.assert( + itemsCount >= n, + "expected #{this} to have a " + descriptor + " at least #{exp} but got #{act}", + "expected #{this} to have a " + descriptor + " below #{exp}", + n, + itemsCount + ); + } else { + this.assert( + obj >= n, + "expected #{this} to be at least #{exp}", + "expected #{this} to be below #{exp}", + n + ); + } +} +__name(assertLeast, "assertLeast"); +Assertion.addMethod("least", assertLeast); +Assertion.addMethod("gte", assertLeast); +Assertion.addMethod("greaterThanOrEqual", assertLeast); +function assertBelow(n, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(), errorMessage, shouldThrow = true; + if (doLength && objType !== "map" && objType !== "set") { + new Assertion(obj, flagMsg, ssfi, true).to.have.property("length"); + } + if (!doLength && objType === "date" && nType !== "date") { + errorMessage = msgPrefix + "the argument to below must be a date"; + } else if (!isNumeric(n) && (doLength || isNumeric(obj))) { + errorMessage = msgPrefix + "the argument to below must be a number"; + } else if (!doLength && objType !== "date" && !isNumeric(obj)) { + let printObj = objType === "string" ? "'" + obj + "'" : obj; + errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; + } else { + shouldThrow = false; + } + if (shouldThrow) { + throw new AssertionError(errorMessage, void 0, ssfi); + } + if (doLength) { + let descriptor = "length", itemsCount; + if (objType === "map" || objType === "set") { + descriptor = "size"; + itemsCount = obj.size; + } else { + itemsCount = obj.length; + } + this.assert( + itemsCount < n, + "expected #{this} to have a " + descriptor + " below #{exp} but got #{act}", + "expected #{this} to not have a " + descriptor + " below #{exp}", + n, + itemsCount + ); + } else { + this.assert( + obj < n, + "expected #{this} to be below #{exp}", + "expected #{this} to be at least #{exp}", + n + ); + } +} +__name(assertBelow, "assertBelow"); +Assertion.addMethod("below", assertBelow); +Assertion.addMethod("lt", assertBelow); +Assertion.addMethod("lessThan", assertBelow); +function assertMost(n, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), nType = type(n).toLowerCase(), errorMessage, shouldThrow = true; + if (doLength && objType !== "map" && objType !== "set") { + new Assertion(obj, flagMsg, ssfi, true).to.have.property("length"); + } + if (!doLength && objType === "date" && nType !== "date") { + errorMessage = msgPrefix + "the argument to most must be a date"; + } else if (!isNumeric(n) && (doLength || isNumeric(obj))) { + errorMessage = msgPrefix + "the argument to most must be a number"; + } else if (!doLength && objType !== "date" && !isNumeric(obj)) { + let printObj = objType === "string" ? "'" + obj + "'" : obj; + errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; + } else { + shouldThrow = false; + } + if (shouldThrow) { + throw new AssertionError(errorMessage, void 0, ssfi); + } + if (doLength) { + let descriptor = "length", itemsCount; + if (objType === "map" || objType === "set") { + descriptor = "size"; + itemsCount = obj.size; + } else { + itemsCount = obj.length; + } + this.assert( + itemsCount <= n, + "expected #{this} to have a " + descriptor + " at most #{exp} but got #{act}", + "expected #{this} to have a " + descriptor + " above #{exp}", + n, + itemsCount + ); + } else { + this.assert( + obj <= n, + "expected #{this} to be at most #{exp}", + "expected #{this} to be above #{exp}", + n + ); + } +} +__name(assertMost, "assertMost"); +Assertion.addMethod("most", assertMost); +Assertion.addMethod("lte", assertMost); +Assertion.addMethod("lessThanOrEqual", assertMost); +Assertion.addMethod("within", function(start, finish, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"), doLength = flag2(this, "doLength"), flagMsg = flag2(this, "message"), msgPrefix = flagMsg ? flagMsg + ": " : "", ssfi = flag2(this, "ssfi"), objType = type(obj).toLowerCase(), startType = type(start).toLowerCase(), finishType = type(finish).toLowerCase(), errorMessage, shouldThrow = true, range = startType === "date" && finishType === "date" ? start.toISOString() + ".." + finish.toISOString() : start + ".." + finish; + if (doLength && objType !== "map" && objType !== "set") { + new Assertion(obj, flagMsg, ssfi, true).to.have.property("length"); + } + if (!doLength && objType === "date" && (startType !== "date" || finishType !== "date")) { + errorMessage = msgPrefix + "the arguments to within must be dates"; + } else if ((!isNumeric(start) || !isNumeric(finish)) && (doLength || isNumeric(obj))) { + errorMessage = msgPrefix + "the arguments to within must be numbers"; + } else if (!doLength && objType !== "date" && !isNumeric(obj)) { + let printObj = objType === "string" ? "'" + obj + "'" : obj; + errorMessage = msgPrefix + "expected " + printObj + " to be a number or a date"; + } else { + shouldThrow = false; + } + if (shouldThrow) { + throw new AssertionError(errorMessage, void 0, ssfi); + } + if (doLength) { + let descriptor = "length", itemsCount; + if (objType === "map" || objType === "set") { + descriptor = "size"; + itemsCount = obj.size; + } else { + itemsCount = obj.length; + } + this.assert( + itemsCount >= start && itemsCount <= finish, + "expected #{this} to have a " + descriptor + " within " + range, + "expected #{this} to not have a " + descriptor + " within " + range + ); + } else { + this.assert( + obj >= start && obj <= finish, + "expected #{this} to be within " + range, + "expected #{this} to not be within " + range + ); + } +}); +function assertInstanceOf(constructor, msg) { + if (msg) flag2(this, "message", msg); + let target = flag2(this, "object"); + let ssfi = flag2(this, "ssfi"); + let flagMsg = flag2(this, "message"); + let isInstanceOf; + try { + isInstanceOf = target instanceof constructor; + } catch (err) { + if (err instanceof TypeError) { + flagMsg = flagMsg ? flagMsg + ": " : ""; + throw new AssertionError( + flagMsg + "The instanceof assertion needs a constructor but " + type(constructor) + " was given.", + void 0, + ssfi + ); + } + throw err; + } + let name = getName(constructor); + if (name == null) { + name = "an unnamed constructor"; + } + this.assert( + isInstanceOf, + "expected #{this} to be an instance of " + name, + "expected #{this} to not be an instance of " + name + ); +} +__name(assertInstanceOf, "assertInstanceOf"); +Assertion.addMethod("instanceof", assertInstanceOf); +Assertion.addMethod("instanceOf", assertInstanceOf); +function assertProperty(name, val, msg) { + if (msg) flag2(this, "message", msg); + let isNested = flag2(this, "nested"), isOwn = flag2(this, "own"), flagMsg = flag2(this, "message"), obj = flag2(this, "object"), ssfi = flag2(this, "ssfi"), nameType = typeof name; + flagMsg = flagMsg ? flagMsg + ": " : ""; + if (isNested) { + if (nameType !== "string") { + throw new AssertionError( + flagMsg + "the argument to property must be a string when using nested syntax", + void 0, + ssfi + ); + } + } else { + if (nameType !== "string" && nameType !== "number" && nameType !== "symbol") { + throw new AssertionError( + flagMsg + "the argument to property must be a string, number, or symbol", + void 0, + ssfi + ); + } + } + if (isNested && isOwn) { + throw new AssertionError( + flagMsg + 'The "nested" and "own" flags cannot be combined.', + void 0, + ssfi + ); + } + if (obj === null || obj === void 0) { + throw new AssertionError( + flagMsg + "Target cannot be null or undefined.", + void 0, + ssfi + ); + } + let isDeep = flag2(this, "deep"), negate = flag2(this, "negate"), pathInfo = isNested ? getPathInfo(obj, name) : null, value = isNested ? pathInfo.value : obj[name], isEql = isDeep ? flag2(this, "eql") : (val1, val2) => val1 === val2; + let descriptor = ""; + if (isDeep) descriptor += "deep "; + if (isOwn) descriptor += "own "; + if (isNested) descriptor += "nested "; + descriptor += "property "; + let hasProperty2; + if (isOwn) hasProperty2 = Object.prototype.hasOwnProperty.call(obj, name); + else if (isNested) hasProperty2 = pathInfo.exists; + else hasProperty2 = hasProperty(obj, name); + if (!negate || arguments.length === 1) { + this.assert( + hasProperty2, + "expected #{this} to have " + descriptor + inspect2(name), + "expected #{this} to not have " + descriptor + inspect2(name) + ); + } + if (arguments.length > 1) { + this.assert( + hasProperty2 && isEql(val, value), + "expected #{this} to have " + descriptor + inspect2(name) + " of #{exp}, but got #{act}", + "expected #{this} to not have " + descriptor + inspect2(name) + " of #{act}", + val, + value + ); + } + flag2(this, "object", value); +} +__name(assertProperty, "assertProperty"); +Assertion.addMethod("property", assertProperty); +function assertOwnProperty(_name, _value, _msg) { + flag2(this, "own", true); + assertProperty.apply(this, arguments); +} +__name(assertOwnProperty, "assertOwnProperty"); +Assertion.addMethod("ownProperty", assertOwnProperty); +Assertion.addMethod("haveOwnProperty", assertOwnProperty); +function assertOwnPropertyDescriptor(name, descriptor, msg) { + if (typeof descriptor === "string") { + msg = descriptor; + descriptor = null; + } + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"); + let actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name); + let eql = flag2(this, "eql"); + if (actualDescriptor && descriptor) { + this.assert( + eql(descriptor, actualDescriptor), + "expected the own property descriptor for " + inspect2(name) + " on #{this} to match " + inspect2(descriptor) + ", got " + inspect2(actualDescriptor), + "expected the own property descriptor for " + inspect2(name) + " on #{this} to not match " + inspect2(descriptor), + descriptor, + actualDescriptor, + true + ); + } else { + this.assert( + actualDescriptor, + "expected #{this} to have an own property descriptor for " + inspect2(name), + "expected #{this} to not have an own property descriptor for " + inspect2(name) + ); + } + flag2(this, "object", actualDescriptor); +} +__name(assertOwnPropertyDescriptor, "assertOwnPropertyDescriptor"); +Assertion.addMethod("ownPropertyDescriptor", assertOwnPropertyDescriptor); +Assertion.addMethod("haveOwnPropertyDescriptor", assertOwnPropertyDescriptor); +function assertLengthChain() { + flag2(this, "doLength", true); +} +__name(assertLengthChain, "assertLengthChain"); +function assertLength(n, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"), objType = type(obj).toLowerCase(), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"), descriptor = "length", itemsCount; + switch (objType) { + case "map": + case "set": + descriptor = "size"; + itemsCount = obj.size; + break; + default: + new Assertion(obj, flagMsg, ssfi, true).to.have.property("length"); + itemsCount = obj.length; + } + this.assert( + itemsCount == n, + "expected #{this} to have a " + descriptor + " of #{exp} but got #{act}", + "expected #{this} to not have a " + descriptor + " of #{act}", + n, + itemsCount + ); +} +__name(assertLength, "assertLength"); +Assertion.addChainableMethod("length", assertLength, assertLengthChain); +Assertion.addChainableMethod("lengthOf", assertLength, assertLengthChain); +function assertMatch(re, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"); + this.assert( + re.exec(obj), + "expected #{this} to match " + re, + "expected #{this} not to match " + re + ); +} +__name(assertMatch, "assertMatch"); +Assertion.addMethod("match", assertMatch); +Assertion.addMethod("matches", assertMatch); +Assertion.addMethod("string", function(str, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"); + new Assertion(obj, flagMsg, ssfi, true).is.a("string"); + this.assert( + ~obj.indexOf(str), + "expected #{this} to contain " + inspect2(str), + "expected #{this} to not contain " + inspect2(str) + ); +}); +function assertKeys(keys) { + let obj = flag2(this, "object"), objType = type(obj), keysType = type(keys), ssfi = flag2(this, "ssfi"), isDeep = flag2(this, "deep"), str, deepStr = "", actual, ok = true, flagMsg = flag2(this, "message"); + flagMsg = flagMsg ? flagMsg + ": " : ""; + let mixedArgsMsg = flagMsg + "when testing keys against an object or an array you must give a single Array|Object|String argument or multiple String arguments"; + if (objType === "Map" || objType === "Set") { + deepStr = isDeep ? "deeply " : ""; + actual = []; + obj.forEach(function(val, key) { + actual.push(key); + }); + if (keysType !== "Array") { + keys = Array.prototype.slice.call(arguments); + } + } else { + actual = getOwnEnumerableProperties(obj); + switch (keysType) { + case "Array": + if (arguments.length > 1) { + throw new AssertionError(mixedArgsMsg, void 0, ssfi); + } + break; + case "Object": + if (arguments.length > 1) { + throw new AssertionError(mixedArgsMsg, void 0, ssfi); + } + keys = Object.keys(keys); + break; + default: + keys = Array.prototype.slice.call(arguments); + } + keys = keys.map(function(val) { + return typeof val === "symbol" ? val : String(val); + }); + } + if (!keys.length) { + throw new AssertionError(flagMsg + "keys required", void 0, ssfi); + } + let len = keys.length, any = flag2(this, "any"), all = flag2(this, "all"), expected = keys, isEql = isDeep ? flag2(this, "eql") : (val1, val2) => val1 === val2; + if (!any && !all) { + all = true; + } + if (any) { + ok = expected.some(function(expectedKey) { + return actual.some(function(actualKey) { + return isEql(expectedKey, actualKey); + }); + }); + } + if (all) { + ok = expected.every(function(expectedKey) { + return actual.some(function(actualKey) { + return isEql(expectedKey, actualKey); + }); + }); + if (!flag2(this, "contains")) { + ok = ok && keys.length == actual.length; + } + } + if (len > 1) { + keys = keys.map(function(key) { + return inspect2(key); + }); + let last = keys.pop(); + if (all) { + str = keys.join(", ") + ", and " + last; + } + if (any) { + str = keys.join(", ") + ", or " + last; + } + } else { + str = inspect2(keys[0]); + } + str = (len > 1 ? "keys " : "key ") + str; + str = (flag2(this, "contains") ? "contain " : "have ") + str; + this.assert( + ok, + "expected #{this} to " + deepStr + str, + "expected #{this} to not " + deepStr + str, + expected.slice(0).sort(compareByInspect), + actual.sort(compareByInspect), + true + ); +} +__name(assertKeys, "assertKeys"); +Assertion.addMethod("keys", assertKeys); +Assertion.addMethod("key", assertKeys); +function assertThrows(errorLike, errMsgMatcher, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"), ssfi = flag2(this, "ssfi"), flagMsg = flag2(this, "message"), negate = flag2(this, "negate") || false; + new Assertion(obj, flagMsg, ssfi, true).is.a("function"); + if (isRegExp2(errorLike) || typeof errorLike === "string") { + errMsgMatcher = errorLike; + errorLike = null; + } + let caughtErr; + let errorWasThrown = false; + try { + obj(); + } catch (err) { + errorWasThrown = true; + caughtErr = err; + } + let everyArgIsUndefined = errorLike === void 0 && errMsgMatcher === void 0; + let everyArgIsDefined = Boolean(errorLike && errMsgMatcher); + let errorLikeFail = false; + let errMsgMatcherFail = false; + if (everyArgIsUndefined || !everyArgIsUndefined && !negate) { + let errorLikeString = "an error"; + if (errorLike instanceof Error) { + errorLikeString = "#{exp}"; + } else if (errorLike) { + errorLikeString = check_error_exports.getConstructorName(errorLike); + } + let actual = caughtErr; + if (caughtErr instanceof Error) { + actual = caughtErr.toString(); + } else if (typeof caughtErr === "string") { + actual = caughtErr; + } else if (caughtErr && (typeof caughtErr === "object" || typeof caughtErr === "function")) { + try { + actual = check_error_exports.getConstructorName(caughtErr); + } catch (_err) { + } + } + this.assert( + errorWasThrown, + "expected #{this} to throw " + errorLikeString, + "expected #{this} to not throw an error but #{act} was thrown", + errorLike && errorLike.toString(), + actual + ); + } + if (errorLike && caughtErr) { + if (errorLike instanceof Error) { + let isCompatibleInstance = check_error_exports.compatibleInstance( + caughtErr, + errorLike + ); + if (isCompatibleInstance === negate) { + if (everyArgIsDefined && negate) { + errorLikeFail = true; + } else { + this.assert( + negate, + "expected #{this} to throw #{exp} but #{act} was thrown", + "expected #{this} to not throw #{exp}" + (caughtErr && !negate ? " but #{act} was thrown" : ""), + errorLike.toString(), + caughtErr.toString() + ); + } + } + } + let isCompatibleConstructor = check_error_exports.compatibleConstructor( + caughtErr, + errorLike + ); + if (isCompatibleConstructor === negate) { + if (everyArgIsDefined && negate) { + errorLikeFail = true; + } else { + this.assert( + negate, + "expected #{this} to throw #{exp} but #{act} was thrown", + "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), + errorLike instanceof Error ? errorLike.toString() : errorLike && check_error_exports.getConstructorName(errorLike), + caughtErr instanceof Error ? caughtErr.toString() : caughtErr && check_error_exports.getConstructorName(caughtErr) + ); + } + } + } + if (caughtErr && errMsgMatcher !== void 0 && errMsgMatcher !== null) { + let placeholder = "including"; + if (isRegExp2(errMsgMatcher)) { + placeholder = "matching"; + } + let isCompatibleMessage = check_error_exports.compatibleMessage( + caughtErr, + errMsgMatcher + ); + if (isCompatibleMessage === negate) { + if (everyArgIsDefined && negate) { + errMsgMatcherFail = true; + } else { + this.assert( + negate, + "expected #{this} to throw error " + placeholder + " #{exp} but got #{act}", + "expected #{this} to throw error not " + placeholder + " #{exp}", + errMsgMatcher, + check_error_exports.getMessage(caughtErr) + ); + } + } + } + if (errorLikeFail && errMsgMatcherFail) { + this.assert( + negate, + "expected #{this} to throw #{exp} but #{act} was thrown", + "expected #{this} to not throw #{exp}" + (caughtErr ? " but #{act} was thrown" : ""), + errorLike instanceof Error ? errorLike.toString() : errorLike && check_error_exports.getConstructorName(errorLike), + caughtErr instanceof Error ? caughtErr.toString() : caughtErr && check_error_exports.getConstructorName(caughtErr) + ); + } + flag2(this, "object", caughtErr); +} +__name(assertThrows, "assertThrows"); +Assertion.addMethod("throw", assertThrows); +Assertion.addMethod("throws", assertThrows); +Assertion.addMethod("Throw", assertThrows); +function respondTo(method, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"), itself = flag2(this, "itself"), context = "function" === typeof obj && !itself ? obj.prototype[method] : obj[method]; + this.assert( + "function" === typeof context, + "expected #{this} to respond to " + inspect2(method), + "expected #{this} to not respond to " + inspect2(method) + ); +} +__name(respondTo, "respondTo"); +Assertion.addMethod("respondTo", respondTo); +Assertion.addMethod("respondsTo", respondTo); +Assertion.addProperty("itself", function() { + flag2(this, "itself", true); +}); +function satisfy(matcher, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"); + let result = matcher(obj); + this.assert( + result, + "expected #{this} to satisfy " + objDisplay(matcher), + "expected #{this} to not satisfy" + objDisplay(matcher), + flag2(this, "negate") ? false : true, + result + ); +} +__name(satisfy, "satisfy"); +Assertion.addMethod("satisfy", satisfy); +Assertion.addMethod("satisfies", satisfy); +function closeTo(expected, delta, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"); + new Assertion(obj, flagMsg, ssfi, true).is.numeric; + let message = "A `delta` value is required for `closeTo`"; + if (delta == void 0) { + throw new AssertionError( + flagMsg ? `${flagMsg}: ${message}` : message, + void 0, + ssfi + ); + } + new Assertion(delta, flagMsg, ssfi, true).is.numeric; + message = "A `expected` value is required for `closeTo`"; + if (expected == void 0) { + throw new AssertionError( + flagMsg ? `${flagMsg}: ${message}` : message, + void 0, + ssfi + ); + } + new Assertion(expected, flagMsg, ssfi, true).is.numeric; + const abs = /* @__PURE__ */ __name((x) => x < 0 ? -x : x, "abs"); + const strip = /* @__PURE__ */ __name((number) => parseFloat(parseFloat(number).toPrecision(12)), "strip"); + this.assert( + strip(abs(obj - expected)) <= delta, + "expected #{this} to be close to " + expected + " +/- " + delta, + "expected #{this} not to be close to " + expected + " +/- " + delta + ); +} +__name(closeTo, "closeTo"); +Assertion.addMethod("closeTo", closeTo); +Assertion.addMethod("approximately", closeTo); +function isSubsetOf(_subset, _superset, cmp, contains, ordered) { + let superset = Array.from(_superset); + let subset = Array.from(_subset); + if (!contains) { + if (subset.length !== superset.length) return false; + superset = superset.slice(); + } + return subset.every(function(elem, idx) { + if (ordered) return cmp ? cmp(elem, superset[idx]) : elem === superset[idx]; + if (!cmp) { + let matchIdx = superset.indexOf(elem); + if (matchIdx === -1) return false; + if (!contains) superset.splice(matchIdx, 1); + return true; + } + return superset.some(function(elem2, matchIdx) { + if (!cmp(elem, elem2)) return false; + if (!contains) superset.splice(matchIdx, 1); + return true; + }); + }); +} +__name(isSubsetOf, "isSubsetOf"); +Assertion.addMethod("members", function(subset, msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"); + new Assertion(obj, flagMsg, ssfi, true).to.be.iterable; + new Assertion(subset, flagMsg, ssfi, true).to.be.iterable; + let contains = flag2(this, "contains"); + let ordered = flag2(this, "ordered"); + let subject, failMsg, failNegateMsg; + if (contains) { + subject = ordered ? "an ordered superset" : "a superset"; + failMsg = "expected #{this} to be " + subject + " of #{exp}"; + failNegateMsg = "expected #{this} to not be " + subject + " of #{exp}"; + } else { + subject = ordered ? "ordered members" : "members"; + failMsg = "expected #{this} to have the same " + subject + " as #{exp}"; + failNegateMsg = "expected #{this} to not have the same " + subject + " as #{exp}"; + } + let cmp = flag2(this, "deep") ? flag2(this, "eql") : void 0; + this.assert( + isSubsetOf(subset, obj, cmp, contains, ordered), + failMsg, + failNegateMsg, + subset, + obj, + true + ); +}); +Assertion.addProperty("iterable", function(msg) { + if (msg) flag2(this, "message", msg); + let obj = flag2(this, "object"); + this.assert( + obj != void 0 && obj[Symbol.iterator], + "expected #{this} to be an iterable", + "expected #{this} to not be an iterable", + obj + ); +}); +function oneOf(list, msg) { + if (msg) flag2(this, "message", msg); + let expected = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"), contains = flag2(this, "contains"), isDeep = flag2(this, "deep"), eql = flag2(this, "eql"); + new Assertion(list, flagMsg, ssfi, true).to.be.an("array"); + if (contains) { + this.assert( + list.some(function(possibility) { + return expected.indexOf(possibility) > -1; + }), + "expected #{this} to contain one of #{exp}", + "expected #{this} to not contain one of #{exp}", + list, + expected + ); + } else { + if (isDeep) { + this.assert( + list.some(function(possibility) { + return eql(expected, possibility); + }), + "expected #{this} to deeply equal one of #{exp}", + "expected #{this} to deeply equal one of #{exp}", + list, + expected + ); + } else { + this.assert( + list.indexOf(expected) > -1, + "expected #{this} to be one of #{exp}", + "expected #{this} to not be one of #{exp}", + list, + expected + ); + } + } +} +__name(oneOf, "oneOf"); +Assertion.addMethod("oneOf", oneOf); +function assertChanges(subject, prop, msg) { + if (msg) flag2(this, "message", msg); + let fn = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"); + new Assertion(fn, flagMsg, ssfi, true).is.a("function"); + let initial; + if (!prop) { + new Assertion(subject, flagMsg, ssfi, true).is.a("function"); + initial = subject(); + } else { + new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop); + initial = subject[prop]; + } + fn(); + let final = prop === void 0 || prop === null ? subject() : subject[prop]; + let msgObj = prop === void 0 || prop === null ? initial : "." + prop; + flag2(this, "deltaMsgObj", msgObj); + flag2(this, "initialDeltaValue", initial); + flag2(this, "finalDeltaValue", final); + flag2(this, "deltaBehavior", "change"); + flag2(this, "realDelta", final !== initial); + this.assert( + initial !== final, + "expected " + msgObj + " to change", + "expected " + msgObj + " to not change" + ); +} +__name(assertChanges, "assertChanges"); +Assertion.addMethod("change", assertChanges); +Assertion.addMethod("changes", assertChanges); +function assertIncreases(subject, prop, msg) { + if (msg) flag2(this, "message", msg); + let fn = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"); + new Assertion(fn, flagMsg, ssfi, true).is.a("function"); + let initial; + if (!prop) { + new Assertion(subject, flagMsg, ssfi, true).is.a("function"); + initial = subject(); + } else { + new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop); + initial = subject[prop]; + } + new Assertion(initial, flagMsg, ssfi, true).is.a("number"); + fn(); + let final = prop === void 0 || prop === null ? subject() : subject[prop]; + let msgObj = prop === void 0 || prop === null ? initial : "." + prop; + flag2(this, "deltaMsgObj", msgObj); + flag2(this, "initialDeltaValue", initial); + flag2(this, "finalDeltaValue", final); + flag2(this, "deltaBehavior", "increase"); + flag2(this, "realDelta", final - initial); + this.assert( + final - initial > 0, + "expected " + msgObj + " to increase", + "expected " + msgObj + " to not increase" + ); +} +__name(assertIncreases, "assertIncreases"); +Assertion.addMethod("increase", assertIncreases); +Assertion.addMethod("increases", assertIncreases); +function assertDecreases(subject, prop, msg) { + if (msg) flag2(this, "message", msg); + let fn = flag2(this, "object"), flagMsg = flag2(this, "message"), ssfi = flag2(this, "ssfi"); + new Assertion(fn, flagMsg, ssfi, true).is.a("function"); + let initial; + if (!prop) { + new Assertion(subject, flagMsg, ssfi, true).is.a("function"); + initial = subject(); + } else { + new Assertion(subject, flagMsg, ssfi, true).to.have.property(prop); + initial = subject[prop]; + } + new Assertion(initial, flagMsg, ssfi, true).is.a("number"); + fn(); + let final = prop === void 0 || prop === null ? subject() : subject[prop]; + let msgObj = prop === void 0 || prop === null ? initial : "." + prop; + flag2(this, "deltaMsgObj", msgObj); + flag2(this, "initialDeltaValue", initial); + flag2(this, "finalDeltaValue", final); + flag2(this, "deltaBehavior", "decrease"); + flag2(this, "realDelta", initial - final); + this.assert( + final - initial < 0, + "expected " + msgObj + " to decrease", + "expected " + msgObj + " to not decrease" + ); +} +__name(assertDecreases, "assertDecreases"); +Assertion.addMethod("decrease", assertDecreases); +Assertion.addMethod("decreases", assertDecreases); +function assertDelta(delta, msg) { + if (msg) flag2(this, "message", msg); + let msgObj = flag2(this, "deltaMsgObj"); + let initial = flag2(this, "initialDeltaValue"); + let final = flag2(this, "finalDeltaValue"); + let behavior = flag2(this, "deltaBehavior"); + let realDelta = flag2(this, "realDelta"); + let expression; + if (behavior === "change") { + expression = Math.abs(final - initial) === Math.abs(delta); + } else { + expression = realDelta === Math.abs(delta); + } + this.assert( + expression, + "expected " + msgObj + " to " + behavior + " by " + delta, + "expected " + msgObj + " to not " + behavior + " by " + delta + ); +} +__name(assertDelta, "assertDelta"); +Assertion.addMethod("by", assertDelta); +Assertion.addProperty("extensible", function() { + let obj = flag2(this, "object"); + let isExtensible = obj === Object(obj) && Object.isExtensible(obj); + this.assert( + isExtensible, + "expected #{this} to be extensible", + "expected #{this} to not be extensible" + ); +}); +Assertion.addProperty("sealed", function() { + let obj = flag2(this, "object"); + let isSealed = obj === Object(obj) ? Object.isSealed(obj) : true; + this.assert( + isSealed, + "expected #{this} to be sealed", + "expected #{this} to not be sealed" + ); +}); +Assertion.addProperty("frozen", function() { + let obj = flag2(this, "object"); + let isFrozen = obj === Object(obj) ? Object.isFrozen(obj) : true; + this.assert( + isFrozen, + "expected #{this} to be frozen", + "expected #{this} to not be frozen" + ); +}); +Assertion.addProperty("finite", function(_msg) { + let obj = flag2(this, "object"); + this.assert( + typeof obj === "number" && isFinite(obj), + "expected #{this} to be a finite number", + "expected #{this} to not be a finite number" + ); +}); +function compareSubset(expected, actual) { + if (expected === actual) { + return true; + } + if (typeof actual !== typeof expected) { + return false; + } + if (typeof expected !== "object" || expected === null) { + return expected === actual; + } + if (!actual) { + return false; + } + if (Array.isArray(expected)) { + if (!Array.isArray(actual)) { + return false; + } + return expected.every(function(exp) { + return actual.some(function(act) { + return compareSubset(exp, act); + }); + }); + } + if (expected instanceof Date) { + if (actual instanceof Date) { + return expected.getTime() === actual.getTime(); + } else { + return false; + } + } + return Object.keys(expected).every(function(key) { + let expectedValue = expected[key]; + let actualValue = actual[key]; + if (typeof expectedValue === "object" && expectedValue !== null && actualValue !== null) { + return compareSubset(expectedValue, actualValue); + } + if (typeof expectedValue === "function") { + return expectedValue(actualValue); + } + return actualValue === expectedValue; + }); +} +__name(compareSubset, "compareSubset"); +Assertion.addMethod("containSubset", function(expected) { + const actual = flag(this, "object"); + const showDiff = config.showDiff; + this.assert( + compareSubset(expected, actual), + "expected #{act} to contain subset #{exp}", + "expected #{act} to not contain subset #{exp}", + expected, + actual, + showDiff + ); +}); + +// lib/chai/interface/expect.js +function expect(val, message) { + return new Assertion(val, message); +} +__name(expect, "expect"); +expect.fail = function(actual, expected, message, operator) { + if (arguments.length < 2) { + message = actual; + actual = void 0; + } + message = message || "expect.fail()"; + throw new AssertionError( + message, + { + actual, + expected, + operator + }, + expect.fail + ); +}; + +// lib/chai/interface/should.js +var should_exports = {}; +__export(should_exports, { + Should: () => Should, + should: () => should +}); +function loadShould() { + function shouldGetter() { + if (this instanceof String || this instanceof Number || this instanceof Boolean || typeof Symbol === "function" && this instanceof Symbol || typeof BigInt === "function" && this instanceof BigInt) { + return new Assertion(this.valueOf(), null, shouldGetter); + } + return new Assertion(this, null, shouldGetter); + } + __name(shouldGetter, "shouldGetter"); + function shouldSetter(value) { + Object.defineProperty(this, "should", { + value, + enumerable: true, + configurable: true, + writable: true + }); + } + __name(shouldSetter, "shouldSetter"); + Object.defineProperty(Object.prototype, "should", { + set: shouldSetter, + get: shouldGetter, + configurable: true + }); + let should2 = {}; + should2.fail = function(actual, expected, message, operator) { + if (arguments.length < 2) { + message = actual; + actual = void 0; + } + message = message || "should.fail()"; + throw new AssertionError( + message, + { + actual, + expected, + operator + }, + should2.fail + ); + }; + should2.equal = function(actual, expected, message) { + new Assertion(actual, message).to.equal(expected); + }; + should2.Throw = function(fn, errt, errs, msg) { + new Assertion(fn, msg).to.Throw(errt, errs); + }; + should2.exist = function(val, msg) { + new Assertion(val, msg).to.exist; + }; + should2.not = {}; + should2.not.equal = function(actual, expected, msg) { + new Assertion(actual, msg).to.not.equal(expected); + }; + should2.not.Throw = function(fn, errt, errs, msg) { + new Assertion(fn, msg).to.not.Throw(errt, errs); + }; + should2.not.exist = function(val, msg) { + new Assertion(val, msg).to.not.exist; + }; + should2["throw"] = should2["Throw"]; + should2.not["throw"] = should2.not["Throw"]; + return should2; +} +__name(loadShould, "loadShould"); +var should = loadShould; +var Should = loadShould; + +// lib/chai/interface/assert.js +function assert(express, errmsg) { + let test2 = new Assertion(null, null, assert, true); + test2.assert(express, errmsg, "[ negation message unavailable ]"); +} +__name(assert, "assert"); +assert.fail = function(actual, expected, message, operator) { + if (arguments.length < 2) { + message = actual; + actual = void 0; + } + message = message || "assert.fail()"; + throw new AssertionError( + message, + { + actual, + expected, + operator + }, + assert.fail + ); +}; +assert.isOk = function(val, msg) { + new Assertion(val, msg, assert.isOk, true).is.ok; +}; +assert.isNotOk = function(val, msg) { + new Assertion(val, msg, assert.isNotOk, true).is.not.ok; +}; +assert.equal = function(act, exp, msg) { + let test2 = new Assertion(act, msg, assert.equal, true); + test2.assert( + exp == flag(test2, "object"), + "expected #{this} to equal #{exp}", + "expected #{this} to not equal #{act}", + exp, + act, + true + ); +}; +assert.notEqual = function(act, exp, msg) { + let test2 = new Assertion(act, msg, assert.notEqual, true); + test2.assert( + exp != flag(test2, "object"), + "expected #{this} to not equal #{exp}", + "expected #{this} to equal #{act}", + exp, + act, + true + ); +}; +assert.strictEqual = function(act, exp, msg) { + new Assertion(act, msg, assert.strictEqual, true).to.equal(exp); +}; +assert.notStrictEqual = function(act, exp, msg) { + new Assertion(act, msg, assert.notStrictEqual, true).to.not.equal(exp); +}; +assert.deepEqual = assert.deepStrictEqual = function(act, exp, msg) { + new Assertion(act, msg, assert.deepEqual, true).to.eql(exp); +}; +assert.notDeepEqual = function(act, exp, msg) { + new Assertion(act, msg, assert.notDeepEqual, true).to.not.eql(exp); +}; +assert.isAbove = function(val, abv, msg) { + new Assertion(val, msg, assert.isAbove, true).to.be.above(abv); +}; +assert.isAtLeast = function(val, atlst, msg) { + new Assertion(val, msg, assert.isAtLeast, true).to.be.least(atlst); +}; +assert.isBelow = function(val, blw, msg) { + new Assertion(val, msg, assert.isBelow, true).to.be.below(blw); +}; +assert.isAtMost = function(val, atmst, msg) { + new Assertion(val, msg, assert.isAtMost, true).to.be.most(atmst); +}; +assert.isTrue = function(val, msg) { + new Assertion(val, msg, assert.isTrue, true).is["true"]; +}; +assert.isNotTrue = function(val, msg) { + new Assertion(val, msg, assert.isNotTrue, true).to.not.equal(true); +}; +assert.isFalse = function(val, msg) { + new Assertion(val, msg, assert.isFalse, true).is["false"]; +}; +assert.isNotFalse = function(val, msg) { + new Assertion(val, msg, assert.isNotFalse, true).to.not.equal(false); +}; +assert.isNull = function(val, msg) { + new Assertion(val, msg, assert.isNull, true).to.equal(null); +}; +assert.isNotNull = function(val, msg) { + new Assertion(val, msg, assert.isNotNull, true).to.not.equal(null); +}; +assert.isNaN = function(val, msg) { + new Assertion(val, msg, assert.isNaN, true).to.be.NaN; +}; +assert.isNotNaN = function(value, message) { + new Assertion(value, message, assert.isNotNaN, true).not.to.be.NaN; +}; +assert.exists = function(val, msg) { + new Assertion(val, msg, assert.exists, true).to.exist; +}; +assert.notExists = function(val, msg) { + new Assertion(val, msg, assert.notExists, true).to.not.exist; +}; +assert.isUndefined = function(val, msg) { + new Assertion(val, msg, assert.isUndefined, true).to.equal(void 0); +}; +assert.isDefined = function(val, msg) { + new Assertion(val, msg, assert.isDefined, true).to.not.equal(void 0); +}; +assert.isCallable = function(value, message) { + new Assertion(value, message, assert.isCallable, true).is.callable; +}; +assert.isNotCallable = function(value, message) { + new Assertion(value, message, assert.isNotCallable, true).is.not.callable; +}; +assert.isObject = function(val, msg) { + new Assertion(val, msg, assert.isObject, true).to.be.a("object"); +}; +assert.isNotObject = function(val, msg) { + new Assertion(val, msg, assert.isNotObject, true).to.not.be.a("object"); +}; +assert.isArray = function(val, msg) { + new Assertion(val, msg, assert.isArray, true).to.be.an("array"); +}; +assert.isNotArray = function(val, msg) { + new Assertion(val, msg, assert.isNotArray, true).to.not.be.an("array"); +}; +assert.isString = function(val, msg) { + new Assertion(val, msg, assert.isString, true).to.be.a("string"); +}; +assert.isNotString = function(val, msg) { + new Assertion(val, msg, assert.isNotString, true).to.not.be.a("string"); +}; +assert.isNumber = function(val, msg) { + new Assertion(val, msg, assert.isNumber, true).to.be.a("number"); +}; +assert.isNotNumber = function(val, msg) { + new Assertion(val, msg, assert.isNotNumber, true).to.not.be.a("number"); +}; +assert.isNumeric = function(val, msg) { + new Assertion(val, msg, assert.isNumeric, true).is.numeric; +}; +assert.isNotNumeric = function(val, msg) { + new Assertion(val, msg, assert.isNotNumeric, true).is.not.numeric; +}; +assert.isFinite = function(val, msg) { + new Assertion(val, msg, assert.isFinite, true).to.be.finite; +}; +assert.isBoolean = function(val, msg) { + new Assertion(val, msg, assert.isBoolean, true).to.be.a("boolean"); +}; +assert.isNotBoolean = function(val, msg) { + new Assertion(val, msg, assert.isNotBoolean, true).to.not.be.a("boolean"); +}; +assert.typeOf = function(val, type3, msg) { + new Assertion(val, msg, assert.typeOf, true).to.be.a(type3); +}; +assert.notTypeOf = function(value, type3, message) { + new Assertion(value, message, assert.notTypeOf, true).to.not.be.a(type3); +}; +assert.instanceOf = function(val, type3, msg) { + new Assertion(val, msg, assert.instanceOf, true).to.be.instanceOf(type3); +}; +assert.notInstanceOf = function(val, type3, msg) { + new Assertion(val, msg, assert.notInstanceOf, true).to.not.be.instanceOf( + type3 + ); +}; +assert.include = function(exp, inc, msg) { + new Assertion(exp, msg, assert.include, true).include(inc); +}; +assert.notInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.notInclude, true).not.include(inc); +}; +assert.deepInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.deepInclude, true).deep.include(inc); +}; +assert.notDeepInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.notDeepInclude, true).not.deep.include(inc); +}; +assert.nestedInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.nestedInclude, true).nested.include(inc); +}; +assert.notNestedInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.notNestedInclude, true).not.nested.include( + inc + ); +}; +assert.deepNestedInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.deepNestedInclude, true).deep.nested.include( + inc + ); +}; +assert.notDeepNestedInclude = function(exp, inc, msg) { + new Assertion( + exp, + msg, + assert.notDeepNestedInclude, + true + ).not.deep.nested.include(inc); +}; +assert.ownInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.ownInclude, true).own.include(inc); +}; +assert.notOwnInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.notOwnInclude, true).not.own.include(inc); +}; +assert.deepOwnInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.deepOwnInclude, true).deep.own.include(inc); +}; +assert.notDeepOwnInclude = function(exp, inc, msg) { + new Assertion(exp, msg, assert.notDeepOwnInclude, true).not.deep.own.include( + inc + ); +}; +assert.match = function(exp, re, msg) { + new Assertion(exp, msg, assert.match, true).to.match(re); +}; +assert.notMatch = function(exp, re, msg) { + new Assertion(exp, msg, assert.notMatch, true).to.not.match(re); +}; +assert.property = function(obj, prop, msg) { + new Assertion(obj, msg, assert.property, true).to.have.property(prop); +}; +assert.notProperty = function(obj, prop, msg) { + new Assertion(obj, msg, assert.notProperty, true).to.not.have.property(prop); +}; +assert.propertyVal = function(obj, prop, val, msg) { + new Assertion(obj, msg, assert.propertyVal, true).to.have.property(prop, val); +}; +assert.notPropertyVal = function(obj, prop, val, msg) { + new Assertion(obj, msg, assert.notPropertyVal, true).to.not.have.property( + prop, + val + ); +}; +assert.deepPropertyVal = function(obj, prop, val, msg) { + new Assertion(obj, msg, assert.deepPropertyVal, true).to.have.deep.property( + prop, + val + ); +}; +assert.notDeepPropertyVal = function(obj, prop, val, msg) { + new Assertion( + obj, + msg, + assert.notDeepPropertyVal, + true + ).to.not.have.deep.property(prop, val); +}; +assert.ownProperty = function(obj, prop, msg) { + new Assertion(obj, msg, assert.ownProperty, true).to.have.own.property(prop); +}; +assert.notOwnProperty = function(obj, prop, msg) { + new Assertion(obj, msg, assert.notOwnProperty, true).to.not.have.own.property( + prop + ); +}; +assert.ownPropertyVal = function(obj, prop, value, msg) { + new Assertion(obj, msg, assert.ownPropertyVal, true).to.have.own.property( + prop, + value + ); +}; +assert.notOwnPropertyVal = function(obj, prop, value, msg) { + new Assertion( + obj, + msg, + assert.notOwnPropertyVal, + true + ).to.not.have.own.property(prop, value); +}; +assert.deepOwnPropertyVal = function(obj, prop, value, msg) { + new Assertion( + obj, + msg, + assert.deepOwnPropertyVal, + true + ).to.have.deep.own.property(prop, value); +}; +assert.notDeepOwnPropertyVal = function(obj, prop, value, msg) { + new Assertion( + obj, + msg, + assert.notDeepOwnPropertyVal, + true + ).to.not.have.deep.own.property(prop, value); +}; +assert.nestedProperty = function(obj, prop, msg) { + new Assertion(obj, msg, assert.nestedProperty, true).to.have.nested.property( + prop + ); +}; +assert.notNestedProperty = function(obj, prop, msg) { + new Assertion( + obj, + msg, + assert.notNestedProperty, + true + ).to.not.have.nested.property(prop); +}; +assert.nestedPropertyVal = function(obj, prop, val, msg) { + new Assertion( + obj, + msg, + assert.nestedPropertyVal, + true + ).to.have.nested.property(prop, val); +}; +assert.notNestedPropertyVal = function(obj, prop, val, msg) { + new Assertion( + obj, + msg, + assert.notNestedPropertyVal, + true + ).to.not.have.nested.property(prop, val); +}; +assert.deepNestedPropertyVal = function(obj, prop, val, msg) { + new Assertion( + obj, + msg, + assert.deepNestedPropertyVal, + true + ).to.have.deep.nested.property(prop, val); +}; +assert.notDeepNestedPropertyVal = function(obj, prop, val, msg) { + new Assertion( + obj, + msg, + assert.notDeepNestedPropertyVal, + true + ).to.not.have.deep.nested.property(prop, val); +}; +assert.lengthOf = function(exp, len, msg) { + new Assertion(exp, msg, assert.lengthOf, true).to.have.lengthOf(len); +}; +assert.hasAnyKeys = function(obj, keys, msg) { + new Assertion(obj, msg, assert.hasAnyKeys, true).to.have.any.keys(keys); +}; +assert.hasAllKeys = function(obj, keys, msg) { + new Assertion(obj, msg, assert.hasAllKeys, true).to.have.all.keys(keys); +}; +assert.containsAllKeys = function(obj, keys, msg) { + new Assertion(obj, msg, assert.containsAllKeys, true).to.contain.all.keys( + keys + ); +}; +assert.doesNotHaveAnyKeys = function(obj, keys, msg) { + new Assertion(obj, msg, assert.doesNotHaveAnyKeys, true).to.not.have.any.keys( + keys + ); +}; +assert.doesNotHaveAllKeys = function(obj, keys, msg) { + new Assertion(obj, msg, assert.doesNotHaveAllKeys, true).to.not.have.all.keys( + keys + ); +}; +assert.hasAnyDeepKeys = function(obj, keys, msg) { + new Assertion(obj, msg, assert.hasAnyDeepKeys, true).to.have.any.deep.keys( + keys + ); +}; +assert.hasAllDeepKeys = function(obj, keys, msg) { + new Assertion(obj, msg, assert.hasAllDeepKeys, true).to.have.all.deep.keys( + keys + ); +}; +assert.containsAllDeepKeys = function(obj, keys, msg) { + new Assertion( + obj, + msg, + assert.containsAllDeepKeys, + true + ).to.contain.all.deep.keys(keys); +}; +assert.doesNotHaveAnyDeepKeys = function(obj, keys, msg) { + new Assertion( + obj, + msg, + assert.doesNotHaveAnyDeepKeys, + true + ).to.not.have.any.deep.keys(keys); +}; +assert.doesNotHaveAllDeepKeys = function(obj, keys, msg) { + new Assertion( + obj, + msg, + assert.doesNotHaveAllDeepKeys, + true + ).to.not.have.all.deep.keys(keys); +}; +assert.throws = function(fn, errorLike, errMsgMatcher, msg) { + if ("string" === typeof errorLike || errorLike instanceof RegExp) { + errMsgMatcher = errorLike; + errorLike = null; + } + let assertErr = new Assertion(fn, msg, assert.throws, true).to.throw( + errorLike, + errMsgMatcher + ); + return flag(assertErr, "object"); +}; +assert.doesNotThrow = function(fn, errorLike, errMsgMatcher, message) { + if ("string" === typeof errorLike || errorLike instanceof RegExp) { + errMsgMatcher = errorLike; + errorLike = null; + } + new Assertion(fn, message, assert.doesNotThrow, true).to.not.throw( + errorLike, + errMsgMatcher + ); +}; +assert.operator = function(val, operator, val2, msg) { + let ok; + switch (operator) { + case "==": + ok = val == val2; + break; + case "===": + ok = val === val2; + break; + case ">": + ok = val > val2; + break; + case ">=": + ok = val >= val2; + break; + case "<": + ok = val < val2; + break; + case "<=": + ok = val <= val2; + break; + case "!=": + ok = val != val2; + break; + case "!==": + ok = val !== val2; + break; + default: + msg = msg ? msg + ": " : msg; + throw new AssertionError( + msg + 'Invalid operator "' + operator + '"', + void 0, + assert.operator + ); + } + let test2 = new Assertion(ok, msg, assert.operator, true); + test2.assert( + true === flag(test2, "object"), + "expected " + inspect2(val) + " to be " + operator + " " + inspect2(val2), + "expected " + inspect2(val) + " to not be " + operator + " " + inspect2(val2) + ); +}; +assert.closeTo = function(act, exp, delta, msg) { + new Assertion(act, msg, assert.closeTo, true).to.be.closeTo(exp, delta); +}; +assert.approximately = function(act, exp, delta, msg) { + new Assertion(act, msg, assert.approximately, true).to.be.approximately( + exp, + delta + ); +}; +assert.sameMembers = function(set1, set2, msg) { + new Assertion(set1, msg, assert.sameMembers, true).to.have.same.members(set2); +}; +assert.notSameMembers = function(set1, set2, msg) { + new Assertion( + set1, + msg, + assert.notSameMembers, + true + ).to.not.have.same.members(set2); +}; +assert.sameDeepMembers = function(set1, set2, msg) { + new Assertion( + set1, + msg, + assert.sameDeepMembers, + true + ).to.have.same.deep.members(set2); +}; +assert.notSameDeepMembers = function(set1, set2, msg) { + new Assertion( + set1, + msg, + assert.notSameDeepMembers, + true + ).to.not.have.same.deep.members(set2); +}; +assert.sameOrderedMembers = function(set1, set2, msg) { + new Assertion( + set1, + msg, + assert.sameOrderedMembers, + true + ).to.have.same.ordered.members(set2); +}; +assert.notSameOrderedMembers = function(set1, set2, msg) { + new Assertion( + set1, + msg, + assert.notSameOrderedMembers, + true + ).to.not.have.same.ordered.members(set2); +}; +assert.sameDeepOrderedMembers = function(set1, set2, msg) { + new Assertion( + set1, + msg, + assert.sameDeepOrderedMembers, + true + ).to.have.same.deep.ordered.members(set2); +}; +assert.notSameDeepOrderedMembers = function(set1, set2, msg) { + new Assertion( + set1, + msg, + assert.notSameDeepOrderedMembers, + true + ).to.not.have.same.deep.ordered.members(set2); +}; +assert.includeMembers = function(superset, subset, msg) { + new Assertion(superset, msg, assert.includeMembers, true).to.include.members( + subset + ); +}; +assert.notIncludeMembers = function(superset, subset, msg) { + new Assertion( + superset, + msg, + assert.notIncludeMembers, + true + ).to.not.include.members(subset); +}; +assert.includeDeepMembers = function(superset, subset, msg) { + new Assertion( + superset, + msg, + assert.includeDeepMembers, + true + ).to.include.deep.members(subset); +}; +assert.notIncludeDeepMembers = function(superset, subset, msg) { + new Assertion( + superset, + msg, + assert.notIncludeDeepMembers, + true + ).to.not.include.deep.members(subset); +}; +assert.includeOrderedMembers = function(superset, subset, msg) { + new Assertion( + superset, + msg, + assert.includeOrderedMembers, + true + ).to.include.ordered.members(subset); +}; +assert.notIncludeOrderedMembers = function(superset, subset, msg) { + new Assertion( + superset, + msg, + assert.notIncludeOrderedMembers, + true + ).to.not.include.ordered.members(subset); +}; +assert.includeDeepOrderedMembers = function(superset, subset, msg) { + new Assertion( + superset, + msg, + assert.includeDeepOrderedMembers, + true + ).to.include.deep.ordered.members(subset); +}; +assert.notIncludeDeepOrderedMembers = function(superset, subset, msg) { + new Assertion( + superset, + msg, + assert.notIncludeDeepOrderedMembers, + true + ).to.not.include.deep.ordered.members(subset); +}; +assert.oneOf = function(inList, list, msg) { + new Assertion(inList, msg, assert.oneOf, true).to.be.oneOf(list); +}; +assert.isIterable = function(obj, msg) { + if (obj == void 0 || !obj[Symbol.iterator]) { + msg = msg ? `${msg} expected ${inspect2(obj)} to be an iterable` : `expected ${inspect2(obj)} to be an iterable`; + throw new AssertionError(msg, void 0, assert.isIterable); + } +}; +assert.changes = function(fn, obj, prop, msg) { + if (arguments.length === 3 && typeof obj === "function") { + msg = prop; + prop = null; + } + new Assertion(fn, msg, assert.changes, true).to.change(obj, prop); +}; +assert.changesBy = function(fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === "function") { + let tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + new Assertion(fn, msg, assert.changesBy, true).to.change(obj, prop).by(delta); +}; +assert.doesNotChange = function(fn, obj, prop, msg) { + if (arguments.length === 3 && typeof obj === "function") { + msg = prop; + prop = null; + } + return new Assertion(fn, msg, assert.doesNotChange, true).to.not.change( + obj, + prop + ); +}; +assert.changesButNotBy = function(fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === "function") { + let tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + new Assertion(fn, msg, assert.changesButNotBy, true).to.change(obj, prop).but.not.by(delta); +}; +assert.increases = function(fn, obj, prop, msg) { + if (arguments.length === 3 && typeof obj === "function") { + msg = prop; + prop = null; + } + return new Assertion(fn, msg, assert.increases, true).to.increase(obj, prop); +}; +assert.increasesBy = function(fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === "function") { + let tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + new Assertion(fn, msg, assert.increasesBy, true).to.increase(obj, prop).by(delta); +}; +assert.doesNotIncrease = function(fn, obj, prop, msg) { + if (arguments.length === 3 && typeof obj === "function") { + msg = prop; + prop = null; + } + return new Assertion(fn, msg, assert.doesNotIncrease, true).to.not.increase( + obj, + prop + ); +}; +assert.increasesButNotBy = function(fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === "function") { + let tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + new Assertion(fn, msg, assert.increasesButNotBy, true).to.increase(obj, prop).but.not.by(delta); +}; +assert.decreases = function(fn, obj, prop, msg) { + if (arguments.length === 3 && typeof obj === "function") { + msg = prop; + prop = null; + } + return new Assertion(fn, msg, assert.decreases, true).to.decrease(obj, prop); +}; +assert.decreasesBy = function(fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === "function") { + let tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + new Assertion(fn, msg, assert.decreasesBy, true).to.decrease(obj, prop).by(delta); +}; +assert.doesNotDecrease = function(fn, obj, prop, msg) { + if (arguments.length === 3 && typeof obj === "function") { + msg = prop; + prop = null; + } + return new Assertion(fn, msg, assert.doesNotDecrease, true).to.not.decrease( + obj, + prop + ); +}; +assert.doesNotDecreaseBy = function(fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === "function") { + let tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + return new Assertion(fn, msg, assert.doesNotDecreaseBy, true).to.not.decrease(obj, prop).by(delta); +}; +assert.decreasesButNotBy = function(fn, obj, prop, delta, msg) { + if (arguments.length === 4 && typeof obj === "function") { + let tmpMsg = delta; + delta = prop; + msg = tmpMsg; + } else if (arguments.length === 3) { + delta = prop; + prop = null; + } + new Assertion(fn, msg, assert.decreasesButNotBy, true).to.decrease(obj, prop).but.not.by(delta); +}; +assert.ifError = function(val) { + if (val) { + throw val; + } +}; +assert.isExtensible = function(obj, msg) { + new Assertion(obj, msg, assert.isExtensible, true).to.be.extensible; +}; +assert.isNotExtensible = function(obj, msg) { + new Assertion(obj, msg, assert.isNotExtensible, true).to.not.be.extensible; +}; +assert.isSealed = function(obj, msg) { + new Assertion(obj, msg, assert.isSealed, true).to.be.sealed; +}; +assert.isNotSealed = function(obj, msg) { + new Assertion(obj, msg, assert.isNotSealed, true).to.not.be.sealed; +}; +assert.isFrozen = function(obj, msg) { + new Assertion(obj, msg, assert.isFrozen, true).to.be.frozen; +}; +assert.isNotFrozen = function(obj, msg) { + new Assertion(obj, msg, assert.isNotFrozen, true).to.not.be.frozen; +}; +assert.isEmpty = function(val, msg) { + new Assertion(val, msg, assert.isEmpty, true).to.be.empty; +}; +assert.isNotEmpty = function(val, msg) { + new Assertion(val, msg, assert.isNotEmpty, true).to.not.be.empty; +}; +assert.containsSubset = function(val, exp, msg) { + new Assertion(val, msg).to.containSubset(exp); +}; +assert.doesNotContainSubset = function(val, exp, msg) { + new Assertion(val, msg).to.not.containSubset(exp); +}; +var aliases = [ + ["isOk", "ok"], + ["isNotOk", "notOk"], + ["throws", "throw"], + ["throws", "Throw"], + ["isExtensible", "extensible"], + ["isNotExtensible", "notExtensible"], + ["isSealed", "sealed"], + ["isNotSealed", "notSealed"], + ["isFrozen", "frozen"], + ["isNotFrozen", "notFrozen"], + ["isEmpty", "empty"], + ["isNotEmpty", "notEmpty"], + ["isCallable", "isFunction"], + ["isNotCallable", "isNotFunction"], + ["containsSubset", "containSubset"] +]; +for (const [name, as] of aliases) { + assert[as] = assert[name]; +} + +// lib/chai.js +var used = []; +function use(fn) { + const exports = { + use, + AssertionError, + util: utils_exports, + config, + expect, + assert, + Assertion, + ...should_exports + }; + if (!~used.indexOf(fn)) { + fn(exports, utils_exports); + used.push(fn); + } + return exports; +} +__name(use, "use"); +export { + Assertion, + AssertionError, + Should, + assert, + config, + expect, + should, + use, + utils_exports as util +}; diff --git a/tools/ui/node_modules/vitest/node_modules/chai/package.json b/tools/ui/node_modules/vitest/node_modules/chai/package.json new file mode 100644 index 0000000000000000000000000000000000000000..f2ad34b1a625348ca91f9eda6d9470623fcda74f --- /dev/null +++ b/tools/ui/node_modules/vitest/node_modules/chai/package.json @@ -0,0 +1,71 @@ +{ + "author": "Jake Luer ", + "name": "chai", + "type": "module", + "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.", + "keywords": [ + "test", + "assertion", + "assert", + "testing", + "chai" + ], + "files": [ + "index.js", + "register-*.js" + ], + "homepage": "http://chaijs.com", + "license": "MIT", + "contributors": [ + "Jake Luer ", + "Domenic Denicola (http://domenicdenicola.com)", + "Veselin Todorov ", + "John Firebaugh " + ], + "version": "6.2.2", + "repository": { + "type": "git", + "url": "https://github.com/chaijs/chai" + }, + "bugs": { + "url": "https://github.com/chaijs/chai/issues" + }, + "main": "./index.js", + "scripts": { + "build": "esbuild --bundle --format=esm --target=es2021 --keep-names --legal-comments=none --outfile=index.js lib/chai.js", + "prebuild": "npm run clean", + "format": "prettier --write lib", + "pretest": "npm run lint", + "test": "npm run test-node && npm run test-chrome", + "test-node": "c8 --99 --check-coverage mocha --require ./test/bootstrap/index.js test/*.js", + "test-chrome": "web-test-runner --playwright", + "lint": "npm run lint:js && npm run lint:format", + "lint:js": "eslint lib/", + "lint:format": "prettier --check lib", + "lint:types": "tsc", + "clean": "rm -rf index.js coverage/" + }, + "engines": { + "node": ">=18" + }, + "devDependencies": { + "@eslint/js": "^9.17.0", + "@rollup/plugin-commonjs": "^29.0.0", + "@web/dev-server-rollup": "^0.6.1", + "@web/test-runner": "^0.20.0", + "@web/test-runner-playwright": "^0.11.0", + "assertion-error": "^2.0.1", + "c8": "^10.1.3", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "esbuild": "^0.27.0", + "eslint": "^9.0.0", + "eslint-plugin-jsdoc": "^61.0.0", + "globals": "^16.3.0", + "loupe": "^3.1.0", + "mocha": "^11.0.0", + "pathval": "^2.0.0", + "prettier": "^3.4.2", + "typescript": "~5.9.0" + } +} diff --git a/tools/ui/node_modules/vitest/node_modules/chai/register-assert.js b/tools/ui/node_modules/vitest/node_modules/chai/register-assert.js new file mode 100644 index 0000000000000000000000000000000000000000..f593717e0b2540660a1358e5bcac92abc5423490 --- /dev/null +++ b/tools/ui/node_modules/vitest/node_modules/chai/register-assert.js @@ -0,0 +1,3 @@ +import {assert} from './index.js'; + +globalThis.assert = assert; diff --git a/tools/ui/node_modules/vitest/node_modules/chai/register-expect.js b/tools/ui/node_modules/vitest/node_modules/chai/register-expect.js new file mode 100644 index 0000000000000000000000000000000000000000..2807b89beda204f9a159ea34ffe64ee4e32a97d7 --- /dev/null +++ b/tools/ui/node_modules/vitest/node_modules/chai/register-expect.js @@ -0,0 +1,3 @@ +import {expect} from './index.js'; + +globalThis.expect = expect; diff --git a/tools/ui/node_modules/vitest/node_modules/chai/register-should.js b/tools/ui/node_modules/vitest/node_modules/chai/register-should.js new file mode 100644 index 0000000000000000000000000000000000000000..1339ee4c47edc5af0703666608ba08b41d523c86 --- /dev/null +++ b/tools/ui/node_modules/vitest/node_modules/chai/register-should.js @@ -0,0 +1,3 @@ +import {should} from './index.js'; + +globalThis.should = should(); diff --git a/tools/ui/node_modules/vitest/optional-runtime-types.d.ts b/tools/ui/node_modules/vitest/optional-runtime-types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ba94336682fd1539c342061fd7e6490c5c4fbb1a --- /dev/null +++ b/tools/ui/node_modules/vitest/optional-runtime-types.d.ts @@ -0,0 +1,6 @@ +/* eslint-disable ts/ban-ts-comment */ + +export interface Disposable { + // @ts-ignore -- Symbol.dispose might not be in user types + [Symbol.dispose]: () => void +} diff --git a/tools/ui/node_modules/vitest/optional-types.d.ts b/tools/ui/node_modules/vitest/optional-types.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..49cdb4fae8205306adc0b6e7998dc5a792d0ab36 --- /dev/null +++ b/tools/ui/node_modules/vitest/optional-types.d.ts @@ -0,0 +1,7 @@ +/* eslint-disable ts/ban-ts-comment */ + +// @ts-ignore optional peer dep +export type * as jsdomTypes from 'jsdom' + +// @ts-ignore optional peer dep +export type * as happyDomTypes from 'happy-dom' diff --git a/tools/ui/node_modules/vitest/package.json b/tools/ui/node_modules/vitest/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1a86f6558469e0730506bab70aac36eeb67e0482 --- /dev/null +++ b/tools/ui/node_modules/vitest/package.json @@ -0,0 +1,239 @@ +{ + "name": "vitest", + "type": "module", + "version": "4.1.10", + "description": "Next generation testing framework powered by Vite", + "author": "Anthony Fu ", + "license": "MIT", + "funding": "https://opencollective.com/vitest", + "homepage": "https://vitest.dev", + "repository": { + "type": "git", + "url": "git+https://github.com/vitest-dev/vitest.git", + "directory": "packages/vitest" + }, + "bugs": { + "url": "https://github.com/vitest-dev/vitest/issues" + }, + "keywords": [ + "vite", + "vitest", + "test", + "jest" + ], + "sideEffects": false, + "imports": { + "#module-evaluator": { + "types": "./dist/module-evaluator.d.ts", + "default": "./dist/module-evaluator.js" + }, + "#nodejs-worker-loader": "./dist/nodejs-worker-loader.js" + }, + "exports": { + ".": { + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./index.d.cts", + "default": "./index.cjs" + } + }, + "./browser": { + "types": "./browser/context.d.ts", + "default": "./browser/context.js" + }, + "./package.json": "./package.json", + "./optional-types.js": { + "types": "./optional-types.d.ts" + }, + "./optional-runtime-types.js": { + "types": "./optional-runtime-types.d.ts" + }, + "./src/*": "./src/*", + "./globals": { + "types": "./globals.d.ts" + }, + "./jsdom": { + "types": "./jsdom.d.ts" + }, + "./importMeta": { + "types": "./importMeta.d.ts" + }, + "./import-meta": { + "types": "./import-meta.d.ts" + }, + "./node": { + "types": "./dist/node.d.ts", + "default": "./dist/node.js" + }, + "./internal/browser": { + "types": "./dist/browser.d.ts", + "default": "./dist/browser.js" + }, + "./runners": { + "types": "./dist/runners.d.ts", + "default": "./dist/runners.js" + }, + "./suite": { + "types": "./dist/suite.d.ts", + "default": "./dist/suite.js" + }, + "./environments": { + "types": "./dist/environments.d.ts", + "default": "./dist/environments.js" + }, + "./config": { + "types": "./config.d.ts", + "require": "./dist/config.cjs", + "default": "./dist/config.js" + }, + "./coverage": { + "types": "./coverage.d.ts", + "default": "./dist/coverage.js" + }, + "./reporters": { + "types": "./dist/reporters.d.ts", + "default": "./dist/reporters.js" + }, + "./snapshot": { + "types": "./dist/snapshot.d.ts", + "default": "./dist/snapshot.js" + }, + "./runtime": { + "types": "./dist/runtime.d.ts", + "default": "./dist/runtime.js" + }, + "./worker": { + "types": "./worker.d.ts", + "default": "./dist/worker.js" + } + }, + "main": "./dist/index.js", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "bin": { + "vitest": "./vitest.mjs" + }, + "files": [ + "*.cjs", + "*.d.cts", + "*.d.ts", + "*.mjs", + "bin", + "browser", + "dist" + ], + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.0.0" + }, + "peerDependencies": { + "@edge-runtime/vm": "*", + "@opentelemetry/api": "^1.9.0", + "@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0", + "happy-dom": "*", + "jsdom": "*", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "@vitest/browser-preview": "4.1.10", + "@vitest/coverage-istanbul": "4.1.10", + "@vitest/browser-playwright": "4.1.10", + "@vitest/browser-webdriverio": "4.1.10", + "@vitest/coverage-v8": "4.1.10", + "@vitest/ui": "4.1.10" + }, + "peerDependenciesMeta": { + "@edge-runtime/vm": { + "optional": true + }, + "@opentelemetry/api": { + "optional": true + }, + "@types/node": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/browser-preview": { + "optional": true + }, + "@vitest/browser-webdriverio": { + "optional": true + }, + "@vitest/coverage-istanbul": { + "optional": true + }, + "@vitest/coverage-v8": { + "optional": true + }, + "@vitest/ui": { + "optional": true + }, + "happy-dom": { + "optional": true + }, + "jsdom": { + "optional": true + }, + "vite": { + "optional": false + } + }, + "dependencies": { + "es-module-lexer": "^2.0.0", + "expect-type": "^1.3.0", + "magic-string": "^0.30.21", + "obug": "^2.1.1", + "pathe": "^2.0.3", + "picomatch": "^4.0.3", + "std-env": "^4.0.0-rc.1", + "tinybench": "^2.9.0", + "tinyexec": "^1.0.2", + "tinyglobby": "^0.2.15", + "tinyrainbow": "^3.1.0", + "vite": "^6.0.0 || ^7.0.0 || ^8.0.0", + "why-is-node-running": "^2.3.0", + "@vitest/expect": "4.1.10", + "@vitest/mocker": "4.1.10", + "@vitest/pretty-format": "4.1.10", + "@vitest/runner": "4.1.10", + "@vitest/spy": "4.1.10", + "@vitest/snapshot": "4.1.10", + "@vitest/utils": "4.1.10" + }, + "devDependencies": { + "@antfu/install-pkg": "^1.1.0", + "@bomb.sh/tab": "^0.0.14", + "@edge-runtime/vm": "^5.0.0", + "@jridgewell/trace-mapping": "0.3.31", + "@opentelemetry/api": "^1.9.0", + "@sinonjs/fake-timers": "15.0.0", + "@types/estree": "^1.0.8", + "@types/istanbul-lib-coverage": "^2.0.6", + "@types/istanbul-reports": "^3.0.4", + "@types/jsdom": "^27.0.0", + "@types/node": "^24.12.0", + "@types/picomatch": "^4.0.2", + "@types/prompts": "^2.4.9", + "@types/sinonjs__fake-timers": "^15.0.1", + "acorn": "8.11.3", + "acorn-walk": "^8.3.5", + "birpc": "^4.0.0", + "cac": "^6.7.14", + "empathic": "^2.0.0", + "flatted": "^3.4.2", + "happy-dom": "^20.8.3", + "jsdom": "^27.4.0", + "local-pkg": "^1.1.2", + "mime": "^4.1.0", + "prompts": "^2.4.2", + "strip-literal": "^3.1.0", + "tinyhighlight": "^0.3.2", + "ws": "^8.19.0" + }, + "scripts": { + "build": "premove dist && rollup -c", + "dev": "NODE_OPTIONS=\"--max-old-space-size=8192\" rollup -c --watch -m inline" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/vitest/reporters.d.ts b/tools/ui/node_modules/vitest/reporters.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5fe5fe7e27afef273a21e20aae05d813a13d7940 --- /dev/null +++ b/tools/ui/node_modules/vitest/reporters.d.ts @@ -0,0 +1 @@ +export * from './dist/reporters.js' diff --git a/tools/ui/node_modules/vitest/runners.d.ts b/tools/ui/node_modules/vitest/runners.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..0477c34a9a47d4c8c7601a9fcf91015b7ca2e3db --- /dev/null +++ b/tools/ui/node_modules/vitest/runners.d.ts @@ -0,0 +1 @@ +export * from './dist/runners.js' diff --git a/tools/ui/node_modules/vitest/snapshot.d.ts b/tools/ui/node_modules/vitest/snapshot.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e032fa789764f191c3e9e5b382c1b6ef5742d301 --- /dev/null +++ b/tools/ui/node_modules/vitest/snapshot.d.ts @@ -0,0 +1 @@ +export * from './dist/snapshot.js' diff --git a/tools/ui/node_modules/vitest/suite.d.ts b/tools/ui/node_modules/vitest/suite.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9465dc5c11d2d0cd0ec9dc7716fcb344fb71f8de --- /dev/null +++ b/tools/ui/node_modules/vitest/suite.d.ts @@ -0,0 +1 @@ +export * from './dist/suite.js' diff --git a/tools/ui/node_modules/vitest/suppress-warnings.cjs b/tools/ui/node_modules/vitest/suppress-warnings.cjs new file mode 100644 index 0000000000000000000000000000000000000000..7ab439dc571ea7b320018233fea5cce7c4dbf85b --- /dev/null +++ b/tools/ui/node_modules/vitest/suppress-warnings.cjs @@ -0,0 +1,22 @@ +// borrowed from tsx implementation: +// https://github.com/esbuild-kit/tsx + +const ignoreWarnings = new Set([ + '--experimental-loader is an experimental feature. This feature could change at any time', + 'Custom ESM Loaders is an experimental feature. This feature could change at any time', + 'Custom ESM Loaders is an experimental feature and might change at any time', + 'VM Modules is an experimental feature and might change at any time', + 'VM Modules is an experimental feature. This feature could change at any time', + 'stripTypeScriptTypes is an experimental feature and might change at any time', +]) + +const { emit } = process + +process.emit = function (event, warning) { + if (event === 'warning' && ignoreWarnings.has(warning.message)) { + return + } + + // eslint-disable-next-line prefer-rest-params + return Reflect.apply(emit, this, arguments) +} diff --git a/tools/ui/node_modules/vitest/vitest.mjs b/tools/ui/node_modules/vitest/vitest.mjs new file mode 100644 index 0000000000000000000000000000000000000000..02dd4714b90340442ab2b2b72a704a99c9b5e4b8 --- /dev/null +++ b/tools/ui/node_modules/vitest/vitest.mjs @@ -0,0 +1,2 @@ +#!/usr/bin/env node +import './dist/cli.js' diff --git a/tools/ui/node_modules/vitest/worker.d.ts b/tools/ui/node_modules/vitest/worker.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7dd14165ffbf697cbbd14dc0abd3c2e4fa3d0f9a --- /dev/null +++ b/tools/ui/node_modules/vitest/worker.d.ts @@ -0,0 +1 @@ +export * from './dist/worker.js' diff --git a/tools/ui/node_modules/web-namespaces/index.d.ts b/tools/ui/node_modules/web-namespaces/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ea37c4791accfc5531864e403c062444d485b103 --- /dev/null +++ b/tools/ui/node_modules/web-namespaces/index.d.ts @@ -0,0 +1,6 @@ +/** + * Map of web namespaces. + * + * @type {Record} + */ +export const webNamespaces: Record diff --git a/tools/ui/node_modules/web-namespaces/index.js b/tools/ui/node_modules/web-namespaces/index.js new file mode 100644 index 0000000000000000000000000000000000000000..8c6b0b5111e195d4d0906d34b3dd2a4859b4af2d --- /dev/null +++ b/tools/ui/node_modules/web-namespaces/index.js @@ -0,0 +1,13 @@ +/** + * Map of web namespaces. + * + * @type {Record} + */ +export const webNamespaces = { + html: 'http://www.w3.org/1999/xhtml', + mathml: 'http://www.w3.org/1998/Math/MathML', + svg: 'http://www.w3.org/2000/svg', + xlink: 'http://www.w3.org/1999/xlink', + xml: 'http://www.w3.org/XML/1998/namespace', + xmlns: 'http://www.w3.org/2000/xmlns/' +} diff --git a/tools/ui/node_modules/web-namespaces/license b/tools/ui/node_modules/web-namespaces/license new file mode 100644 index 0000000000000000000000000000000000000000..8d8660d36ef2eced1f9cce91e17ae0290261734c --- /dev/null +++ b/tools/ui/node_modules/web-namespaces/license @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2016 Titus Wormer + +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/web-namespaces/package.json b/tools/ui/node_modules/web-namespaces/package.json new file mode 100644 index 0000000000000000000000000000000000000000..3e7712732f97e0dbcdf14ff4b10e4da61b9f32f5 --- /dev/null +++ b/tools/ui/node_modules/web-namespaces/package.json @@ -0,0 +1,81 @@ +{ + "name": "web-namespaces", + "version": "2.0.1", + "description": "Map of web namespaces", + "license": "MIT", + "keywords": [ + "web", + "platform", + "namespace", + "namespaces", + "whatwg", + "w3c" + ], + "repository": "wooorm/web-namespaces", + "bugs": "https://github.com/wooorm/web-namespaces/issues", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/wooorm" + }, + "author": "Titus Wormer (https://wooorm.com)", + "contributors": [ + "Titus Wormer (https://wooorm.com)" + ], + "sideEffects": false, + "type": "module", + "main": "index.js", + "types": "index.d.ts", + "files": [ + "index.d.ts", + "index.js" + ], + "devDependencies": { + "@types/tape": "^4.0.0", + "bail": "^2.0.0", + "c8": "^7.0.0", + "concat-stream": "^2.0.0", + "hast-util-select": "^5.0.0", + "hast-util-to-string": "^2.0.0", + "prettier": "^2.0.0", + "rehype-parse": "^8.0.0", + "remark-cli": "^10.0.0", + "remark-preset-wooorm": "^9.0.0", + "rimraf": "^3.0.0", + "tape": "^5.0.0", + "type-coverage": "^2.0.0", + "typescript": "^4.0.0", + "unified": "^10.0.0", + "xo": "^0.46.0" + }, + "scripts": { + "generate": "node build", + "prepublishOnly": "npm run build && npm run format", + "build": "rimraf \"*.d.ts\" && tsc && type-coverage", + "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix", + "test-api": "node --conditions development test.js", + "test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api", + "test": "npm run generate && npm run build && npm run format && npm run test-coverage" + }, + "prettier": { + "tabWidth": 2, + "useTabs": false, + "singleQuote": true, + "bracketSpacing": false, + "semi": false, + "trailingComma": "none" + }, + "xo": { + "prettier": true + }, + "remarkConfig": { + "plugins": [ + "preset-wooorm" + ] + }, + "typeCoverage": { + "atLeast": 100, + "detail": true, + "strict": true, + "ignoreCatch": true + } +} diff --git a/tools/ui/node_modules/web-namespaces/readme.md b/tools/ui/node_modules/web-namespaces/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..507b77c6cdbd5de032476cb3d9ad79ce0e73165e --- /dev/null +++ b/tools/ui/node_modules/web-namespaces/readme.md @@ -0,0 +1,156 @@ +# web-namespaces + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] + +Map of web namespaces. + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`webNamespaces`](#webnamespaces) +* [Types](#types) +* [Compatibility](#compatibility) +* [Security](#security) +* [Related](#related) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This is a map of names to namespaces found on the web platforms. + +## When should I use this? + +You can use this package if you want to access the XML, HTML, SVG, etc. +namespace urls. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]: + +```sh +npm install web-namespaces +``` + +In Deno with [Skypack][]: + +```js +import {webNamespaces} from 'https://cdn.skypack.dev/web-namespaces@2?dts' +``` + +In browsers with [Skypack][]: + +```html + +``` + +## Use + +```js +import {webNamespaces} from 'web-namespaces' + +console.log(webNamespaces) +``` + +Yields: + +```js +{ + html: 'http://www.w3.org/1999/xhtml', + mathml: 'http://www.w3.org/1998/Math/MathML', + svg: 'http://www.w3.org/2000/svg', + xlink: 'http://www.w3.org/1999/xlink', + xml: 'http://www.w3.org/XML/1998/namespace', + xmlns: 'http://www.w3.org/2000/xmlns/' +} +``` + +## API + +This package exports the following identifiers: `webNamespaces`. +There is no default export. + +### `webNamespaces` + +Map of names to namespaces (`Record`). + +## Types + +This package is fully typed with [TypeScript][]. +There are no extra exported types. + +## Compatibility + +This package is at least compatible with all maintained versions of Node.js. +As of now, that is Node.js 12.20+, 14.14+, and 16.0+. +It also works in Deno and modern browsers. + +## Security + +This package is safe. + +## Related + +* [`wooorm/html-tag-names`](https://github.com/wooorm/html-tag-names) + — list of HTML tag names +* [`wooorm/mathml-tag-names`](https://github.com/wooorm/mathml-tag-names) + — list of MathML tag names +* [`wooorm/svg-tag-names`](https://github.com/wooorm/svg-tag-names) + — list of SVG tag names +* [`wooorm/svg-element-attributes`](https://github.com/wooorm/svg-element-attributes) + — map of SVG elements to allowed attributes +* [`wooorm/html-element-attributes`](https://github.com/wooorm/html-element-attributes) + — map of HTML elements to allowed attributes +* [`wooorm/aria-attributes`](https://github.com/wooorm/aria-attributes) + — list of ARIA attributes + +## Contribute + +Yes please! +See [How to Contribute to Open Source][contribute]. + +## License + +[MIT][license] © [Titus Wormer][author] + + + +[build-badge]: https://github.com/wooorm/web-namespaces/workflows/main/badge.svg + +[build]: https://github.com/wooorm/web-namespaces/actions + +[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/web-namespaces.svg + +[coverage]: https://codecov.io/github/wooorm/web-namespaces + +[downloads-badge]: https://img.shields.io/npm/dm/web-namespaces.svg + +[downloads]: https://www.npmjs.com/package/web-namespaces + +[size-badge]: https://img.shields.io/bundlephobia/minzip/web-namespaces.svg + +[size]: https://bundlephobia.com/result?p=web-namespaces + +[npm]: https://docs.npmjs.com/cli/install + +[skypack]: https://www.skypack.dev + +[license]: license + +[author]: https://wooorm.com + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[typescript]: https://www.typescriptlang.org + +[contribute]: https://opensource.guide/how-to-contribute/ diff --git a/tools/ui/node_modules/webidl-conversions/LICENSE.md b/tools/ui/node_modules/webidl-conversions/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..d4a994f50bfa1ecc19489f03822a6e728d3e2a49 --- /dev/null +++ b/tools/ui/node_modules/webidl-conversions/LICENSE.md @@ -0,0 +1,12 @@ +# The BSD 2-Clause License + +Copyright (c) 2014, Domenic Denicola +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. 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. + +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/webidl-conversions/README.md b/tools/ui/node_modules/webidl-conversions/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ed67f5e96fa6028d2efd49582a30b631160c94c5 --- /dev/null +++ b/tools/ui/node_modules/webidl-conversions/README.md @@ -0,0 +1,80 @@ +# Web IDL Type Conversions on JavaScript Values + +This package implements, in JavaScript, the algorithms to convert a given JavaScript value according to a given [Web IDL](http://heycam.github.io/webidl/) [type](http://heycam.github.io/webidl/#idl-types). + +The goal is that you should be able to write code like + +```js +"use strict"; +const conversions = require("webidl-conversions"); + +function doStuff(x, y) { + x = conversions["boolean"](x); + y = conversions["unsigned long"](y); + // actual algorithm code here +} +``` + +and your function `doStuff` will behave the same as a Web IDL operation declared as + +```webidl +void doStuff(boolean x, unsigned long y); +``` + +## API + +This package's main module's default export is an object with a variety of methods, each corresponding to a different Web IDL type. Each method, when invoked on a JavaScript value, will give back the new JavaScript value that results after passing through the Web IDL conversion rules. (See below for more details on what that means.) Alternately, the method could throw an error, if the Web IDL algorithm is specified to do so: for example `conversions["float"](NaN)` [will throw a `TypeError`](http://heycam.github.io/webidl/#es-float). + +Each method also accepts a second, optional, parameter for miscellaneous options. For conversion methods that throw errors, a string option `{ context }` may be provided to provide more information in the error message. (For example, `conversions["float"](NaN, { context: "Argument 1 of Interface's operation" })` will throw an error with message `"Argument 1 of Interface's operation is not a finite floating-point value."`) Specific conversions may also accept other options, the details of which can be found below. + +## Conversions implemented + +Conversions for all of the basic types from the Web IDL specification are implemented: + +- [`any`](https://heycam.github.io/webidl/#es-any) +- [`void`](https://heycam.github.io/webidl/#es-void) +- [`boolean`](https://heycam.github.io/webidl/#es-boolean) +- [Integer types](https://heycam.github.io/webidl/#es-integer-types), which can additionally be provided the boolean options `{ clamp, enforceRange }` as a second parameter +- [`float`](https://heycam.github.io/webidl/#es-float), [`unrestricted float`](https://heycam.github.io/webidl/#es-unrestricted-float) +- [`double`](https://heycam.github.io/webidl/#es-double), [`unrestricted double`](https://heycam.github.io/webidl/#es-unrestricted-double) +- [`DOMString`](https://heycam.github.io/webidl/#es-DOMString), which can additionally be provided the boolean option `{ treatNullAsEmptyString }` as a second parameter +- [`ByteString`](https://heycam.github.io/webidl/#es-ByteString), [`USVString`](https://heycam.github.io/webidl/#es-USVString) +- [`object`](https://heycam.github.io/webidl/#es-object) +- [`Error`](https://heycam.github.io/webidl/#es-Error) +- [Buffer source types](https://heycam.github.io/webidl/#es-buffer-source-types) + +Additionally, for convenience, the following derived type definitions are implemented: + +- [`ArrayBufferView`](https://heycam.github.io/webidl/#ArrayBufferView) +- [`BufferSource`](https://heycam.github.io/webidl/#BufferSource) +- [`DOMTimeStamp`](https://heycam.github.io/webidl/#DOMTimeStamp) +- [`Function`](https://heycam.github.io/webidl/#Function) +- [`VoidFunction`](https://heycam.github.io/webidl/#VoidFunction) (although it will not censor the return type) + +Derived types, such as nullable types, promise types, sequences, records, etc. are not handled by this library. You may wish to investigate the [webidl2js](https://github.com/jsdom/webidl2js) project. + +### A note on the `long long` types + +The `long long` and `unsigned long long` Web IDL types can hold values that cannot be stored in JavaScript numbers, so the conversion is imperfect. For example, converting the JavaScript number `18446744073709552000` to a Web IDL `long long` is supposed to produce the Web IDL value `-18446744073709551232`. Since we are representing our Web IDL values in JavaScript, we can't represent `-18446744073709551232`, so we instead the best we could do is `-18446744073709552000` as the output. + +This library actually doesn't even get that far. Producing those results would require doing accurate modular arithmetic on 64-bit intermediate values, but JavaScript does not make this easy. We could pull in a big-integer library as a dependency, but in lieu of that, we for now have decided to just produce inaccurate results if you pass in numbers that are not strictly between `Number.MIN_SAFE_INTEGER` and `Number.MAX_SAFE_INTEGER`. + +## Background + +What's actually going on here, conceptually, is pretty weird. Let's try to explain. + +Web IDL, as part of its madness-inducing design, has its own type system. When people write algorithms in web platform specs, they usually operate on Web IDL values, i.e. instances of Web IDL types. For example, if they were specifying the algorithm for our `doStuff` operation above, they would treat `x` as a Web IDL value of [Web IDL type `boolean`](http://heycam.github.io/webidl/#idl-boolean). Crucially, they would _not_ treat `x` as a JavaScript variable whose value is either the JavaScript `true` or `false`. They're instead working in a different type system altogether, with its own rules. + +Separately from its type system, Web IDL defines a ["binding"](http://heycam.github.io/webidl/#ecmascript-binding) of the type system into JavaScript. This contains rules like: when you pass a JavaScript value to the JavaScript method that manifests a given Web IDL operation, how does that get converted into a Web IDL value? For example, a JavaScript `true` passed in the position of a Web IDL `boolean` argument becomes a Web IDL `true`. But, a JavaScript `true` passed in the position of a [Web IDL `unsigned long`](http://heycam.github.io/webidl/#idl-unsigned-long) becomes a Web IDL `1`. And so on. + +Finally, we have the actual implementation code. This is usually C++, although these days [some smart people are using Rust](https://github.com/servo/servo). The implementation, of course, has its own type system. So when they implement the Web IDL algorithms, they don't actually use Web IDL values, since those aren't "real" outside of specs. Instead, implementations apply the Web IDL binding rules in such a way as to convert incoming JavaScript values into C++ values. For example, if code in the browser called `doStuff(true, true)`, then the implementation code would eventually receive a C++ `bool` containing `true` and a C++ `uint32_t` containing `1`. + +The upside of all this is that implementations can abstract all the conversion logic away, letting Web IDL handle it, and focus on implementing the relevant methods in C++ with values of the correct type already provided. That is payoff of Web IDL, in a nutshell. + +And getting to that payoff is the goal of _this_ project—but for JavaScript implementations, instead of C++ ones. That is, this library is designed to make it easier for JavaScript developers to write functions that behave like a given Web IDL operation. So conceptually, the conversion pipeline, which in its general form is JavaScript values ↦ Web IDL values ↦ implementation-language values, in this case becomes JavaScript values ↦ Web IDL values ↦ JavaScript values. And that intermediate step is where all the logic is performed: a JavaScript `true` becomes a Web IDL `1` in an unsigned long context, which then becomes a JavaScript `1`. + +## Don't use this + +Seriously, why would you ever use this? You really shouldn't. Web IDL is … strange, and you shouldn't be emulating its semantics. If you're looking for a generic argument-processing library, you should find one with better rules than those from Web IDL. In general, your JavaScript should not be trying to become more like Web IDL; if anything, we should fix Web IDL to make it more like JavaScript. + +The _only_ people who should use this are those trying to create faithful implementations (or polyfills) of web platform interfaces defined in Web IDL. Its main consumer is the [jsdom](https://github.com/tmpvar/jsdom) project. diff --git a/tools/ui/node_modules/webidl-conversions/lib/index.js b/tools/ui/node_modules/webidl-conversions/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..7f16341c1cd37fe898104c2abce44975fe7beaa1 --- /dev/null +++ b/tools/ui/node_modules/webidl-conversions/lib/index.js @@ -0,0 +1,332 @@ +"use strict"; + +function _(message, opts) { + return `${opts && opts.context ? opts.context : "Value"} ${message}.`; +} + +function type(V) { + if (V === null) { + return "Null"; + } + switch (typeof V) { + case "undefined": + return "Undefined"; + case "boolean": + return "Boolean"; + case "number": + return "Number"; + case "string": + return "String"; + case "symbol": + return "Symbol"; + case "object": + // Falls through + case "function": + // Falls through + default: + // Per ES spec, typeof returns an implemention-defined value that is not any of the existing ones for + // uncallable non-standard exotic objects. Yet Type() which the Web IDL spec depends on returns Object for + // such cases. So treat the default case as an object. + return "Object"; + } +} + +// Round x to the nearest integer, choosing the even integer if it lies halfway between two. +function evenRound(x) { + // There are four cases for numbers with fractional part being .5: + // + // case | x | floor(x) | round(x) | expected | x <> 0 | x % 1 | x & 1 | example + // 1 | 2n + 0.5 | 2n | 2n + 1 | 2n | > | 0.5 | 0 | 0.5 -> 0 + // 2 | 2n + 1.5 | 2n + 1 | 2n + 2 | 2n + 2 | > | 0.5 | 1 | 1.5 -> 2 + // 3 | -2n - 0.5 | -2n - 1 | -2n | -2n | < | -0.5 | 0 | -0.5 -> 0 + // 4 | -2n - 1.5 | -2n - 2 | -2n - 1 | -2n - 2 | < | -0.5 | 1 | -1.5 -> -2 + // (where n is a non-negative integer) + // + // Branch here for cases 1 and 4 + if ((x > 0 && (x % 1) === +0.5 && (x & 1) === 0) || + (x < 0 && (x % 1) === -0.5 && (x & 1) === 1)) { + return censorNegativeZero(Math.floor(x)); + } + + return censorNegativeZero(Math.round(x)); +} + +function integerPart(n) { + return censorNegativeZero(Math.trunc(n)); +} + +function sign(x) { + return x < 0 ? -1 : 1; +} + +function modulo(x, y) { + // https://tc39.github.io/ecma262/#eqn-modulo + // Note that http://stackoverflow.com/a/4467559/3191 does NOT work for large modulos + const signMightNotMatch = x % y; + if (sign(y) !== sign(signMightNotMatch)) { + return signMightNotMatch + y; + } + return signMightNotMatch; +} + +function censorNegativeZero(x) { + return x === 0 ? 0 : x; +} + +function createIntegerConversion(bitLength, typeOpts) { + const isSigned = !typeOpts.unsigned; + + let lowerBound; + let upperBound; + if (bitLength === 64) { + upperBound = Math.pow(2, 53) - 1; + lowerBound = !isSigned ? 0 : -Math.pow(2, 53) + 1; + } else if (!isSigned) { + lowerBound = 0; + upperBound = Math.pow(2, bitLength) - 1; + } else { + lowerBound = -Math.pow(2, bitLength - 1); + upperBound = Math.pow(2, bitLength - 1) - 1; + } + + const twoToTheBitLength = Math.pow(2, bitLength); + const twoToOneLessThanTheBitLength = Math.pow(2, bitLength - 1); + + return (V, opts) => { + if (opts === undefined) { + opts = {}; + } + + let x = +V; + x = censorNegativeZero(x); // Spec discussion ongoing: https://github.com/heycam/webidl/issues/306 + + if (opts.enforceRange) { + if (!Number.isFinite(x)) { + throw new TypeError(_("is not a finite number", opts)); + } + + x = integerPart(x); + + if (x < lowerBound || x > upperBound) { + throw new TypeError(_( + `is outside the accepted range of ${lowerBound} to ${upperBound}, inclusive`, opts)); + } + + return x; + } + + if (!Number.isNaN(x) && opts.clamp) { + x = Math.min(Math.max(x, lowerBound), upperBound); + x = evenRound(x); + return x; + } + + if (!Number.isFinite(x) || x === 0) { + return 0; + } + x = integerPart(x); + + // Math.pow(2, 64) is not accurately representable in JavaScript, so try to avoid these per-spec operations if + // possible. Hopefully it's an optimization for the non-64-bitLength cases too. + if (x >= lowerBound && x <= upperBound) { + return x; + } + + // These will not work great for bitLength of 64, but oh well. See the README for more details. + x = modulo(x, twoToTheBitLength); + if (isSigned && x >= twoToOneLessThanTheBitLength) { + return x - twoToTheBitLength; + } + return x; + }; +} + +exports.any = V => { + return V; +}; + +exports.void = function () { + return undefined; +}; + +exports.boolean = function (val) { + return !!val; +}; + +exports.byte = createIntegerConversion(8, { unsigned: false }); +exports.octet = createIntegerConversion(8, { unsigned: true }); + +exports.short = createIntegerConversion(16, { unsigned: false }); +exports["unsigned short"] = createIntegerConversion(16, { unsigned: true }); + +exports.long = createIntegerConversion(32, { unsigned: false }); +exports["unsigned long"] = createIntegerConversion(32, { unsigned: true }); + +exports["long long"] = createIntegerConversion(64, { unsigned: false }); +exports["unsigned long long"] = createIntegerConversion(64, { unsigned: true }); + +exports.double = (V, opts) => { + const x = +V; + + if (!Number.isFinite(x)) { + throw new TypeError(_("is not a finite floating-point value", opts)); + } + + return x; +}; + +exports["unrestricted double"] = V => { + const x = +V; + + return x; +}; + +exports.float = (V, opts) => { + const x = +V; + + if (!Number.isFinite(x)) { + throw new TypeError(_("is not a finite floating-point value", opts)); + } + + if (Object.is(x, -0)) { + return x; + } + + const y = Math.fround(x); + + if (!Number.isFinite(y)) { + throw new TypeError(_("is outside the range of a single-precision floating-point value", opts)); + } + + return y; +}; + +exports["unrestricted float"] = V => { + const x = +V; + + if (isNaN(x)) { + return x; + } + + if (Object.is(x, -0)) { + return x; + } + + return Math.fround(x); +}; + +exports.DOMString = function (V, opts) { + if (opts === undefined) { + opts = {}; + } + + if (opts.treatNullAsEmptyString && V === null) { + return ""; + } + + if (typeof V === "symbol") { + throw new TypeError(_("is a symbol, which cannot be converted to a string", opts)); + } + + return String(V); +}; + +exports.ByteString = (V, opts) => { + const x = exports.DOMString(V, opts); + let c; + for (let i = 0; (c = x.codePointAt(i)) !== undefined; ++i) { + if (c > 255) { + throw new TypeError(_("is not a valid ByteString", opts)); + } + } + + return x; +}; + +exports.USVString = (V, opts) => { + const S = exports.DOMString(V, opts); + const n = S.length; + const U = []; + for (let i = 0; i < n; ++i) { + const c = S.charCodeAt(i); + if (c < 0xD800 || c > 0xDFFF) { + U.push(String.fromCodePoint(c)); + } else if (0xDC00 <= c && c <= 0xDFFF) { + U.push(String.fromCodePoint(0xFFFD)); + } else if (i === n - 1) { + U.push(String.fromCodePoint(0xFFFD)); + } else { + const d = S.charCodeAt(i + 1); + if (0xDC00 <= d && d <= 0xDFFF) { + const a = c & 0x3FF; + const b = d & 0x3FF; + U.push(String.fromCodePoint((2 << 15) + ((2 << 9) * a) + b)); + ++i; + } else { + U.push(String.fromCodePoint(0xFFFD)); + } + } + } + + return U.join(""); +}; + +exports.object = (V, opts) => { + if (type(V) !== "Object") { + throw new TypeError(_("is not an object", opts)); + } + + return V; +}; + +// Not exported, but used in Function and VoidFunction. + +// Neither Function nor VoidFunction is defined with [TreatNonObjectAsNull], so +// handling for that is omitted. +function convertCallbackFunction(V, opts) { + if (typeof V !== "function") { + throw new TypeError(_("is not a function", opts)); + } + return V; +} + +[ + Error, + ArrayBuffer, // The IsDetachedBuffer abstract operation is not exposed in JS + DataView, Int8Array, Int16Array, Int32Array, Uint8Array, + Uint16Array, Uint32Array, Uint8ClampedArray, Float32Array, Float64Array +].forEach(func => { + const name = func.name; + const article = /^[AEIOU]/.test(name) ? "an" : "a"; + exports[name] = (V, opts) => { + if (!(V instanceof func)) { + throw new TypeError(_(`is not ${article} ${name} object`, opts)); + } + + return V; + }; +}); + +// Common definitions + +exports.ArrayBufferView = (V, opts) => { + if (!ArrayBuffer.isView(V)) { + throw new TypeError(_("is not a view on an ArrayBuffer object", opts)); + } + + return V; +}; + +exports.BufferSource = (V, opts) => { + if (!(ArrayBuffer.isView(V) || V instanceof ArrayBuffer)) { + throw new TypeError(_("is not an ArrayBuffer object or a view on one", opts)); + } + + return V; +}; + +exports.DOMTimeStamp = exports["unsigned long long"]; + +exports.Function = convertCallbackFunction; + +exports.VoidFunction = convertCallbackFunction; diff --git a/tools/ui/node_modules/webidl-conversions/package.json b/tools/ui/node_modules/webidl-conversions/package.json new file mode 100644 index 0000000000000000000000000000000000000000..fc59adde757de684509fb17ff884021db1ba62f5 --- /dev/null +++ b/tools/ui/node_modules/webidl-conversions/package.json @@ -0,0 +1,27 @@ +{ + "name": "webidl-conversions", + "version": "4.0.2", + "description": "Implements the WebIDL algorithms for converting to and from JavaScript values", + "main": "lib/index.js", + "scripts": { + "lint": "eslint .", + "test": "mocha test/*.js", + "coverage": "nyc mocha test/*.js" + }, + "repository": "jsdom/webidl-conversions", + "keywords": [ + "webidl", + "web", + "types" + ], + "files": [ + "lib/" + ], + "author": "Domenic Denicola (https://domenic.me/)", + "license": "BSD-2-Clause", + "devDependencies": { + "eslint": "^3.15.0", + "mocha": "^1.21.4", + "nyc": "^10.1.2" + } +} diff --git a/tools/ui/node_modules/webpack-virtual-modules/LICENSE b/tools/ui/node_modules/webpack-virtual-modules/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..913422af052bba238de456283fdcecde1975045f --- /dev/null +++ b/tools/ui/node_modules/webpack-virtual-modules/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017 SysGears + +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/webpack-virtual-modules/README.md b/tools/ui/node_modules/webpack-virtual-modules/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7b2201e8b8d8a20d7c79a78ae53b22650fcadcdf --- /dev/null +++ b/tools/ui/node_modules/webpack-virtual-modules/README.md @@ -0,0 +1,131 @@ +# Webpack Virtual Modules + +[![npm version][npm-version-src]][npm-version-href] +[![npm downloads][npm-downloads-src]][npm-downloads-href] +[![License][license-src]][license-href] + +**Webpack Virtual Modules** is a plugin that allows for dynamical generation of in-memory virtual modules for JavaScript +builds created with webpack. When virtual module is created all the parent virtual dirs that lead to the module filename are created too. This plugin supports watch mode meaning any write to a virtual module is seen by webpack as +if a real file stored on disk has changed. + +## Installation + +Use NPM or Yarn to install Webpack Virtual Modules as a development dependency: + +```bash +# with NPM +npm install webpack-virtual-modules --save-dev + +# with Yarn +yarn add webpack-virtual-modules --dev +``` + +## Usage + +You can use Webpack Virtual Modules with webpack 5, 4 and 3. The examples below show the usage with webpack 5 or 4. If you want to use our plugin with webpack 3, check out a dedicated doc: + +* [Webpack Virtual Modules with Webpack 3] + +### Generating static virtual modules + +Require the plugin in the webpack configuration file, then create and add virtual modules in the `plugins` array in the +webpack configuration object: + +```js +var VirtualModulesPlugin = require('webpack-virtual-modules'); + +var virtualModules = new VirtualModulesPlugin({ + 'node_modules/module-foo.js': 'module.exports = { foo: "foo" };', + 'node_modules/module-bar.js': 'module.exports = { bar: "bar" };' +}); + +module.exports = { + // ... + plugins: [ + virtualModules + ] +}; +``` + +You can now import your virtual modules anywhere in the application and use them: + +```js +var moduleFoo = require('module-foo'); +// You can now use moduleFoo +console.log(moduleFoo.foo); +``` + +### Generating dynamic virtual modules + +You can generate virtual modules **_dynamically_** with Webpack Virtual Modules. + +Here's an example of dynamic generation of a module. All you need to do is create new virtual modules using the plugin +and add them to the `plugins` array. After that, you need to add a webpack hook. For using hooks, consult [webpack +compiler hook documentation]. + +```js +var webpack = require('webpack'); +var VirtualModulesPlugin = require('webpack-virtual-modules'); + +// Create an empty set of virtual modules +const virtualModules = new VirtualModulesPlugin(); + +var compiler = webpack({ + // ... + plugins: [ + virtualModules + ] +}); + +compiler.hooks.compilation.tap('MyPlugin', function(compilation) { + virtualModules.writeModule('node_modules/module-foo.js', ''); +}); + +compiler.watch(); +``` + +In other module or a Webpack plugin, you can write to the module `module-foo` whatever you need. After this write, +webpack will "see" that `module-foo.js` has changed and will restart compilation. + +```js +virtualModules.writeModule( + 'node_modules/module-foo.js', + 'module.exports = { foo: "foo" };' +); +``` + +## More Examples + + - [Swagger and JSDoc Example with Webpack 5] + - [Swagger and JSDoc Example with Webpack 4] + - [Swagger and JSDoc Example with Webpack 3] + +## API Reference + + - [API Reference] + +## Inspiration + +This project is inspired by [virtual-module-webpack-plugin]. + +## License + +Copyright © 2017 [SysGears INC]. This source code is licensed under the [MIT] license. + +[webpack virtual modules with webpack 3]: https://github.com/sysgears/webpack-virtual-modules/tree/master/docs/webpack3.md +[webpack compiler hook documentation]: https://webpack.js.org/api/compiler-hooks/ +[swagger and jsdoc example with webpack 3]: https://github.com/sysgears/webpack-virtual-modules/tree/master/examples/swagger-webpack3 +[swagger and jsdoc example with webpack 4]: https://github.com/sysgears/webpack-virtual-modules/tree/master/examples/swagger-webpack4 +[swagger and jsdoc example with webpack 5]: https://github.com/sysgears/webpack-virtual-modules/tree/master/examples/swagger-webpack5 +[api reference]: https://github.com/sysgears/webpack-virtual-modules/tree/master/docs/API%20Reference.md +[virtual-module-webpack-plugin]: https://github.com/rmarscher/virtual-module-webpack-plugin +[MIT]: LICENSE +[SysGears INC]: http://sysgears.com + + +[npm-version-src]: https://img.shields.io/npm/v/webpack-virtual-modules?style=flat +[npm-version-href]: https://npmjs.com/package/webpack-virtual-modules +[npm-downloads-src]: https://img.shields.io/npm/dm/webpack-virtual-modules?style=flat +[npm-downloads-href]: https://npmjs.com/package/webpack-virtual-modules +[license-src]: https://img.shields.io/github/license/sysgears/webpack-virtual-modules.svg?style=flat +[license-href]: https://github.com/sysgears/webpack-virtual-modules/blob/main/LICENSE diff --git a/tools/ui/node_modules/webpack-virtual-modules/lib/index.d.ts b/tools/ui/node_modules/webpack-virtual-modules/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2d8f611d49cd22370f445ea573d2d36e5fc62f95 --- /dev/null +++ b/tools/ui/node_modules/webpack-virtual-modules/lib/index.d.ts @@ -0,0 +1,15 @@ +import type { Compiler } from 'webpack'; +declare const ALL = "all"; +declare const STATIC = "static"; +declare const DYNAMIC = "dynamic"; +declare type AvailableModules = typeof ALL | typeof STATIC | typeof DYNAMIC; +declare class VirtualModulesPlugin { + private _staticModules; + private _compiler; + private _watcher; + constructor(modules?: Record); + getModuleList(filter?: AvailableModules): {}; + writeModule(filePath: string, contents: string): void; + apply(compiler: Compiler): void; +} +export = VirtualModulesPlugin; diff --git a/tools/ui/node_modules/webpack-virtual-modules/lib/index.js b/tools/ui/node_modules/webpack-virtual-modules/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..06fa523ee5382295b2e96c6550a0d6563c67f08f --- /dev/null +++ b/tools/ui/node_modules/webpack-virtual-modules/lib/index.js @@ -0,0 +1,292 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +const path_1 = __importDefault(require("path")); +const virtual_stats_1 = require("./virtual-stats"); +let inode = 45000000; +const ALL = 'all'; +const STATIC = 'static'; +const DYNAMIC = 'dynamic'; +function checkActivation(instance) { + if (!instance._compiler) { + throw new Error('You must use this plugin only after creating webpack instance!'); + } +} +function getModulePath(filePath, compiler) { + return path_1.default.isAbsolute(filePath) ? filePath : path_1.default.join(compiler.context, filePath); +} +function createWebpackData(result) { + return (backendOrStorage) => { + if (backendOrStorage._data) { + const curLevelIdx = backendOrStorage._currentLevel; + const curLevel = backendOrStorage._levels[curLevelIdx]; + return { + result, + level: curLevel, + }; + } + return [null, result]; + }; +} +function getData(storage, key) { + if (storage._data instanceof Map) { + return storage._data.get(key); + } + else if (storage._data) { + return storage.data[key]; + } + else if (storage.data instanceof Map) { + return storage.data.get(key); + } + else { + return storage.data[key]; + } +} +function setData(backendOrStorage, key, valueFactory) { + const value = valueFactory(backendOrStorage); + if (backendOrStorage._data instanceof Map) { + backendOrStorage._data.set(key, value); + } + else if (backendOrStorage._data) { + backendOrStorage.data[key] = value; + } + else if (backendOrStorage.data instanceof Map) { + backendOrStorage.data.set(key, value); + } + else { + backendOrStorage.data[key] = value; + } +} +function getStatStorage(fileSystem) { + if (fileSystem._statStorage) { + return fileSystem._statStorage; + } + else if (fileSystem._statBackend) { + return fileSystem._statBackend; + } + else { + throw new Error("Couldn't find a stat storage"); + } +} +function getFileStorage(fileSystem) { + if (fileSystem._readFileStorage) { + return fileSystem._readFileStorage; + } + else if (fileSystem._readFileBackend) { + return fileSystem._readFileBackend; + } + else { + throw new Error("Couldn't find a readFileStorage"); + } +} +function getReadDirBackend(fileSystem) { + if (fileSystem._readdirBackend) { + return fileSystem._readdirBackend; + } + else if (fileSystem._readdirStorage) { + return fileSystem._readdirStorage; + } + else { + throw new Error("Couldn't find a readDirStorage from Webpack Internals"); + } +} +function getRealpathBackend(fileSystem) { + if (fileSystem._realpathBackend) { + return fileSystem._realpathBackend; + } +} +class VirtualModulesPlugin { + constructor(modules) { + this._compiler = null; + this._watcher = null; + this._staticModules = modules || null; + } + getModuleList(filter = ALL) { + var _a, _b; + let modules = {}; + const shouldGetStaticModules = filter === ALL || filter === STATIC; + const shouldGetDynamicModules = filter === ALL || filter === DYNAMIC; + if (shouldGetStaticModules) { + modules = Object.assign(Object.assign({}, modules), this._staticModules); + } + if (shouldGetDynamicModules) { + const finalInputFileSystem = (_a = this._compiler) === null || _a === void 0 ? void 0 : _a.inputFileSystem; + const virtualFiles = (_b = finalInputFileSystem === null || finalInputFileSystem === void 0 ? void 0 : finalInputFileSystem._virtualFiles) !== null && _b !== void 0 ? _b : {}; + const dynamicModules = {}; + Object.keys(virtualFiles).forEach((key) => { + dynamicModules[key] = virtualFiles[key].contents; + }); + modules = Object.assign(Object.assign({}, modules), dynamicModules); + } + return modules; + } + writeModule(filePath, contents) { + if (!this._compiler) { + throw new Error(`Plugin has not been initialized`); + } + checkActivation(this); + const len = contents ? contents.length : 0; + const time = Date.now(); + const date = new Date(time); + const stats = new virtual_stats_1.VirtualStats({ + dev: 8675309, + nlink: 0, + uid: 1000, + gid: 1000, + rdev: 0, + blksize: 4096, + ino: inode++, + mode: 33188, + size: len, + blocks: Math.floor(len / 4096), + atime: date, + mtime: date, + ctime: date, + birthtime: date, + }); + const modulePath = getModulePath(filePath, this._compiler); + if (process.env.WVM_DEBUG) + console.log(this._compiler.name, 'Write virtual module:', modulePath, contents); + let finalWatchFileSystem = this._watcher && this._watcher.watchFileSystem; + while (finalWatchFileSystem && finalWatchFileSystem.wfs) { + finalWatchFileSystem = finalWatchFileSystem.wfs; + } + let finalInputFileSystem = this._compiler.inputFileSystem; + while (finalInputFileSystem && finalInputFileSystem._inputFileSystem) { + finalInputFileSystem = finalInputFileSystem._inputFileSystem; + } + finalInputFileSystem._writeVirtualFile(modulePath, stats, contents); + if (finalWatchFileSystem && + finalWatchFileSystem.watcher && + (finalWatchFileSystem.watcher.fileWatchers.size || finalWatchFileSystem.watcher.fileWatchers.length)) { + const fileWatchers = finalWatchFileSystem.watcher.fileWatchers instanceof Map + ? Array.from(finalWatchFileSystem.watcher.fileWatchers.values()) + : finalWatchFileSystem.watcher.fileWatchers; + for (let fileWatcher of fileWatchers) { + if ('watcher' in fileWatcher) { + fileWatcher = fileWatcher.watcher; + } + if (fileWatcher.path === modulePath) { + if (process.env.DEBUG) + console.log(this._compiler.name, 'Emit file change:', modulePath, time); + delete fileWatcher.directoryWatcher._cachedTimeInfoEntries; + fileWatcher.emit('change', time, null); + } + } + } + } + apply(compiler) { + this._compiler = compiler; + const afterEnvironmentHook = () => { + let finalInputFileSystem = compiler.inputFileSystem; + while (finalInputFileSystem && finalInputFileSystem._inputFileSystem) { + finalInputFileSystem = finalInputFileSystem._inputFileSystem; + } + if (!finalInputFileSystem._writeVirtualFile) { + const originalPurge = finalInputFileSystem.purge; + finalInputFileSystem.purge = () => { + originalPurge.apply(finalInputFileSystem, []); + if (finalInputFileSystem._virtualFiles) { + Object.keys(finalInputFileSystem._virtualFiles).forEach((file) => { + const data = finalInputFileSystem._virtualFiles[file]; + finalInputFileSystem._writeVirtualFile(file, data.stats, data.contents); + }); + } + }; + finalInputFileSystem._writeVirtualFile = (file, stats, contents) => { + const statStorage = getStatStorage(finalInputFileSystem); + const fileStorage = getFileStorage(finalInputFileSystem); + const readDirStorage = getReadDirBackend(finalInputFileSystem); + const realPathStorage = getRealpathBackend(finalInputFileSystem); + finalInputFileSystem._virtualFiles = finalInputFileSystem._virtualFiles || {}; + finalInputFileSystem._virtualFiles[file] = { stats: stats, contents: contents }; + setData(statStorage, file, createWebpackData(stats)); + setData(fileStorage, file, createWebpackData(contents)); + const segments = file.split(/[\\/]/); + let count = segments.length - 1; + const minCount = segments[0] ? 1 : 0; + while (count > minCount) { + const dir = segments.slice(0, count).join(path_1.default.sep) || path_1.default.sep; + try { + finalInputFileSystem.readdirSync(dir); + } + catch (e) { + const time = Date.now(); + const dirStats = new virtual_stats_1.VirtualStats({ + dev: 8675309, + nlink: 0, + uid: 1000, + gid: 1000, + rdev: 0, + blksize: 4096, + ino: inode++, + mode: 16877, + size: stats.size, + blocks: Math.floor(stats.size / 4096), + atime: time, + mtime: time, + ctime: time, + birthtime: time, + }); + setData(readDirStorage, dir, createWebpackData([])); + if (realPathStorage) { + setData(realPathStorage, dir, createWebpackData(dir)); + } + setData(statStorage, dir, createWebpackData(dirStats)); + } + let dirData = getData(getReadDirBackend(finalInputFileSystem), dir); + dirData = dirData[1] || dirData.result; + const filename = segments[count]; + if (dirData.indexOf(filename) < 0) { + const files = dirData.concat([filename]).sort(); + setData(getReadDirBackend(finalInputFileSystem), dir, createWebpackData(files)); + } + else { + break; + } + count--; + } + }; + } + }; + const afterResolversHook = () => { + if (this._staticModules) { + for (const [filePath, contents] of Object.entries(this._staticModules)) { + this.writeModule(filePath, contents); + } + this._staticModules = null; + } + }; + const version = typeof compiler.webpack === 'undefined' ? 4 : 5; + const watchRunHook = (watcher, callback) => { + this._watcher = watcher.compiler || watcher; + const virtualFiles = compiler.inputFileSystem._virtualFiles; + const fts = compiler.fileTimestamps; + if (virtualFiles && fts && typeof fts.set === 'function') { + Object.keys(virtualFiles).forEach((file) => { + const mtime = +virtualFiles[file].stats.mtime; + fts.set(file, version === 4 + ? mtime + : { + safeTime: mtime, + timestamp: mtime, + }); + }); + } + callback(); + }; + if (compiler.hooks) { + compiler.hooks.afterEnvironment.tap('VirtualModulesPlugin', afterEnvironmentHook); + compiler.hooks.afterResolvers.tap('VirtualModulesPlugin', afterResolversHook); + compiler.hooks.watchRun.tapAsync('VirtualModulesPlugin', watchRunHook); + } + else { + compiler.plugin('after-environment', afterEnvironmentHook); + compiler.plugin('after-resolvers', afterResolversHook); + compiler.plugin('watch-run', watchRunHook); + } + } +} +module.exports = VirtualModulesPlugin; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/webpack-virtual-modules/lib/index.js.map b/tools/ui/node_modules/webpack-virtual-modules/lib/index.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f476a4f1d53c76555923905e2a170ff2c77e5ddc --- /dev/null +++ b/tools/ui/node_modules/webpack-virtual-modules/lib/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;AAAA,gDAAwB;AACxB,mDAA+C;AAG/C,IAAI,KAAK,GAAG,QAAQ,CAAC;AACrB,MAAM,GAAG,GAAG,KAAK,CAAC;AAClB,MAAM,MAAM,GAAG,QAAQ,CAAC;AACxB,MAAM,OAAO,GAAG,SAAS,CAAC;AAI1B,SAAS,eAAe,CAAC,QAAQ;IAC/B,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE;QACvB,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;KACnF;AACH,CAAC;AAED,SAAS,aAAa,CAAC,QAAQ,EAAE,QAAQ;IACvC,OAAO,cAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;AACtF,CAAC;AAED,SAAS,iBAAiB,CAAC,MAAM;IAC/B,OAAO,CAAC,gBAAgB,EAAE,EAAE;QAG1B,IAAI,gBAAgB,CAAC,KAAK,EAAE;YAC1B,MAAM,WAAW,GAAG,gBAAgB,CAAC,aAAa,CAAC;YACnD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YACvD,OAAO;gBACL,MAAM;gBACN,KAAK,EAAE,QAAQ;aAChB,CAAC;SACH;QAED,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;IACxB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,OAAO,CAAC,OAAO,EAAE,GAAG;IAE3B,IAAI,OAAO,CAAC,KAAK,YAAY,GAAG,EAAE;QAChC,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KAC/B;SAAM,IAAI,OAAO,CAAC,KAAK,EAAE;QACxB,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC1B;SAAM,IAAI,OAAO,CAAC,IAAI,YAAY,GAAG,EAAE;QAEtC,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;KAC9B;SAAM;QACL,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC1B;AACH,CAAC;AAED,SAAS,OAAO,CAAC,gBAAgB,EAAE,GAAG,EAAE,YAAY;IAClD,MAAM,KAAK,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAG7C,IAAI,gBAAgB,CAAC,KAAK,YAAY,GAAG,EAAE;QACzC,gBAAgB,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACxC;SAAM,IAAI,gBAAgB,CAAC,KAAK,EAAE;QACjC,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;KACpC;SAAM,IAAI,gBAAgB,CAAC,IAAI,YAAY,GAAG,EAAE;QAE/C,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;KACvC;SAAM;QACL,gBAAgB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;KACpC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,UAAU;IAChC,IAAI,UAAU,CAAC,YAAY,EAAE;QAE3B,OAAO,UAAU,CAAC,YAAY,CAAC;KAChC;SAAM,IAAI,UAAU,CAAC,YAAY,EAAE;QAElC,OAAO,UAAU,CAAC,YAAY,CAAC;KAChC;SAAM;QAEL,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;KACjD;AACH,CAAC;AAED,SAAS,cAAc,CAAC,UAAU;IAChC,IAAI,UAAU,CAAC,gBAAgB,EAAE;QAE/B,OAAO,UAAU,CAAC,gBAAgB,CAAC;KACpC;SAAM,IAAI,UAAU,CAAC,gBAAgB,EAAE;QAEtC,OAAO,UAAU,CAAC,gBAAgB,CAAC;KACpC;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;KACpD;AACH,CAAC;AAED,SAAS,iBAAiB,CAAC,UAAU;IACnC,IAAI,UAAU,CAAC,eAAe,EAAE;QAC9B,OAAO,UAAU,CAAC,eAAe,CAAC;KACnC;SAAM,IAAI,UAAU,CAAC,eAAe,EAAE;QACrC,OAAO,UAAU,CAAC,eAAe,CAAC;KACnC;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,uDAAuD,CAAC,CAAC;KAC1E;AACH,CAAC;AAED,SAAS,kBAAkB,CAAC,UAAU;IACpC,IAAI,UAAU,CAAC,gBAAgB,EAAE;QAC/B,OAAO,UAAU,CAAC,gBAAgB,CAAC;KACpC;AAGH,CAAC;AAED,MAAM,oBAAoB;IAKxB,YAAmB,OAAgC;QAH3C,cAAS,GAAoB,IAAI,CAAC;QAClC,aAAQ,GAAQ,IAAI,CAAC;QAG3B,IAAI,CAAC,cAAc,GAAG,OAAO,IAAI,IAAI,CAAC;IACxC,CAAC;IAEM,aAAa,CAAC,SAA2B,GAAG;;QACjD,IAAI,OAAO,GAAG,EAAE,CAAC;QACjB,MAAM,sBAAsB,GAAG,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,MAAM,CAAC;QACnE,MAAM,uBAAuB,GAAG,MAAM,KAAK,GAAG,IAAI,MAAM,KAAK,OAAO,CAAC;QAErE,IAAI,sBAAsB,EAAE;YAE1B,OAAO,mCACF,OAAO,GACP,IAAI,CAAC,cAAc,CACvB,CAAC;SACH;QAED,IAAI,uBAAuB,EAAE;YAE3B,MAAM,oBAAoB,GAAQ,MAAA,IAAI,CAAC,SAAS,0CAAE,eAAe,CAAC;YAClE,MAAM,YAAY,GAAG,MAAA,oBAAoB,aAApB,oBAAoB,uBAApB,oBAAoB,CAAE,aAAa,mCAAI,EAAE,CAAC;YAE/D,MAAM,cAAc,GAA2B,EAAE,CAAC;YAClD,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,GAAW,EAAE,EAAE;gBAChD,cAAc,CAAC,GAAG,CAAC,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC;YACnD,CAAC,CAAC,CAAC;YAEH,OAAO,mCACF,OAAO,GACP,cAAc,CAClB,CAAC;SACH;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,WAAW,CAAC,QAAgB,EAAE,QAAgB;QACnD,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;SACpD;QAED,eAAe,CAAC,IAAI,CAAC,CAAC;QAEtB,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC3C,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACxB,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;QAE5B,MAAM,KAAK,GAAG,IAAI,4BAAY,CAAC;YAC7B,GAAG,EAAE,OAAO;YACZ,KAAK,EAAE,CAAC;YACR,GAAG,EAAE,IAAI;YACT,GAAG,EAAE,IAAI;YACT,IAAI,EAAE,CAAC;YACP,OAAO,EAAE,IAAI;YACb,GAAG,EAAE,KAAK,EAAE;YACZ,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,GAAG;YACT,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC;YAC9B,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,IAAI;YACX,KAAK,EAAE,IAAI;YACX,SAAS,EAAE,IAAI;SAChB,CAAC,CAAC;QACH,MAAM,UAAU,GAAG,aAAa,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAE3D,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS;YAEvB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,uBAAuB,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC;QAKlF,IAAI,oBAAoB,GAAG,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC;QAE1E,OAAO,oBAAoB,IAAI,oBAAoB,CAAC,GAAG,EAAE;YACvD,oBAAoB,GAAG,oBAAoB,CAAC,GAAG,CAAC;SACjD;QAED,IAAI,oBAAoB,GAAQ,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC;QAC/D,OAAO,oBAAoB,IAAI,oBAAoB,CAAC,gBAAgB,EAAE;YACpE,oBAAoB,GAAG,oBAAoB,CAAC,gBAAgB,CAAC;SAC9D;QAED,oBAAoB,CAAC,iBAAiB,CAAC,UAAU,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;QACpE,IACE,oBAAoB;YACpB,oBAAoB,CAAC,OAAO;YAC5B,CAAC,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,IAAI,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,EACpG;YACA,MAAM,YAAY,GAChB,oBAAoB,CAAC,OAAO,CAAC,YAAY,YAAY,GAAG;gBACtD,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC;gBAChE,CAAC,CAAC,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC;YAChD,KAAK,IAAI,WAAW,IAAI,YAAY,EAAE;gBACpC,IAAI,SAAS,IAAI,WAAW,EAAE;oBAC5B,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC;iBACnC;gBACD,IAAI,WAAW,CAAC,IAAI,KAAK,UAAU,EAAE;oBACnC,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK;wBAEnB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,mBAAmB,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC;oBAC1E,OAAO,WAAW,CAAC,gBAAgB,CAAC,sBAAsB,CAAC;oBAC3D,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;iBACxC;aACF;SACF;IACH,CAAC;IAEM,KAAK,CAAC,QAAkB;QAC7B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAE1B,MAAM,oBAAoB,GAAG,GAAG,EAAE;YAChC,IAAI,oBAAoB,GAAQ,QAAQ,CAAC,eAAe,CAAC;YACzD,OAAO,oBAAoB,IAAI,oBAAoB,CAAC,gBAAgB,EAAE;gBACpE,oBAAoB,GAAG,oBAAoB,CAAC,gBAAgB,CAAC;aAC9D;YAED,IAAI,CAAC,oBAAoB,CAAC,iBAAiB,EAAE;gBAC3C,MAAM,aAAa,GAAG,oBAAoB,CAAC,KAAK,CAAC;gBAEjD,oBAAoB,CAAC,KAAK,GAAG,GAAG,EAAE;oBAChC,aAAa,CAAC,KAAK,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;oBAC9C,IAAI,oBAAoB,CAAC,aAAa,EAAE;wBACtC,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;4BAC/D,MAAM,IAAI,GAAG,oBAAoB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;4BACtD,oBAAoB,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;wBAC1E,CAAC,CAAC,CAAC;qBACJ;gBACH,CAAC,CAAC;gBAEF,oBAAoB,CAAC,iBAAiB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;oBACjE,MAAM,WAAW,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC;oBACzD,MAAM,WAAW,GAAG,cAAc,CAAC,oBAAoB,CAAC,CAAC;oBACzD,MAAM,cAAc,GAAG,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;oBAC/D,MAAM,eAAe,GAAG,kBAAkB,CAAC,oBAAoB,CAAC,CAAC;oBAEjE,oBAAoB,CAAC,aAAa,GAAG,oBAAoB,CAAC,aAAa,IAAI,EAAE,CAAC;oBAC9E,oBAAoB,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;oBAChF,OAAO,CAAC,WAAW,EAAE,IAAI,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;oBACrD,OAAO,CAAC,WAAW,EAAE,IAAI,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;oBACxD,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;oBACrC,IAAI,KAAK,GAAG,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;oBAChC,MAAM,QAAQ,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;oBACrC,OAAO,KAAK,GAAG,QAAQ,EAAE;wBACvB,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,IAAI,CAAC,cAAI,CAAC,GAAG,CAAC,IAAI,cAAI,CAAC,GAAG,CAAC;wBAChE,IAAI;4BACF,oBAAoB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;yBACvC;wBAAC,OAAO,CAAC,EAAE;4BACV,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;4BACxB,MAAM,QAAQ,GAAG,IAAI,4BAAY,CAAC;gCAChC,GAAG,EAAE,OAAO;gCACZ,KAAK,EAAE,CAAC;gCACR,GAAG,EAAE,IAAI;gCACT,GAAG,EAAE,IAAI;gCACT,IAAI,EAAE,CAAC;gCACP,OAAO,EAAE,IAAI;gCACb,GAAG,EAAE,KAAK,EAAE;gCACZ,IAAI,EAAE,KAAK;gCACX,IAAI,EAAE,KAAK,CAAC,IAAI;gCAChB,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;gCACrC,KAAK,EAAE,IAAI;gCACX,KAAK,EAAE,IAAI;gCACX,KAAK,EAAE,IAAI;gCACX,SAAS,EAAE,IAAI;6BAChB,CAAC,CAAC;4BAEH,OAAO,CAAC,cAAc,EAAE,GAAG,EAAE,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC;4BACpD,IAAI,eAAe,EAAE;gCACnB,OAAO,CAAC,eAAe,EAAE,GAAG,EAAE,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC;6BACvD;4BACD,OAAO,CAAC,WAAW,EAAE,GAAG,EAAE,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;yBACxD;wBACD,IAAI,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,EAAE,GAAG,CAAC,CAAC;wBAEpE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC;wBACvC,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;wBACjC,IAAI,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;4BACjC,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;4BAChD,OAAO,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,EAAE,GAAG,EAAE,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;yBACjF;6BAAM;4BACL,MAAM;yBACP;wBACD,KAAK,EAAE,CAAC;qBACT;gBACH,CAAC,CAAC;aACH;QACH,CAAC,CAAC;QACF,MAAM,kBAAkB,GAAG,GAAG,EAAE;YAC9B,IAAI,IAAI,CAAC,cAAc,EAAE;gBACvB,KAAK,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE;oBACtE,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;iBACtC;gBACD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;aAC5B;QACH,CAAC,CAAC;QAGF,MAAM,OAAO,GAAG,OAAQ,QAAgB,CAAC,OAAO,KAAK,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEzE,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE;YACzC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC;YAC5C,MAAM,YAAY,GAAI,QAAgB,CAAC,eAAe,CAAC,aAAa,CAAC;YACrE,MAAM,GAAG,GAAG,QAAQ,CAAC,cAAqB,CAAC;YAE3C,IAAI,YAAY,IAAI,GAAG,IAAI,OAAO,GAAG,CAAC,GAAG,KAAK,UAAU,EAAE;gBACxD,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;oBACzC,MAAM,KAAK,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC;oBAI9C,GAAG,CAAC,GAAG,CACL,IAAI,EACJ,OAAO,KAAK,CAAC;wBACX,CAAC,CAAC,KAAK;wBACP,CAAC,CAAC;4BACE,QAAQ,EAAE,KAAK;4BACf,SAAS,EAAE,KAAK;yBACjB,CACN,CAAC;gBACJ,CAAC,CAAC,CAAC;aACJ;YACD,QAAQ,EAAE,CAAC;QACb,CAAC,CAAC;QAEF,IAAI,QAAQ,CAAC,KAAK,EAAE;YAClB,QAAQ,CAAC,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;YAClF,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,GAAG,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAAC;YAC9E,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,EAAE,YAAY,CAAC,CAAC;SACxE;aAAM;YACJ,QAAgB,CAAC,MAAM,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,CAAC;YACnE,QAAgB,CAAC,MAAM,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,CAAC;YAC/D,QAAgB,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;SACrD;IACH,CAAC;CACF;AAED,iBAAS,oBAAoB,CAAC"} \ No newline at end of file diff --git a/tools/ui/node_modules/webpack-virtual-modules/lib/virtual-stats.d.ts b/tools/ui/node_modules/webpack-virtual-modules/lib/virtual-stats.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..ee7b643de29aff4e1310243024b652805f582443 --- /dev/null +++ b/tools/ui/node_modules/webpack-virtual-modules/lib/virtual-stats.d.ts @@ -0,0 +1,11 @@ +export declare class VirtualStats { + constructor(config: any); + private _checkModeProperty; + isDirectory(): boolean; + isFile(): boolean; + isBlockDevice(): boolean; + isCharacterDevice(): boolean; + isSymbolicLink(): boolean; + isFIFO(): boolean; + isSocket(): boolean; +} diff --git a/tools/ui/node_modules/webpack-virtual-modules/lib/virtual-stats.js b/tools/ui/node_modules/webpack-virtual-modules/lib/virtual-stats.js new file mode 100644 index 0000000000000000000000000000000000000000..b2ec3ee17d464d3d18b2e96619f7e34bc5151a86 --- /dev/null +++ b/tools/ui/node_modules/webpack-virtual-modules/lib/virtual-stats.js @@ -0,0 +1,43 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VirtualStats = void 0; +const constants_1 = __importDefault(require("constants")); +class VirtualStats { + constructor(config) { + for (const key in config) { + if (!Object.prototype.hasOwnProperty.call(config, key)) { + continue; + } + this[key] = config[key]; + } + } + _checkModeProperty(property) { + return (this.mode & constants_1.default.S_IFMT) === property; + } + isDirectory() { + return this._checkModeProperty(constants_1.default.S_IFDIR); + } + isFile() { + return this._checkModeProperty(constants_1.default.S_IFREG); + } + isBlockDevice() { + return this._checkModeProperty(constants_1.default.S_IFBLK); + } + isCharacterDevice() { + return this._checkModeProperty(constants_1.default.S_IFCHR); + } + isSymbolicLink() { + return this._checkModeProperty(constants_1.default.S_IFLNK); + } + isFIFO() { + return this._checkModeProperty(constants_1.default.S_IFIFO); + } + isSocket() { + return this._checkModeProperty(constants_1.default.S_IFSOCK); + } +} +exports.VirtualStats = VirtualStats; +//# sourceMappingURL=virtual-stats.js.map \ No newline at end of file diff --git a/tools/ui/node_modules/webpack-virtual-modules/lib/virtual-stats.js.map b/tools/ui/node_modules/webpack-virtual-modules/lib/virtual-stats.js.map new file mode 100644 index 0000000000000000000000000000000000000000..e166b618fc416b64329a548c0250abd29141e351 --- /dev/null +++ b/tools/ui/node_modules/webpack-virtual-modules/lib/virtual-stats.js.map @@ -0,0 +1 @@ +{"version":3,"file":"virtual-stats.js","sourceRoot":"","sources":["../src/virtual-stats.ts"],"names":[],"mappings":";;;;;;AASA,0DAAkC;AAElC,MAAa,YAAY;IAMvB,YAAmB,MAAM;QACvB,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACxB,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;gBACtD,SAAS;aACV;YACD,IAAI,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;SACzB;IACH,CAAC;IAKO,kBAAkB,CAAC,QAAQ;QACjC,OAAO,CAAE,IAAY,CAAC,IAAI,GAAG,mBAAS,CAAC,MAAM,CAAC,KAAK,QAAQ,CAAC;IAC9D,CAAC;IAEM,WAAW;QAChB,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAS,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAS,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAEM,aAAa;QAClB,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAS,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAEM,iBAAiB;QACtB,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAS,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAEM,cAAc;QACnB,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAS,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAS,CAAC,OAAO,CAAC,CAAC;IACpD,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,kBAAkB,CAAC,mBAAS,CAAC,QAAQ,CAAC,CAAC;IACrD,CAAC;CACF;AAjDD,oCAiDC"} \ No newline at end of file diff --git a/tools/ui/node_modules/webpack-virtual-modules/package.json b/tools/ui/node_modules/webpack-virtual-modules/package.json new file mode 100644 index 0000000000000000000000000000000000000000..fa9fb02bef7c248bef3cc866c371b1e6d16ce430 --- /dev/null +++ b/tools/ui/node_modules/webpack-virtual-modules/package.json @@ -0,0 +1,82 @@ +{ + "name": "webpack-virtual-modules", + "version": "0.6.2", + "description": "Webpack Virtual Modules", + "main": "lib/index.js", + "scripts": { + "clean": "rm -rf ./lib", + "build": "tsc -p tsconfig.build.json", + "watch": "tsc -p tsconfig.build.json -w", + "tests": "jest", + "tests:watch": "jest --watch", + "test": "yarn lint && yarn tests", + "lint": "eslint --fix src/**/*.ts", + "prepack": "yarn clean && yarn build" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/sysgears/webpack-virtual-modules.git" + }, + "keywords": [ + "webpack", + "webpack-plugin", + "virtual", + "modules" + ], + "author": "SysGears INC", + "license": "MIT", + "bugs": { + "url": "https://github.com/sysgears/webpack-virtual-modules/issues" + }, + "homepage": "https://github.com/sysgears/webpack-virtual-modules#readme", + "devDependencies": { + "@babel/core": "^7.4.5", + "@babel/plugin-proposal-class-properties": "^7.4.4", + "@babel/plugin-transform-modules-commonjs": "^7.4.4", + "@babel/preset-typescript": "^7.3.3", + "@babel/register": "^7.5.5", + "@types/jest": "^24.0.6", + "@types/node": "^11.11.3", + "@types/tmp": "^0.1.0", + "@types/webpack": "^4.32.1", + "@typescript-eslint/eslint-plugin": "^5.26.0", + "@typescript-eslint/parser": "^5.26.0", + "babel-jest": "^29.0.3", + "babel-plugin-replace-ts-export-assignment": "^0.0.2", + "eslint": "^8.23.1", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-jest": "^27.0.4", + "eslint-plugin-prettier": "^4.2.1", + "husky": "^8.0.1", + "jest": "^29.0.3", + "lint-staged": "^13.0.3", + "memory-fs": "^0.5.0", + "prettier": "^2.7.1", + "tmp": "^0.2.1", + "typescript": "^4.8.3", + "webpack": "5" + }, + "files": [ + "lib", + "src", + "!__tests__" + ], + "publishConfig": { + "main": "lib/index.js", + "types": "lib/index.d.ts" + }, + "lint-staged": { + "*.ts": [ + "eslint --fix -c tslint.json", + "git add" + ] + }, + "prettier": { + "printWidth": 120, + "singleQuote": true, + "parser": "typescript" + }, + "husky": { + "pre-commit": "lint-staged" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/webpack-virtual-modules/src/index.ts b/tools/ui/node_modules/webpack-virtual-modules/src/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..3266aa35aa349459be3e2b061a3c6cd5f9def5e5 --- /dev/null +++ b/tools/ui/node_modules/webpack-virtual-modules/src/index.ts @@ -0,0 +1,353 @@ +import path from 'path'; +import { VirtualStats } from './virtual-stats'; +import type { Compiler } from 'webpack'; + +let inode = 45000000; +const ALL = 'all'; +const STATIC = 'static'; +const DYNAMIC = 'dynamic'; + +type AvailableModules = typeof ALL | typeof STATIC | typeof DYNAMIC; + +function checkActivation(instance) { + if (!instance._compiler) { + throw new Error('You must use this plugin only after creating webpack instance!'); + } +} + +function getModulePath(filePath, compiler) { + return path.isAbsolute(filePath) ? filePath : path.join(compiler.context, filePath); +} + +function createWebpackData(result) { + return (backendOrStorage) => { + // In Webpack v5, this variable is a "Backend", and has the data stored in a field + // _data. In V4, the `_` prefix isn't present. + if (backendOrStorage._data) { + const curLevelIdx = backendOrStorage._currentLevel; + const curLevel = backendOrStorage._levels[curLevelIdx]; + return { + result, + level: curLevel, + }; + } + // Webpack 4 + return [null, result]; + }; +} + +function getData(storage, key) { + // Webpack 5 + if (storage._data instanceof Map) { + return storage._data.get(key); + } else if (storage._data) { + return storage.data[key]; + } else if (storage.data instanceof Map) { + // Webpack v4 + return storage.data.get(key); + } else { + return storage.data[key]; + } +} + +function setData(backendOrStorage, key, valueFactory) { + const value = valueFactory(backendOrStorage); + + // Webpack v5 + if (backendOrStorage._data instanceof Map) { + backendOrStorage._data.set(key, value); + } else if (backendOrStorage._data) { + backendOrStorage.data[key] = value; + } else if (backendOrStorage.data instanceof Map) { + // Webpack 4 + backendOrStorage.data.set(key, value); + } else { + backendOrStorage.data[key] = value; + } +} + +function getStatStorage(fileSystem) { + if (fileSystem._statStorage) { + // Webpack v4 + return fileSystem._statStorage; + } else if (fileSystem._statBackend) { + // webpack v5 + return fileSystem._statBackend; + } else { + // Unknown version? + throw new Error("Couldn't find a stat storage"); + } +} + +function getFileStorage(fileSystem) { + if (fileSystem._readFileStorage) { + // Webpack v4 + return fileSystem._readFileStorage; + } else if (fileSystem._readFileBackend) { + // Webpack v5 + return fileSystem._readFileBackend; + } else { + throw new Error("Couldn't find a readFileStorage"); + } +} + +function getReadDirBackend(fileSystem) { + if (fileSystem._readdirBackend) { + return fileSystem._readdirBackend; + } else if (fileSystem._readdirStorage) { + return fileSystem._readdirStorage; + } else { + throw new Error("Couldn't find a readDirStorage from Webpack Internals"); + } +} + +function getRealpathBackend(fileSystem) { + if (fileSystem._realpathBackend) { + return fileSystem._realpathBackend; + } + + // Nothing, because not all version of webpack support it +} + +class VirtualModulesPlugin { + private _staticModules: Record | null; + private _compiler: Compiler | null = null; + private _watcher: any = null; + + public constructor(modules?: Record) { + this._staticModules = modules || null; + } + + public getModuleList(filter: AvailableModules = ALL) { + let modules = {}; + const shouldGetStaticModules = filter === ALL || filter === STATIC; + const shouldGetDynamicModules = filter === ALL || filter === DYNAMIC; + + if (shouldGetStaticModules) { + // Get static modules + modules = { + ...modules, + ...this._staticModules, + }; + } + + if (shouldGetDynamicModules) { + // Get dynamic modules + const finalInputFileSystem: any = this._compiler?.inputFileSystem; + const virtualFiles = finalInputFileSystem?._virtualFiles ?? {}; + + const dynamicModules: Record = {}; + Object.keys(virtualFiles).forEach((key: string) => { + dynamicModules[key] = virtualFiles[key].contents; + }); + + modules = { + ...modules, + ...dynamicModules, + }; + } + + return modules; + } + + public writeModule(filePath: string, contents: string): void { + if (!this._compiler) { + throw new Error(`Plugin has not been initialized`); + } + + checkActivation(this); + + const len = contents ? contents.length : 0; + const time = Date.now(); + const date = new Date(time); + + const stats = new VirtualStats({ + dev: 8675309, + nlink: 0, + uid: 1000, + gid: 1000, + rdev: 0, + blksize: 4096, + ino: inode++, + mode: 33188, + size: len, + blocks: Math.floor(len / 4096), + atime: date, + mtime: date, + ctime: date, + birthtime: date, + }); + const modulePath = getModulePath(filePath, this._compiler); + + if (process.env.WVM_DEBUG) + // eslint-disable-next-line no-console + console.log(this._compiler.name, 'Write virtual module:', modulePath, contents); + + // When using the WatchIgnorePlugin (https://github.com/webpack/webpack/blob/52184b897f40c75560b3630e43ca642fcac7e2cf/lib/WatchIgnorePlugin.js), + // the original watchFileSystem is stored in `wfs`. The following "unwraps" the ignoring + // wrappers, giving us access to the "real" watchFileSystem. + let finalWatchFileSystem = this._watcher && this._watcher.watchFileSystem; + + while (finalWatchFileSystem && finalWatchFileSystem.wfs) { + finalWatchFileSystem = finalWatchFileSystem.wfs; + } + + let finalInputFileSystem: any = this._compiler.inputFileSystem; + while (finalInputFileSystem && finalInputFileSystem._inputFileSystem) { + finalInputFileSystem = finalInputFileSystem._inputFileSystem; + } + + finalInputFileSystem._writeVirtualFile(modulePath, stats, contents); + if ( + finalWatchFileSystem && + finalWatchFileSystem.watcher && + (finalWatchFileSystem.watcher.fileWatchers.size || finalWatchFileSystem.watcher.fileWatchers.length) + ) { + const fileWatchers = + finalWatchFileSystem.watcher.fileWatchers instanceof Map + ? Array.from(finalWatchFileSystem.watcher.fileWatchers.values()) + : finalWatchFileSystem.watcher.fileWatchers; + for (let fileWatcher of fileWatchers) { + if ('watcher' in fileWatcher) { + fileWatcher = fileWatcher.watcher; + } + if (fileWatcher.path === modulePath) { + if (process.env.DEBUG) + // eslint-disable-next-line no-console + console.log(this._compiler.name, 'Emit file change:', modulePath, time); + delete fileWatcher.directoryWatcher._cachedTimeInfoEntries; + fileWatcher.emit('change', time, null); + } + } + } + } + + public apply(compiler: Compiler) { + this._compiler = compiler; + + const afterEnvironmentHook = () => { + let finalInputFileSystem: any = compiler.inputFileSystem; + while (finalInputFileSystem && finalInputFileSystem._inputFileSystem) { + finalInputFileSystem = finalInputFileSystem._inputFileSystem; + } + + if (!finalInputFileSystem._writeVirtualFile) { + const originalPurge = finalInputFileSystem.purge; + + finalInputFileSystem.purge = () => { + originalPurge.apply(finalInputFileSystem, []); + if (finalInputFileSystem._virtualFiles) { + Object.keys(finalInputFileSystem._virtualFiles).forEach((file) => { + const data = finalInputFileSystem._virtualFiles[file]; + finalInputFileSystem._writeVirtualFile(file, data.stats, data.contents); + }); + } + }; + + finalInputFileSystem._writeVirtualFile = (file, stats, contents) => { + const statStorage = getStatStorage(finalInputFileSystem); + const fileStorage = getFileStorage(finalInputFileSystem); + const readDirStorage = getReadDirBackend(finalInputFileSystem); + const realPathStorage = getRealpathBackend(finalInputFileSystem); + + finalInputFileSystem._virtualFiles = finalInputFileSystem._virtualFiles || {}; + finalInputFileSystem._virtualFiles[file] = { stats: stats, contents: contents }; + setData(statStorage, file, createWebpackData(stats)); + setData(fileStorage, file, createWebpackData(contents)); + const segments = file.split(/[\\/]/); + let count = segments.length - 1; + const minCount = segments[0] ? 1 : 0; + while (count > minCount) { + const dir = segments.slice(0, count).join(path.sep) || path.sep; + try { + finalInputFileSystem.readdirSync(dir); + } catch (e) { + const time = Date.now(); + const dirStats = new VirtualStats({ + dev: 8675309, + nlink: 0, + uid: 1000, + gid: 1000, + rdev: 0, + blksize: 4096, + ino: inode++, + mode: 16877, + size: stats.size, + blocks: Math.floor(stats.size / 4096), + atime: time, + mtime: time, + ctime: time, + birthtime: time, + }); + + setData(readDirStorage, dir, createWebpackData([])); + if (realPathStorage) { + setData(realPathStorage, dir, createWebpackData(dir)); + } + setData(statStorage, dir, createWebpackData(dirStats)); + } + let dirData = getData(getReadDirBackend(finalInputFileSystem), dir); + // Webpack v4 returns an array, webpack v5 returns an object + dirData = dirData[1] || dirData.result; + const filename = segments[count]; + if (dirData.indexOf(filename) < 0) { + const files = dirData.concat([filename]).sort(); + setData(getReadDirBackend(finalInputFileSystem), dir, createWebpackData(files)); + } else { + break; + } + count--; + } + }; + } + }; + const afterResolversHook = () => { + if (this._staticModules) { + for (const [filePath, contents] of Object.entries(this._staticModules)) { + this.writeModule(filePath, contents); + } + this._staticModules = null; + } + }; + + // The webpack property is not exposed in webpack v4 + const version = typeof (compiler as any).webpack === 'undefined' ? 4 : 5; + + const watchRunHook = (watcher, callback) => { + this._watcher = watcher.compiler || watcher; + const virtualFiles = (compiler as any).inputFileSystem._virtualFiles; + const fts = compiler.fileTimestamps as any; + + if (virtualFiles && fts && typeof fts.set === 'function') { + Object.keys(virtualFiles).forEach((file) => { + const mtime = +virtualFiles[file].stats.mtime; + // fts is + // Map in webpack 4 + // Map in webpack 5 + fts.set( + file, + version === 4 + ? mtime + : { + safeTime: mtime, + timestamp: mtime, + } + ); + }); + } + callback(); + }; + + if (compiler.hooks) { + compiler.hooks.afterEnvironment.tap('VirtualModulesPlugin', afterEnvironmentHook); + compiler.hooks.afterResolvers.tap('VirtualModulesPlugin', afterResolversHook); + compiler.hooks.watchRun.tapAsync('VirtualModulesPlugin', watchRunHook); + } else { + (compiler as any).plugin('after-environment', afterEnvironmentHook); + (compiler as any).plugin('after-resolvers', afterResolversHook); + (compiler as any).plugin('watch-run', watchRunHook); + } + } +} + +export = VirtualModulesPlugin; diff --git a/tools/ui/node_modules/webpack-virtual-modules/src/virtual-stats.ts b/tools/ui/node_modules/webpack-virtual-modules/src/virtual-stats.ts new file mode 100644 index 0000000000000000000000000000000000000000..22e3030b363021011539c7d2662bd758a64c9218 --- /dev/null +++ b/tools/ui/node_modules/webpack-virtual-modules/src/virtual-stats.ts @@ -0,0 +1,61 @@ +/** + * Used to cache a stats object for the virtual file. + * Extracted from the `mock-fs` package. + * + * @author Tim Schaub http://tschaub.net/ + * @author `webpack-virtual-modules` Contributors + * @link https://github.com/tschaub/mock-fs/blob/master/lib/binding.js + * @link https://github.com/tschaub/mock-fs/blob/master/license.md + */ +import constants from 'constants'; + +export class VirtualStats { + /** + * Create a new stats object. + * + * @param config Stats properties. + */ + public constructor(config) { + for (const key in config) { + if (!Object.prototype.hasOwnProperty.call(config, key)) { + continue; + } + this[key] = config[key]; + } + } + + /** + * Check if mode indicates property. + */ + private _checkModeProperty(property): boolean { + return ((this as any).mode & constants.S_IFMT) === property; + } + + public isDirectory(): boolean { + return this._checkModeProperty(constants.S_IFDIR); + } + + public isFile(): boolean { + return this._checkModeProperty(constants.S_IFREG); + } + + public isBlockDevice(): boolean { + return this._checkModeProperty(constants.S_IFBLK); + } + + public isCharacterDevice(): boolean { + return this._checkModeProperty(constants.S_IFCHR); + } + + public isSymbolicLink(): boolean { + return this._checkModeProperty(constants.S_IFLNK); + } + + public isFIFO(): boolean { + return this._checkModeProperty(constants.S_IFIFO); + } + + public isSocket(): boolean { + return this._checkModeProperty(constants.S_IFSOCK); + } +} diff --git a/tools/ui/node_modules/whatwg-encoding/LICENSE.txt b/tools/ui/node_modules/whatwg-encoding/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..4220dead347e8c5273b9280d608626100a7fa5a8 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/LICENSE.txt @@ -0,0 +1,7 @@ +Copyright © Domenic Denicola + +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/whatwg-encoding/README.md b/tools/ui/node_modules/whatwg-encoding/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1528bf5c53a4e8d460123db5d6d1cc4208dec5ae --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/README.md @@ -0,0 +1,50 @@ +# Decode According to the WHATWG Encoding Standard + +This package provides a thin layer on top of [iconv-lite](https://github.com/ashtuchkin/iconv-lite) which makes it expose some of the same primitives as the [Encoding Standard](https://encoding.spec.whatwg.org/). + +```js +const whatwgEncoding = require("whatwg-encoding"); + +console.assert(whatwgEncoding.labelToName("latin1") === "windows-1252"); +console.assert(whatwgEncoding.labelToName(" CYRILLic ") === "ISO-8859-5"); + +console.assert(whatwgEncoding.isSupported("IBM866") === true); + +// Not supported by the Encoding Standard +console.assert(whatwgEncoding.isSupported("UTF-32") === false); + +// In the Encoding Standard, but this package can't decode it +console.assert(whatwgEncoding.isSupported("x-mac-cyrillic") === false); + +console.assert(whatwgEncoding.getBOMEncoding(new Uint8Array([0xFE, 0xFF])) === "UTF-16BE"); +console.assert(whatwgEncoding.getBOMEncoding(new Uint8Array([0x48, 0x69])) === null); + +console.assert(whatwgEncoding.decode(new Uint8Array([0x48, 0x69]), "UTF-8") === "Hi"); +``` + +## API + +- `decode(uint8Array, fallbackEncodingName)`: performs the [decode](https://encoding.spec.whatwg.org/#decode) algorithm (in which any BOM will override the passed fallback encoding), and returns the resulting string +- `labelToName(label)`: performs the [get an encoding](https://encoding.spec.whatwg.org/#concept-encoding-get) algorithm and returns the resulting encoding's name, or `null` for failure +- `isSupported(name)`: returns whether the encoding is one of [the encodings](https://encoding.spec.whatwg.org/#names-and-labels) of the Encoding Standard, _and_ is an encoding that this package can decode (via iconv-lite) +- `getBOMEncoding(uint8Array)`: sniffs the first 2–3 bytes of the supplied `Uint8Array`, returning one of the encoding names `"UTF-8"`, `"UTF-16LE"`, or `"UTF-16BE"` if the appropriate BOM is present, or `null` if no BOM is present + +## Unsupported encodings + +Since we rely on iconv-lite, we are limited to support only the encodings that they support. Currently we are missing support for: + +- ISO-2022-JP +- ISO-8859-8-I +- replacement +- x-mac-cyrillic +- x-user-defined + +Passing these encoding names will return `false` when calling `isSupported`, and passing any of the possible labels for these encodings to `labelToName` will return `null`. + +## Credits + +This package was originally based on the excellent work of [@nicolashenry](https://github.com/nicolashenry), [in jsdom](https://github.com/tmpvar/jsdom/blob/7ce11776ce161e8d5921a7a183585327400f786b/lib/jsdom/living/helpers/encoding.js). It has since been pulled out into this separate package. + +## Alternatives + +If you are looking for a JavaScript implementation of the Encoding Standard's `TextEncoder` and `TextDecoder` APIs, you'll want [@inexorabletash](https://github.com/inexorabletash)'s [text-encoding](https://github.com/inexorabletash/text-encoding) package. Node.js also has them [built-in](https://nodejs.org/dist/latest/docs/api/globals.html#globals_textdecoder). diff --git a/tools/ui/node_modules/whatwg-encoding/lib/labels-to-names.json b/tools/ui/node_modules/whatwg-encoding/lib/labels-to-names.json new file mode 100644 index 0000000000000000000000000000000000000000..e7c7f9a5a4b4b74038bcee8e96ecfa46aed04cda --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/lib/labels-to-names.json @@ -0,0 +1,216 @@ +{ + "866": "IBM866", + "unicode-1-1-utf-8": "UTF-8", + "unicode11utf8": "UTF-8", + "unicode20utf8": "UTF-8", + "utf-8": "UTF-8", + "utf8": "UTF-8", + "x-unicode20utf8": "UTF-8", + "cp866": "IBM866", + "csibm866": "IBM866", + "ibm866": "IBM866", + "csisolatin2": "ISO-8859-2", + "iso-8859-2": "ISO-8859-2", + "iso-ir-101": "ISO-8859-2", + "iso8859-2": "ISO-8859-2", + "iso88592": "ISO-8859-2", + "iso_8859-2": "ISO-8859-2", + "iso_8859-2:1987": "ISO-8859-2", + "l2": "ISO-8859-2", + "latin2": "ISO-8859-2", + "csisolatin3": "ISO-8859-3", + "iso-8859-3": "ISO-8859-3", + "iso-ir-109": "ISO-8859-3", + "iso8859-3": "ISO-8859-3", + "iso88593": "ISO-8859-3", + "iso_8859-3": "ISO-8859-3", + "iso_8859-3:1988": "ISO-8859-3", + "l3": "ISO-8859-3", + "latin3": "ISO-8859-3", + "csisolatin4": "ISO-8859-4", + "iso-8859-4": "ISO-8859-4", + "iso-ir-110": "ISO-8859-4", + "iso8859-4": "ISO-8859-4", + "iso88594": "ISO-8859-4", + "iso_8859-4": "ISO-8859-4", + "iso_8859-4:1988": "ISO-8859-4", + "l4": "ISO-8859-4", + "latin4": "ISO-8859-4", + "csisolatincyrillic": "ISO-8859-5", + "cyrillic": "ISO-8859-5", + "iso-8859-5": "ISO-8859-5", + "iso-ir-144": "ISO-8859-5", + "iso8859-5": "ISO-8859-5", + "iso88595": "ISO-8859-5", + "iso_8859-5": "ISO-8859-5", + "iso_8859-5:1988": "ISO-8859-5", + "arabic": "ISO-8859-6", + "asmo-708": "ISO-8859-6", + "csiso88596e": "ISO-8859-6", + "csiso88596i": "ISO-8859-6", + "csisolatinarabic": "ISO-8859-6", + "ecma-114": "ISO-8859-6", + "iso-8859-6": "ISO-8859-6", + "iso-8859-6-e": "ISO-8859-6", + "iso-8859-6-i": "ISO-8859-6", + "iso-ir-127": "ISO-8859-6", + "iso8859-6": "ISO-8859-6", + "iso88596": "ISO-8859-6", + "iso_8859-6": "ISO-8859-6", + "iso_8859-6:1987": "ISO-8859-6", + "csisolatingreek": "ISO-8859-7", + "ecma-118": "ISO-8859-7", + "elot_928": "ISO-8859-7", + "greek": "ISO-8859-7", + "greek8": "ISO-8859-7", + "iso-8859-7": "ISO-8859-7", + "iso-ir-126": "ISO-8859-7", + "iso8859-7": "ISO-8859-7", + "iso88597": "ISO-8859-7", + "iso_8859-7": "ISO-8859-7", + "iso_8859-7:1987": "ISO-8859-7", + "sun_eu_greek": "ISO-8859-7", + "csiso88598e": "ISO-8859-8", + "csisolatinhebrew": "ISO-8859-8", + "hebrew": "ISO-8859-8", + "iso-8859-8": "ISO-8859-8", + "iso-8859-8-e": "ISO-8859-8", + "iso-ir-138": "ISO-8859-8", + "iso8859-8": "ISO-8859-8", + "iso88598": "ISO-8859-8", + "iso_8859-8": "ISO-8859-8", + "iso_8859-8:1988": "ISO-8859-8", + "visual": "ISO-8859-8", + "csisolatin6": "ISO-8859-10", + "iso-8859-10": "ISO-8859-10", + "iso-ir-157": "ISO-8859-10", + "iso8859-10": "ISO-8859-10", + "iso885910": "ISO-8859-10", + "l6": "ISO-8859-10", + "latin6": "ISO-8859-10", + "iso-8859-13": "ISO-8859-13", + "iso8859-13": "ISO-8859-13", + "iso885913": "ISO-8859-13", + "iso-8859-14": "ISO-8859-14", + "iso8859-14": "ISO-8859-14", + "iso885914": "ISO-8859-14", + "csisolatin9": "ISO-8859-15", + "iso-8859-15": "ISO-8859-15", + "iso8859-15": "ISO-8859-15", + "iso885915": "ISO-8859-15", + "iso_8859-15": "ISO-8859-15", + "l9": "ISO-8859-15", + "iso-8859-16": "ISO-8859-16", + "cskoi8r": "KOI8-R", + "koi": "KOI8-R", + "koi8": "KOI8-R", + "koi8-r": "KOI8-R", + "koi8_r": "KOI8-R", + "koi8-ru": "KOI8-U", + "koi8-u": "KOI8-U", + "csmacintosh": "macintosh", + "mac": "macintosh", + "macintosh": "macintosh", + "x-mac-roman": "macintosh", + "dos-874": "windows-874", + "iso-8859-11": "windows-874", + "iso8859-11": "windows-874", + "iso885911": "windows-874", + "tis-620": "windows-874", + "windows-874": "windows-874", + "cp1250": "windows-1250", + "windows-1250": "windows-1250", + "x-cp1250": "windows-1250", + "cp1251": "windows-1251", + "windows-1251": "windows-1251", + "x-cp1251": "windows-1251", + "ansi_x3.4-1968": "windows-1252", + "ascii": "windows-1252", + "cp1252": "windows-1252", + "cp819": "windows-1252", + "csisolatin1": "windows-1252", + "ibm819": "windows-1252", + "iso-8859-1": "windows-1252", + "iso-ir-100": "windows-1252", + "iso8859-1": "windows-1252", + "iso88591": "windows-1252", + "iso_8859-1": "windows-1252", + "iso_8859-1:1987": "windows-1252", + "l1": "windows-1252", + "latin1": "windows-1252", + "us-ascii": "windows-1252", + "windows-1252": "windows-1252", + "x-cp1252": "windows-1252", + "cp1253": "windows-1253", + "windows-1253": "windows-1253", + "x-cp1253": "windows-1253", + "cp1254": "windows-1254", + "csisolatin5": "windows-1254", + "iso-8859-9": "windows-1254", + "iso-ir-148": "windows-1254", + "iso8859-9": "windows-1254", + "iso88599": "windows-1254", + "iso_8859-9": "windows-1254", + "iso_8859-9:1989": "windows-1254", + "l5": "windows-1254", + "latin5": "windows-1254", + "windows-1254": "windows-1254", + "x-cp1254": "windows-1254", + "cp1255": "windows-1255", + "windows-1255": "windows-1255", + "x-cp1255": "windows-1255", + "cp1256": "windows-1256", + "windows-1256": "windows-1256", + "x-cp1256": "windows-1256", + "cp1257": "windows-1257", + "windows-1257": "windows-1257", + "x-cp1257": "windows-1257", + "cp1258": "windows-1258", + "windows-1258": "windows-1258", + "x-cp1258": "windows-1258", + "chinese": "GBK", + "csgb2312": "GBK", + "csiso58gb231280": "GBK", + "gb2312": "GBK", + "gb_2312": "GBK", + "gb_2312-80": "GBK", + "gbk": "GBK", + "iso-ir-58": "GBK", + "x-gbk": "GBK", + "gb18030": "gb18030", + "big5": "Big5", + "big5-hkscs": "Big5", + "cn-big5": "Big5", + "csbig5": "Big5", + "x-x-big5": "Big5", + "cseucpkdfmtjapanese": "EUC-JP", + "euc-jp": "EUC-JP", + "x-euc-jp": "EUC-JP", + "csshiftjis": "Shift_JIS", + "ms932": "Shift_JIS", + "ms_kanji": "Shift_JIS", + "shift-jis": "Shift_JIS", + "shift_jis": "Shift_JIS", + "sjis": "Shift_JIS", + "windows-31j": "Shift_JIS", + "x-sjis": "Shift_JIS", + "cseuckr": "EUC-KR", + "csksc56011987": "EUC-KR", + "euc-kr": "EUC-KR", + "iso-ir-149": "EUC-KR", + "korean": "EUC-KR", + "ks_c_5601-1987": "EUC-KR", + "ks_c_5601-1989": "EUC-KR", + "ksc5601": "EUC-KR", + "ksc_5601": "EUC-KR", + "windows-949": "EUC-KR", + "unicodefffe": "UTF-16BE", + "utf-16be": "UTF-16BE", + "csunicode": "UTF-16LE", + "iso-10646-ucs-2": "UTF-16LE", + "ucs-2": "UTF-16LE", + "unicode": "UTF-16LE", + "unicodefeff": "UTF-16LE", + "utf-16": "UTF-16LE", + "utf-16le": "UTF-16LE" +} \ No newline at end of file diff --git a/tools/ui/node_modules/whatwg-encoding/lib/supported-names.json b/tools/ui/node_modules/whatwg-encoding/lib/supported-names.json new file mode 100644 index 0000000000000000000000000000000000000000..bcb282e67837621035695a93e32f3deebf2ae69a --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/lib/supported-names.json @@ -0,0 +1,37 @@ +[ + "UTF-8", + "IBM866", + "ISO-8859-2", + "ISO-8859-3", + "ISO-8859-4", + "ISO-8859-5", + "ISO-8859-6", + "ISO-8859-7", + "ISO-8859-8", + "ISO-8859-10", + "ISO-8859-13", + "ISO-8859-14", + "ISO-8859-15", + "ISO-8859-16", + "KOI8-R", + "KOI8-U", + "macintosh", + "windows-874", + "windows-1250", + "windows-1251", + "windows-1252", + "windows-1253", + "windows-1254", + "windows-1255", + "windows-1256", + "windows-1257", + "windows-1258", + "GBK", + "gb18030", + "Big5", + "EUC-JP", + "Shift_JIS", + "EUC-KR", + "UTF-16BE", + "UTF-16LE" +] \ No newline at end of file diff --git a/tools/ui/node_modules/whatwg-encoding/lib/whatwg-encoding.js b/tools/ui/node_modules/whatwg-encoding/lib/whatwg-encoding.js new file mode 100644 index 0000000000000000000000000000000000000000..dbb77fb626d8cff9ec34ae484ea381833e6d7535 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/lib/whatwg-encoding.js @@ -0,0 +1,47 @@ +"use strict"; +const iconvLite = require("iconv-lite"); +const supportedNames = require("./supported-names.json"); +const labelsToNames = require("./labels-to-names.json"); + +const supportedNamesSet = new Set(supportedNames); + +// https://encoding.spec.whatwg.org/#concept-encoding-get +exports.labelToName = label => { + label = String(label).trim().toLowerCase(); + + return labelsToNames[label] || null; +}; + +// https://encoding.spec.whatwg.org/#decode +exports.decode = (uint8Array, fallbackEncodingName) => { + let encoding = fallbackEncodingName; + if (!exports.isSupported(encoding)) { + throw new RangeError(`"${encoding}" is not a supported encoding name`); + } + + const bomEncoding = exports.getBOMEncoding(uint8Array); + if (bomEncoding !== null) { + encoding = bomEncoding; + } + + // iconv-lite will strip BOMs for us, so no need to do the stuff the spec does + + return iconvLite.decode(uint8Array, encoding); +}; + +// https://github.com/whatwg/html/issues/1910#issuecomment-254017369 +exports.getBOMEncoding = uint8Array => { + if (uint8Array[0] === 0xFE && uint8Array[1] === 0xFF) { + return "UTF-16BE"; + } else if (uint8Array[0] === 0xFF && uint8Array[1] === 0xFE) { + return "UTF-16LE"; + } else if (uint8Array[0] === 0xEF && uint8Array[1] === 0xBB && uint8Array[2] === 0xBF) { + return "UTF-8"; + } + + return null; +}; + +exports.isSupported = name => { + return supportedNamesSet.has(String(name)); +}; diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.github/dependabot.yml b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.github/dependabot.yml new file mode 100644 index 0000000000000000000000000000000000000000..e4a0e0afdff7c81947fc0359ad479dfd6c9430ab --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.github/dependabot.yml @@ -0,0 +1,11 @@ +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "npm" + directory: "/" + schedule: + interval: "daily" + allow: + - dependency-type: production diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/codeStyles/Project.xml b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/codeStyles/Project.xml new file mode 100644 index 0000000000000000000000000000000000000000..3f2688cb57ab8cf0c18c4d3057be5fb75198ed9a --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/codeStyles/Project.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml new file mode 100644 index 0000000000000000000000000000000000000000..79ee123c2b23e069e35ed634d687e17f731cc702 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/iconv-lite.iml b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/iconv-lite.iml new file mode 100644 index 0000000000000000000000000000000000000000..0c8867d7e175f46d4bcd66698ac13f4ca00cf592 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/iconv-lite.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000000000000000000000000000000000000..03d9549ea8e4ada36fb3ecbc30fef08175b7d728 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/modules.xml b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/modules.xml new file mode 100644 index 0000000000000000000000000000000000000000..5d24f2e1ec92a255c8bc442c30b6666e0bb8d324 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/vcs.xml b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..94a25f7f4cb416c083d265558da75d457237d671 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/Changelog.md b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/Changelog.md new file mode 100644 index 0000000000000000000000000000000000000000..464549b148481a3f61966c985bf41bdabc095009 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/Changelog.md @@ -0,0 +1,212 @@ +## 0.6.3 / 2021-05-23 + * Fix HKSCS encoding to prefer Big5 codes if both Big5 and HKSCS codes are possible (#264) + + +## 0.6.2 / 2020-07-08 + * Support Uint8Array-s decoding without conversion to Buffers, plus fix an edge case. + + +## 0.6.1 / 2020-06-28 + * Support Uint8Array-s directly when decoding (#246, by @gyzerok) + * Unify package.json version ranges to be strictly semver-compatible (#241) + * Fix minor issue in UTF-32 decoder's endianness detection code. + + +## 0.6.0 / 2020-06-08 + * Updated 'gb18030' encoding to :2005 edition (see https://github.com/whatwg/encoding/issues/22). + * Removed `iconv.extendNodeEncodings()` mechanism. It was deprecated 5 years ago and didn't work + in recent Node versions. + * Reworked Streaming API behavior in browser environments to fix #204. Streaming API will be + excluded by default in browser packs, saving ~100Kb bundle size, unless enabled explicitly using + `iconv.enableStreamingAPI(require('stream'))`. + * Updates to development environment & tests: + * Added ./test/webpack private package to test complex new use cases that need custom environment. + It's tested as a separate job in Travis CI. + * Updated generation code for the new EUC-KR index file format from Encoding Standard. + * Removed Buffer() constructor in tests (#197 by @gabrielschulhof). + + +## 0.5.2 / 2020-06-08 + * Added `iconv.getEncoder()` and `iconv.getDecoder()` methods to typescript definitions (#229). + * Fixed semver version to 6.1.2 to support Node 8.x (by @tanandara). + * Capped iconv version to 2.x as 3.x has dropped support for older Node versions. + * Switched from instanbul to c8 for code coverage. + + +## 0.5.1 / 2020-01-18 + + * Added cp720 encoding (#221, by @kr-deps) + * (minor) Changed Changelog.md formatting to use h2. + + +## 0.5.0 / 2019-06-26 + + * Added UTF-32 encoding, both little-endian and big-endian variants (UTF-32LE, UTF32-BE). If endianness + is not provided for decoding, it's deduced automatically from the stream using a heuristic similar to + what we use in UTF-16. (great work in #216 by @kshetline) + * Several minor updates to README (#217 by @oldj, plus some more) + * Added Node versions 10 and 12 to Travis test harness. + + +## 0.4.24 / 2018-08-22 + + * Added MIK encoding (#196, by @Ivan-Kalatchev) + + +## 0.4.23 / 2018-05-07 + + * Fix deprecation warning in Node v10 due to the last usage of `new Buffer` (#185, by @felixbuenemann) + * Switched from NodeBuffer to Buffer in typings (#155 by @felixfbecker, #186 by @larssn) + + +## 0.4.22 / 2018-05-05 + + * Use older semver style for dependencies to be compatible with Node version 0.10 (#182, by @dougwilson) + * Fix tests to accomodate fixes in Node v10 (#182, by @dougwilson) + + +## 0.4.21 / 2018-04-06 + + * Fix encoding canonicalization (#156) + * Fix the paths in the "browser" field in package.json (#174 by @LMLB) + * Removed "contributors" section in package.json - see Git history instead. + + +## 0.4.20 / 2018-04-06 + + * Updated `new Buffer()` usages with recommended replacements as it's being deprecated in Node v10 (#176, #178 by @ChALkeR) + + +## 0.4.19 / 2017-09-09 + + * Fixed iso8859-1 codec regression in handling untranslatable characters (#162, caused by #147) + * Re-generated windows1255 codec, because it was updated in iconv project + * Fixed grammar in error message when iconv-lite is loaded with encoding other than utf8 + + +## 0.4.18 / 2017-06-13 + + * Fixed CESU-8 regression in Node v8. + + +## 0.4.17 / 2017-04-22 + + * Updated typescript definition file to support Angular 2 AoT mode (#153 by @larssn) + + +## 0.4.16 / 2017-04-22 + + * Added support for React Native (#150) + * Changed iso8859-1 encoding to usine internal 'binary' encoding, as it's the same thing (#147 by @mscdex) + * Fixed typo in Readme (#138 by @jiangzhuo) + * Fixed build for Node v6.10+ by making correct version comparison + * Added a warning if iconv-lite is loaded not as utf-8 (see #142) + + +## 0.4.15 / 2016-11-21 + + * Fixed typescript type definition (#137) + + +## 0.4.14 / 2016-11-20 + + * Preparation for v1.0 + * Added Node v6 and latest Node versions to Travis CI test rig + * Deprecated Node v0.8 support + * Typescript typings (@larssn) + * Fix encoding of Euro character in GB 18030 (inspired by @lygstate) + * Add ms prefix to dbcs windows encodings (@rokoroku) + + +## 0.4.13 / 2015-10-01 + + * Fix silly mistake in deprecation notice. + + +## 0.4.12 / 2015-09-26 + + * Node v4 support: + * Added CESU-8 decoding (#106) + * Added deprecation notice for `extendNodeEncodings` + * Added Travis tests for Node v4 and io.js latest (#105 by @Mithgol) + + +## 0.4.11 / 2015-07-03 + + * Added CESU-8 encoding. + + +## 0.4.10 / 2015-05-26 + + * Changed UTF-16 endianness heuristic to take into account any ASCII chars, not + just spaces. This should minimize the importance of "default" endianness. + + +## 0.4.9 / 2015-05-24 + + * Streamlined BOM handling: strip BOM by default, add BOM when encoding if + addBOM: true. Added docs to Readme. + * UTF16 now uses UTF16-LE by default. + * Fixed minor issue with big5 encoding. + * Added io.js testing on Travis; updated node-iconv version to test against. + Now we just skip testing SBCS encodings that node-iconv doesn't support. + * (internal refactoring) Updated codec interface to use classes. + * Use strict mode in all files. + + +## 0.4.8 / 2015-04-14 + + * added alias UNICODE-1-1-UTF-7 for UTF-7 encoding (#94) + + +## 0.4.7 / 2015-02-05 + + * stop official support of Node.js v0.8. Should still work, but no guarantees. + reason: Packages needed for testing are hard to get on Travis CI. + * work in environment where Object.prototype is monkey patched with enumerable + props (#89). + + +## 0.4.6 / 2015-01-12 + + * fix rare aliases of single-byte encodings (thanks @mscdex) + * double the timeout for dbcs tests to make them less flaky on travis + + +## 0.4.5 / 2014-11-20 + + * fix windows-31j and x-sjis encoding support (@nleush) + * minor fix: undefined variable reference when internal error happens + + +## 0.4.4 / 2014-07-16 + + * added encodings UTF-7 (RFC2152) and UTF-7-IMAP (RFC3501 Section 5.1.3) + * fixed streaming base64 encoding + + +## 0.4.3 / 2014-06-14 + + * added encodings UTF-16BE and UTF-16 with BOM + + +## 0.4.2 / 2014-06-12 + + * don't throw exception if `extendNodeEncodings()` is called more than once + + +## 0.4.1 / 2014-06-11 + + * codepage 808 added + + +## 0.4.0 / 2014-06-10 + + * code is rewritten from scratch + * all widespread encodings are supported + * streaming interface added + * browserify compatibility added + * (optional) extend core primitive encodings to make usage even simpler + * moved from vows to mocha as the testing framework + + diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/LICENSE b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..d518d8376af9faa47af875d83c8cdd51a11f9099 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/LICENSE @@ -0,0 +1,21 @@ +Copyright (c) 2011 Alexander Shtuchkin + +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/whatwg-encoding/node_modules/iconv-lite/README.md b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3c97f87307946765dae4f1b2089c9d8afd9130f0 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/README.md @@ -0,0 +1,130 @@ +## iconv-lite: Pure JS character encoding conversion + + * No need for native code compilation. Quick to install, works on Windows and in sandboxed environments like [Cloud9](http://c9.io). + * Used in popular projects like [Express.js (body_parser)](https://github.com/expressjs/body-parser), + [Grunt](http://gruntjs.com/), [Nodemailer](http://www.nodemailer.com/), [Yeoman](http://yeoman.io/) and others. + * Faster than [node-iconv](https://github.com/bnoordhuis/node-iconv) (see below for performance comparison). + * Intuitive encode/decode API, including Streaming support. + * In-browser usage via [browserify](https://github.com/substack/node-browserify) or [webpack](https://webpack.js.org/) (~180kb gzip compressed with Buffer shim included). + * Typescript [type definition file](https://github.com/ashtuchkin/iconv-lite/blob/master/lib/index.d.ts) included. + * React Native is supported (need to install `stream` module to enable Streaming API). + * License: MIT. + +[![NPM Stats](https://nodei.co/npm/iconv-lite.png)](https://npmjs.org/package/iconv-lite/) +[![Build Status](https://travis-ci.org/ashtuchkin/iconv-lite.svg?branch=master)](https://travis-ci.org/ashtuchkin/iconv-lite) +[![npm](https://img.shields.io/npm/v/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/) +[![npm downloads](https://img.shields.io/npm/dm/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/) +[![npm bundle size](https://img.shields.io/bundlephobia/min/iconv-lite.svg)](https://npmjs.org/package/iconv-lite/) + +## Usage +### Basic API +```javascript +var iconv = require('iconv-lite'); + +// Convert from an encoded buffer to a js string. +str = iconv.decode(Buffer.from([0x68, 0x65, 0x6c, 0x6c, 0x6f]), 'win1251'); + +// Convert from a js string to an encoded buffer. +buf = iconv.encode("Sample input string", 'win1251'); + +// Check if encoding is supported +iconv.encodingExists("us-ascii") +``` + +### Streaming API +```javascript + +// Decode stream (from binary data stream to js strings) +http.createServer(function(req, res) { + var converterStream = iconv.decodeStream('win1251'); + req.pipe(converterStream); + + converterStream.on('data', function(str) { + console.log(str); // Do something with decoded strings, chunk-by-chunk. + }); +}); + +// Convert encoding streaming example +fs.createReadStream('file-in-win1251.txt') + .pipe(iconv.decodeStream('win1251')) + .pipe(iconv.encodeStream('ucs2')) + .pipe(fs.createWriteStream('file-in-ucs2.txt')); + +// Sugar: all encode/decode streams have .collect(cb) method to accumulate data. +http.createServer(function(req, res) { + req.pipe(iconv.decodeStream('win1251')).collect(function(err, body) { + assert(typeof body == 'string'); + console.log(body); // full request body string + }); +}); +``` + +## Supported encodings + + * All node.js native encodings: utf8, ucs2 / utf16-le, ascii, binary, base64, hex. + * Additional unicode encodings: utf16, utf16-be, utf-7, utf-7-imap, utf32, utf32-le, and utf32-be. + * All widespread singlebyte encodings: Windows 125x family, ISO-8859 family, + IBM/DOS codepages, Macintosh family, KOI8 family, all others supported by iconv library. + Aliases like 'latin1', 'us-ascii' also supported. + * All widespread multibyte encodings: CP932, CP936, CP949, CP950, GB2312, GBK, GB18030, Big5, Shift_JIS, EUC-JP. + +See [all supported encodings on wiki](https://github.com/ashtuchkin/iconv-lite/wiki/Supported-Encodings). + +Most singlebyte encodings are generated automatically from [node-iconv](https://github.com/bnoordhuis/node-iconv). Thank you Ben Noordhuis and libiconv authors! + +Multibyte encodings are generated from [Unicode.org mappings](http://www.unicode.org/Public/MAPPINGS/) and [WHATWG Encoding Standard mappings](http://encoding.spec.whatwg.org/). Thank you, respective authors! + + +## Encoding/decoding speed + +Comparison with node-iconv module (1000x256kb, on MacBook Pro, Core i5/2.6 GHz, Node v0.12.0). +Note: your results may vary, so please always check on your hardware. + + operation iconv@2.1.4 iconv-lite@0.4.7 + ---------------------------------------------------------- + encode('win1251') ~96 Mb/s ~320 Mb/s + decode('win1251') ~95 Mb/s ~246 Mb/s + +## BOM handling + + * Decoding: BOM is stripped by default, unless overridden by passing `stripBOM: false` in options + (f.ex. `iconv.decode(buf, enc, {stripBOM: false})`). + A callback might also be given as a `stripBOM` parameter - it'll be called if BOM character was actually found. + * If you want to detect UTF-8 BOM when decoding other encodings, use [node-autodetect-decoder-stream](https://github.com/danielgindi/node-autodetect-decoder-stream) module. + * Encoding: No BOM added, unless overridden by `addBOM: true` option. + +## UTF-16 Encodings + +This library supports UTF-16LE, UTF-16BE and UTF-16 encodings. First two are straightforward, but UTF-16 is trying to be +smart about endianness in the following ways: + * Decoding: uses BOM and 'spaces heuristic' to determine input endianness. Default is UTF-16LE, but can be + overridden with `defaultEncoding: 'utf-16be'` option. Strips BOM unless `stripBOM: false`. + * Encoding: uses UTF-16LE and writes BOM by default. Use `addBOM: false` to override. + +## UTF-32 Encodings + +This library supports UTF-32LE, UTF-32BE and UTF-32 encodings. Like the UTF-16 encoding above, UTF-32 defaults to UTF-32LE, but uses BOM and 'spaces heuristics' to determine input endianness. + * The default of UTF-32LE can be overridden with the `defaultEncoding: 'utf-32be'` option. Strips BOM unless `stripBOM: false`. + * Encoding: uses UTF-32LE and writes BOM by default. Use `addBOM: false` to override. (`defaultEncoding: 'utf-32be'` can also be used here to change encoding.) + +## Other notes + +When decoding, be sure to supply a Buffer to decode() method, otherwise [bad things usually happen](https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding). +Untranslatable characters are set to � or ?. No transliteration is currently supported. +Node versions 0.10.31 and 0.11.13 are buggy, don't use them (see #65, #77). + +## Testing + +```bash +$ git clone git@github.com:ashtuchkin/iconv-lite.git +$ cd iconv-lite +$ npm install +$ npm test + +$ # To view performance: +$ node test/performance.js + +$ # To view test coverage: +$ npm run coverage +$ open coverage/lcov-report/index.html +``` diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-codec.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-codec.js new file mode 100644 index 0000000000000000000000000000000000000000..fa839170367b271072dc097d29b2c05f085e7681 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-codec.js @@ -0,0 +1,597 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Multibyte codec. In this scheme, a character is represented by 1 or more bytes. +// Our codec supports UTF-16 surrogates, extensions for GB18030 and unicode sequences. +// To save memory and loading time, we read table files only when requested. + +exports._dbcs = DBCSCodec; + +var UNASSIGNED = -1, + GB18030_CODE = -2, + SEQ_START = -10, + NODE_START = -1000, + UNASSIGNED_NODE = new Array(0x100), + DEF_CHAR = -1; + +for (var i = 0; i < 0x100; i++) + UNASSIGNED_NODE[i] = UNASSIGNED; + + +// Class DBCSCodec reads and initializes mapping tables. +function DBCSCodec(codecOptions, iconv) { + this.encodingName = codecOptions.encodingName; + if (!codecOptions) + throw new Error("DBCS codec is called without the data.") + if (!codecOptions.table) + throw new Error("Encoding '" + this.encodingName + "' has no data."); + + // Load tables. + var mappingTable = codecOptions.table(); + + + // Decode tables: MBCS -> Unicode. + + // decodeTables is a trie, encoded as an array of arrays of integers. Internal arrays are trie nodes and all have len = 256. + // Trie root is decodeTables[0]. + // Values: >= 0 -> unicode character code. can be > 0xFFFF + // == UNASSIGNED -> unknown/unassigned sequence. + // == GB18030_CODE -> this is the end of a GB18030 4-byte sequence. + // <= NODE_START -> index of the next node in our trie to process next byte. + // <= SEQ_START -> index of the start of a character code sequence, in decodeTableSeq. + this.decodeTables = []; + this.decodeTables[0] = UNASSIGNED_NODE.slice(0); // Create root node. + + // Sometimes a MBCS char corresponds to a sequence of unicode chars. We store them as arrays of integers here. + this.decodeTableSeq = []; + + // Actual mapping tables consist of chunks. Use them to fill up decode tables. + for (var i = 0; i < mappingTable.length; i++) + this._addDecodeChunk(mappingTable[i]); + + // Load & create GB18030 tables when needed. + if (typeof codecOptions.gb18030 === 'function') { + this.gb18030 = codecOptions.gb18030(); // Load GB18030 ranges. + + // Add GB18030 common decode nodes. + var commonThirdByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); + + var commonFourthByteNodeIdx = this.decodeTables.length; + this.decodeTables.push(UNASSIGNED_NODE.slice(0)); + + // Fill out the tree + var firstByteNode = this.decodeTables[0]; + for (var i = 0x81; i <= 0xFE; i++) { + var secondByteNode = this.decodeTables[NODE_START - firstByteNode[i]]; + for (var j = 0x30; j <= 0x39; j++) { + if (secondByteNode[j] === UNASSIGNED) { + secondByteNode[j] = NODE_START - commonThirdByteNodeIdx; + } else if (secondByteNode[j] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 2"); + } + + var thirdByteNode = this.decodeTables[NODE_START - secondByteNode[j]]; + for (var k = 0x81; k <= 0xFE; k++) { + if (thirdByteNode[k] === UNASSIGNED) { + thirdByteNode[k] = NODE_START - commonFourthByteNodeIdx; + } else if (thirdByteNode[k] === NODE_START - commonFourthByteNodeIdx) { + continue; + } else if (thirdByteNode[k] > NODE_START) { + throw new Error("gb18030 decode tables conflict at byte 3"); + } + + var fourthByteNode = this.decodeTables[NODE_START - thirdByteNode[k]]; + for (var l = 0x30; l <= 0x39; l++) { + if (fourthByteNode[l] === UNASSIGNED) + fourthByteNode[l] = GB18030_CODE; + } + } + } + } + } + + this.defaultCharUnicode = iconv.defaultCharUnicode; + + + // Encode tables: Unicode -> DBCS. + + // `encodeTable` is array mapping from unicode char to encoded char. All its values are integers for performance. + // Because it can be sparse, it is represented as array of buckets by 256 chars each. Bucket can be null. + // Values: >= 0 -> it is a normal char. Write the value (if <=256 then 1 byte, if <=65536 then 2 bytes, etc.). + // == UNASSIGNED -> no conversion found. Output a default char. + // <= SEQ_START -> it's an index in encodeTableSeq, see below. The character starts a sequence. + this.encodeTable = []; + + // `encodeTableSeq` is used when a sequence of unicode characters is encoded as a single code. We use a tree of + // objects where keys correspond to characters in sequence and leafs are the encoded dbcs values. A special DEF_CHAR key + // means end of sequence (needed when one sequence is a strict subsequence of another). + // Objects are kept separately from encodeTable to increase performance. + this.encodeTableSeq = []; + + // Some chars can be decoded, but need not be encoded. + var skipEncodeChars = {}; + if (codecOptions.encodeSkipVals) + for (var i = 0; i < codecOptions.encodeSkipVals.length; i++) { + var val = codecOptions.encodeSkipVals[i]; + if (typeof val === 'number') + skipEncodeChars[val] = true; + else + for (var j = val.from; j <= val.to; j++) + skipEncodeChars[j] = true; + } + + // Use decode trie to recursively fill out encode tables. + this._fillEncodeTable(0, 0, skipEncodeChars); + + // Add more encoding pairs when needed. + if (codecOptions.encodeAdd) { + for (var uChar in codecOptions.encodeAdd) + if (Object.prototype.hasOwnProperty.call(codecOptions.encodeAdd, uChar)) + this._setEncodeChar(uChar.charCodeAt(0), codecOptions.encodeAdd[uChar]); + } + + this.defCharSB = this.encodeTable[0][iconv.defaultCharSingleByte.charCodeAt(0)]; + if (this.defCharSB === UNASSIGNED) this.defCharSB = this.encodeTable[0]['?']; + if (this.defCharSB === UNASSIGNED) this.defCharSB = "?".charCodeAt(0); +} + +DBCSCodec.prototype.encoder = DBCSEncoder; +DBCSCodec.prototype.decoder = DBCSDecoder; + +// Decoder helpers +DBCSCodec.prototype._getDecodeTrieNode = function(addr) { + var bytes = []; + for (; addr > 0; addr >>>= 8) + bytes.push(addr & 0xFF); + if (bytes.length == 0) + bytes.push(0); + + var node = this.decodeTables[0]; + for (var i = bytes.length-1; i > 0; i--) { // Traverse nodes deeper into the trie. + var val = node[bytes[i]]; + + if (val == UNASSIGNED) { // Create new node. + node[bytes[i]] = NODE_START - this.decodeTables.length; + this.decodeTables.push(node = UNASSIGNED_NODE.slice(0)); + } + else if (val <= NODE_START) { // Existing node. + node = this.decodeTables[NODE_START - val]; + } + else + throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + addr.toString(16)); + } + return node; +} + + +DBCSCodec.prototype._addDecodeChunk = function(chunk) { + // First element of chunk is the hex mbcs code where we start. + var curAddr = parseInt(chunk[0], 16); + + // Choose the decoding node where we'll write our chars. + var writeTable = this._getDecodeTrieNode(curAddr); + curAddr = curAddr & 0xFF; + + // Write all other elements of the chunk to the table. + for (var k = 1; k < chunk.length; k++) { + var part = chunk[k]; + if (typeof part === "string") { // String, write as-is. + for (var l = 0; l < part.length;) { + var code = part.charCodeAt(l++); + if (0xD800 <= code && code < 0xDC00) { // Decode surrogate + var codeTrail = part.charCodeAt(l++); + if (0xDC00 <= codeTrail && codeTrail < 0xE000) + writeTable[curAddr++] = 0x10000 + (code - 0xD800) * 0x400 + (codeTrail - 0xDC00); + else + throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + chunk[0]); + } + else if (0x0FF0 < code && code <= 0x0FFF) { // Character sequence (our own encoding used) + var len = 0xFFF - code + 2; + var seq = []; + for (var m = 0; m < len; m++) + seq.push(part.charCodeAt(l++)); // Simple variation: don't support surrogates or subsequences in seq. + + writeTable[curAddr++] = SEQ_START - this.decodeTableSeq.length; + this.decodeTableSeq.push(seq); + } + else + writeTable[curAddr++] = code; // Basic char + } + } + else if (typeof part === "number") { // Integer, meaning increasing sequence starting with prev character. + var charCode = writeTable[curAddr - 1] + 1; + for (var l = 0; l < part; l++) + writeTable[curAddr++] = charCode++; + } + else + throw new Error("Incorrect type '" + typeof part + "' given in " + this.encodingName + " at chunk " + chunk[0]); + } + if (curAddr > 0xFF) + throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + chunk[0] + ": too long" + curAddr); +} + +// Encoder helpers +DBCSCodec.prototype._getEncodeBucket = function(uCode) { + var high = uCode >> 8; // This could be > 0xFF because of astral characters. + if (this.encodeTable[high] === undefined) + this.encodeTable[high] = UNASSIGNED_NODE.slice(0); // Create bucket on demand. + return this.encodeTable[high]; +} + +DBCSCodec.prototype._setEncodeChar = function(uCode, dbcsCode) { + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + if (bucket[low] <= SEQ_START) + this.encodeTableSeq[SEQ_START-bucket[low]][DEF_CHAR] = dbcsCode; // There's already a sequence, set a single-char subsequence of it. + else if (bucket[low] == UNASSIGNED) + bucket[low] = dbcsCode; +} + +DBCSCodec.prototype._setEncodeSequence = function(seq, dbcsCode) { + + // Get the root of character tree according to first character of the sequence. + var uCode = seq[0]; + var bucket = this._getEncodeBucket(uCode); + var low = uCode & 0xFF; + + var node; + if (bucket[low] <= SEQ_START) { + // There's already a sequence with - use it. + node = this.encodeTableSeq[SEQ_START-bucket[low]]; + } + else { + // There was no sequence object - allocate a new one. + node = {}; + if (bucket[low] !== UNASSIGNED) node[DEF_CHAR] = bucket[low]; // If a char was set before - make it a single-char subsequence. + bucket[low] = SEQ_START - this.encodeTableSeq.length; + this.encodeTableSeq.push(node); + } + + // Traverse the character tree, allocating new nodes as needed. + for (var j = 1; j < seq.length-1; j++) { + var oldVal = node[uCode]; + if (typeof oldVal === 'object') + node = oldVal; + else { + node = node[uCode] = {} + if (oldVal !== undefined) + node[DEF_CHAR] = oldVal + } + } + + // Set the leaf to given dbcsCode. + uCode = seq[seq.length-1]; + node[uCode] = dbcsCode; +} + +DBCSCodec.prototype._fillEncodeTable = function(nodeIdx, prefix, skipEncodeChars) { + var node = this.decodeTables[nodeIdx]; + var hasValues = false; + var subNodeEmpty = {}; + for (var i = 0; i < 0x100; i++) { + var uCode = node[i]; + var mbCode = prefix + i; + if (skipEncodeChars[mbCode]) + continue; + + if (uCode >= 0) { + this._setEncodeChar(uCode, mbCode); + hasValues = true; + } else if (uCode <= NODE_START) { + var subNodeIdx = NODE_START - uCode; + if (!subNodeEmpty[subNodeIdx]) { // Skip empty subtrees (they are too large in gb18030). + var newPrefix = (mbCode << 8) >>> 0; // NOTE: '>>> 0' keeps 32-bit num positive. + if (this._fillEncodeTable(subNodeIdx, newPrefix, skipEncodeChars)) + hasValues = true; + else + subNodeEmpty[subNodeIdx] = true; + } + } else if (uCode <= SEQ_START) { + this._setEncodeSequence(this.decodeTableSeq[SEQ_START - uCode], mbCode); + hasValues = true; + } + } + return hasValues; +} + + + +// == Encoder ================================================================== + +function DBCSEncoder(options, codec) { + // Encoder state + this.leadSurrogate = -1; + this.seqObj = undefined; + + // Static data + this.encodeTable = codec.encodeTable; + this.encodeTableSeq = codec.encodeTableSeq; + this.defaultCharSingleByte = codec.defCharSB; + this.gb18030 = codec.gb18030; +} + +DBCSEncoder.prototype.write = function(str) { + var newBuf = Buffer.alloc(str.length * (this.gb18030 ? 4 : 3)), + leadSurrogate = this.leadSurrogate, + seqObj = this.seqObj, nextChar = -1, + i = 0, j = 0; + + while (true) { + // 0. Get next character. + if (nextChar === -1) { + if (i == str.length) break; + var uCode = str.charCodeAt(i++); + } + else { + var uCode = nextChar; + nextChar = -1; + } + + // 1. Handle surrogates. + if (0xD800 <= uCode && uCode < 0xE000) { // Char is one of surrogates. + if (uCode < 0xDC00) { // We've got lead surrogate. + if (leadSurrogate === -1) { + leadSurrogate = uCode; + continue; + } else { + leadSurrogate = uCode; + // Double lead surrogate found. + uCode = UNASSIGNED; + } + } else { // We've got trail surrogate. + if (leadSurrogate !== -1) { + uCode = 0x10000 + (leadSurrogate - 0xD800) * 0x400 + (uCode - 0xDC00); + leadSurrogate = -1; + } else { + // Incomplete surrogate pair - only trail surrogate found. + uCode = UNASSIGNED; + } + + } + } + else if (leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + nextChar = uCode; uCode = UNASSIGNED; // Write an error, then current char. + leadSurrogate = -1; + } + + // 2. Convert uCode character. + var dbcsCode = UNASSIGNED; + if (seqObj !== undefined && uCode != UNASSIGNED) { // We are in the middle of the sequence + var resCode = seqObj[uCode]; + if (typeof resCode === 'object') { // Sequence continues. + seqObj = resCode; + continue; + + } else if (typeof resCode == 'number') { // Sequence finished. Write it. + dbcsCode = resCode; + + } else if (resCode == undefined) { // Current character is not part of the sequence. + + // Try default character for this sequence + resCode = seqObj[DEF_CHAR]; + if (resCode !== undefined) { + dbcsCode = resCode; // Found. Write it. + nextChar = uCode; // Current character will be written too in the next iteration. + + } else { + // TODO: What if we have no default? (resCode == undefined) + // Then, we should write first char of the sequence as-is and try the rest recursively. + // Didn't do it for now because no encoding has this situation yet. + // Currently, just skip the sequence and write current char. + } + } + seqObj = undefined; + } + else if (uCode >= 0) { // Regular character + var subtable = this.encodeTable[uCode >> 8]; + if (subtable !== undefined) + dbcsCode = subtable[uCode & 0xFF]; + + if (dbcsCode <= SEQ_START) { // Sequence start + seqObj = this.encodeTableSeq[SEQ_START-dbcsCode]; + continue; + } + + if (dbcsCode == UNASSIGNED && this.gb18030) { + // Use GB18030 algorithm to find character(s) to write. + var idx = findIdx(this.gb18030.uChars, uCode); + if (idx != -1) { + var dbcsCode = this.gb18030.gbChars[idx] + (uCode - this.gb18030.uChars[idx]); + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 12600); dbcsCode = dbcsCode % 12600; + newBuf[j++] = 0x30 + Math.floor(dbcsCode / 1260); dbcsCode = dbcsCode % 1260; + newBuf[j++] = 0x81 + Math.floor(dbcsCode / 10); dbcsCode = dbcsCode % 10; + newBuf[j++] = 0x30 + dbcsCode; + continue; + } + } + } + + // 3. Write dbcsCode character. + if (dbcsCode === UNASSIGNED) + dbcsCode = this.defaultCharSingleByte; + + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else if (dbcsCode < 0x10000) { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + else if (dbcsCode < 0x1000000) { + newBuf[j++] = dbcsCode >> 16; + newBuf[j++] = (dbcsCode >> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } else { + newBuf[j++] = dbcsCode >>> 24; + newBuf[j++] = (dbcsCode >>> 16) & 0xFF; + newBuf[j++] = (dbcsCode >>> 8) & 0xFF; + newBuf[j++] = dbcsCode & 0xFF; + } + } + + this.seqObj = seqObj; + this.leadSurrogate = leadSurrogate; + return newBuf.slice(0, j); +} + +DBCSEncoder.prototype.end = function() { + if (this.leadSurrogate === -1 && this.seqObj === undefined) + return; // All clean. Most often case. + + var newBuf = Buffer.alloc(10), j = 0; + + if (this.seqObj) { // We're in the sequence. + var dbcsCode = this.seqObj[DEF_CHAR]; + if (dbcsCode !== undefined) { // Write beginning of the sequence. + if (dbcsCode < 0x100) { + newBuf[j++] = dbcsCode; + } + else { + newBuf[j++] = dbcsCode >> 8; // high byte + newBuf[j++] = dbcsCode & 0xFF; // low byte + } + } else { + // See todo above. + } + this.seqObj = undefined; + } + + if (this.leadSurrogate !== -1) { + // Incomplete surrogate pair - only lead surrogate found. + newBuf[j++] = this.defaultCharSingleByte; + this.leadSurrogate = -1; + } + + return newBuf.slice(0, j); +} + +// Export for testing +DBCSEncoder.prototype.findIdx = findIdx; + + +// == Decoder ================================================================== + +function DBCSDecoder(options, codec) { + // Decoder state + this.nodeIdx = 0; + this.prevBytes = []; + + // Static data + this.decodeTables = codec.decodeTables; + this.decodeTableSeq = codec.decodeTableSeq; + this.defaultCharUnicode = codec.defaultCharUnicode; + this.gb18030 = codec.gb18030; +} + +DBCSDecoder.prototype.write = function(buf) { + var newBuf = Buffer.alloc(buf.length*2), + nodeIdx = this.nodeIdx, + prevBytes = this.prevBytes, prevOffset = this.prevBytes.length, + seqStart = -this.prevBytes.length, // idx of the start of current parsed sequence. + uCode; + + for (var i = 0, j = 0; i < buf.length; i++) { + var curByte = (i >= 0) ? buf[i] : prevBytes[i + prevOffset]; + + // Lookup in current trie node. + var uCode = this.decodeTables[nodeIdx][curByte]; + + if (uCode >= 0) { + // Normal character, just use it. + } + else if (uCode === UNASSIGNED) { // Unknown char. + // TODO: Callback with seq. + uCode = this.defaultCharUnicode.charCodeAt(0); + i = seqStart; // Skip one byte ('i' will be incremented by the for loop) and try to parse again. + } + else if (uCode === GB18030_CODE) { + if (i >= 3) { + var ptr = (buf[i-3]-0x81)*12600 + (buf[i-2]-0x30)*1260 + (buf[i-1]-0x81)*10 + (curByte-0x30); + } else { + var ptr = (prevBytes[i-3+prevOffset]-0x81)*12600 + + (((i-2 >= 0) ? buf[i-2] : prevBytes[i-2+prevOffset])-0x30)*1260 + + (((i-1 >= 0) ? buf[i-1] : prevBytes[i-1+prevOffset])-0x81)*10 + + (curByte-0x30); + } + var idx = findIdx(this.gb18030.gbChars, ptr); + uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx]; + } + else if (uCode <= NODE_START) { // Go to next trie node. + nodeIdx = NODE_START - uCode; + continue; + } + else if (uCode <= SEQ_START) { // Output a sequence of chars. + var seq = this.decodeTableSeq[SEQ_START - uCode]; + for (var k = 0; k < seq.length - 1; k++) { + uCode = seq[k]; + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + } + uCode = seq[seq.length-1]; + } + else + throw new Error("iconv-lite internal error: invalid decoding table value " + uCode + " at " + nodeIdx + "/" + curByte); + + // Write the character to buffer, handling higher planes using surrogate pair. + if (uCode >= 0x10000) { + uCode -= 0x10000; + var uCodeLead = 0xD800 | (uCode >> 10); + newBuf[j++] = uCodeLead & 0xFF; + newBuf[j++] = uCodeLead >> 8; + + uCode = 0xDC00 | (uCode & 0x3FF); + } + newBuf[j++] = uCode & 0xFF; + newBuf[j++] = uCode >> 8; + + // Reset trie node. + nodeIdx = 0; seqStart = i+1; + } + + this.nodeIdx = nodeIdx; + this.prevBytes = (seqStart >= 0) + ? Array.prototype.slice.call(buf, seqStart) + : prevBytes.slice(seqStart + prevOffset).concat(Array.prototype.slice.call(buf)); + + return newBuf.slice(0, j).toString('ucs2'); +} + +DBCSDecoder.prototype.end = function() { + var ret = ''; + + // Try to parse all remaining chars. + while (this.prevBytes.length > 0) { + // Skip 1 character in the buffer. + ret += this.defaultCharUnicode; + var bytesArr = this.prevBytes.slice(1); + + // Parse remaining as usual. + this.prevBytes = []; + this.nodeIdx = 0; + if (bytesArr.length > 0) + ret += this.write(bytesArr); + } + + this.prevBytes = []; + this.nodeIdx = 0; + return ret; +} + +// Binary search for GB18030. Returns largest i such that table[i] <= val. +function findIdx(table, val) { + if (table[0] > val) + return -1; + + var l = 0, r = table.length; + while (l < r-1) { // always table[l] <= val < table[r] + var mid = l + ((r-l+1) >> 1); + if (table[mid] <= val) + l = mid; + else + r = mid; + } + return l; +} + diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-data.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-data.js new file mode 100644 index 0000000000000000000000000000000000000000..0d17e5821b3df97bb961c4e71142331139d03d15 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/dbcs-data.js @@ -0,0 +1,188 @@ +"use strict"; + +// Description of supported double byte encodings and aliases. +// Tables are not require()-d until they are needed to speed up library load. +// require()-s are direct to support Browserify. + +module.exports = { + + // == Japanese/ShiftJIS ==================================================== + // All japanese encodings are based on JIS X set of standards: + // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF. + // JIS X 0208 - Main set of 6879 characters, placed in 94x94 plane, to be encoded by 2 bytes. + // Has several variations in 1978, 1983, 1990 and 1997. + // JIS X 0212 - Supplementary plane of 6067 chars in 94x94 plane. 1990. Effectively dead. + // JIS X 0213 - Extension and modern replacement of 0208 and 0212. Total chars: 11233. + // 2 planes, first is superset of 0208, second - revised 0212. + // Introduced in 2000, revised 2004. Some characters are in Unicode Plane 2 (0x2xxxx) + + // Byte encodings are: + // * Shift_JIS: Compatible with 0201, uses not defined chars in top half as lead bytes for double-byte + // encoding of 0208. Lead byte ranges: 0x81-0x9F, 0xE0-0xEF; Trail byte ranges: 0x40-0x7E, 0x80-0x9E, 0x9F-0xFC. + // Windows CP932 is a superset of Shift_JIS. Some companies added more chars, notably KDDI. + // * EUC-JP: Up to 3 bytes per character. Used mostly on *nixes. + // 0x00-0x7F - lower part of 0201 + // 0x8E, 0xA1-0xDF - upper part of 0201 + // (0xA1-0xFE)x2 - 0208 plane (94x94). + // 0x8F, (0xA1-0xFE)x2 - 0212 plane (94x94). + // * JIS X 208: 7-bit, direct encoding of 0208. Byte ranges: 0x21-0x7E (94 values). Uncommon. + // Used as-is in ISO2022 family. + // * ISO2022-JP: Stateful encoding, with escape sequences to switch between ASCII, + // 0201-1976 Roman, 0208-1978, 0208-1983. + // * ISO2022-JP-1: Adds esc seq for 0212-1990. + // * ISO2022-JP-2: Adds esc seq for GB2313-1980, KSX1001-1992, ISO8859-1, ISO8859-7. + // * ISO2022-JP-3: Adds esc seq for 0201-1976 Kana set, 0213-2000 Planes 1, 2. + // * ISO2022-JP-2004: Adds 0213-2004 Plane 1. + // + // After JIS X 0213 appeared, Shift_JIS-2004, EUC-JISX0213 and ISO2022-JP-2004 followed, with just changing the planes. + // + // Overall, it seems that it's a mess :( http://www8.plala.or.jp/tkubota1/unicode-symbols-map2.html + + 'shiftjis': { + type: '_dbcs', + table: function() { return require('./tables/shiftjis.json') }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + encodeSkipVals: [{from: 0xED40, to: 0xF940}], + }, + 'csshiftjis': 'shiftjis', + 'mskanji': 'shiftjis', + 'sjis': 'shiftjis', + 'windows31j': 'shiftjis', + 'ms31j': 'shiftjis', + 'xsjis': 'shiftjis', + 'windows932': 'shiftjis', + 'ms932': 'shiftjis', + '932': 'shiftjis', + 'cp932': 'shiftjis', + + 'eucjp': { + type: '_dbcs', + table: function() { return require('./tables/eucjp.json') }, + encodeAdd: {'\u00a5': 0x5C, '\u203E': 0x7E}, + }, + + // TODO: KDDI extension to Shift_JIS + // TODO: IBM CCSID 942 = CP932, but F0-F9 custom chars and other char changes. + // TODO: IBM CCSID 943 = Shift_JIS = CP932 with original Shift_JIS lower 128 chars. + + + // == Chinese/GBK ========================================================== + // http://en.wikipedia.org/wiki/GBK + // We mostly implement W3C recommendation: https://www.w3.org/TR/encoding/#gbk-encoder + + // Oldest GB2312 (1981, ~7600 chars) is a subset of CP936 + 'gb2312': 'cp936', + 'gb231280': 'cp936', + 'gb23121980': 'cp936', + 'csgb2312': 'cp936', + 'csiso58gb231280': 'cp936', + 'euccn': 'cp936', + + // Microsoft's CP936 is a subset and approximation of GBK. + 'windows936': 'cp936', + 'ms936': 'cp936', + '936': 'cp936', + 'cp936': { + type: '_dbcs', + table: function() { return require('./tables/cp936.json') }, + }, + + // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other. + 'gbk': { + type: '_dbcs', + table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, + }, + 'xgbk': 'gbk', + 'isoir58': 'gbk', + + // GB18030 is an algorithmic extension of GBK. + // Main source: https://www.w3.org/TR/encoding/#gbk-encoder + // http://icu-project.org/docs/papers/gb18030.html + // http://source.icu-project.org/repos/icu/data/trunk/charset/data/xml/gb-18030-2000.xml + // http://www.khngai.com/chinese/charmap/tblgbk.php?page=0 + 'gb18030': { + type: '_dbcs', + table: function() { return require('./tables/cp936.json').concat(require('./tables/gbk-added.json')) }, + gb18030: function() { return require('./tables/gb18030-ranges.json') }, + encodeSkipVals: [0x80], + encodeAdd: {'€': 0xA2E3}, + }, + + 'chinese': 'gb18030', + + + // == Korean =============================================================== + // EUC-KR, KS_C_5601 and KS X 1001 are exactly the same. + 'windows949': 'cp949', + 'ms949': 'cp949', + '949': 'cp949', + 'cp949': { + type: '_dbcs', + table: function() { return require('./tables/cp949.json') }, + }, + + 'cseuckr': 'cp949', + 'csksc56011987': 'cp949', + 'euckr': 'cp949', + 'isoir149': 'cp949', + 'korean': 'cp949', + 'ksc56011987': 'cp949', + 'ksc56011989': 'cp949', + 'ksc5601': 'cp949', + + + // == Big5/Taiwan/Hong Kong ================================================ + // There are lots of tables for Big5 and cp950. Please see the following links for history: + // http://moztw.org/docs/big5/ http://www.haible.de/bruno/charsets/conversion-tables/Big5.html + // Variations, in roughly number of defined chars: + // * Windows CP 950: Microsoft variant of Big5. Canonical: http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP950.TXT + // * Windows CP 951: Microsoft variant of Big5-HKSCS-2001. Seems to be never public. http://me.abelcheung.org/articles/research/what-is-cp951/ + // * Big5-2003 (Taiwan standard) almost superset of cp950. + // * Unicode-at-on (UAO) / Mozilla 1.8. Falling out of use on the Web. Not supported by other browsers. + // * Big5-HKSCS (-2001, -2004, -2008). Hong Kong standard. + // many unicode code points moved from PUA to Supplementary plane (U+2XXXX) over the years. + // Plus, it has 4 combining sequences. + // Seems that Mozilla refused to support it for 10 yrs. https://bugzilla.mozilla.org/show_bug.cgi?id=162431 https://bugzilla.mozilla.org/show_bug.cgi?id=310299 + // because big5-hkscs is the only encoding to include astral characters in non-algorithmic way. + // Implementations are not consistent within browsers; sometimes labeled as just big5. + // MS Internet Explorer switches from big5 to big5-hkscs when a patch applied. + // Great discussion & recap of what's going on https://bugzilla.mozilla.org/show_bug.cgi?id=912470#c31 + // In the encoder, it might make sense to support encoding old PUA mappings to Big5 bytes seq-s. + // Official spec: http://www.ogcio.gov.hk/en/business/tech_promotion/ccli/terms/doc/2003cmp_2008.txt + // http://www.ogcio.gov.hk/tc/business/tech_promotion/ccli/terms/doc/hkscs-2008-big5-iso.txt + // + // Current understanding of how to deal with Big5(-HKSCS) is in the Encoding Standard, http://encoding.spec.whatwg.org/#big5-encoder + // Unicode mapping (http://www.unicode.org/Public/MAPPINGS/OBSOLETE/EASTASIA/OTHER/BIG5.TXT) is said to be wrong. + + 'windows950': 'cp950', + 'ms950': 'cp950', + '950': 'cp950', + 'cp950': { + type: '_dbcs', + table: function() { return require('./tables/cp950.json') }, + }, + + // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus. + 'big5': 'big5hkscs', + 'big5hkscs': { + type: '_dbcs', + table: function() { return require('./tables/cp950.json').concat(require('./tables/big5-added.json')) }, + encodeSkipVals: [ + // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of + // https://encoding.spec.whatwg.org/#index-big5-pointer), we still do it to increase compatibility with ICU. + // But if a single unicode point can be encoded both as HKSCS and regular Big5, we prefer the latter. + 0x8e69, 0x8e6f, 0x8e7e, 0x8eab, 0x8eb4, 0x8ecd, 0x8ed0, 0x8f57, 0x8f69, 0x8f6e, 0x8fcb, 0x8ffe, + 0x906d, 0x907a, 0x90c4, 0x90dc, 0x90f1, 0x91bf, 0x92af, 0x92b0, 0x92b1, 0x92b2, 0x92d1, 0x9447, 0x94ca, + 0x95d9, 0x96fc, 0x9975, 0x9b76, 0x9b78, 0x9b7b, 0x9bc6, 0x9bde, 0x9bec, 0x9bf6, 0x9c42, 0x9c53, 0x9c62, + 0x9c68, 0x9c6b, 0x9c77, 0x9cbc, 0x9cbd, 0x9cd0, 0x9d57, 0x9d5a, 0x9dc4, 0x9def, 0x9dfb, 0x9ea9, 0x9eef, + 0x9efd, 0x9f60, 0x9fcb, 0xa077, 0xa0dc, 0xa0df, 0x8fcc, 0x92c8, 0x9644, 0x96ed, + + // Step 2 of https://encoding.spec.whatwg.org/#index-big5-pointer: Use last pointer for U+2550, U+255E, U+2561, U+256A, U+5341, or U+5345 + 0xa2a4, 0xa2a5, 0xa2a7, 0xa2a6, 0xa2cc, 0xa2ce, + ], + }, + + 'cnbig5': 'big5hkscs', + 'csbig5': 'big5hkscs', + 'xxbig5': 'big5hkscs', +}; diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/index.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d95c2441151a93320a45e2042d30974230b4902b --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/index.js @@ -0,0 +1,23 @@ +"use strict"; + +// Update this array if you add/rename/remove files in this directory. +// We support Browserify by skipping automatic module discovery and requiring modules directly. +var modules = [ + require("./internal"), + require("./utf32"), + require("./utf16"), + require("./utf7"), + require("./sbcs-codec"), + require("./sbcs-data"), + require("./sbcs-data-generated"), + require("./dbcs-codec"), + require("./dbcs-data"), +]; + +// Put all encoding/alias/codec definitions to single object and export it. +for (var i = 0; i < modules.length; i++) { + var module = modules[i]; + for (var enc in module) + if (Object.prototype.hasOwnProperty.call(module, enc)) + exports[enc] = module[enc]; +} diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/internal.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/internal.js new file mode 100644 index 0000000000000000000000000000000000000000..dc1074f04f11a31c0e962846f5d162eab9556d38 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/internal.js @@ -0,0 +1,198 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Export Node.js internal encodings. + +module.exports = { + // Encodings + utf8: { type: "_internal", bomAware: true}, + cesu8: { type: "_internal", bomAware: true}, + unicode11utf8: "utf8", + + ucs2: { type: "_internal", bomAware: true}, + utf16le: "ucs2", + + binary: { type: "_internal" }, + base64: { type: "_internal" }, + hex: { type: "_internal" }, + + // Codec. + _internal: InternalCodec, +}; + +//------------------------------------------------------------------------------ + +function InternalCodec(codecOptions, iconv) { + this.enc = codecOptions.encodingName; + this.bomAware = codecOptions.bomAware; + + if (this.enc === "base64") + this.encoder = InternalEncoderBase64; + else if (this.enc === "cesu8") { + this.enc = "utf8"; // Use utf8 for decoding. + this.encoder = InternalEncoderCesu8; + + // Add decoder for versions of Node not supporting CESU-8 + if (Buffer.from('eda0bdedb2a9', 'hex').toString() !== '💩') { + this.decoder = InternalDecoderCesu8; + this.defaultCharUnicode = iconv.defaultCharUnicode; + } + } +} + +InternalCodec.prototype.encoder = InternalEncoder; +InternalCodec.prototype.decoder = InternalDecoder; + +//------------------------------------------------------------------------------ + +// We use node.js internal decoder. Its signature is the same as ours. +var StringDecoder = require('string_decoder').StringDecoder; + +if (!StringDecoder.prototype.end) // Node v0.8 doesn't have this method. + StringDecoder.prototype.end = function() {}; + + +function InternalDecoder(options, codec) { + this.decoder = new StringDecoder(codec.enc); +} + +InternalDecoder.prototype.write = function(buf) { + if (!Buffer.isBuffer(buf)) { + buf = Buffer.from(buf); + } + + return this.decoder.write(buf); +} + +InternalDecoder.prototype.end = function() { + return this.decoder.end(); +} + + +//------------------------------------------------------------------------------ +// Encoder is mostly trivial + +function InternalEncoder(options, codec) { + this.enc = codec.enc; +} + +InternalEncoder.prototype.write = function(str) { + return Buffer.from(str, this.enc); +} + +InternalEncoder.prototype.end = function() { +} + + +//------------------------------------------------------------------------------ +// Except base64 encoder, which must keep its state. + +function InternalEncoderBase64(options, codec) { + this.prevStr = ''; +} + +InternalEncoderBase64.prototype.write = function(str) { + str = this.prevStr + str; + var completeQuads = str.length - (str.length % 4); + this.prevStr = str.slice(completeQuads); + str = str.slice(0, completeQuads); + + return Buffer.from(str, "base64"); +} + +InternalEncoderBase64.prototype.end = function() { + return Buffer.from(this.prevStr, "base64"); +} + + +//------------------------------------------------------------------------------ +// CESU-8 encoder is also special. + +function InternalEncoderCesu8(options, codec) { +} + +InternalEncoderCesu8.prototype.write = function(str) { + var buf = Buffer.alloc(str.length * 3), bufIdx = 0; + for (var i = 0; i < str.length; i++) { + var charCode = str.charCodeAt(i); + // Naive implementation, but it works because CESU-8 is especially easy + // to convert from UTF-16 (which all JS strings are encoded in). + if (charCode < 0x80) + buf[bufIdx++] = charCode; + else if (charCode < 0x800) { + buf[bufIdx++] = 0xC0 + (charCode >>> 6); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + else { // charCode will always be < 0x10000 in javascript. + buf[bufIdx++] = 0xE0 + (charCode >>> 12); + buf[bufIdx++] = 0x80 + ((charCode >>> 6) & 0x3f); + buf[bufIdx++] = 0x80 + (charCode & 0x3f); + } + } + return buf.slice(0, bufIdx); +} + +InternalEncoderCesu8.prototype.end = function() { +} + +//------------------------------------------------------------------------------ +// CESU-8 decoder is not implemented in Node v4.0+ + +function InternalDecoderCesu8(options, codec) { + this.acc = 0; + this.contBytes = 0; + this.accBytes = 0; + this.defaultCharUnicode = codec.defaultCharUnicode; +} + +InternalDecoderCesu8.prototype.write = function(buf) { + var acc = this.acc, contBytes = this.contBytes, accBytes = this.accBytes, + res = ''; + for (var i = 0; i < buf.length; i++) { + var curByte = buf[i]; + if ((curByte & 0xC0) !== 0x80) { // Leading byte + if (contBytes > 0) { // Previous code is invalid + res += this.defaultCharUnicode; + contBytes = 0; + } + + if (curByte < 0x80) { // Single-byte code + res += String.fromCharCode(curByte); + } else if (curByte < 0xE0) { // Two-byte code + acc = curByte & 0x1F; + contBytes = 1; accBytes = 1; + } else if (curByte < 0xF0) { // Three-byte code + acc = curByte & 0x0F; + contBytes = 2; accBytes = 1; + } else { // Four or more are not supported for CESU-8. + res += this.defaultCharUnicode; + } + } else { // Continuation byte + if (contBytes > 0) { // We're waiting for it. + acc = (acc << 6) | (curByte & 0x3f); + contBytes--; accBytes++; + if (contBytes === 0) { + // Check for overlong encoding, but support Modified UTF-8 (encoding NULL as C0 80) + if (accBytes === 2 && acc < 0x80 && acc > 0) + res += this.defaultCharUnicode; + else if (accBytes === 3 && acc < 0x800) + res += this.defaultCharUnicode; + else + // Actually add character. + res += String.fromCharCode(acc); + } + } else { // Unexpected continuation byte + res += this.defaultCharUnicode; + } + } + } + this.acc = acc; this.contBytes = contBytes; this.accBytes = accBytes; + return res; +} + +InternalDecoderCesu8.prototype.end = function() { + var res = 0; + if (this.contBytes > 0) + res += this.defaultCharUnicode; + return res; +} diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-codec.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-codec.js new file mode 100644 index 0000000000000000000000000000000000000000..abac5ffaac97da29fa5c5d8aedf5b47763fc7c58 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-codec.js @@ -0,0 +1,72 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Single-byte codec. Needs a 'chars' string parameter that contains 256 or 128 chars that +// correspond to encoded bytes (if 128 - then lower half is ASCII). + +exports._sbcs = SBCSCodec; +function SBCSCodec(codecOptions, iconv) { + if (!codecOptions) + throw new Error("SBCS codec is called without the data.") + + // Prepare char buffer for decoding. + if (!codecOptions.chars || (codecOptions.chars.length !== 128 && codecOptions.chars.length !== 256)) + throw new Error("Encoding '"+codecOptions.type+"' has incorrect 'chars' (must be of len 128 or 256)"); + + if (codecOptions.chars.length === 128) { + var asciiString = ""; + for (var i = 0; i < 128; i++) + asciiString += String.fromCharCode(i); + codecOptions.chars = asciiString + codecOptions.chars; + } + + this.decodeBuf = Buffer.from(codecOptions.chars, 'ucs2'); + + // Encoding buffer. + var encodeBuf = Buffer.alloc(65536, iconv.defaultCharSingleByte.charCodeAt(0)); + + for (var i = 0; i < codecOptions.chars.length; i++) + encodeBuf[codecOptions.chars.charCodeAt(i)] = i; + + this.encodeBuf = encodeBuf; +} + +SBCSCodec.prototype.encoder = SBCSEncoder; +SBCSCodec.prototype.decoder = SBCSDecoder; + + +function SBCSEncoder(options, codec) { + this.encodeBuf = codec.encodeBuf; +} + +SBCSEncoder.prototype.write = function(str) { + var buf = Buffer.alloc(str.length); + for (var i = 0; i < str.length; i++) + buf[i] = this.encodeBuf[str.charCodeAt(i)]; + + return buf; +} + +SBCSEncoder.prototype.end = function() { +} + + +function SBCSDecoder(options, codec) { + this.decodeBuf = codec.decodeBuf; +} + +SBCSDecoder.prototype.write = function(buf) { + // Strings are immutable in JS -> we use ucs2 buffer to speed up computations. + var decodeBuf = this.decodeBuf; + var newBuf = Buffer.alloc(buf.length*2); + var idx1 = 0, idx2 = 0; + for (var i = 0; i < buf.length; i++) { + idx1 = buf[i]*2; idx2 = i*2; + newBuf[idx2] = decodeBuf[idx1]; + newBuf[idx2+1] = decodeBuf[idx1+1]; + } + return newBuf.toString('ucs2'); +} + +SBCSDecoder.prototype.end = function() { +} diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js new file mode 100644 index 0000000000000000000000000000000000000000..9b4823607b6071c67dd7b553767bfee98a49de1c --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data-generated.js @@ -0,0 +1,451 @@ +"use strict"; + +// Generated data for sbcs codec. Don't edit manually. Regenerate using generation/gen-sbcs.js script. +module.exports = { + "437": "cp437", + "737": "cp737", + "775": "cp775", + "850": "cp850", + "852": "cp852", + "855": "cp855", + "856": "cp856", + "857": "cp857", + "858": "cp858", + "860": "cp860", + "861": "cp861", + "862": "cp862", + "863": "cp863", + "864": "cp864", + "865": "cp865", + "866": "cp866", + "869": "cp869", + "874": "windows874", + "922": "cp922", + "1046": "cp1046", + "1124": "cp1124", + "1125": "cp1125", + "1129": "cp1129", + "1133": "cp1133", + "1161": "cp1161", + "1162": "cp1162", + "1163": "cp1163", + "1250": "windows1250", + "1251": "windows1251", + "1252": "windows1252", + "1253": "windows1253", + "1254": "windows1254", + "1255": "windows1255", + "1256": "windows1256", + "1257": "windows1257", + "1258": "windows1258", + "28591": "iso88591", + "28592": "iso88592", + "28593": "iso88593", + "28594": "iso88594", + "28595": "iso88595", + "28596": "iso88596", + "28597": "iso88597", + "28598": "iso88598", + "28599": "iso88599", + "28600": "iso885910", + "28601": "iso885911", + "28603": "iso885913", + "28604": "iso885914", + "28605": "iso885915", + "28606": "iso885916", + "windows874": { + "type": "_sbcs", + "chars": "€����…�����������‘’“”•–—�������� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "win874": "windows874", + "cp874": "windows874", + "windows1250": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰Š‹ŚŤŽŹ�‘’“”•–—�™š›śťžź ˇ˘Ł¤Ą¦§¨©Ş«¬­®Ż°±˛ł´µ¶·¸ąş»Ľ˝ľżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "win1250": "windows1250", + "cp1250": "windows1250", + "windows1251": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊЌЋЏђ‘’“”•–—�™љ›њќћџ ЎўЈ¤Ґ¦§Ё©Є«¬­®Ї°±Ііґµ¶·ё№є»јЅѕїАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "win1251": "windows1251", + "cp1251": "windows1251", + "windows1252": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ�Ž��‘’“”•–—˜™š›œ�žŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "win1252": "windows1252", + "cp1252": "windows1252", + "windows1253": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡�‰�‹�����‘’“”•–—�™�›���� ΅Ά£¤¥¦§¨©�«¬­®―°±²³΄µ¶·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "win1253": "windows1253", + "cp1253": "windows1253", + "windows1254": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰Š‹Œ����‘’“”•–—˜™š›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "win1254": "windows1254", + "cp1254": "windows1254", + "windows1255": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹�����‘’“”•–—˜™�›���� ¡¢£₪¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾¿ְֱֲֳִֵֶַָֹֺֻּֽ־ֿ׀ׁׂ׃װױײ׳״�������אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "win1255": "windows1255", + "cp1255": "windows1255", + "windows1256": { + "type": "_sbcs", + "chars": "€پ‚ƒ„…†‡ˆ‰ٹ‹Œچژڈگ‘’“”•–—ک™ڑ›œ‌‍ں ،¢£¤¥¦§¨©ھ«¬­®¯°±²³´µ¶·¸¹؛»¼½¾؟ہءآأؤإئابةتثجحخدذرزسشصض×طظعغـفقكàلâمنهوçèéêëىيîïًٌٍَôُِ÷ّùْûü‎‏ے" + }, + "win1256": "windows1256", + "cp1256": "windows1256", + "windows1257": { + "type": "_sbcs", + "chars": "€�‚�„…†‡�‰�‹�¨ˇ¸�‘’“”•–—�™�›�¯˛� �¢£¤�¦§Ø©Ŗ«¬­®Æ°±²³´µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž˙" + }, + "win1257": "windows1257", + "cp1257": "windows1257", + "windows1258": { + "type": "_sbcs", + "chars": "€�‚ƒ„…†‡ˆ‰�‹Œ����‘’“”•–—˜™�›œ��Ÿ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "win1258": "windows1258", + "cp1258": "windows1258", + "iso88591": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28591": "iso88591", + "iso88592": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ą˘Ł¤ĽŚ§¨ŠŞŤŹ­ŽŻ°ą˛ł´ľśˇ¸šşťź˝žżŔÁÂĂÄĹĆÇČÉĘËĚÍÎĎĐŃŇÓÔŐÖ×ŘŮÚŰÜÝŢßŕáâăäĺćçčéęëěíîďđńňóôőö÷řůúűüýţ˙" + }, + "cp28592": "iso88592", + "iso88593": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ħ˘£¤�Ĥ§¨İŞĞĴ­�ݰħ²³´µĥ·¸ışğĵ½�żÀÁÂ�ÄĊĈÇÈÉÊËÌÍÎÏ�ÑÒÓÔĠÖ×ĜÙÚÛÜŬŜßàáâ�äċĉçèéêëìíîï�ñòóôġö÷ĝùúûüŭŝ˙" + }, + "cp28593": "iso88593", + "iso88594": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĸŖ¤Ĩϧ¨ŠĒĢŦ­Ž¯°ą˛ŗ´ĩšēģŧŊžŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎĪĐŅŌĶÔÕÖרŲÚÛÜŨŪßāáâãäåæįčéęëėíîīđņōķôõö÷øųúûüũū˙" + }, + "cp28594": "iso88594", + "iso88595": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂЃЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђѓєѕіїјљњћќ§ўџ" + }, + "cp28595": "iso88595", + "iso88596": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ���¤�������،­�������������؛���؟�ءآأؤإئابةتثجحخدذرزسشصضطظعغ�����ـفقكلمنهوىيًٌٍَُِّْ�������������" + }, + "cp28596": "iso88596", + "iso88597": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ‘’£€₯¦§¨©ͺ«¬­�―°±²³΄΅Ά·ΈΉΊ»Ό½ΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡ�ΣΤΥΦΧΨΩΪΫάέήίΰαβγδεζηθικλμνξοπρςστυφχψωϊϋόύώ�" + }, + "cp28597": "iso88597", + "iso88598": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �¢£¤¥¦§¨©×«¬­®¯°±²³´µ¶·¸¹÷»¼½¾��������������������������������‗אבגדהוזחטיךכלםמןנסעףפץצקרשת��‎‏�" + }, + "cp28598": "iso88598", + "iso88599": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏĞÑÒÓÔÕÖרÙÚÛÜİŞßàáâãäåæçèéêëìíîïğñòóôõö÷øùúûüışÿ" + }, + "cp28599": "iso88599", + "iso885910": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄĒĢĪĨͧĻĐŠŦŽ­ŪŊ°ąēģīĩķ·ļđšŧž―ūŋĀÁÂÃÄÅÆĮČÉĘËĖÍÎÏÐŅŌÓÔÕÖŨØŲÚÛÜÝÞßāáâãäåæįčéęëėíîïðņōóôõöũøųúûüýþĸ" + }, + "cp28600": "iso885910", + "iso885911": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "cp28601": "iso885911", + "iso885913": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ”¢£¤„¦§Ø©Ŗ«¬­®Æ°±²³“µ¶·ø¹ŗ»¼½¾æĄĮĀĆÄÅĘĒČÉŹĖĢĶĪĻŠŃŅÓŌÕÖ×ŲŁŚŪÜŻŽßąįāćäåęēčéźėģķīļšńņóōõö÷ųłśūüżž’" + }, + "cp28603": "iso885913", + "iso885914": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ Ḃḃ£ĊċḊ§Ẁ©ẂḋỲ­®ŸḞḟĠġṀṁ¶ṖẁṗẃṠỳẄẅṡÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŴÑÒÓÔÕÖṪØÙÚÛÜÝŶßàáâãäåæçèéêëìíîïŵñòóôõöṫøùúûüýŷÿ" + }, + "cp28604": "iso885914", + "iso885915": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥Š§š©ª«¬­®¯°±²³Žµ¶·ž¹º»ŒœŸ¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "cp28605": "iso885915", + "iso885916": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ĄąŁ€„Чš©Ș«Ź­źŻ°±ČłŽ”¶·žčș»ŒœŸżÀÁÂĂÄĆÆÇÈÉÊËÌÍÎÏĐŃÒÓÔŐÖŚŰÙÚÛÜĘȚßàáâăäćæçèéêëìíîïđńòóôőöśűùúûüęțÿ" + }, + "cp28606": "iso885916", + "cp437": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm437": "cp437", + "csibm437": "cp437", + "cp737": { + "type": "_sbcs", + "chars": "ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩαβγδεζηθικλμνξοπρσςτυφχψ░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ωάέήϊίόύϋώΆΈΉΊΌΎΏ±≥≤ΪΫ÷≈°∙·√ⁿ²■ " + }, + "ibm737": "cp737", + "csibm737": "cp737", + "cp775": { + "type": "_sbcs", + "chars": "ĆüéāäģåćłēŖŗīŹÄÅÉæÆōöĢ¢ŚśÖÜø£Ø×¤ĀĪóŻżź”¦©®¬½¼Ł«»░▒▓│┤ĄČĘĖ╣║╗╝ĮŠ┐└┴┬├─┼ŲŪ╚╔╩╦╠═╬Žąčęėįšųūž┘┌█▄▌▐▀ÓßŌŃõÕµńĶķĻļņĒŅ’­±“¾¶§÷„°∙·¹³²■ " + }, + "ibm775": "cp775", + "csibm775": "cp775", + "cp850": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈıÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm850": "cp850", + "csibm850": "cp850", + "cp852": { + "type": "_sbcs", + "chars": "ÇüéâäůćçłëŐőîŹÄĆÉĹĺôöĽľŚśÖÜŤťŁ×čáíóúĄąŽžĘ꬟Ⱥ«»░▒▓│┤ÁÂĚŞ╣║╗╝Żż┐└┴┬├─┼Ăă╚╔╩╦╠═╬¤đĐĎËďŇÍÎě┘┌█▄ŢŮ▀ÓßÔŃńňŠšŔÚŕŰýÝţ´­˝˛ˇ˘§÷¸°¨˙űŘř■ " + }, + "ibm852": "cp852", + "csibm852": "cp852", + "cp855": { + "type": "_sbcs", + "chars": "ђЂѓЃёЁєЄѕЅіІїЇјЈљЉњЊћЋќЌўЎџЏюЮъЪаАбБцЦдДеЕфФгГ«»░▒▓│┤хХиИ╣║╗╝йЙ┐└┴┬├─┼кК╚╔╩╦╠═╬¤лЛмМнНоОп┘┌█▄Пя▀ЯрРсСтТуУжЖвВьЬ№­ыЫзЗшШэЭщЩчЧ§■ " + }, + "ibm855": "cp855", + "csibm855": "cp855", + "cp856": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת�£�×����������®¬½¼�«»░▒▓│┤���©╣║╗╝¢¥┐└┴┬├─┼��╚╔╩╦╠═╬¤���������┘┌█▄¦�▀������µ�������¯´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm856": "cp856", + "csibm856": "cp856", + "cp857": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîıÄÅÉæÆôöòûùİÖÜø£ØŞşáíóúñÑĞ𿮬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ºªÊËÈ�ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµ�×ÚÛÙìÿ¯´­±�¾¶§÷¸°¨·¹³²■ " + }, + "ibm857": "cp857", + "csibm857": "cp857", + "cp858": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø×ƒáíóúñѪº¿®¬½¼¡«»░▒▓│┤ÁÂÀ©╣║╗╝¢¥┐└┴┬├─┼ãÃ╚╔╩╦╠═╬¤ðÐÊËÈ€ÍÎÏ┘┌█▄¦Ì▀ÓßÔÒõÕµþÞÚÛÙýݯ´­±‗¾¶§÷¸°¨·¹³²■ " + }, + "ibm858": "cp858", + "csibm858": "cp858", + "cp860": { + "type": "_sbcs", + "chars": "ÇüéâãàÁçêÊèÍÔìÃÂÉÀÈôõòÚùÌÕÜ¢£Ù₧ÓáíóúñѪº¿Ò¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm860": "cp860", + "csibm860": "cp860", + "cp861": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèÐðÞÄÅÉæÆôöþûÝýÖÜø£Ø₧ƒáíóúÁÍÓÚ¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm861": "cp861", + "csibm861": "cp861", + "cp862": { + "type": "_sbcs", + "chars": "אבגדהוזחטיךכלםמןנסעףפץצקרשת¢£¥₧ƒáíóúñѪº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm862": "cp862", + "csibm862": "cp862", + "cp863": { + "type": "_sbcs", + "chars": "ÇüéâÂà¶çêëèïî‗À§ÉÈÊôËÏûù¤ÔÜ¢£ÙÛƒ¦´óú¨¸³¯Î⌐¬½¼¾«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm863": "cp863", + "csibm863": "cp863", + "cp864": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$٪&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~°·∙√▒─│┼┤┬├┴┐┌└┘β∞φ±½¼≈«»ﻷﻸ��ﻻﻼ� ­ﺂ£¤ﺄ��ﺎﺏﺕﺙ،ﺝﺡﺥ٠١٢٣٤٥٦٧٨٩ﻑ؛ﺱﺵﺹ؟¢ﺀﺁﺃﺅﻊﺋﺍﺑﺓﺗﺛﺟﺣﺧﺩﺫﺭﺯﺳﺷﺻﺿﻁﻅﻋﻏ¦¬÷×ﻉـﻓﻗﻛﻟﻣﻧﻫﻭﻯﻳﺽﻌﻎﻍﻡﹽّﻥﻩﻬﻰﻲﻐﻕﻵﻶﻝﻙﻱ■�" + }, + "ibm864": "cp864", + "csibm864": "cp864", + "cp865": { + "type": "_sbcs", + "chars": "ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜø£Ø₧ƒáíóúñѪº¿⌐¬½¼¡«¤░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + "ibm865": "cp865", + "csibm865": "cp865", + "cp866": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№¤■ " + }, + "ibm866": "cp866", + "csibm866": "cp866", + "cp869": { + "type": "_sbcs", + "chars": "������Ά�·¬¦‘’Έ―ΉΊΪΌ��ΎΫ©Ώ²³ά£έήίϊΐόύΑΒΓΔΕΖΗ½ΘΙ«»░▒▓│┤ΚΛΜΝ╣║╗╝ΞΟ┐└┴┬├─┼ΠΡ╚╔╩╦╠═╬ΣΤΥΦΧΨΩαβγ┘┌█▄δε▀ζηθικλμνξοπρσςτ΄­±υφχ§ψ΅°¨ωϋΰώ■ " + }, + "ibm869": "cp869", + "csibm869": "cp869", + "cp922": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®‾°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏŠÑÒÓÔÕÖרÙÚÛÜÝŽßàáâãäåæçèéêëìíîïšñòóôõö÷øùúûüýžÿ" + }, + "ibm922": "cp922", + "csibm922": "cp922", + "cp1046": { + "type": "_sbcs", + "chars": "ﺈ×÷ﹱˆ■│─┐┌└┘ﹹﹻﹽﹿﹷﺊﻰﻳﻲﻎﻏﻐﻶﻸﻺﻼ ¤ﺋﺑﺗﺛﺟﺣ،­ﺧﺳ٠١٢٣٤٥٦٧٨٩ﺷ؛ﺻﺿﻊ؟ﻋءآأؤإئابةتثجحخدذرزسشصضطﻇعغﻌﺂﺄﺎﻓـفقكلمنهوىيًٌٍَُِّْﻗﻛﻟﻵﻷﻹﻻﻣﻧﻬﻩ�" + }, + "ibm1046": "cp1046", + "csibm1046": "cp1046", + "cp1124": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ЁЂҐЄЅІЇЈЉЊЋЌ­ЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя№ёђґєѕіїјљњћќ§ўџ" + }, + "ibm1124": "cp1124", + "csibm1124": "cp1124", + "cp1125": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёҐґЄєІіЇї·√№¤■ " + }, + "ibm1125": "cp1125", + "csibm1125": "cp1125", + "cp1129": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1129": "cp1129", + "csibm1129": "cp1129", + "cp1133": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ກຂຄງຈສຊຍດຕຖທນບປຜຝພຟມຢຣລວຫອຮ���ຯະາຳິີຶືຸູຼັົຽ���ເແໂໃໄ່້໊໋໌ໍໆ�ໜໝ₭����������������໐໑໒໓໔໕໖໗໘໙��¢¬¦�" + }, + "ibm1133": "cp1133", + "csibm1133": "cp1133", + "cp1161": { + "type": "_sbcs", + "chars": "��������������������������������่กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู้๊๋€฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛¢¬¦ " + }, + "ibm1161": "cp1161", + "csibm1161": "cp1161", + "cp1162": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + }, + "ibm1162": "cp1162", + "csibm1162": "cp1162", + "cp1163": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£€¥¦§œ©ª«¬­®¯°±²³Ÿµ¶·Œ¹º»¼½¾¿ÀÁÂĂÄÅÆÇÈÉÊË̀ÍÎÏĐÑ̉ÓÔƠÖרÙÚÛÜỮßàáâăäåæçèéêë́íîïđṇ̃óôơö÷øùúûüư₫ÿ" + }, + "ibm1163": "cp1163", + "csibm1163": "cp1163", + "maccroatian": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊�©⁄¤‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ" + }, + "maccyrillic": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°¢£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµ∂ЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "macgreek": { + "type": "_sbcs", + "chars": "Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦­ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ�" + }, + "maciceland": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macroman": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macromania": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂŞ∞±≤≥¥µ∂∑∏π∫ªºΩăş¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›Ţţ‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macthai": { + "type": "_sbcs", + "chars": "«»…“”�•‘’� กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู​–—฿เแโใไๅๆ็่้๊๋์ํ™๏๐๑๒๓๔๕๖๗๘๙®©����" + }, + "macturkish": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙ�ˆ˜¯˘˙˚¸˝˛ˇ" + }, + "macukraine": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю¤" + }, + "koi8r": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ё╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡Ё╢╣╤╥╦╧╨╩╪╫╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8u": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґ╝╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪Ґ╬©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8ru": { + "type": "_sbcs", + "chars": "─│┌┐└┘├┤┬┴┼▀▄█▌▐░▒▓⌠■∙√≈≤≥ ⌡°²·÷═║╒ёє╔ії╗╘╙╚╛ґў╞╟╠╡ЁЄ╣ІЇ╦╧╨╩╪ҐЎ©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "koi8t": { + "type": "_sbcs", + "chars": "қғ‚Ғ„…†‡�‰ҳ‹ҲҷҶ�Қ‘’“”•–—�™�›�����ӯӮё¤ӣ¦§���«¬­®�°±²Ё�Ӣ¶·�№�»���©юабцдефгхийклмнопярстужвьызшэщчъЮАБЦДЕФГХИЙКЛМНОПЯРСТУЖВЬЫЗШЭЩЧЪ" + }, + "armscii8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ �և։)(»«—.՝,-֊…՜՛՞ԱաԲբԳգԴդԵեԶզԷէԸըԹթԺժԻիԼլԽխԾծԿկՀհՁձՂղՃճՄմՅյՆնՇշՈոՉչՊպՋջՌռՍսՎվՏտՐրՑցՒւՓփՔքՕօՖֆ՚�" + }, + "rk1048": { + "type": "_sbcs", + "chars": "ЂЃ‚ѓ„…†‡€‰Љ‹ЊҚҺЏђ‘’“”•–—�™љ›њқһџ ҰұӘ¤Ө¦§Ё©Ғ«¬­®Ү°±Ііөµ¶·ё№ғ»әҢңүАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "tcvn": { + "type": "_sbcs", + "chars": "\u0000ÚỤ\u0003ỪỬỮ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010ỨỰỲỶỸÝỴ\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ÀẢÃÁẠẶẬÈẺẼÉẸỆÌỈĨÍỊÒỎÕÓỌỘỜỞỠỚỢÙỦŨ ĂÂÊÔƠƯĐăâêôơưđẶ̀̀̉̃́àảãáạẲằẳẵắẴẮẦẨẪẤỀặầẩẫấậèỂẻẽéẹềểễếệìỉỄẾỒĩíịòỔỏõóọồổỗốộờởỡớợùỖủũúụừửữứựỳỷỹýỵỐ" + }, + "georgianacademy": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "georgianps": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿აბგდევზჱთიკლმნჲოპჟრსტჳუფქღყშჩცძწჭხჴჯჰჵæçèéêëìíîïðñòóôõö÷øùúûüýþÿ" + }, + "pt154": { + "type": "_sbcs", + "chars": "ҖҒӮғ„…ҶҮҲүҠӢҢҚҺҸҗ‘’“”•–—ҳҷҡӣңқһҹ ЎўЈӨҘҰ§Ё©Ә«¬ӯ®Ҝ°ұІіҙө¶·ё№ә»јҪҫҝАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя" + }, + "viscii": { + "type": "_sbcs", + "chars": "\u0000\u0001Ẳ\u0003\u0004ẴẪ\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013Ỷ\u0015\u0016\u0017\u0018Ỹ\u001a\u001b\u001c\u001dỴ\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ẠẮẰẶẤẦẨẬẼẸẾỀỂỄỆỐỒỔỖỘỢỚỜỞỊỎỌỈỦŨỤỲÕắằặấầẩậẽẹếềểễệốồổỗỠƠộờởịỰỨỪỬơớƯÀÁÂÃẢĂẳẵÈÉÊẺÌÍĨỳĐứÒÓÔạỷừửÙÚỹỵÝỡưàáâãảăữẫèéêẻìíĩỉđựòóôõỏọụùúũủýợỮ" + }, + "iso646cn": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#¥%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "iso646jp": { + "type": "_sbcs", + "chars": "\u0000\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[¥]^_`abcdefghijklmnopqrstuvwxyz{|}‾��������������������������������������������������������������������������������������������������������������������������������" + }, + "hproman8": { + "type": "_sbcs", + "chars": "€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ÀÂÈÊËÎÏ´ˋˆ¨˜ÙÛ₤¯Ýý°ÇçÑñ¡¿¤£¥§ƒ¢âêôûáéóúàèòùäëöüÅîØÆåíøæÄìÖÜÉïßÔÁÃãÐðÍÌÓÒÕõŠšÚŸÿÞþ·µ¶¾—¼½ªº«■»±�" + }, + "macintosh": { + "type": "_sbcs", + "chars": "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄¤‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔ�ÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ" + }, + "ascii": { + "type": "_sbcs", + "chars": "��������������������������������������������������������������������������������������������������������������������������������" + }, + "tis620": { + "type": "_sbcs", + "chars": "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����" + } +} \ No newline at end of file diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data.js new file mode 100644 index 0000000000000000000000000000000000000000..066f904e5f1d3e713e573b1e1cd7dae41f463ed3 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/sbcs-data.js @@ -0,0 +1,179 @@ +"use strict"; + +// Manually added data to be used by sbcs codec in addition to generated one. + +module.exports = { + // Not supported by iconv, not sure why. + "10029": "maccenteuro", + "maccenteuro": { + "type": "_sbcs", + "chars": "ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ" + }, + + "808": "cp808", + "ibm808": "cp808", + "cp808": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмноп░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀рстуфхцчшщъыьэюяЁёЄєЇїЎў°∙·√№€■ " + }, + + "mik": { + "type": "_sbcs", + "chars": "АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюя└┴┬├─┼╣║╚╔╩╦╠═╬┐░▒▓│┤№§╗╝┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ " + }, + + "cp720": { + "type": "_sbcs", + "chars": "\x80\x81éâ\x84à\x86çêëèïî\x8d\x8e\x8f\x90\u0651\u0652ô¤ـûùءآأؤ£إئابةتثجحخدذرزسشص«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀ضطظعغفµقكلمنهوىي≡\u064b\u064c\u064d\u064e\u064f\u0650≈°∙·√ⁿ²■\u00a0" + }, + + // Aliases of generated encodings. + "ascii8bit": "ascii", + "usascii": "ascii", + "ansix34": "ascii", + "ansix341968": "ascii", + "ansix341986": "ascii", + "csascii": "ascii", + "cp367": "ascii", + "ibm367": "ascii", + "isoir6": "ascii", + "iso646us": "ascii", + "iso646irv": "ascii", + "us": "ascii", + + "latin1": "iso88591", + "latin2": "iso88592", + "latin3": "iso88593", + "latin4": "iso88594", + "latin5": "iso88599", + "latin6": "iso885910", + "latin7": "iso885913", + "latin8": "iso885914", + "latin9": "iso885915", + "latin10": "iso885916", + + "csisolatin1": "iso88591", + "csisolatin2": "iso88592", + "csisolatin3": "iso88593", + "csisolatin4": "iso88594", + "csisolatincyrillic": "iso88595", + "csisolatinarabic": "iso88596", + "csisolatingreek" : "iso88597", + "csisolatinhebrew": "iso88598", + "csisolatin5": "iso88599", + "csisolatin6": "iso885910", + + "l1": "iso88591", + "l2": "iso88592", + "l3": "iso88593", + "l4": "iso88594", + "l5": "iso88599", + "l6": "iso885910", + "l7": "iso885913", + "l8": "iso885914", + "l9": "iso885915", + "l10": "iso885916", + + "isoir14": "iso646jp", + "isoir57": "iso646cn", + "isoir100": "iso88591", + "isoir101": "iso88592", + "isoir109": "iso88593", + "isoir110": "iso88594", + "isoir144": "iso88595", + "isoir127": "iso88596", + "isoir126": "iso88597", + "isoir138": "iso88598", + "isoir148": "iso88599", + "isoir157": "iso885910", + "isoir166": "tis620", + "isoir179": "iso885913", + "isoir199": "iso885914", + "isoir203": "iso885915", + "isoir226": "iso885916", + + "cp819": "iso88591", + "ibm819": "iso88591", + + "cyrillic": "iso88595", + + "arabic": "iso88596", + "arabic8": "iso88596", + "ecma114": "iso88596", + "asmo708": "iso88596", + + "greek" : "iso88597", + "greek8" : "iso88597", + "ecma118" : "iso88597", + "elot928" : "iso88597", + + "hebrew": "iso88598", + "hebrew8": "iso88598", + + "turkish": "iso88599", + "turkish8": "iso88599", + + "thai": "iso885911", + "thai8": "iso885911", + + "celtic": "iso885914", + "celtic8": "iso885914", + "isoceltic": "iso885914", + + "tis6200": "tis620", + "tis62025291": "tis620", + "tis62025330": "tis620", + + "10000": "macroman", + "10006": "macgreek", + "10007": "maccyrillic", + "10079": "maciceland", + "10081": "macturkish", + + "cspc8codepage437": "cp437", + "cspc775baltic": "cp775", + "cspc850multilingual": "cp850", + "cspcp852": "cp852", + "cspc862latinhebrew": "cp862", + "cpgr": "cp869", + + "msee": "cp1250", + "mscyrl": "cp1251", + "msansi": "cp1252", + "msgreek": "cp1253", + "msturk": "cp1254", + "mshebr": "cp1255", + "msarab": "cp1256", + "winbaltrim": "cp1257", + + "cp20866": "koi8r", + "20866": "koi8r", + "ibm878": "koi8r", + "cskoi8r": "koi8r", + + "cp21866": "koi8u", + "21866": "koi8u", + "ibm1168": "koi8u", + + "strk10482002": "rk1048", + + "tcvn5712": "tcvn", + "tcvn57121": "tcvn", + + "gb198880": "iso646cn", + "cn": "iso646cn", + + "csiso14jisc6220ro": "iso646jp", + "jisc62201969ro": "iso646jp", + "jp": "iso646jp", + + "cshproman8": "hproman8", + "r8": "hproman8", + "roman8": "hproman8", + "xroman8": "hproman8", + "ibm1051": "hproman8", + + "mac": "macintosh", + "csmacintosh": "macintosh", +}; + diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/big5-added.json b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/big5-added.json new file mode 100644 index 0000000000000000000000000000000000000000..3c3d3c2f7b14c6a570e58184f68ef0894a5f812d --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/big5-added.json @@ -0,0 +1,122 @@ +[ +["8740","䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"], +["8767","綕夝𨮹㷴霴𧯯寛𡵞媤㘥𩺰嫑宷峼杮薓𩥅瑡璝㡵𡵓𣚞𦀡㻬"], +["87a1","𥣞㫵竼龗𤅡𨤍𣇪𠪊𣉞䌊蒄龖鐯䤰蘓墖靊鈘秐稲晠権袝瑌篅枂稬剏遆㓦珄𥶹瓆鿇垳䤯呌䄱𣚎堘穲𧭥讏䚮𦺈䆁𥶙箮𢒼鿈𢓁𢓉𢓌鿉蔄𣖻䂴鿊䓡𪷿拁灮鿋"], +["8840","㇀",4,"𠄌㇅𠃑𠃍㇆㇇𠃋𡿨㇈𠃊㇉㇊㇋㇌𠄎㇍㇎ĀÁǍÀĒÉĚÈŌÓǑÒ࿿Ê̄Ế࿿Ê̌ỀÊāáǎàɑēéěèīíǐìōóǒòūúǔùǖǘǚ"], +["88a1","ǜü࿿ê̄ế࿿ê̌ềêɡ⏚⏛"], +["8940","𪎩𡅅"], +["8943","攊"], +["8946","丽滝鵎釟"], +["894c","𧜵撑会伨侨兖兴农凤务动医华发变团声处备夲头学实実岚庆总斉柾栄桥济炼电纤纬纺织经统缆缷艺苏药视设询车轧轮"], +["89a1","琑糼緍楆竉刧"], +["89ab","醌碸酞肼"], +["89b0","贋胶𠧧"], +["89b5","肟黇䳍鷉鸌䰾𩷶𧀎鸊𪄳㗁"], +["89c1","溚舾甙"], +["89c5","䤑马骏龙禇𨑬𡷊𠗐𢫦两亁亀亇亿仫伷㑌侽㹈倃傈㑽㒓㒥円夅凛凼刅争剹劐匧㗇厩㕑厰㕓参吣㕭㕲㚁咓咣咴咹哐哯唘唣唨㖘唿㖥㖿嗗㗅"], +["8a40","𧶄唥"], +["8a43","𠱂𠴕𥄫喐𢳆㧬𠍁蹆𤶸𩓥䁓𨂾睺𢰸㨴䟕𨅝𦧲𤷪擝𠵼𠾴𠳕𡃴撍蹾𠺖𠰋𠽤𢲩𨉖𤓓"], +["8a64","𠵆𩩍𨃩䟴𤺧𢳂骲㩧𩗴㿭㔆𥋇𩟔𧣈𢵄鵮頕"], +["8a76","䏙𦂥撴哣𢵌𢯊𡁷㧻𡁯"], +["8aa1","𦛚𦜖𧦠擪𥁒𠱃蹨𢆡𨭌𠜱"], +["8aac","䠋𠆩㿺塳𢶍"], +["8ab2","𤗈𠓼𦂗𠽌𠶖啹䂻䎺"], +["8abb","䪴𢩦𡂝膪飵𠶜捹㧾𢝵跀嚡摼㹃"], +["8ac9","𪘁𠸉𢫏𢳉"], +["8ace","𡃈𣧂㦒㨆𨊛㕸𥹉𢃇噒𠼱𢲲𩜠㒼氽𤸻"], +["8adf","𧕴𢺋𢈈𪙛𨳍𠹺𠰴𦠜羓𡃏𢠃𢤹㗻𥇣𠺌𠾍𠺪㾓𠼰𠵇𡅏𠹌"], +["8af6","𠺫𠮩𠵈𡃀𡄽㿹𢚖搲𠾭"], +["8b40","𣏴𧘹𢯎𠵾𠵿𢱑𢱕㨘𠺘𡃇𠼮𪘲𦭐𨳒𨶙𨳊閪哌苄喹"], +["8b55","𩻃鰦骶𧝞𢷮煀腭胬尜𦕲脴㞗卟𨂽醶𠻺𠸏𠹷𠻻㗝𤷫㘉𠳖嚯𢞵𡃉𠸐𠹸𡁸𡅈𨈇𡑕𠹹𤹐𢶤婔𡀝𡀞𡃵𡃶垜𠸑"], +["8ba1","𧚔𨋍𠾵𠹻𥅾㜃𠾶𡆀𥋘𪊽𤧚𡠺𤅷𨉼墙剨㘚𥜽箲孨䠀䬬鼧䧧鰟鮍𥭴𣄽嗻㗲嚉丨夂𡯁屮靑𠂆乛亻㔾尣彑忄㣺扌攵歺氵氺灬爫丬犭𤣩罒礻糹罓𦉪㓁"], +["8bde","𦍋耂肀𦘒𦥑卝衤见𧢲讠贝钅镸长门𨸏韦页风飞饣𩠐鱼鸟黄歯龜丷𠂇阝户钢"], +["8c40","倻淾𩱳龦㷉袏𤅎灷峵䬠𥇍㕙𥴰愢𨨲辧釶熑朙玺𣊁𪄇㲋𡦀䬐磤琂冮𨜏䀉橣𪊺䈣蘏𠩯稪𩥇𨫪靕灍匤𢁾鏴盙𨧣龧矝亣俰傼丯众龨吴綋墒壐𡶶庒庙忂𢜒斋"], +["8ca1","𣏹椙橃𣱣泿"], +["8ca7","爀𤔅玌㻛𤨓嬕璹讃𥲤𥚕窓篬糃繬苸薗龩袐龪躹龫迏蕟駠鈡龬𨶹𡐿䁱䊢娚"], +["8cc9","顨杫䉶圽"], +["8cce","藖𤥻芿𧄍䲁𦵴嵻𦬕𦾾龭龮宖龯曧繛湗秊㶈䓃𣉖𢞖䎚䔶"], +["8ce6","峕𣬚諹屸㴒𣕑嵸龲煗䕘𤃬𡸣䱷㥸㑊𠆤𦱁諌侴𠈹妿腬顖𩣺弻"], +["8d40","𠮟"], +["8d42","𢇁𨥭䄂䚻𩁹㼇龳𪆵䃸㟖䛷𦱆䅼𨚲𧏿䕭㣔𥒚䕡䔛䶉䱻䵶䗪㿈𤬏㙡䓞䒽䇭崾嵈嵖㷼㠏嶤嶹㠠㠸幂庽弥徃㤈㤔㤿㥍惗愽峥㦉憷憹懏㦸戬抐拥挘㧸嚱"], +["8da1","㨃揢揻搇摚㩋擀崕嘡龟㪗斆㪽旿晓㫲暒㬢朖㭂枤栀㭘桊梄㭲㭱㭻椉楃牜楤榟榅㮼槖㯝橥橴橱檂㯬檙㯲檫檵櫔櫶殁毁毪汵沪㳋洂洆洦涁㳯涤涱渕渘温溆𨧀溻滢滚齿滨滩漤漴㵆𣽁澁澾㵪㵵熷岙㶊瀬㶑灐灔灯灿炉𠌥䏁㗱𠻘"], +["8e40","𣻗垾𦻓焾𥟠㙎榢𨯩孴穉𥣡𩓙穥穽𥦬窻窰竂竃燑𦒍䇊竚竝竪䇯咲𥰁笋筕笩𥌎𥳾箢筯莜𥮴𦱿篐萡箒箸𥴠㶭𥱥蒒篺簆簵𥳁籄粃𤢂粦晽𤕸糉糇糦籴糳糵糎"], +["8ea1","繧䔝𦹄絝𦻖璍綉綫焵綳緒𤁗𦀩緤㴓緵𡟹緥𨍭縝𦄡𦅚繮纒䌫鑬縧罀罁罇礶𦋐駡羗𦍑羣𡙡𠁨䕜𣝦䔃𨌺翺𦒉者耈耝耨耯𪂇𦳃耻耼聡𢜔䦉𦘦𣷣𦛨朥肧𨩈脇脚墰𢛶汿𦒘𤾸擧𡒊舘𡡞橓𤩥𤪕䑺舩𠬍𦩒𣵾俹𡓽蓢荢𦬊𤦧𣔰𡝳𣷸芪椛芳䇛"], +["8f40","蕋苐茚𠸖𡞴㛁𣅽𣕚艻苢茘𣺋𦶣𦬅𦮗𣗎㶿茝嗬莅䔋𦶥莬菁菓㑾𦻔橗蕚㒖𦹂𢻯葘𥯤葱㷓䓤檧葊𣲵祘蒨𦮖𦹷𦹃蓞萏莑䒠蒓蓤𥲑䉀𥳀䕃蔴嫲𦺙䔧蕳䔖枿蘖"], +["8fa1","𨘥𨘻藁𧂈蘂𡖂𧃍䕫䕪蘨㙈𡢢号𧎚虾蝱𪃸蟮𢰧螱蟚蠏噡虬桖䘏衅衆𧗠𣶹𧗤衞袜䙛袴袵揁装睷𧜏覇覊覦覩覧覼𨨥觧𧤤𧪽誜瞓釾誐𧩙竩𧬺𣾏䜓𧬸煼謌謟𥐰𥕥謿譌譍誩𤩺讐讛誯𡛟䘕衏貛𧵔𧶏貫㜥𧵓賖𧶘𧶽贒贃𡤐賛灜贑𤳉㻐起"], +["9040","趩𨀂𡀔𤦊㭼𨆼𧄌竧躭躶軃鋔輙輭𨍥𨐒辥錃𪊟𠩐辳䤪𨧞𨔽𣶻廸𣉢迹𪀔𨚼𨔁𢌥㦀𦻗逷𨔼𧪾遡𨕬𨘋邨𨜓郄𨛦邮都酧㫰醩釄粬𨤳𡺉鈎沟鉁鉢𥖹銹𨫆𣲛𨬌𥗛"], +["90a1","𠴱錬鍫𨫡𨯫炏嫃𨫢𨫥䥥鉄𨯬𨰹𨯿鍳鑛躼閅閦鐦閠濶䊹𢙺𨛘𡉼𣸮䧟氜陻隖䅬隣𦻕懚隶磵𨫠隽双䦡𦲸𠉴𦐐𩂯𩃥𤫑𡤕𣌊霱虂霶䨏䔽䖅𤫩灵孁霛靜𩇕靗孊𩇫靟鐥僐𣂷𣂼鞉鞟鞱鞾韀韒韠𥑬韮琜𩐳響韵𩐝𧥺䫑頴頳顋顦㬎𧅵㵑𠘰𤅜"], +["9140","𥜆飊颷飈飇䫿𦴧𡛓喰飡飦飬鍸餹𤨩䭲𩡗𩤅駵騌騻騐驘𥜥㛄𩂱𩯕髠髢𩬅髴䰎鬔鬭𨘀倴鬴𦦨㣃𣁽魐魀𩴾婅𡡣鮎𤉋鰂鯿鰌𩹨鷔𩾷𪆒𪆫𪃡𪄣𪇟鵾鶃𪄴鸎梈"], +["91a1","鷄𢅛𪆓𪈠𡤻𪈳鴹𪂹𪊴麐麕麞麢䴴麪麯𤍤黁㭠㧥㴝伲㞾𨰫鼂鼈䮖鐤𦶢鼗鼖鼹嚟嚊齅馸𩂋韲葿齢齩竜龎爖䮾𤥵𤦻煷𤧸𤍈𤩑玞𨯚𡣺禟𨥾𨸶鍩鏳𨩄鋬鎁鏋𨥬𤒹爗㻫睲穃烐𤑳𤏸煾𡟯炣𡢾𣖙㻇𡢅𥐯𡟸㜢𡛻𡠹㛡𡝴𡣑𥽋㜣𡛀坛𤨥𡏾𡊨"], +["9240","𡏆𡒶蔃𣚦蔃葕𤦔𧅥𣸱𥕜𣻻𧁒䓴𣛮𩦝𦼦柹㜳㰕㷧塬𡤢栐䁗𣜿𤃡𤂋𤄏𦰡哋嚞𦚱嚒𠿟𠮨𠸍鏆𨬓鎜仸儫㠙𤐶亼𠑥𠍿佋侊𥙑婨𠆫𠏋㦙𠌊𠐔㐵伩𠋀𨺳𠉵諚𠈌亘"], +["92a1","働儍侢伃𤨎𣺊佂倮偬傁俌俥偘僼兙兛兝兞湶𣖕𣸹𣺿浲𡢄𣺉冨凃𠗠䓝𠒣𠒒𠒑赺𨪜𠜎剙劤𠡳勡鍮䙺熌𤎌𠰠𤦬𡃤槑𠸝瑹㻞璙琔瑖玘䮎𤪼𤂍叐㖄爏𤃉喴𠍅响𠯆圝鉝雴鍦埝垍坿㘾壋媙𨩆𡛺𡝯𡜐娬妸銏婾嫏娒𥥆𡧳𡡡𤊕㛵洅瑃娡𥺃"], +["9340","媁𨯗𠐓鏠璌𡌃焅䥲鐈𨧻鎽㞠尞岞幞幈𡦖𡥼𣫮廍孏𡤃𡤄㜁𡢠㛝𡛾㛓脪𨩇𡶺𣑲𨦨弌弎𡤧𡞫婫𡜻孄蘔𧗽衠恾𢡠𢘫忛㺸𢖯𢖾𩂈𦽳懀𠀾𠁆𢘛憙憘恵𢲛𢴇𤛔𩅍"], +["93a1","摱𤙥𢭪㨩𢬢𣑐𩣪𢹸挷𪑛撶挱揑𤧣𢵧护𢲡搻敫楲㯴𣂎𣊭𤦉𣊫唍𣋠𡣙𩐿曎𣊉𣆳㫠䆐𥖄𨬢𥖏𡛼𥕛𥐥磮𣄃𡠪𣈴㑤𣈏𣆂𤋉暎𦴤晫䮓昰𧡰𡷫晣𣋒𣋡昞𥡲㣑𣠺𣞼㮙𣞢𣏾瓐㮖枏𤘪梶栞㯄檾㡣𣟕𤒇樳橒櫉欅𡤒攑梘橌㯗橺歗𣿀𣲚鎠鋲𨯪𨫋"], +["9440","銉𨀞𨧜鑧涥漋𤧬浧𣽿㶏渄𤀼娽渊塇洤硂焻𤌚𤉶烱牐犇犔𤞏𤜥兹𤪤𠗫瑺𣻸𣙟𤩊𤤗𥿡㼆㺱𤫟𨰣𣼵悧㻳瓌琼鎇琷䒟𦷪䕑疃㽣𤳙𤴆㽘畕癳𪗆㬙瑨𨫌𤦫𤦎㫻"], +["94a1","㷍𤩎㻿𤧅𤣳釺圲鍂𨫣𡡤僟𥈡𥇧睸𣈲眎眏睻𤚗𣞁㩞𤣰琸璛㺿𤪺𤫇䃈𤪖𦆮錇𥖁砞碍碈磒珐祙𧝁𥛣䄎禛蒖禥樭𣻺稺秴䅮𡛦䄲鈵秱𠵌𤦌𠊙𣶺𡝮㖗啫㕰㚪𠇔𠰍竢婙𢛵𥪯𥪜娍𠉛磰娪𥯆竾䇹籝籭䈑𥮳𥺼𥺦糍𤧹𡞰粎籼粮檲緜縇緓罎𦉡"], +["9540","𦅜𧭈綗𥺂䉪𦭵𠤖柖𠁎𣗏埄𦐒𦏸𤥢翝笧𠠬𥫩𥵃笌𥸎駦虅驣樜𣐿㧢𤧷𦖭騟𦖠蒀𧄧𦳑䓪脷䐂胆脉腂𦞴飃𦩂艢艥𦩑葓𦶧蘐𧈛媆䅿𡡀嬫𡢡嫤𡣘蚠蜨𣶏蠭𧐢娂"], +["95a1","衮佅袇袿裦襥襍𥚃襔𧞅𧞄𨯵𨯙𨮜𨧹㺭蒣䛵䛏㟲訽訜𩑈彍鈫𤊄旔焩烄𡡅鵭貟賩𧷜妚矃姰䍮㛔踪躧𤰉輰轊䋴汘澻𢌡䢛潹溋𡟚鯩㚵𤤯邻邗啱䤆醻鐄𨩋䁢𨫼鐧𨰝𨰻蓥訫閙閧閗閖𨴴瑅㻂𤣿𤩂𤏪㻧𣈥随𨻧𨹦𨹥㻌𤧭𤩸𣿮琒瑫㻼靁𩂰"], +["9640","桇䨝𩂓𥟟靝鍨𨦉𨰦𨬯𦎾銺嬑譩䤼珹𤈛鞛靱餸𠼦巁𨯅𤪲頟𩓚鋶𩗗釥䓀𨭐𤩧𨭤飜𨩅㼀鈪䤥萔餻饍𧬆㷽馛䭯馪驜𨭥𥣈檏騡嫾騯𩣱䮐𩥈馼䮽䮗鍽塲𡌂堢𤦸"], +["96a1","𡓨硄𢜟𣶸棅㵽鑘㤧慐𢞁𢥫愇鱏鱓鱻鰵鰐魿鯏𩸭鮟𪇵𪃾鴡䲮𤄄鸘䲰鴌𪆴𪃭𪃳𩤯鶥蒽𦸒𦿟𦮂藼䔳𦶤𦺄𦷰萠藮𦸀𣟗𦁤秢𣖜𣙀䤭𤧞㵢鏛銾鍈𠊿碹鉷鑍俤㑀遤𥕝砽硔碶硋𡝗𣇉𤥁㚚佲濚濙瀞瀞吔𤆵垻壳垊鴖埗焴㒯𤆬燫𦱀𤾗嬨𡞵𨩉"], +["9740","愌嫎娋䊼𤒈㜬䭻𨧼鎻鎸𡣖𠼝葲𦳀𡐓𤋺𢰦𤏁妔𣶷𦝁綨𦅛𦂤𤦹𤦋𨧺鋥珢㻩璴𨭣𡢟㻡𤪳櫘珳珻㻖𤨾𤪔𡟙𤩦𠎧𡐤𤧥瑈𤤖炥𤥶銄珦鍟𠓾錱𨫎𨨖鎆𨯧𥗕䤵𨪂煫"], +["97a1","𤥃𠳿嚤𠘚𠯫𠲸唂秄𡟺緾𡛂𤩐𡡒䔮鐁㜊𨫀𤦭妰𡢿𡢃𧒄媡㛢𣵛㚰鉟婹𨪁𡡢鍴㳍𠪴䪖㦊僴㵩㵌𡎜煵䋻𨈘渏𩃤䓫浗𧹏灧沯㳖𣿭𣸭渂漌㵯𠏵畑㚼㓈䚀㻚䡱姄鉮䤾轁𨰜𦯀堒埈㛖𡑒烾𤍢𤩱𢿣𡊰𢎽梹楧𡎘𣓥𧯴𣛟𨪃𣟖𣏺𤲟樚𣚭𦲷萾䓟䓎"], +["9840","𦴦𦵑𦲂𦿞漗𧄉茽𡜺菭𦲀𧁓𡟛妉媂𡞳婡婱𡤅𤇼㜭姯𡜼㛇熎鎐暚𤊥婮娫𤊓樫𣻹𧜶𤑛𤋊焝𤉙𨧡侰𦴨峂𤓎𧹍𤎽樌𤉖𡌄炦焳𤏩㶥泟勇𤩏繥姫崯㷳彜𤩝𡟟綤萦"], +["98a1","咅𣫺𣌀𠈔坾𠣕𠘙㿥𡾞𪊶瀃𩅛嵰玏糓𨩙𩐠俈翧狍猐𧫴猸猹𥛶獁獈㺩𧬘遬燵𤣲珡臶㻊県㻑沢国琙琞琟㻢㻰㻴㻺瓓㼎㽓畂畭畲疍㽼痈痜㿀癍㿗癴㿜発𤽜熈嘣覀塩䀝睃䀹条䁅㗛瞘䁪䁯属瞾矋売砘点砜䂨砹硇硑硦葈𥔵礳栃礲䄃"], +["9940","䄉禑禙辻稆込䅧窑䆲窼艹䇄竏竛䇏両筢筬筻簒簛䉠䉺类粜䊌粸䊔糭输烀𠳏総緔緐緽羮羴犟䎗耠耥笹耮耱联㷌垴炠肷胩䏭脌猪脎脒畠脔䐁㬹腖腙腚"], +["99a1","䐓堺腼膄䐥膓䐭膥埯臁臤艔䒏芦艶苊苘苿䒰荗险榊萅烵葤惣蒈䔄蒾蓡蓸蔐蔸蕒䔻蕯蕰藠䕷虲蚒蚲蛯际螋䘆䘗袮裿褤襇覑𧥧訩訸誔誴豑賔賲贜䞘塟跃䟭仮踺嗘坔蹱嗵躰䠷軎転軤軭軲辷迁迊迌逳駄䢭飠鈓䤞鈨鉘鉫銱銮銿"], +["9a40","鋣鋫鋳鋴鋽鍃鎄鎭䥅䥑麿鐗匁鐝鐭鐾䥪鑔鑹锭関䦧间阳䧥枠䨤靀䨵鞲韂噔䫤惨颹䬙飱塄餎餙冴餜餷饂饝饢䭰駅䮝騼鬏窃魩鮁鯝鯱鯴䱭鰠㝯𡯂鵉鰺"], +["9aa1","黾噐鶓鶽鷀鷼银辶鹻麬麱麽黆铜黢黱黸竈齄𠂔𠊷𠎠椚铃妬𠓗塀铁㞹𠗕𠘕𠙶𡚺块煳𠫂𠫍𠮿呪吆𠯋咞𠯻𠰻𠱓𠱥𠱼惧𠲍噺𠲵𠳝𠳭𠵯𠶲𠷈楕鰯螥𠸄𠸎𠻗𠾐𠼭𠹳尠𠾼帋𡁜𡁏𡁶朞𡁻𡂈𡂖㙇𡂿𡃓𡄯𡄻卤蒭𡋣𡍵𡌶讁𡕷𡘙𡟃𡟇乸炻𡠭𡥪"], +["9b40","𡨭𡩅𡰪𡱰𡲬𡻈拃𡻕𡼕熘桕𢁅槩㛈𢉼𢏗𢏺𢜪𢡱𢥏苽𢥧𢦓𢫕覥𢫨辠𢬎鞸𢬿顇骽𢱌"], +["9b62","𢲈𢲷𥯨𢴈𢴒𢶷𢶕𢹂𢽴𢿌𣀳𣁦𣌟𣏞徱晈暿𧩹𣕧𣗳爁𤦺矗𣘚𣜖纇𠍆墵朎"], +["9ba1","椘𣪧𧙗𥿢𣸑𣺹𧗾𢂚䣐䪸𤄙𨪚𤋮𤌍𤀻𤌴𤎖𤩅𠗊凒𠘑妟𡺨㮾𣳿𤐄𤓖垈𤙴㦛𤜯𨗨𩧉㝢𢇃譞𨭎駖𤠒𤣻𤨕爉𤫀𠱸奥𤺥𤾆𠝹軚𥀬劏圿煱𥊙𥐙𣽊𤪧喼𥑆𥑮𦭒釔㑳𥔿𧘲𥕞䜘𥕢𥕦𥟇𤤿𥡝偦㓻𣏌惞𥤃䝼𨥈𥪮𥮉𥰆𡶐垡煑澶𦄂𧰒遖𦆲𤾚譢𦐂𦑊"], +["9c40","嵛𦯷輶𦒄𡤜諪𤧶𦒈𣿯𦔒䯀𦖿𦚵𢜛鑥𥟡憕娧晉侻嚹𤔡𦛼乪𤤴陖涏𦲽㘘襷𦞙𦡮𦐑𦡞營𦣇筂𩃀𠨑𦤦鄄𦤹穅鷰𦧺騦𦨭㙟𦑩𠀡禃𦨴𦭛崬𣔙菏𦮝䛐𦲤画补𦶮墶"], +["9ca1","㜜𢖍𧁋𧇍㱔𧊀𧊅銁𢅺𧊋錰𧋦𤧐氹钟𧑐𠻸蠧裵𢤦𨑳𡞱溸𤨪𡠠㦤㚹尐秣䔿暶𩲭𩢤襃𧟌𧡘囖䃟𡘊㦡𣜯𨃨𡏅熭荦𧧝𩆨婧䲷𧂯𨦫𧧽𧨊𧬋𧵦𤅺筃祾𨀉澵𪋟樃𨌘厢𦸇鎿栶靝𨅯𨀣𦦵𡏭𣈯𨁈嶅𨰰𨂃圕頣𨥉嶫𤦈斾槕叒𤪥𣾁㰑朶𨂐𨃴𨄮𡾡𨅏"], +["9d40","𨆉𨆯𨈚𨌆𨌯𨎊㗊𨑨𨚪䣺揦𨥖砈鉕𨦸䏲𨧧䏟𨧨𨭆𨯔姸𨰉輋𨿅𩃬筑𩄐𩄼㷷𩅞𤫊运犏嚋𩓧𩗩𩖰𩖸𩜲𩣑𩥉𩥪𩧃𩨨𩬎𩵚𩶛纟𩻸𩼣䲤镇𪊓熢𪋿䶑递𪗋䶜𠲜达嗁"], +["9da1","辺𢒰边𤪓䔉繿潖檱仪㓤𨬬𧢝㜺躀𡟵𨀤𨭬𨮙𧨾𦚯㷫𧙕𣲷𥘵𥥖亚𥺁𦉘嚿𠹭踎孭𣺈𤲞揞拐𡟶𡡻攰嘭𥱊吚𥌑㷆𩶘䱽嘢嘞罉𥻘奵𣵀蝰东𠿪𠵉𣚺脗鵞贘瘻鱅癎瞹鍅吲腈苷嘥脲萘肽嗪祢噃吖𠺝㗎嘅嗱曱𨋢㘭甴嗰喺咗啲𠱁𠲖廐𥅈𠹶𢱢"], +["9e40","𠺢麫絚嗞𡁵抝靭咔賍燶酶揼掹揾啩𢭃鱲𢺳冚㓟𠶧冧呍唞唓癦踭𦢊疱肶蠄螆裇膶萜𡃁䓬猄𤜆宐茋𦢓噻𢛴𧴯𤆣𧵳𦻐𧊶酰𡇙鈈𣳼𪚩𠺬𠻹牦𡲢䝎𤿂𧿹𠿫䃺"], +["9ea1","鱝攟𢶠䣳𤟠𩵼𠿬𠸊恢𧖣𠿭"], +["9ead","𦁈𡆇熣纎鵐业丄㕷嬍沲卧㚬㧜卽㚥𤘘墚𤭮舭呋垪𥪕𠥹"], +["9ec5","㩒𢑥獴𩺬䴉鯭𣳾𩼰䱛𤾩𩖞𩿞葜𣶶𧊲𦞳𣜠挮紥𣻷𣸬㨪逈勌㹴㙺䗩𠒎癀嫰𠺶硺𧼮墧䂿噼鮋嵴癔𪐴麅䳡痹㟻愙𣃚𤏲"], +["9ef5","噝𡊩垧𤥣𩸆刴𧂮㖭汊鵼"], +["9f40","籖鬹埞𡝬屓擓𩓐𦌵𧅤蚭𠴨𦴢𤫢𠵱"], +["9f4f","凾𡼏嶎霃𡷑麁遌笟鬂峑箣扨挵髿篏鬪籾鬮籂粆鰕篼鬉鼗鰛𤤾齚啳寃俽麘俲剠㸆勑坧偖妷帒韈鶫轜呩鞴饀鞺匬愰"], +["9fa1","椬叚鰊鴂䰻陁榀傦畆𡝭駚剳"], +["9fae","酙隁酜"], +["9fb2","酑𨺗捿𦴣櫊嘑醎畺抅𠏼獏籰𥰡𣳽"], +["9fc1","𤤙盖鮝个𠳔莾衂"], +["9fc9","届槀僭坺刟巵从氱𠇲伹咜哚劚趂㗾弌㗳"], +["9fdb","歒酼龥鮗頮颴骺麨麄煺笔"], +["9fe7","毺蠘罸"], +["9feb","嘠𪙊蹷齓"], +["9ff0","跔蹏鸜踁抂𨍽踨蹵竓𤩷稾磘泪詧瘇"], +["a040","𨩚鼦泎蟖痃𪊲硓咢贌狢獱謭猂瓱賫𤪻蘯徺袠䒷"], +["a055","𡠻𦸅"], +["a058","詾𢔛"], +["a05b","惽癧髗鵄鍮鮏蟵"], +["a063","蠏賷猬霡鮰㗖犲䰇籑饊𦅙慙䰄麖慽"], +["a073","坟慯抦戹拎㩜懢厪𣏵捤栂㗒"], +["a0a1","嵗𨯂迚𨸹"], +["a0a6","僙𡵆礆匲阸𠼻䁥"], +["a0ae","矾"], +["a0b0","糂𥼚糚稭聦聣絍甅瓲覔舚朌聢𧒆聛瓰脃眤覉𦟌畓𦻑螩蟎臈螌詉貭譃眫瓸蓚㘵榲趦"], +["a0d4","覩瑨涹蟁𤀑瓧㷛煶悤憜㳑煢恷"], +["a0e2","罱𨬭牐惩䭾删㰘𣳇𥻗𧙖𥔱𡥄𡋾𩤃𦷜𧂭峁𦆭𨨏𣙷𠃮𦡆𤼎䕢嬟𦍌齐麦𦉫"], +["a3c0","␀",31,"␡"], +["c6a1","①",9,"⑴",9,"ⅰ",9,"丶丿亅亠冂冖冫勹匸卩厶夊宀巛⼳广廴彐彡攴无疒癶辵隶¨ˆヽヾゝゞ〃仝々〆〇ー[]✽ぁ",23], +["c740","す",58,"ァアィイ"], +["c7a1","ゥ",81,"А",5,"ЁЖ",4], +["c840","Л",26,"ёж",25,"⇧↸↹㇏𠃌乚𠂊刂䒑"], +["c8a1","龰冈龱𧘇"], +["c8cd","¬¦'"㈱№℡゛゜⺀⺄⺆⺇⺈⺊⺌⺍⺕⺜⺝⺥⺧⺪⺬⺮⺶⺼⺾⻆⻊⻌⻍⻏⻖⻗⻞⻣"], +["c8f5","ʃɐɛɔɵœøŋʊɪ"], +["f9fe","■"], +["fa40","𠕇鋛𠗟𣿅蕌䊵珯况㙉𤥂𨧤鍄𡧛苮𣳈砼杄拟𤤳𨦪𠊠𦮳𡌅侫𢓭倈𦴩𧪄𣘀𤪱𢔓倩𠍾徤𠎀𠍇滛𠐟偽儁㑺儎顬㝃萖𤦤𠒇兠𣎴兪𠯿𢃼𠋥𢔰𠖎𣈳𡦃宂蝽𠖳𣲙冲冸"], +["faa1","鴴凉减凑㳜凓𤪦决凢卂凭菍椾𣜭彻刋刦刼劵剗劔効勅簕蕂勠蘍𦬓包𨫞啉滙𣾀𠥔𣿬匳卄𠯢泋𡜦栛珕恊㺪㣌𡛨燝䒢卭却𨚫卾卿𡖖𡘓矦厓𨪛厠厫厮玧𥝲㽙玜叁叅汉义埾叙㪫𠮏叠𣿫𢶣叶𠱷吓灹唫晗浛呭𦭓𠵴啝咏咤䞦𡜍𠻝㶴𠵍"], +["fb40","𨦼𢚘啇䳭启琗喆喩嘅𡣗𤀺䕒𤐵暳𡂴嘷曍𣊊暤暭噍噏磱囱鞇叾圀囯园𨭦㘣𡉏坆𤆥汮炋坂㚱𦱾埦𡐖堃𡑔𤍣堦𤯵塜墪㕡壠壜𡈼壻寿坃𪅐𤉸鏓㖡够梦㛃湙"], +["fba1","𡘾娤啓𡚒蔅姉𠵎𦲁𦴪𡟜姙𡟻𡞲𦶦浱𡠨𡛕姹𦹅媫婣㛦𤦩婷㜈媖瑥嫓𦾡𢕔㶅𡤑㜲𡚸広勐孶斈孼𧨎䀄䡝𠈄寕慠𡨴𥧌𠖥寳宝䴐尅𡭄尓珎尔𡲥𦬨屉䣝岅峩峯嶋𡷹𡸷崐崘嵆𡺤岺巗苼㠭𤤁𢁉𢅳芇㠶㯂帮檊幵幺𤒼𠳓厦亷廐厨𡝱帉廴𨒂"], +["fc40","廹廻㢠廼栾鐛弍𠇁弢㫞䢮𡌺强𦢈𢏐彘𢑱彣鞽𦹮彲鍀𨨶徧嶶㵟𥉐𡽪𧃸𢙨釖𠊞𨨩怱暅𡡷㥣㷇㘹垐𢞴祱㹀悞悤悳𤦂𤦏𧩓璤僡媠慤萤慂慈𦻒憁凴𠙖憇宪𣾷"], +["fca1","𢡟懓𨮝𩥝懐㤲𢦀𢣁怣慜攞掋𠄘担𡝰拕𢸍捬𤧟㨗搸揸𡎎𡟼撐澊𢸶頔𤂌𥜝擡擥鑻㩦携㩗敍漖𤨨𤨣斅敭敟𣁾斵𤥀䬷旑䃘𡠩无旣忟𣐀昘𣇷𣇸晄𣆤𣆥晋𠹵晧𥇦晳晴𡸽𣈱𨗴𣇈𥌓矅𢣷馤朂𤎜𤨡㬫槺𣟂杞杧杢𤇍𩃭柗䓩栢湐鈼栁𣏦𦶠桝"], +["fd40","𣑯槡樋𨫟楳棃𣗍椁椀㴲㨁𣘼㮀枬楡𨩊䋼椶榘㮡𠏉荣傐槹𣙙𢄪橅𣜃檝㯳枱櫈𩆜㰍欝𠤣惞欵歴𢟍溵𣫛𠎵𡥘㝀吡𣭚毡𣻼毜氷𢒋𤣱𦭑汚舦汹𣶼䓅𣶽𤆤𤤌𤤀"], +["fda1","𣳉㛥㳫𠴲鮃𣇹𢒑羏样𦴥𦶡𦷫涖浜湼漄𤥿𤂅𦹲蔳𦽴凇沜渝萮𨬡港𣸯瑓𣾂秌湏媑𣁋濸㜍澝𣸰滺𡒗𤀽䕕鏰潄潜㵎潴𩅰㴻澟𤅄濓𤂑𤅕𤀹𣿰𣾴𤄿凟𤅖𤅗𤅀𦇝灋灾炧炁烌烕烖烟䄄㷨熴熖𤉷焫煅媈煊煮岜𤍥煏鍢𤋁焬𤑚𤨧𤨢熺𨯨炽爎"], +["fe40","鑂爕夑鑃爤鍁𥘅爮牀𤥴梽牕牗㹕𣁄栍漽犂猪猫𤠣𨠫䣭𨠄猨献珏玪𠰺𦨮珉瑉𤇢𡛧𤨤昣㛅𤦷𤦍𤧻珷琕椃𤨦琹𠗃㻗瑜𢢭瑠𨺲瑇珤瑶莹瑬㜰瑴鏱樬璂䥓𤪌"], +["fea1","𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"] +] diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp936.json b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp936.json new file mode 100644 index 0000000000000000000000000000000000000000..49ddb9a1d68fd76a82904ef694de6b2770c04575 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp936.json @@ -0,0 +1,264 @@ +[ +["0","\u0000",127,"€"], +["8140","丂丄丅丆丏丒丗丟丠両丣並丩丮丯丱丳丵丷丼乀乁乂乄乆乊乑乕乗乚乛乢乣乤乥乧乨乪",5,"乲乴",9,"乿",6,"亇亊"], +["8180","亐亖亗亙亜亝亞亣亪亯亰亱亴亶亷亸亹亼亽亾仈仌仏仐仒仚仛仜仠仢仦仧仩仭仮仯仱仴仸仹仺仼仾伀伂",6,"伋伌伒",4,"伜伝伡伣伨伩伬伭伮伱伳伵伷伹伻伾",4,"佄佅佇",5,"佒佔佖佡佢佦佨佪佫佭佮佱佲併佷佸佹佺佽侀侁侂侅來侇侊侌侎侐侒侓侕侖侘侙侚侜侞侟価侢"], +["8240","侤侫侭侰",4,"侶",8,"俀俁係俆俇俈俉俋俌俍俒",4,"俙俛俠俢俤俥俧俫俬俰俲俴俵俶俷俹俻俼俽俿",11], +["8280","個倎倐們倓倕倖倗倛倝倞倠倢倣値倧倫倯",10,"倻倽倿偀偁偂偄偅偆偉偊偋偍偐",4,"偖偗偘偙偛偝",7,"偦",5,"偭",8,"偸偹偺偼偽傁傂傃傄傆傇傉傊傋傌傎",20,"傤傦傪傫傭",4,"傳",6,"傼"], +["8340","傽",17,"僐",5,"僗僘僙僛",10,"僨僩僪僫僯僰僱僲僴僶",4,"僼",9,"儈"], +["8380","儉儊儌",5,"儓",13,"儢",28,"兂兇兊兌兎兏児兒兓兗兘兙兛兝",4,"兣兤兦內兩兪兯兲兺兾兿冃冄円冇冊冋冎冏冐冑冓冔冘冚冝冞冟冡冣冦",4,"冭冮冴冸冹冺冾冿凁凂凃凅凈凊凍凎凐凒",5], +["8440","凘凙凚凜凞凟凢凣凥",5,"凬凮凱凲凴凷凾刄刅刉刋刌刏刐刓刔刕刜刞刟刡刢刣別刦刧刪刬刯刱刲刴刵刼刾剄",5,"剋剎剏剒剓剕剗剘"], +["8480","剙剚剛剝剟剠剢剣剤剦剨剫剬剭剮剰剱剳",9,"剾劀劃",4,"劉",6,"劑劒劔",6,"劜劤劥劦劧劮劯劰労",9,"勀勁勂勄勅勆勈勊勌勍勎勏勑勓勔動勗務",5,"勠勡勢勣勥",10,"勱",7,"勻勼勽匁匂匃匄匇匉匊匋匌匎"], +["8540","匑匒匓匔匘匛匜匞匟匢匤匥匧匨匩匫匬匭匯",9,"匼匽區卂卄卆卋卌卍卐協単卙卛卝卥卨卪卬卭卲卶卹卻卼卽卾厀厁厃厇厈厊厎厏"], +["8580","厐",4,"厖厗厙厛厜厞厠厡厤厧厪厫厬厭厯",6,"厷厸厹厺厼厽厾叀參",4,"収叏叐叒叓叕叚叜叝叞叡叢叧叴叺叾叿吀吂吅吇吋吔吘吙吚吜吢吤吥吪吰吳吶吷吺吽吿呁呂呄呅呇呉呌呍呎呏呑呚呝",4,"呣呥呧呩",7,"呴呹呺呾呿咁咃咅咇咈咉咊咍咑咓咗咘咜咞咟咠咡"], +["8640","咢咥咮咰咲咵咶咷咹咺咼咾哃哅哊哋哖哘哛哠",4,"哫哬哯哰哱哴",5,"哻哾唀唂唃唄唅唈唊",4,"唒唓唕",5,"唜唝唞唟唡唥唦"], +["8680","唨唩唫唭唲唴唵唶唸唹唺唻唽啀啂啅啇啈啋",4,"啑啒啓啔啗",4,"啝啞啟啠啢啣啨啩啫啯",5,"啹啺啽啿喅喆喌喍喎喐喒喓喕喖喗喚喛喞喠",6,"喨",8,"喲喴営喸喺喼喿",4,"嗆嗇嗈嗊嗋嗎嗏嗐嗕嗗",4,"嗞嗠嗢嗧嗩嗭嗮嗰嗱嗴嗶嗸",4,"嗿嘂嘃嘄嘅"], +["8740","嘆嘇嘊嘋嘍嘐",7,"嘙嘚嘜嘝嘠嘡嘢嘥嘦嘨嘩嘪嘫嘮嘯嘰嘳嘵嘷嘸嘺嘼嘽嘾噀",11,"噏",4,"噕噖噚噛噝",4], +["8780","噣噥噦噧噭噮噯噰噲噳噴噵噷噸噹噺噽",7,"嚇",6,"嚐嚑嚒嚔",14,"嚤",10,"嚰",6,"嚸嚹嚺嚻嚽",12,"囋",8,"囕囖囘囙囜団囥",5,"囬囮囯囲図囶囷囸囻囼圀圁圂圅圇國",6], +["8840","園",9,"圝圞圠圡圢圤圥圦圧圫圱圲圴",4,"圼圽圿坁坃坄坅坆坈坉坋坒",4,"坘坙坢坣坥坧坬坮坰坱坲坴坵坸坹坺坽坾坿垀"], +["8880","垁垇垈垉垊垍",4,"垔",6,"垜垝垞垟垥垨垪垬垯垰垱垳垵垶垷垹",8,"埄",6,"埌埍埐埑埓埖埗埛埜埞埡埢埣埥",7,"埮埰埱埲埳埵埶執埻埼埾埿堁堃堄堅堈堉堊堌堎堏堐堒堓堔堖堗堘堚堛堜堝堟堢堣堥",4,"堫",4,"報堲堳場堶",7], +["8940","堾",5,"塅",6,"塎塏塐塒塓塕塖塗塙",4,"塟",5,"塦",4,"塭",16,"塿墂墄墆墇墈墊墋墌"], +["8980","墍",4,"墔",4,"墛墜墝墠",7,"墪",17,"墽墾墿壀壂壃壄壆",10,"壒壓壔壖",13,"壥",5,"壭壯壱売壴壵壷壸壺",7,"夃夅夆夈",4,"夎夐夑夒夓夗夘夛夝夞夠夡夢夣夦夨夬夰夲夳夵夶夻"], +["8a40","夽夾夿奀奃奅奆奊奌奍奐奒奓奙奛",4,"奡奣奤奦",12,"奵奷奺奻奼奾奿妀妅妉妋妌妎妏妐妑妔妕妘妚妛妜妝妟妠妡妢妦"], +["8a80","妧妬妭妰妱妳",5,"妺妼妽妿",6,"姇姈姉姌姍姎姏姕姖姙姛姞",4,"姤姦姧姩姪姫姭",11,"姺姼姽姾娀娂娊娋娍娎娏娐娒娔娕娖娗娙娚娛娝娞娡娢娤娦娧娨娪",6,"娳娵娷",4,"娽娾娿婁",4,"婇婈婋",9,"婖婗婘婙婛",5], +["8b40","婡婣婤婥婦婨婩婫",8,"婸婹婻婼婽婾媀",17,"媓",6,"媜",13,"媫媬"], +["8b80","媭",4,"媴媶媷媹",4,"媿嫀嫃",5,"嫊嫋嫍",4,"嫓嫕嫗嫙嫚嫛嫝嫞嫟嫢嫤嫥嫧嫨嫪嫬",4,"嫲",22,"嬊",11,"嬘",25,"嬳嬵嬶嬸",7,"孁",6], +["8c40","孈",7,"孒孖孞孠孡孧孨孫孭孮孯孲孴孶孷學孹孻孼孾孿宂宆宊宍宎宐宑宒宔宖実宧宨宩宬宭宮宯宱宲宷宺宻宼寀寁寃寈寉寊寋寍寎寏"], +["8c80","寑寔",8,"寠寢寣實寧審",4,"寯寱",6,"寽対尀専尃尅將專尋尌對導尐尒尓尗尙尛尞尟尠尡尣尦尨尩尪尫尭尮尯尰尲尳尵尶尷屃屄屆屇屌屍屒屓屔屖屗屘屚屛屜屝屟屢層屧",6,"屰屲",6,"屻屼屽屾岀岃",4,"岉岊岋岎岏岒岓岕岝",4,"岤",4], +["8d40","岪岮岯岰岲岴岶岹岺岻岼岾峀峂峃峅",5,"峌",5,"峓",5,"峚",6,"峢峣峧峩峫峬峮峯峱",9,"峼",4], +["8d80","崁崄崅崈",5,"崏",4,"崕崗崘崙崚崜崝崟",4,"崥崨崪崫崬崯",4,"崵",7,"崿",7,"嵈嵉嵍",10,"嵙嵚嵜嵞",10,"嵪嵭嵮嵰嵱嵲嵳嵵",12,"嶃",21,"嶚嶛嶜嶞嶟嶠"], +["8e40","嶡",21,"嶸",12,"巆",6,"巎",12,"巜巟巠巣巤巪巬巭"], +["8e80","巰巵巶巸",4,"巿帀帄帇帉帊帋帍帎帒帓帗帞",7,"帨",4,"帯帰帲",4,"帹帺帾帿幀幁幃幆",5,"幍",6,"幖",4,"幜幝幟幠幣",14,"幵幷幹幾庁庂広庅庈庉庌庍庎庒庘庛庝庡庢庣庤庨",4,"庮",4,"庴庺庻庼庽庿",6], +["8f40","廆廇廈廋",5,"廔廕廗廘廙廚廜",11,"廩廫",8,"廵廸廹廻廼廽弅弆弇弉弌弍弎弐弒弔弖弙弚弜弝弞弡弢弣弤"], +["8f80","弨弫弬弮弰弲",6,"弻弽弾弿彁",14,"彑彔彙彚彛彜彞彟彠彣彥彧彨彫彮彯彲彴彵彶彸彺彽彾彿徃徆徍徎徏徑従徔徖徚徛徝從徟徠徢",5,"復徫徬徯",5,"徶徸徹徺徻徾",4,"忇忈忊忋忎忓忔忕忚忛応忞忟忢忣忥忦忨忩忬忯忰忲忳忴忶忷忹忺忼怇"], +["9040","怈怉怋怌怐怑怓怗怘怚怞怟怢怣怤怬怭怮怰",4,"怶",4,"怽怾恀恄",6,"恌恎恏恑恓恔恖恗恘恛恜恞恟恠恡恥恦恮恱恲恴恵恷恾悀"], +["9080","悁悂悅悆悇悈悊悋悎悏悐悑悓悕悗悘悙悜悞悡悢悤悥悧悩悪悮悰悳悵悶悷悹悺悽",7,"惇惈惉惌",4,"惒惓惔惖惗惙惛惞惡",4,"惪惱惲惵惷惸惻",4,"愂愃愄愅愇愊愋愌愐",4,"愖愗愘愙愛愜愝愞愡愢愥愨愩愪愬",18,"慀",6], +["9140","慇慉態慍慏慐慒慓慔慖",6,"慞慟慠慡慣慤慥慦慩",6,"慱慲慳慴慶慸",18,"憌憍憏",4,"憕"], +["9180","憖",6,"憞",8,"憪憫憭",9,"憸",5,"憿懀懁懃",4,"應懌",4,"懓懕",16,"懧",13,"懶",8,"戀",5,"戇戉戓戔戙戜戝戞戠戣戦戧戨戩戫戭戯戰戱戲戵戶戸",4,"扂扄扅扆扊"], +["9240","扏扐払扖扗扙扚扜",6,"扤扥扨扱扲扴扵扷扸扺扻扽抁抂抃抅抆抇抈抋",5,"抔抙抜抝択抣抦抧抩抪抭抮抯抰抲抳抴抶抷抸抺抾拀拁"], +["9280","拃拋拏拑拕拝拞拠拡拤拪拫拰拲拵拸拹拺拻挀挃挄挅挆挊挋挌挍挏挐挒挓挔挕挗挘挙挜挦挧挩挬挭挮挰挱挳",5,"挻挼挾挿捀捁捄捇捈捊捑捒捓捔捖",7,"捠捤捥捦捨捪捫捬捯捰捲捳捴捵捸捹捼捽捾捿掁掃掄掅掆掋掍掑掓掔掕掗掙",6,"採掤掦掫掯掱掲掵掶掹掻掽掿揀"], +["9340","揁揂揃揅揇揈揊揋揌揑揓揔揕揗",6,"揟揢揤",4,"揫揬揮揯揰揱揳揵揷揹揺揻揼揾搃搄搆",4,"損搎搑搒搕",5,"搝搟搢搣搤"], +["9380","搥搧搨搩搫搮",5,"搵",4,"搻搼搾摀摂摃摉摋",6,"摓摕摖摗摙",4,"摟",7,"摨摪摫摬摮",9,"摻",6,"撃撆撈",8,"撓撔撗撘撚撛撜撝撟",4,"撥撦撧撨撪撫撯撱撲撳撴撶撹撻撽撾撿擁擃擄擆",6,"擏擑擓擔擕擖擙據"], +["9440","擛擜擝擟擠擡擣擥擧",24,"攁",7,"攊",7,"攓",4,"攙",8], +["9480","攢攣攤攦",4,"攬攭攰攱攲攳攷攺攼攽敀",4,"敆敇敊敋敍敎敐敒敓敔敗敘敚敜敟敠敡敤敥敧敨敩敪敭敮敯敱敳敵敶數",14,"斈斉斊斍斎斏斒斔斕斖斘斚斝斞斠斢斣斦斨斪斬斮斱",7,"斺斻斾斿旀旂旇旈旉旊旍旐旑旓旔旕旘",7,"旡旣旤旪旫"], +["9540","旲旳旴旵旸旹旻",4,"昁昄昅昇昈昉昋昍昐昑昒昖昗昘昚昛昜昞昡昢昣昤昦昩昪昫昬昮昰昲昳昷",4,"昽昿晀時晄",6,"晍晎晐晑晘"], +["9580","晙晛晜晝晞晠晢晣晥晧晩",4,"晱晲晳晵晸晹晻晼晽晿暀暁暃暅暆暈暉暊暋暍暎暏暐暒暓暔暕暘",4,"暞",8,"暩",4,"暯",4,"暵暶暷暸暺暻暼暽暿",25,"曚曞",7,"曧曨曪",5,"曱曵曶書曺曻曽朁朂會"], +["9640","朄朅朆朇朌朎朏朑朒朓朖朘朙朚朜朞朠",5,"朧朩朮朰朲朳朶朷朸朹朻朼朾朿杁杄杅杇杊杋杍杒杔杕杗",4,"杝杢杣杤杦杧杫杬杮東杴杶"], +["9680","杸杹杺杻杽枀枂枃枅枆枈枊枌枍枎枏枑枒枓枔枖枙枛枟枠枡枤枦枩枬枮枱枲枴枹",7,"柂柅",9,"柕柖柗柛柟柡柣柤柦柧柨柪柫柭柮柲柵",7,"柾栁栂栃栄栆栍栐栒栔栕栘",4,"栞栟栠栢",6,"栫",6,"栴栵栶栺栻栿桇桋桍桏桒桖",5], +["9740","桜桝桞桟桪桬",7,"桵桸",8,"梂梄梇",7,"梐梑梒梔梕梖梘",9,"梣梤梥梩梪梫梬梮梱梲梴梶梷梸"], +["9780","梹",6,"棁棃",5,"棊棌棎棏棐棑棓棔棖棗棙棛",4,"棡棢棤",9,"棯棲棳棴棶棷棸棻棽棾棿椀椂椃椄椆",4,"椌椏椑椓",11,"椡椢椣椥",7,"椮椯椱椲椳椵椶椷椸椺椻椼椾楀楁楃",16,"楕楖楘楙楛楜楟"], +["9840","楡楢楤楥楧楨楩楪楬業楯楰楲",4,"楺楻楽楾楿榁榃榅榊榋榌榎",5,"榖榗榙榚榝",9,"榩榪榬榮榯榰榲榳榵榶榸榹榺榼榽"], +["9880","榾榿槀槂",7,"構槍槏槑槒槓槕",5,"槜槝槞槡",11,"槮槯槰槱槳",9,"槾樀",9,"樋",11,"標",5,"樠樢",5,"権樫樬樭樮樰樲樳樴樶",6,"樿",4,"橅橆橈",7,"橑",6,"橚"], +["9940","橜",4,"橢橣橤橦",10,"橲",6,"橺橻橽橾橿檁檂檃檅",8,"檏檒",4,"檘",7,"檡",5], +["9980","檧檨檪檭",114,"欥欦欨",6], +["9a40","欯欰欱欳欴欵欶欸欻欼欽欿歀歁歂歄歅歈歊歋歍",11,"歚",7,"歨歩歫",13,"歺歽歾歿殀殅殈"], +["9a80","殌殎殏殐殑殔殕殗殘殙殜",4,"殢",7,"殫",7,"殶殸",6,"毀毃毄毆",4,"毌毎毐毑毘毚毜",4,"毢",7,"毬毭毮毰毱毲毴毶毷毸毺毻毼毾",6,"氈",4,"氎氒気氜氝氞氠氣氥氫氬氭氱氳氶氷氹氺氻氼氾氿汃汄汅汈汋",4,"汑汒汓汖汘"], +["9b40","汙汚汢汣汥汦汧汫",4,"汱汳汵汷汸決汻汼汿沀沄沇沊沋沍沎沑沒沕沖沗沘沚沜沝沞沠沢沨沬沯沰沴沵沶沷沺泀況泂泃泆泇泈泋泍泎泏泑泒泘"], +["9b80","泙泚泜泝泟泤泦泧泩泬泭泲泴泹泿洀洂洃洅洆洈洉洊洍洏洐洑洓洔洕洖洘洜洝洟",5,"洦洨洩洬洭洯洰洴洶洷洸洺洿浀浂浄浉浌浐浕浖浗浘浛浝浟浡浢浤浥浧浨浫浬浭浰浱浲浳浵浶浹浺浻浽",4,"涃涄涆涇涊涋涍涏涐涒涖",4,"涜涢涥涬涭涰涱涳涴涶涷涹",5,"淁淂淃淈淉淊"], +["9c40","淍淎淏淐淒淓淔淕淗淚淛淜淟淢淣淥淧淨淩淪淭淯淰淲淴淵淶淸淺淽",7,"渆渇済渉渋渏渒渓渕渘渙減渜渞渟渢渦渧渨渪測渮渰渱渳渵"], +["9c80","渶渷渹渻",7,"湅",7,"湏湐湑湒湕湗湙湚湜湝湞湠",10,"湬湭湯",14,"満溁溂溄溇溈溊",4,"溑",6,"溙溚溛溝溞溠溡溣溤溦溨溩溫溬溭溮溰溳溵溸溹溼溾溿滀滃滄滅滆滈滉滊滌滍滎滐滒滖滘滙滛滜滝滣滧滪",5], +["9d40","滰滱滲滳滵滶滷滸滺",7,"漃漄漅漇漈漊",4,"漐漑漒漖",9,"漡漢漣漥漦漧漨漬漮漰漲漴漵漷",6,"漿潀潁潂"], +["9d80","潃潄潅潈潉潊潌潎",9,"潙潚潛潝潟潠潡潣潤潥潧",5,"潯潰潱潳潵潶潷潹潻潽",6,"澅澆澇澊澋澏",12,"澝澞澟澠澢",4,"澨",10,"澴澵澷澸澺",5,"濁濃",5,"濊",6,"濓",10,"濟濢濣濤濥"], +["9e40","濦",7,"濰",32,"瀒",7,"瀜",6,"瀤",6], +["9e80","瀫",9,"瀶瀷瀸瀺",17,"灍灎灐",13,"灟",11,"灮灱灲灳灴灷灹灺灻災炁炂炃炄炆炇炈炋炌炍炏炐炑炓炗炘炚炛炞",12,"炰炲炴炵炶為炾炿烄烅烆烇烉烋",12,"烚"], +["9f40","烜烝烞烠烡烢烣烥烪烮烰",6,"烸烺烻烼烾",10,"焋",4,"焑焒焔焗焛",10,"焧",7,"焲焳焴"], +["9f80","焵焷",13,"煆煇煈煉煋煍煏",12,"煝煟",4,"煥煩",4,"煯煰煱煴煵煶煷煹煻煼煾",5,"熅",4,"熋熌熍熎熐熑熒熓熕熖熗熚",4,"熡",6,"熩熪熫熭",5,"熴熶熷熸熺",8,"燄",9,"燏",4], +["a040","燖",9,"燡燢燣燤燦燨",5,"燯",9,"燺",11,"爇",19], +["a080","爛爜爞",9,"爩爫爭爮爯爲爳爴爺爼爾牀",6,"牉牊牋牎牏牐牑牓牔牕牗牘牚牜牞牠牣牤牥牨牪牫牬牭牰牱牳牴牶牷牸牻牼牽犂犃犅",4,"犌犎犐犑犓",11,"犠",11,"犮犱犲犳犵犺",6,"狅狆狇狉狊狋狌狏狑狓狔狕狖狘狚狛"], +["a1a1"," 、。·ˉˇ¨〃々—~‖…‘’“”〔〕〈",7,"〖〗【】±×÷∶∧∨∑∏∪∩∈∷√⊥∥∠⌒⊙∫∮≡≌≈∽∝≠≮≯≤≥∞∵∴♂♀°′″℃$¤¢£‰§№☆★○●◎◇◆□■△▲※→←↑↓〓"], +["a2a1","ⅰ",9], +["a2b1","⒈",19,"⑴",19,"①",9], +["a2e5","㈠",9], +["a2f1","Ⅰ",11], +["a3a1","!"#¥%",88," ̄"], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a6e0","︵︶︹︺︿﹀︽︾﹁﹂﹃﹄"], +["a6ee","︻︼︷︸︱"], +["a6f4","︳︴"], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a840","ˊˋ˙–―‥‵℅℉↖↗↘↙∕∟∣≒≦≧⊿═",35,"▁",6], +["a880","█",7,"▓▔▕▼▽◢◣◤◥☉⊕〒〝〞"], +["a8a1","āáǎàēéěèīíǐìōóǒòūúǔùǖǘǚǜüêɑ"], +["a8bd","ńň"], +["a8c0","ɡ"], +["a8c5","ㄅ",36], +["a940","〡",8,"㊣㎎㎏㎜㎝㎞㎡㏄㏎㏑㏒㏕︰¬¦"], +["a959","℡㈱"], +["a95c","‐"], +["a960","ー゛゜ヽヾ〆ゝゞ﹉",9,"﹔﹕﹖﹗﹙",8], +["a980","﹢",4,"﹨﹩﹪﹫"], +["a996","〇"], +["a9a4","─",75], +["aa40","狜狝狟狢",5,"狪狫狵狶狹狽狾狿猀猂猄",5,"猋猌猍猏猐猑猒猔猘猙猚猟猠猣猤猦猧猨猭猯猰猲猳猵猶猺猻猼猽獀",8], +["aa80","獉獊獋獌獎獏獑獓獔獕獖獘",7,"獡",10,"獮獰獱"], +["ab40","獲",11,"獿",4,"玅玆玈玊玌玍玏玐玒玓玔玕玗玘玙玚玜玝玞玠玡玣",5,"玪玬玭玱玴玵玶玸玹玼玽玾玿珁珃",4], +["ab80","珋珌珎珒",6,"珚珛珜珝珟珡珢珣珤珦珨珪珫珬珮珯珰珱珳",4], +["ac40","珸",10,"琄琇琈琋琌琍琎琑",8,"琜",5,"琣琤琧琩琫琭琯琱琲琷",4,"琽琾琿瑀瑂",11], +["ac80","瑎",6,"瑖瑘瑝瑠",12,"瑮瑯瑱",4,"瑸瑹瑺"], +["ad40","瑻瑼瑽瑿璂璄璅璆璈璉璊璌璍璏璑",10,"璝璟",7,"璪",15,"璻",12], +["ad80","瓈",9,"瓓",8,"瓝瓟瓡瓥瓧",6,"瓰瓱瓲"], +["ae40","瓳瓵瓸",6,"甀甁甂甃甅",7,"甎甐甒甔甕甖甗甛甝甞甠",4,"甦甧甪甮甴甶甹甼甽甿畁畂畃畄畆畇畉畊畍畐畑畒畓畕畖畗畘"], +["ae80","畝",7,"畧畨畩畫",6,"畳畵當畷畺",4,"疀疁疂疄疅疇"], +["af40","疈疉疊疌疍疎疐疓疕疘疛疜疞疢疦",4,"疭疶疷疺疻疿痀痁痆痋痌痎痏痐痑痓痗痙痚痜痝痟痠痡痥痩痬痭痮痯痲痳痵痶痷痸痺痻痽痾瘂瘄瘆瘇"], +["af80","瘈瘉瘋瘍瘎瘏瘑瘒瘓瘔瘖瘚瘜瘝瘞瘡瘣瘧瘨瘬瘮瘯瘱瘲瘶瘷瘹瘺瘻瘽癁療癄"], +["b040","癅",6,"癎",5,"癕癗",4,"癝癟癠癡癢癤",6,"癬癭癮癰",7,"癹発發癿皀皁皃皅皉皊皌皍皏皐皒皔皕皗皘皚皛"], +["b080","皜",7,"皥",8,"皯皰皳皵",9,"盀盁盃啊阿埃挨哎唉哀皑癌蔼矮艾碍爱隘鞍氨安俺按暗岸胺案肮昂盎凹敖熬翱袄傲奥懊澳芭捌扒叭吧笆八疤巴拔跋靶把耙坝霸罢爸白柏百摆佰败拜稗斑班搬扳般颁板版扮拌伴瓣半办绊邦帮梆榜膀绑棒磅蚌镑傍谤苞胞包褒剥"], +["b140","盄盇盉盋盌盓盕盙盚盜盝盞盠",4,"盦",7,"盰盳盵盶盷盺盻盽盿眀眂眃眅眆眊県眎",10,"眛眜眝眞眡眣眤眥眧眪眫"], +["b180","眬眮眰",4,"眹眻眽眾眿睂睄睅睆睈",7,"睒",7,"睜薄雹保堡饱宝抱报暴豹鲍爆杯碑悲卑北辈背贝钡倍狈备惫焙被奔苯本笨崩绷甭泵蹦迸逼鼻比鄙笔彼碧蓖蔽毕毙毖币庇痹闭敝弊必辟壁臂避陛鞭边编贬扁便变卞辨辩辫遍标彪膘表鳖憋别瘪彬斌濒滨宾摈兵冰柄丙秉饼炳"], +["b240","睝睞睟睠睤睧睩睪睭",11,"睺睻睼瞁瞂瞃瞆",5,"瞏瞐瞓",11,"瞡瞣瞤瞦瞨瞫瞭瞮瞯瞱瞲瞴瞶",4], +["b280","瞼瞾矀",12,"矎",8,"矘矙矚矝",4,"矤病并玻菠播拨钵波博勃搏铂箔伯帛舶脖膊渤泊驳捕卜哺补埠不布步簿部怖擦猜裁材才财睬踩采彩菜蔡餐参蚕残惭惨灿苍舱仓沧藏操糙槽曹草厕策侧册测层蹭插叉茬茶查碴搽察岔差诧拆柴豺搀掺蝉馋谗缠铲产阐颤昌猖"], +["b340","矦矨矪矯矰矱矲矴矵矷矹矺矻矼砃",5,"砊砋砎砏砐砓砕砙砛砞砠砡砢砤砨砪砫砮砯砱砲砳砵砶砽砿硁硂硃硄硆硈硉硊硋硍硏硑硓硔硘硙硚"], +["b380","硛硜硞",11,"硯",7,"硸硹硺硻硽",6,"场尝常长偿肠厂敞畅唱倡超抄钞朝嘲潮巢吵炒车扯撤掣彻澈郴臣辰尘晨忱沉陈趁衬撑称城橙成呈乘程惩澄诚承逞骋秤吃痴持匙池迟弛驰耻齿侈尺赤翅斥炽充冲虫崇宠抽酬畴踌稠愁筹仇绸瞅丑臭初出橱厨躇锄雏滁除楚"], +["b440","碄碅碆碈碊碋碏碐碒碔碕碖碙碝碞碠碢碤碦碨",7,"碵碶碷碸確碻碼碽碿磀磂磃磄磆磇磈磌磍磎磏磑磒磓磖磗磘磚",9], +["b480","磤磥磦磧磩磪磫磭",4,"磳磵磶磸磹磻",5,"礂礃礄礆",6,"础储矗搐触处揣川穿椽传船喘串疮窗幢床闯创吹炊捶锤垂春椿醇唇淳纯蠢戳绰疵茨磁雌辞慈瓷词此刺赐次聪葱囱匆从丛凑粗醋簇促蹿篡窜摧崔催脆瘁粹淬翠村存寸磋撮搓措挫错搭达答瘩打大呆歹傣戴带殆代贷袋待逮"], +["b540","礍",5,"礔",9,"礟",4,"礥",14,"礵",4,"礽礿祂祃祄祅祇祊",8,"祔祕祘祙祡祣"], +["b580","祤祦祩祪祫祬祮祰",6,"祹祻",4,"禂禃禆禇禈禉禋禌禍禎禐禑禒怠耽担丹单郸掸胆旦氮但惮淡诞弹蛋当挡党荡档刀捣蹈倒岛祷导到稻悼道盗德得的蹬灯登等瞪凳邓堤低滴迪敌笛狄涤翟嫡抵底地蒂第帝弟递缔颠掂滇碘点典靛垫电佃甸店惦奠淀殿碉叼雕凋刁掉吊钓调跌爹碟蝶迭谍叠"], +["b640","禓",6,"禛",11,"禨",10,"禴",4,"禼禿秂秄秅秇秈秊秌秎秏秐秓秔秖秗秙",5,"秠秡秢秥秨秪"], +["b680","秬秮秱",6,"秹秺秼秾秿稁稄稅稇稈稉稊稌稏",4,"稕稖稘稙稛稜丁盯叮钉顶鼎锭定订丢东冬董懂动栋侗恫冻洞兜抖斗陡豆逗痘都督毒犊独读堵睹赌杜镀肚度渡妒端短锻段断缎堆兑队对墩吨蹲敦顿囤钝盾遁掇哆多夺垛躲朵跺舵剁惰堕蛾峨鹅俄额讹娥恶厄扼遏鄂饿恩而儿耳尔饵洱二"], +["b740","稝稟稡稢稤",14,"稴稵稶稸稺稾穀",5,"穇",9,"穒",4,"穘",16], +["b780","穩",6,"穱穲穳穵穻穼穽穾窂窅窇窉窊窋窌窎窏窐窓窔窙窚窛窞窡窢贰发罚筏伐乏阀法珐藩帆番翻樊矾钒繁凡烦反返范贩犯饭泛坊芳方肪房防妨仿访纺放菲非啡飞肥匪诽吠肺废沸费芬酚吩氛分纷坟焚汾粉奋份忿愤粪丰封枫蜂峰锋风疯烽逢冯缝讽奉凤佛否夫敷肤孵扶拂辐幅氟符伏俘服"], +["b840","窣窤窧窩窪窫窮",4,"窴",10,"竀",10,"竌",9,"竗竘竚竛竜竝竡竢竤竧",5,"竮竰竱竲竳"], +["b880","竴",4,"竻竼竾笀笁笂笅笇笉笌笍笎笐笒笓笖笗笘笚笜笝笟笡笢笣笧笩笭浮涪福袱弗甫抚辅俯釜斧脯腑府腐赴副覆赋复傅付阜父腹负富讣附妇缚咐噶嘎该改概钙盖溉干甘杆柑竿肝赶感秆敢赣冈刚钢缸肛纲岗港杠篙皋高膏羔糕搞镐稿告哥歌搁戈鸽胳疙割革葛格蛤阁隔铬个各给根跟耕更庚羹"], +["b940","笯笰笲笴笵笶笷笹笻笽笿",5,"筆筈筊筍筎筓筕筗筙筜筞筟筡筣",10,"筯筰筳筴筶筸筺筼筽筿箁箂箃箄箆",6,"箎箏"], +["b980","箑箒箓箖箘箙箚箛箞箟箠箣箤箥箮箯箰箲箳箵箶箷箹",7,"篂篃範埂耿梗工攻功恭龚供躬公宫弓巩汞拱贡共钩勾沟苟狗垢构购够辜菇咕箍估沽孤姑鼓古蛊骨谷股故顾固雇刮瓜剐寡挂褂乖拐怪棺关官冠观管馆罐惯灌贯光广逛瑰规圭硅归龟闺轨鬼诡癸桂柜跪贵刽辊滚棍锅郭国果裹过哈"], +["ba40","篅篈築篊篋篍篎篏篐篒篔",4,"篛篜篞篟篠篢篣篤篧篨篩篫篬篭篯篰篲",4,"篸篹篺篻篽篿",7,"簈簉簊簍簎簐",5,"簗簘簙"], +["ba80","簚",4,"簠",5,"簨簩簫",12,"簹",5,"籂骸孩海氦亥害骇酣憨邯韩含涵寒函喊罕翰撼捍旱憾悍焊汗汉夯杭航壕嚎豪毫郝好耗号浩呵喝荷菏核禾和何合盒貉阂河涸赫褐鹤贺嘿黑痕很狠恨哼亨横衡恒轰哄烘虹鸿洪宏弘红喉侯猴吼厚候后呼乎忽瑚壶葫胡蝴狐糊湖"], +["bb40","籃",9,"籎",36,"籵",5,"籾",9], +["bb80","粈粊",6,"粓粔粖粙粚粛粠粡粣粦粧粨粩粫粬粭粯粰粴",4,"粺粻弧虎唬护互沪户花哗华猾滑画划化话槐徊怀淮坏欢环桓还缓换患唤痪豢焕涣宦幻荒慌黄磺蝗簧皇凰惶煌晃幌恍谎灰挥辉徽恢蛔回毁悔慧卉惠晦贿秽会烩汇讳诲绘荤昏婚魂浑混豁活伙火获或惑霍货祸击圾基机畸稽积箕"], +["bc40","粿糀糂糃糄糆糉糋糎",6,"糘糚糛糝糞糡",6,"糩",5,"糰",7,"糹糺糼",13,"紋",5], +["bc80","紑",14,"紡紣紤紥紦紨紩紪紬紭紮細",6,"肌饥迹激讥鸡姬绩缉吉极棘辑籍集及急疾汲即嫉级挤几脊己蓟技冀季伎祭剂悸济寄寂计记既忌际妓继纪嘉枷夹佳家加荚颊贾甲钾假稼价架驾嫁歼监坚尖笺间煎兼肩艰奸缄茧检柬碱硷拣捡简俭剪减荐槛鉴践贱见键箭件"], +["bd40","紷",54,"絯",7], +["bd80","絸",32,"健舰剑饯渐溅涧建僵姜将浆江疆蒋桨奖讲匠酱降蕉椒礁焦胶交郊浇骄娇嚼搅铰矫侥脚狡角饺缴绞剿教酵轿较叫窖揭接皆秸街阶截劫节桔杰捷睫竭洁结解姐戒藉芥界借介疥诫届巾筋斤金今津襟紧锦仅谨进靳晋禁近烬浸"], +["be40","継",12,"綧",6,"綯",42], +["be80","線",32,"尽劲荆兢茎睛晶鲸京惊精粳经井警景颈静境敬镜径痉靖竟竞净炯窘揪究纠玖韭久灸九酒厩救旧臼舅咎就疚鞠拘狙疽居驹菊局咀矩举沮聚拒据巨具距踞锯俱句惧炬剧捐鹃娟倦眷卷绢撅攫抉掘倔爵觉决诀绝均菌钧军君峻"], +["bf40","緻",62], +["bf80","縺縼",4,"繂",4,"繈",21,"俊竣浚郡骏喀咖卡咯开揩楷凯慨刊堪勘坎砍看康慷糠扛抗亢炕考拷烤靠坷苛柯棵磕颗科壳咳可渴克刻客课肯啃垦恳坑吭空恐孔控抠口扣寇枯哭窟苦酷库裤夸垮挎跨胯块筷侩快宽款匡筐狂框矿眶旷况亏盔岿窥葵奎魁傀"], +["c040","繞",35,"纃",23,"纜纝纞"], +["c080","纮纴纻纼绖绤绬绹缊缐缞缷缹缻",6,"罃罆",9,"罒罓馈愧溃坤昆捆困括扩廓阔垃拉喇蜡腊辣啦莱来赖蓝婪栏拦篮阑兰澜谰揽览懒缆烂滥琅榔狼廊郎朗浪捞劳牢老佬姥酪烙涝勒乐雷镭蕾磊累儡垒擂肋类泪棱楞冷厘梨犁黎篱狸离漓理李里鲤礼莉荔吏栗丽厉励砾历利傈例俐"], +["c140","罖罙罛罜罝罞罠罣",4,"罫罬罭罯罰罳罵罶罷罸罺罻罼罽罿羀羂",7,"羋羍羏",4,"羕",4,"羛羜羠羢羣羥羦羨",6,"羱"], +["c180","羳",4,"羺羻羾翀翂翃翄翆翇翈翉翋翍翏",4,"翖翗翙",5,"翢翣痢立粒沥隶力璃哩俩联莲连镰廉怜涟帘敛脸链恋炼练粮凉梁粱良两辆量晾亮谅撩聊僚疗燎寥辽潦了撂镣廖料列裂烈劣猎琳林磷霖临邻鳞淋凛赁吝拎玲菱零龄铃伶羚凌灵陵岭领另令溜琉榴硫馏留刘瘤流柳六龙聋咙笼窿"], +["c240","翤翧翨翪翫翬翭翯翲翴",6,"翽翾翿耂耇耈耉耊耎耏耑耓耚耛耝耞耟耡耣耤耫",5,"耲耴耹耺耼耾聀聁聄聅聇聈聉聎聏聐聑聓聕聖聗"], +["c280","聙聛",13,"聫",5,"聲",11,"隆垄拢陇楼娄搂篓漏陋芦卢颅庐炉掳卤虏鲁麓碌露路赂鹿潞禄录陆戮驴吕铝侣旅履屡缕虑氯律率滤绿峦挛孪滦卵乱掠略抡轮伦仑沦纶论萝螺罗逻锣箩骡裸落洛骆络妈麻玛码蚂马骂嘛吗埋买麦卖迈脉瞒馒蛮满蔓曼慢漫"], +["c340","聾肁肂肅肈肊肍",5,"肔肕肗肙肞肣肦肧肨肬肰肳肵肶肸肹肻胅胇",4,"胏",6,"胘胟胠胢胣胦胮胵胷胹胻胾胿脀脁脃脄脅脇脈脋"], +["c380","脌脕脗脙脛脜脝脟",12,"脭脮脰脳脴脵脷脹",4,"脿谩芒茫盲氓忙莽猫茅锚毛矛铆卯茂冒帽貌贸么玫枚梅酶霉煤没眉媒镁每美昧寐妹媚门闷们萌蒙檬盟锰猛梦孟眯醚靡糜迷谜弥米秘觅泌蜜密幂棉眠绵冕免勉娩缅面苗描瞄藐秒渺庙妙蔑灭民抿皿敏悯闽明螟鸣铭名命谬摸"], +["c440","腀",5,"腇腉腍腎腏腒腖腗腘腛",4,"腡腢腣腤腦腨腪腫腬腯腲腳腵腶腷腸膁膃",4,"膉膋膌膍膎膐膒",5,"膙膚膞",4,"膤膥"], +["c480","膧膩膫",7,"膴",5,"膼膽膾膿臄臅臇臈臉臋臍",6,"摹蘑模膜磨摩魔抹末莫墨默沫漠寞陌谋牟某拇牡亩姆母墓暮幕募慕木目睦牧穆拿哪呐钠那娜纳氖乃奶耐奈南男难囊挠脑恼闹淖呢馁内嫩能妮霓倪泥尼拟你匿腻逆溺蔫拈年碾撵捻念娘酿鸟尿捏聂孽啮镊镍涅您柠狞凝宁"], +["c540","臔",14,"臤臥臦臨臩臫臮",4,"臵",5,"臽臿舃與",4,"舎舏舑舓舕",5,"舝舠舤舥舦舧舩舮舲舺舼舽舿"], +["c580","艀艁艂艃艅艆艈艊艌艍艎艐",7,"艙艛艜艝艞艠",7,"艩拧泞牛扭钮纽脓浓农弄奴努怒女暖虐疟挪懦糯诺哦欧鸥殴藕呕偶沤啪趴爬帕怕琶拍排牌徘湃派攀潘盘磐盼畔判叛乓庞旁耪胖抛咆刨炮袍跑泡呸胚培裴赔陪配佩沛喷盆砰抨烹澎彭蓬棚硼篷膨朋鹏捧碰坯砒霹批披劈琵毗"], +["c640","艪艫艬艭艱艵艶艷艸艻艼芀芁芃芅芆芇芉芌芐芓芔芕芖芚芛芞芠芢芣芧芲芵芶芺芻芼芿苀苂苃苅苆苉苐苖苙苚苝苢苧苨苩苪苬苭苮苰苲苳苵苶苸"], +["c680","苺苼",4,"茊茋茍茐茒茓茖茘茙茝",9,"茩茪茮茰茲茷茻茽啤脾疲皮匹痞僻屁譬篇偏片骗飘漂瓢票撇瞥拼频贫品聘乒坪苹萍平凭瓶评屏坡泼颇婆破魄迫粕剖扑铺仆莆葡菩蒲埔朴圃普浦谱曝瀑期欺栖戚妻七凄漆柒沏其棋奇歧畦崎脐齐旗祈祁骑起岂乞企启契砌器气迄弃汽泣讫掐"], +["c740","茾茿荁荂荄荅荈荊",4,"荓荕",4,"荝荢荰",6,"荹荺荾",6,"莇莈莊莋莌莍莏莐莑莔莕莖莗莙莚莝莟莡",6,"莬莭莮"], +["c780","莯莵莻莾莿菂菃菄菆菈菉菋菍菎菐菑菒菓菕菗菙菚菛菞菢菣菤菦菧菨菫菬菭恰洽牵扦钎铅千迁签仟谦乾黔钱钳前潜遣浅谴堑嵌欠歉枪呛腔羌墙蔷强抢橇锹敲悄桥瞧乔侨巧鞘撬翘峭俏窍切茄且怯窃钦侵亲秦琴勤芹擒禽寝沁青轻氢倾卿清擎晴氰情顷请庆琼穷秋丘邱球求囚酋泅趋区蛆曲躯屈驱渠"], +["c840","菮華菳",4,"菺菻菼菾菿萀萂萅萇萈萉萊萐萒",5,"萙萚萛萞",5,"萩",7,"萲",5,"萹萺萻萾",7,"葇葈葉"], +["c880","葊",6,"葒",4,"葘葝葞葟葠葢葤",4,"葪葮葯葰葲葴葷葹葻葼取娶龋趣去圈颧权醛泉全痊拳犬券劝缺炔瘸却鹊榷确雀裙群然燃冉染瓤壤攘嚷让饶扰绕惹热壬仁人忍韧任认刃妊纫扔仍日戎茸蓉荣融熔溶容绒冗揉柔肉茹蠕儒孺如辱乳汝入褥软阮蕊瑞锐闰润若弱撒洒萨腮鳃塞赛三叁"], +["c940","葽",4,"蒃蒄蒅蒆蒊蒍蒏",7,"蒘蒚蒛蒝蒞蒟蒠蒢",12,"蒰蒱蒳蒵蒶蒷蒻蒼蒾蓀蓂蓃蓅蓆蓇蓈蓋蓌蓎蓏蓒蓔蓕蓗"], +["c980","蓘",4,"蓞蓡蓢蓤蓧",4,"蓭蓮蓯蓱",10,"蓽蓾蔀蔁蔂伞散桑嗓丧搔骚扫嫂瑟色涩森僧莎砂杀刹沙纱傻啥煞筛晒珊苫杉山删煽衫闪陕擅赡膳善汕扇缮墒伤商赏晌上尚裳梢捎稍烧芍勺韶少哨邵绍奢赊蛇舌舍赦摄射慑涉社设砷申呻伸身深娠绅神沈审婶甚肾慎渗声生甥牲升绳"], +["ca40","蔃",8,"蔍蔎蔏蔐蔒蔔蔕蔖蔘蔙蔛蔜蔝蔞蔠蔢",8,"蔭",9,"蔾",4,"蕄蕅蕆蕇蕋",10], +["ca80","蕗蕘蕚蕛蕜蕝蕟",4,"蕥蕦蕧蕩",8,"蕳蕵蕶蕷蕸蕼蕽蕿薀薁省盛剩胜圣师失狮施湿诗尸虱十石拾时什食蚀实识史矢使屎驶始式示士世柿事拭誓逝势是嗜噬适仕侍释饰氏市恃室视试收手首守寿授售受瘦兽蔬枢梳殊抒输叔舒淑疏书赎孰熟薯暑曙署蜀黍鼠属术述树束戍竖墅庶数漱"], +["cb40","薂薃薆薈",6,"薐",10,"薝",6,"薥薦薧薩薫薬薭薱",5,"薸薺",6,"藂",6,"藊",4,"藑藒"], +["cb80","藔藖",5,"藝",6,"藥藦藧藨藪",14,"恕刷耍摔衰甩帅栓拴霜双爽谁水睡税吮瞬顺舜说硕朔烁斯撕嘶思私司丝死肆寺嗣四伺似饲巳松耸怂颂送宋讼诵搜艘擞嗽苏酥俗素速粟僳塑溯宿诉肃酸蒜算虽隋随绥髓碎岁穗遂隧祟孙损笋蓑梭唆缩琐索锁所塌他它她塔"], +["cc40","藹藺藼藽藾蘀",4,"蘆",10,"蘒蘓蘔蘕蘗",15,"蘨蘪",13,"蘹蘺蘻蘽蘾蘿虀"], +["cc80","虁",11,"虒虓處",4,"虛虜虝號虠虡虣",7,"獭挞蹋踏胎苔抬台泰酞太态汰坍摊贪瘫滩坛檀痰潭谭谈坦毯袒碳探叹炭汤塘搪堂棠膛唐糖倘躺淌趟烫掏涛滔绦萄桃逃淘陶讨套特藤腾疼誊梯剔踢锑提题蹄啼体替嚏惕涕剃屉天添填田甜恬舔腆挑条迢眺跳贴铁帖厅听烃"], +["cd40","虭虯虰虲",6,"蚃",6,"蚎",4,"蚔蚖",5,"蚞",4,"蚥蚦蚫蚭蚮蚲蚳蚷蚸蚹蚻",4,"蛁蛂蛃蛅蛈蛌蛍蛒蛓蛕蛖蛗蛚蛜"], +["cd80","蛝蛠蛡蛢蛣蛥蛦蛧蛨蛪蛫蛬蛯蛵蛶蛷蛺蛻蛼蛽蛿蜁蜄蜅蜆蜋蜌蜎蜏蜐蜑蜔蜖汀廷停亭庭挺艇通桐酮瞳同铜彤童桶捅筒统痛偷投头透凸秃突图徒途涂屠土吐兔湍团推颓腿蜕褪退吞屯臀拖托脱鸵陀驮驼椭妥拓唾挖哇蛙洼娃瓦袜歪外豌弯湾玩顽丸烷完碗挽晚皖惋宛婉万腕汪王亡枉网往旺望忘妄威"], +["ce40","蜙蜛蜝蜟蜠蜤蜦蜧蜨蜪蜫蜬蜭蜯蜰蜲蜳蜵蜶蜸蜹蜺蜼蜽蝀",6,"蝊蝋蝍蝏蝐蝑蝒蝔蝕蝖蝘蝚",5,"蝡蝢蝦",7,"蝯蝱蝲蝳蝵"], +["ce80","蝷蝸蝹蝺蝿螀螁螄螆螇螉螊螌螎",4,"螔螕螖螘",6,"螠",4,"巍微危韦违桅围唯惟为潍维苇萎委伟伪尾纬未蔚味畏胃喂魏位渭谓尉慰卫瘟温蚊文闻纹吻稳紊问嗡翁瓮挝蜗涡窝我斡卧握沃巫呜钨乌污诬屋无芜梧吾吴毋武五捂午舞伍侮坞戊雾晤物勿务悟误昔熙析西硒矽晰嘻吸锡牺"], +["cf40","螥螦螧螩螪螮螰螱螲螴螶螷螸螹螻螼螾螿蟁",4,"蟇蟈蟉蟌",4,"蟔",6,"蟜蟝蟞蟟蟡蟢蟣蟤蟦蟧蟨蟩蟫蟬蟭蟯",9], +["cf80","蟺蟻蟼蟽蟿蠀蠁蠂蠄",5,"蠋",7,"蠔蠗蠘蠙蠚蠜",4,"蠣稀息希悉膝夕惜熄烯溪汐犀檄袭席习媳喜铣洗系隙戏细瞎虾匣霞辖暇峡侠狭下厦夏吓掀锨先仙鲜纤咸贤衔舷闲涎弦嫌显险现献县腺馅羡宪陷限线相厢镶香箱襄湘乡翔祥详想响享项巷橡像向象萧硝霄削哮嚣销消宵淆晓"], +["d040","蠤",13,"蠳",5,"蠺蠻蠽蠾蠿衁衂衃衆",5,"衎",5,"衕衖衘衚",6,"衦衧衪衭衯衱衳衴衵衶衸衹衺"], +["d080","衻衼袀袃袆袇袉袊袌袎袏袐袑袓袔袕袗",4,"袝",4,"袣袥",5,"小孝校肖啸笑效楔些歇蝎鞋协挟携邪斜胁谐写械卸蟹懈泄泻谢屑薪芯锌欣辛新忻心信衅星腥猩惺兴刑型形邢行醒幸杏性姓兄凶胸匈汹雄熊休修羞朽嗅锈秀袖绣墟戌需虚嘘须徐许蓄酗叙旭序畜恤絮婿绪续轩喧宣悬旋玄"], +["d140","袬袮袯袰袲",4,"袸袹袺袻袽袾袿裀裃裄裇裈裊裋裌裍裏裐裑裓裖裗裚",4,"裠裡裦裧裩",6,"裲裵裶裷裺裻製裿褀褁褃",5], +["d180","褉褋",4,"褑褔",4,"褜",4,"褢褣褤褦褧褨褩褬褭褮褯褱褲褳褵褷选癣眩绚靴薛学穴雪血勋熏循旬询寻驯巡殉汛训讯逊迅压押鸦鸭呀丫芽牙蚜崖衙涯雅哑亚讶焉咽阉烟淹盐严研蜒岩延言颜阎炎沿奄掩眼衍演艳堰燕厌砚雁唁彦焰宴谚验殃央鸯秧杨扬佯疡羊洋阳氧仰痒养样漾邀腰妖瑶"], +["d240","褸",8,"襂襃襅",24,"襠",5,"襧",19,"襼"], +["d280","襽襾覀覂覄覅覇",26,"摇尧遥窑谣姚咬舀药要耀椰噎耶爷野冶也页掖业叶曳腋夜液一壹医揖铱依伊衣颐夷遗移仪胰疑沂宜姨彝椅蚁倚已乙矣以艺抑易邑屹亿役臆逸肄疫亦裔意毅忆义益溢诣议谊译异翼翌绎茵荫因殷音阴姻吟银淫寅饮尹引隐"], +["d340","覢",30,"觃觍觓觔觕觗觘觙觛觝觟觠觡觢觤觧觨觩觪觬觭觮觰觱觲觴",6], +["d380","觻",4,"訁",5,"計",21,"印英樱婴鹰应缨莹萤营荧蝇迎赢盈影颖硬映哟拥佣臃痈庸雍踊蛹咏泳涌永恿勇用幽优悠忧尤由邮铀犹油游酉有友右佑釉诱又幼迂淤于盂榆虞愚舆余俞逾鱼愉渝渔隅予娱雨与屿禹宇语羽玉域芋郁吁遇喻峪御愈欲狱育誉"], +["d440","訞",31,"訿",8,"詉",21], +["d480","詟",25,"詺",6,"浴寓裕预豫驭鸳渊冤元垣袁原援辕园员圆猿源缘远苑愿怨院曰约越跃钥岳粤月悦阅耘云郧匀陨允运蕴酝晕韵孕匝砸杂栽哉灾宰载再在咱攒暂赞赃脏葬遭糟凿藻枣早澡蚤躁噪造皂灶燥责择则泽贼怎增憎曾赠扎喳渣札轧"], +["d540","誁",7,"誋",7,"誔",46], +["d580","諃",32,"铡闸眨栅榨咋乍炸诈摘斋宅窄债寨瞻毡詹粘沾盏斩辗崭展蘸栈占战站湛绽樟章彰漳张掌涨杖丈帐账仗胀瘴障招昭找沼赵照罩兆肇召遮折哲蛰辙者锗蔗这浙珍斟真甄砧臻贞针侦枕疹诊震振镇阵蒸挣睁征狰争怔整拯正政"], +["d640","諤",34,"謈",27], +["d680","謤謥謧",30,"帧症郑证芝枝支吱蜘知肢脂汁之织职直植殖执值侄址指止趾只旨纸志挚掷至致置帜峙制智秩稚质炙痔滞治窒中盅忠钟衷终种肿重仲众舟周州洲诌粥轴肘帚咒皱宙昼骤珠株蛛朱猪诸诛逐竹烛煮拄瞩嘱主著柱助蛀贮铸筑"], +["d740","譆",31,"譧",4,"譭",25], +["d780","讇",24,"讬讱讻诇诐诪谉谞住注祝驻抓爪拽专砖转撰赚篆桩庄装妆撞壮状椎锥追赘坠缀谆准捉拙卓桌琢茁酌啄着灼浊兹咨资姿滋淄孜紫仔籽滓子自渍字鬃棕踪宗综总纵邹走奏揍租足卒族祖诅阻组钻纂嘴醉最罪尊遵昨左佐柞做作坐座"], +["d840","谸",8,"豂豃豄豅豈豊豋豍",7,"豖豗豘豙豛",5,"豣",6,"豬",6,"豴豵豶豷豻",6,"貃貄貆貇"], +["d880","貈貋貍",6,"貕貖貗貙",20,"亍丌兀丐廿卅丕亘丞鬲孬噩丨禺丿匕乇夭爻卮氐囟胤馗毓睾鼗丶亟鼐乜乩亓芈孛啬嘏仄厍厝厣厥厮靥赝匚叵匦匮匾赜卦卣刂刈刎刭刳刿剀剌剞剡剜蒯剽劂劁劐劓冂罔亻仃仉仂仨仡仫仞伛仳伢佤仵伥伧伉伫佞佧攸佚佝"], +["d940","貮",62], +["d980","賭",32,"佟佗伲伽佶佴侑侉侃侏佾佻侪佼侬侔俦俨俪俅俚俣俜俑俟俸倩偌俳倬倏倮倭俾倜倌倥倨偾偃偕偈偎偬偻傥傧傩傺僖儆僭僬僦僮儇儋仝氽佘佥俎龠汆籴兮巽黉馘冁夔勹匍訇匐凫夙兕亠兖亳衮袤亵脔裒禀嬴蠃羸冫冱冽冼"], +["da40","贎",14,"贠赑赒赗赟赥赨赩赪赬赮赯赱赲赸",8,"趂趃趆趇趈趉趌",4,"趒趓趕",9,"趠趡"], +["da80","趢趤",12,"趲趶趷趹趻趽跀跁跂跅跇跈跉跊跍跐跒跓跔凇冖冢冥讠讦讧讪讴讵讷诂诃诋诏诎诒诓诔诖诘诙诜诟诠诤诨诩诮诰诳诶诹诼诿谀谂谄谇谌谏谑谒谔谕谖谙谛谘谝谟谠谡谥谧谪谫谮谯谲谳谵谶卩卺阝阢阡阱阪阽阼陂陉陔陟陧陬陲陴隈隍隗隰邗邛邝邙邬邡邴邳邶邺"], +["db40","跕跘跙跜跠跡跢跥跦跧跩跭跮跰跱跲跴跶跼跾",6,"踆踇踈踋踍踎踐踑踒踓踕",7,"踠踡踤",4,"踫踭踰踲踳踴踶踷踸踻踼踾"], +["db80","踿蹃蹅蹆蹌",4,"蹓",5,"蹚",11,"蹧蹨蹪蹫蹮蹱邸邰郏郅邾郐郄郇郓郦郢郜郗郛郫郯郾鄄鄢鄞鄣鄱鄯鄹酃酆刍奂劢劬劭劾哿勐勖勰叟燮矍廴凵凼鬯厶弁畚巯坌垩垡塾墼壅壑圩圬圪圳圹圮圯坜圻坂坩垅坫垆坼坻坨坭坶坳垭垤垌垲埏垧垴垓垠埕埘埚埙埒垸埴埯埸埤埝"], +["dc40","蹳蹵蹷",4,"蹽蹾躀躂躃躄躆躈",6,"躑躒躓躕",6,"躝躟",11,"躭躮躰躱躳",6,"躻",7], +["dc80","軃",10,"軏",21,"堋堍埽埭堀堞堙塄堠塥塬墁墉墚墀馨鼙懿艹艽艿芏芊芨芄芎芑芗芙芫芸芾芰苈苊苣芘芷芮苋苌苁芩芴芡芪芟苄苎芤苡茉苷苤茏茇苜苴苒苘茌苻苓茑茚茆茔茕苠苕茜荑荛荜茈莒茼茴茱莛荞茯荏荇荃荟荀茗荠茭茺茳荦荥"], +["dd40","軥",62], +["dd80","輤",32,"荨茛荩荬荪荭荮莰荸莳莴莠莪莓莜莅荼莶莩荽莸荻莘莞莨莺莼菁萁菥菘堇萘萋菝菽菖萜萸萑萆菔菟萏萃菸菹菪菅菀萦菰菡葜葑葚葙葳蒇蒈葺蒉葸萼葆葩葶蒌蒎萱葭蓁蓍蓐蓦蒽蓓蓊蒿蒺蓠蒡蒹蒴蒗蓥蓣蔌甍蔸蓰蔹蔟蔺"], +["de40","轅",32,"轪辀辌辒辝辠辡辢辤辥辦辧辪辬辭辮辯農辳辴辵辷辸辺辻込辿迀迃迆"], +["de80","迉",4,"迏迒迖迗迚迠迡迣迧迬迯迱迲迴迵迶迺迻迼迾迿逇逈逌逎逓逕逘蕖蔻蓿蓼蕙蕈蕨蕤蕞蕺瞢蕃蕲蕻薤薨薇薏蕹薮薜薅薹薷薰藓藁藜藿蘧蘅蘩蘖蘼廾弈夼奁耷奕奚奘匏尢尥尬尴扌扪抟抻拊拚拗拮挢拶挹捋捃掭揶捱捺掎掴捭掬掊捩掮掼揲揸揠揿揄揞揎摒揆掾摅摁搋搛搠搌搦搡摞撄摭撖"], +["df40","這逜連逤逥逧",5,"逰",4,"逷逹逺逽逿遀遃遅遆遈",4,"過達違遖遙遚遜",5,"遤遦遧適遪遫遬遯",4,"遶",6,"遾邁"], +["df80","還邅邆邇邉邊邌",4,"邒邔邖邘邚邜邞邟邠邤邥邧邨邩邫邭邲邷邼邽邿郀摺撷撸撙撺擀擐擗擤擢攉攥攮弋忒甙弑卟叱叽叩叨叻吒吖吆呋呒呓呔呖呃吡呗呙吣吲咂咔呷呱呤咚咛咄呶呦咝哐咭哂咴哒咧咦哓哔呲咣哕咻咿哌哙哚哜咩咪咤哝哏哞唛哧唠哽唔哳唢唣唏唑唧唪啧喏喵啉啭啁啕唿啐唼"], +["e040","郂郃郆郈郉郋郌郍郒郔郕郖郘郙郚郞郟郠郣郤郥郩郪郬郮郰郱郲郳郵郶郷郹郺郻郼郿鄀鄁鄃鄅",19,"鄚鄛鄜"], +["e080","鄝鄟鄠鄡鄤",10,"鄰鄲",6,"鄺",8,"酄唷啖啵啶啷唳唰啜喋嗒喃喱喹喈喁喟啾嗖喑啻嗟喽喾喔喙嗪嗷嗉嘟嗑嗫嗬嗔嗦嗝嗄嗯嗥嗲嗳嗌嗍嗨嗵嗤辔嘞嘈嘌嘁嘤嘣嗾嘀嘧嘭噘嘹噗嘬噍噢噙噜噌噔嚆噤噱噫噻噼嚅嚓嚯囔囗囝囡囵囫囹囿圄圊圉圜帏帙帔帑帱帻帼"], +["e140","酅酇酈酑酓酔酕酖酘酙酛酜酟酠酦酧酨酫酭酳酺酻酼醀",4,"醆醈醊醎醏醓",6,"醜",5,"醤",5,"醫醬醰醱醲醳醶醷醸醹醻"], +["e180","醼",10,"釈釋釐釒",9,"針",8,"帷幄幔幛幞幡岌屺岍岐岖岈岘岙岑岚岜岵岢岽岬岫岱岣峁岷峄峒峤峋峥崂崃崧崦崮崤崞崆崛嵘崾崴崽嵬嵛嵯嵝嵫嵋嵊嵩嵴嶂嶙嶝豳嶷巅彳彷徂徇徉後徕徙徜徨徭徵徼衢彡犭犰犴犷犸狃狁狎狍狒狨狯狩狲狴狷猁狳猃狺"], +["e240","釦",62], +["e280","鈥",32,"狻猗猓猡猊猞猝猕猢猹猥猬猸猱獐獍獗獠獬獯獾舛夥飧夤夂饣饧",5,"饴饷饽馀馄馇馊馍馐馑馓馔馕庀庑庋庖庥庠庹庵庾庳赓廒廑廛廨廪膺忄忉忖忏怃忮怄忡忤忾怅怆忪忭忸怙怵怦怛怏怍怩怫怊怿怡恸恹恻恺恂"], +["e340","鉆",45,"鉵",16], +["e380","銆",7,"銏",24,"恪恽悖悚悭悝悃悒悌悛惬悻悱惝惘惆惚悴愠愦愕愣惴愀愎愫慊慵憬憔憧憷懔懵忝隳闩闫闱闳闵闶闼闾阃阄阆阈阊阋阌阍阏阒阕阖阗阙阚丬爿戕氵汔汜汊沣沅沐沔沌汨汩汴汶沆沩泐泔沭泷泸泱泗沲泠泖泺泫泮沱泓泯泾"], +["e440","銨",5,"銯",24,"鋉",31], +["e480","鋩",32,"洹洧洌浃浈洇洄洙洎洫浍洮洵洚浏浒浔洳涑浯涞涠浞涓涔浜浠浼浣渚淇淅淞渎涿淠渑淦淝淙渖涫渌涮渫湮湎湫溲湟溆湓湔渲渥湄滟溱溘滠漭滢溥溧溽溻溷滗溴滏溏滂溟潢潆潇漤漕滹漯漶潋潴漪漉漩澉澍澌潸潲潼潺濑"], +["e540","錊",51,"錿",10], +["e580","鍊",31,"鍫濉澧澹澶濂濡濮濞濠濯瀚瀣瀛瀹瀵灏灞宀宄宕宓宥宸甯骞搴寤寮褰寰蹇謇辶迓迕迥迮迤迩迦迳迨逅逄逋逦逑逍逖逡逵逶逭逯遄遑遒遐遨遘遢遛暹遴遽邂邈邃邋彐彗彖彘尻咫屐屙孱屣屦羼弪弩弭艴弼鬻屮妁妃妍妩妪妣"], +["e640","鍬",34,"鎐",27], +["e680","鎬",29,"鏋鏌鏍妗姊妫妞妤姒妲妯姗妾娅娆姝娈姣姘姹娌娉娲娴娑娣娓婀婧婊婕娼婢婵胬媪媛婷婺媾嫫媲嫒嫔媸嫠嫣嫱嫖嫦嫘嫜嬉嬗嬖嬲嬷孀尕尜孚孥孳孑孓孢驵驷驸驺驿驽骀骁骅骈骊骐骒骓骖骘骛骜骝骟骠骢骣骥骧纟纡纣纥纨纩"], +["e740","鏎",7,"鏗",54], +["e780","鐎",32,"纭纰纾绀绁绂绉绋绌绐绔绗绛绠绡绨绫绮绯绱绲缍绶绺绻绾缁缂缃缇缈缋缌缏缑缒缗缙缜缛缟缡",6,"缪缫缬缭缯",4,"缵幺畿巛甾邕玎玑玮玢玟珏珂珑玷玳珀珉珈珥珙顼琊珩珧珞玺珲琏琪瑛琦琥琨琰琮琬"], +["e840","鐯",14,"鐿",43,"鑬鑭鑮鑯"], +["e880","鑰",20,"钑钖钘铇铏铓铔铚铦铻锜锠琛琚瑁瑜瑗瑕瑙瑷瑭瑾璜璎璀璁璇璋璞璨璩璐璧瓒璺韪韫韬杌杓杞杈杩枥枇杪杳枘枧杵枨枞枭枋杷杼柰栉柘栊柩枰栌柙枵柚枳柝栀柃枸柢栎柁柽栲栳桠桡桎桢桄桤梃栝桕桦桁桧桀栾桊桉栩梵梏桴桷梓桫棂楮棼椟椠棹"], +["e940","锧锳锽镃镈镋镕镚镠镮镴镵長",7,"門",42], +["e980","閫",32,"椤棰椋椁楗棣椐楱椹楠楂楝榄楫榀榘楸椴槌榇榈槎榉楦楣楹榛榧榻榫榭槔榱槁槊槟榕槠榍槿樯槭樗樘橥槲橄樾檠橐橛樵檎橹樽樨橘橼檑檐檩檗檫猷獒殁殂殇殄殒殓殍殚殛殡殪轫轭轱轲轳轵轶轸轷轹轺轼轾辁辂辄辇辋"], +["ea40","闌",27,"闬闿阇阓阘阛阞阠阣",6,"阫阬阭阯阰阷阸阹阺阾陁陃陊陎陏陑陒陓陖陗"], +["ea80","陘陙陚陜陝陞陠陣陥陦陫陭",4,"陳陸",12,"隇隉隊辍辎辏辘辚軎戋戗戛戟戢戡戥戤戬臧瓯瓴瓿甏甑甓攴旮旯旰昊昙杲昃昕昀炅曷昝昴昱昶昵耆晟晔晁晏晖晡晗晷暄暌暧暝暾曛曜曦曩贲贳贶贻贽赀赅赆赈赉赇赍赕赙觇觊觋觌觎觏觐觑牮犟牝牦牯牾牿犄犋犍犏犒挈挲掰"], +["eb40","隌階隑隒隓隕隖隚際隝",9,"隨",7,"隱隲隴隵隷隸隺隻隿雂雃雈雊雋雐雑雓雔雖",9,"雡",6,"雫"], +["eb80","雬雭雮雰雱雲雴雵雸雺電雼雽雿霂霃霅霊霋霌霐霑霒霔霕霗",4,"霝霟霠搿擘耄毪毳毽毵毹氅氇氆氍氕氘氙氚氡氩氤氪氲攵敕敫牍牒牖爰虢刖肟肜肓肼朊肽肱肫肭肴肷胧胨胩胪胛胂胄胙胍胗朐胝胫胱胴胭脍脎胲胼朕脒豚脶脞脬脘脲腈腌腓腴腙腚腱腠腩腼腽腭腧塍媵膈膂膑滕膣膪臌朦臊膻"], +["ec40","霡",8,"霫霬霮霯霱霳",4,"霺霻霼霽霿",18,"靔靕靗靘靚靜靝靟靣靤靦靧靨靪",7], +["ec80","靲靵靷",4,"靽",7,"鞆",4,"鞌鞎鞏鞐鞓鞕鞖鞗鞙",4,"臁膦欤欷欹歃歆歙飑飒飓飕飙飚殳彀毂觳斐齑斓於旆旄旃旌旎旒旖炀炜炖炝炻烀炷炫炱烨烊焐焓焖焯焱煳煜煨煅煲煊煸煺熘熳熵熨熠燠燔燧燹爝爨灬焘煦熹戾戽扃扈扉礻祀祆祉祛祜祓祚祢祗祠祯祧祺禅禊禚禧禳忑忐"], +["ed40","鞞鞟鞡鞢鞤",6,"鞬鞮鞰鞱鞳鞵",46], +["ed80","韤韥韨韮",4,"韴韷",23,"怼恝恚恧恁恙恣悫愆愍慝憩憝懋懑戆肀聿沓泶淼矶矸砀砉砗砘砑斫砭砜砝砹砺砻砟砼砥砬砣砩硎硭硖硗砦硐硇硌硪碛碓碚碇碜碡碣碲碹碥磔磙磉磬磲礅磴礓礤礞礴龛黹黻黼盱眄眍盹眇眈眚眢眙眭眦眵眸睐睑睇睃睚睨"], +["ee40","頏",62], +["ee80","顎",32,"睢睥睿瞍睽瞀瞌瞑瞟瞠瞰瞵瞽町畀畎畋畈畛畲畹疃罘罡罟詈罨罴罱罹羁罾盍盥蠲钅钆钇钋钊钌钍钏钐钔钗钕钚钛钜钣钤钫钪钭钬钯钰钲钴钶",4,"钼钽钿铄铈",6,"铐铑铒铕铖铗铙铘铛铞铟铠铢铤铥铧铨铪"], +["ef40","顯",5,"颋颎颒颕颙颣風",37,"飏飐飔飖飗飛飜飝飠",4], +["ef80","飥飦飩",30,"铩铫铮铯铳铴铵铷铹铼铽铿锃锂锆锇锉锊锍锎锏锒",4,"锘锛锝锞锟锢锪锫锩锬锱锲锴锶锷锸锼锾锿镂锵镄镅镆镉镌镎镏镒镓镔镖镗镘镙镛镞镟镝镡镢镤",8,"镯镱镲镳锺矧矬雉秕秭秣秫稆嵇稃稂稞稔"], +["f040","餈",4,"餎餏餑",28,"餯",26], +["f080","饊",9,"饖",12,"饤饦饳饸饹饻饾馂馃馉稹稷穑黏馥穰皈皎皓皙皤瓞瓠甬鸠鸢鸨",4,"鸲鸱鸶鸸鸷鸹鸺鸾鹁鹂鹄鹆鹇鹈鹉鹋鹌鹎鹑鹕鹗鹚鹛鹜鹞鹣鹦",6,"鹱鹭鹳疒疔疖疠疝疬疣疳疴疸痄疱疰痃痂痖痍痣痨痦痤痫痧瘃痱痼痿瘐瘀瘅瘌瘗瘊瘥瘘瘕瘙"], +["f140","馌馎馚",10,"馦馧馩",47], +["f180","駙",32,"瘛瘼瘢瘠癀瘭瘰瘿瘵癃瘾瘳癍癞癔癜癖癫癯翊竦穸穹窀窆窈窕窦窠窬窨窭窳衤衩衲衽衿袂袢裆袷袼裉裢裎裣裥裱褚裼裨裾裰褡褙褓褛褊褴褫褶襁襦襻疋胥皲皴矜耒耔耖耜耠耢耥耦耧耩耨耱耋耵聃聆聍聒聩聱覃顸颀颃"], +["f240","駺",62], +["f280","騹",32,"颉颌颍颏颔颚颛颞颟颡颢颥颦虍虔虬虮虿虺虼虻蚨蚍蚋蚬蚝蚧蚣蚪蚓蚩蚶蛄蚵蛎蚰蚺蚱蚯蛉蛏蚴蛩蛱蛲蛭蛳蛐蜓蛞蛴蛟蛘蛑蜃蜇蛸蜈蜊蜍蜉蜣蜻蜞蜥蜮蜚蜾蝈蜴蜱蜩蜷蜿螂蜢蝽蝾蝻蝠蝰蝌蝮螋蝓蝣蝼蝤蝙蝥螓螯螨蟒"], +["f340","驚",17,"驲骃骉骍骎骔骕骙骦骩",6,"骲骳骴骵骹骻骽骾骿髃髄髆",4,"髍髎髏髐髒體髕髖髗髙髚髛髜"], +["f380","髝髞髠髢髣髤髥髧髨髩髪髬髮髰",8,"髺髼",6,"鬄鬅鬆蟆螈螅螭螗螃螫蟥螬螵螳蟋蟓螽蟑蟀蟊蟛蟪蟠蟮蠖蠓蟾蠊蠛蠡蠹蠼缶罂罄罅舐竺竽笈笃笄笕笊笫笏筇笸笪笙笮笱笠笥笤笳笾笞筘筚筅筵筌筝筠筮筻筢筲筱箐箦箧箸箬箝箨箅箪箜箢箫箴篑篁篌篝篚篥篦篪簌篾篼簏簖簋"], +["f440","鬇鬉",5,"鬐鬑鬒鬔",10,"鬠鬡鬢鬤",10,"鬰鬱鬳",7,"鬽鬾鬿魀魆魊魋魌魎魐魒魓魕",5], +["f480","魛",32,"簟簪簦簸籁籀臾舁舂舄臬衄舡舢舣舭舯舨舫舸舻舳舴舾艄艉艋艏艚艟艨衾袅袈裘裟襞羝羟羧羯羰羲籼敉粑粝粜粞粢粲粼粽糁糇糌糍糈糅糗糨艮暨羿翎翕翥翡翦翩翮翳糸絷綦綮繇纛麸麴赳趄趔趑趱赧赭豇豉酊酐酎酏酤"], +["f540","魼",62], +["f580","鮻",32,"酢酡酰酩酯酽酾酲酴酹醌醅醐醍醑醢醣醪醭醮醯醵醴醺豕鹾趸跫踅蹙蹩趵趿趼趺跄跖跗跚跞跎跏跛跆跬跷跸跣跹跻跤踉跽踔踝踟踬踮踣踯踺蹀踹踵踽踱蹉蹁蹂蹑蹒蹊蹰蹶蹼蹯蹴躅躏躔躐躜躞豸貂貊貅貘貔斛觖觞觚觜"], +["f640","鯜",62], +["f680","鰛",32,"觥觫觯訾謦靓雩雳雯霆霁霈霏霎霪霭霰霾龀龃龅",5,"龌黾鼋鼍隹隼隽雎雒瞿雠銎銮鋈錾鍪鏊鎏鐾鑫鱿鲂鲅鲆鲇鲈稣鲋鲎鲐鲑鲒鲔鲕鲚鲛鲞",5,"鲥",4,"鲫鲭鲮鲰",7,"鲺鲻鲼鲽鳄鳅鳆鳇鳊鳋"], +["f740","鰼",62], +["f780","鱻鱽鱾鲀鲃鲄鲉鲊鲌鲏鲓鲖鲗鲘鲙鲝鲪鲬鲯鲹鲾",4,"鳈鳉鳑鳒鳚鳛鳠鳡鳌",4,"鳓鳔鳕鳗鳘鳙鳜鳝鳟鳢靼鞅鞑鞒鞔鞯鞫鞣鞲鞴骱骰骷鹘骶骺骼髁髀髅髂髋髌髑魅魃魇魉魈魍魑飨餍餮饕饔髟髡髦髯髫髻髭髹鬈鬏鬓鬟鬣麽麾縻麂麇麈麋麒鏖麝麟黛黜黝黠黟黢黩黧黥黪黯鼢鼬鼯鼹鼷鼽鼾齄"], +["f840","鳣",62], +["f880","鴢",32], +["f940","鵃",62], +["f980","鶂",32], +["fa40","鶣",62], +["fa80","鷢",32], +["fb40","鸃",27,"鸤鸧鸮鸰鸴鸻鸼鹀鹍鹐鹒鹓鹔鹖鹙鹝鹟鹠鹡鹢鹥鹮鹯鹲鹴",9,"麀"], +["fb80","麁麃麄麅麆麉麊麌",5,"麔",8,"麞麠",5,"麧麨麩麪"], +["fc40","麫",8,"麵麶麷麹麺麼麿",4,"黅黆黇黈黊黋黌黐黒黓黕黖黗黙黚點黡黣黤黦黨黫黬黭黮黰",8,"黺黽黿",6], +["fc80","鼆",4,"鼌鼏鼑鼒鼔鼕鼖鼘鼚",5,"鼡鼣",8,"鼭鼮鼰鼱"], +["fd40","鼲",4,"鼸鼺鼼鼿",4,"齅",10,"齒",38], +["fd80","齹",5,"龁龂龍",11,"龜龝龞龡",4,"郎凉秊裏隣"], +["fe40","兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"] +] diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp949.json b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp949.json new file mode 100644 index 0000000000000000000000000000000000000000..2022a007ff7ac97ce51167903d116eec42bffd9a --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp949.json @@ -0,0 +1,273 @@ +[ +["0","\u0000",127], +["8141","갂갃갅갆갋",4,"갘갞갟갡갢갣갥",6,"갮갲갳갴"], +["8161","갵갶갷갺갻갽갾갿걁",9,"걌걎",5,"걕"], +["8181","걖걗걙걚걛걝",18,"걲걳걵걶걹걻",4,"겂겇겈겍겎겏겑겒겓겕",6,"겞겢",5,"겫겭겮겱",6,"겺겾겿곀곂곃곅곆곇곉곊곋곍",7,"곖곘",7,"곢곣곥곦곩곫곭곮곲곴곷",4,"곾곿괁괂괃괅괇",4,"괎괐괒괓"], +["8241","괔괕괖괗괙괚괛괝괞괟괡",7,"괪괫괮",5], +["8261","괶괷괹괺괻괽",6,"굆굈굊",5,"굑굒굓굕굖굗"], +["8281","굙",7,"굢굤",7,"굮굯굱굲굷굸굹굺굾궀궃",4,"궊궋궍궎궏궑",10,"궞",5,"궥",17,"궸",7,"귂귃귅귆귇귉",6,"귒귔",7,"귝귞귟귡귢귣귥",18], +["8341","귺귻귽귾긂",5,"긊긌긎",5,"긕",7], +["8361","긝",18,"긲긳긵긶긹긻긼"], +["8381","긽긾긿깂깄깇깈깉깋깏깑깒깓깕깗",4,"깞깢깣깤깦깧깪깫깭깮깯깱",6,"깺깾",5,"꺆",5,"꺍",46,"꺿껁껂껃껅",6,"껎껒",5,"껚껛껝",8], +["8441","껦껧껩껪껬껮",5,"껵껶껷껹껺껻껽",8], +["8461","꼆꼉꼊꼋꼌꼎꼏꼑",18], +["8481","꼤",7,"꼮꼯꼱꼳꼵",6,"꼾꽀꽄꽅꽆꽇꽊",5,"꽑",10,"꽞",5,"꽦",18,"꽺",5,"꾁꾂꾃꾅꾆꾇꾉",6,"꾒꾓꾔꾖",5,"꾝",26,"꾺꾻꾽꾾"], +["8541","꾿꿁",5,"꿊꿌꿏",4,"꿕",6,"꿝",4], +["8561","꿢",5,"꿪",5,"꿲꿳꿵꿶꿷꿹",6,"뀂뀃"], +["8581","뀅",6,"뀍뀎뀏뀑뀒뀓뀕",6,"뀞",9,"뀩",26,"끆끇끉끋끍끏끐끑끒끖끘끚끛끜끞",29,"끾끿낁낂낃낅",6,"낎낐낒",5,"낛낝낞낣낤"], +["8641","낥낦낧낪낰낲낶낷낹낺낻낽",6,"냆냊",5,"냒"], +["8661","냓냕냖냗냙",6,"냡냢냣냤냦",10], +["8681","냱",22,"넊넍넎넏넑넔넕넖넗넚넞",4,"넦넧넩넪넫넭",6,"넶넺",5,"녂녃녅녆녇녉",6,"녒녓녖녗녙녚녛녝녞녟녡",22,"녺녻녽녾녿놁놃",4,"놊놌놎놏놐놑놕놖놗놙놚놛놝"], +["8741","놞",9,"놩",15], +["8761","놹",18,"뇍뇎뇏뇑뇒뇓뇕"], +["8781","뇖",5,"뇞뇠",7,"뇪뇫뇭뇮뇯뇱",7,"뇺뇼뇾",5,"눆눇눉눊눍",6,"눖눘눚",5,"눡",18,"눵",6,"눽",26,"뉙뉚뉛뉝뉞뉟뉡",6,"뉪",4], +["8841","뉯",4,"뉶",5,"뉽",6,"늆늇늈늊",4], +["8861","늏늒늓늕늖늗늛",4,"늢늤늧늨늩늫늭늮늯늱늲늳늵늶늷"], +["8881","늸",15,"닊닋닍닎닏닑닓",4,"닚닜닞닟닠닡닣닧닩닪닰닱닲닶닼닽닾댂댃댅댆댇댉",6,"댒댖",5,"댝",54,"덗덙덚덝덠덡덢덣"], +["8941","덦덨덪덬덭덯덲덳덵덶덷덹",6,"뎂뎆",5,"뎍"], +["8961","뎎뎏뎑뎒뎓뎕",10,"뎢",5,"뎩뎪뎫뎭"], +["8981","뎮",21,"돆돇돉돊돍돏돑돒돓돖돘돚돜돞돟돡돢돣돥돦돧돩",18,"돽",18,"됑",6,"됙됚됛됝됞됟됡",6,"됪됬",7,"됵",15], +["8a41","둅",10,"둒둓둕둖둗둙",6,"둢둤둦"], +["8a61","둧",4,"둭",18,"뒁뒂"], +["8a81","뒃",4,"뒉",19,"뒞",5,"뒥뒦뒧뒩뒪뒫뒭",7,"뒶뒸뒺",5,"듁듂듃듅듆듇듉",6,"듑듒듓듔듖",5,"듞듟듡듢듥듧",4,"듮듰듲",5,"듹",26,"딖딗딙딚딝"], +["8b41","딞",5,"딦딫",4,"딲딳딵딶딷딹",6,"땂땆"], +["8b61","땇땈땉땊땎땏땑땒땓땕",6,"땞땢",8], +["8b81","땫",52,"떢떣떥떦떧떩떬떭떮떯떲떶",4,"떾떿뗁뗂뗃뗅",6,"뗎뗒",5,"뗙",18,"뗭",18], +["8c41","똀",15,"똒똓똕똖똗똙",4], +["8c61","똞",6,"똦",5,"똭",6,"똵",5], +["8c81","똻",12,"뙉",26,"뙥뙦뙧뙩",50,"뚞뚟뚡뚢뚣뚥",5,"뚭뚮뚯뚰뚲",16], +["8d41","뛃",16,"뛕",8], +["8d61","뛞",17,"뛱뛲뛳뛵뛶뛷뛹뛺"], +["8d81","뛻",4,"뜂뜃뜄뜆",33,"뜪뜫뜭뜮뜱",6,"뜺뜼",7,"띅띆띇띉띊띋띍",6,"띖",9,"띡띢띣띥띦띧띩",6,"띲띴띶",5,"띾띿랁랂랃랅",6,"랎랓랔랕랚랛랝랞"], +["8e41","랟랡",6,"랪랮",5,"랶랷랹",8], +["8e61","럂",4,"럈럊",19], +["8e81","럞",13,"럮럯럱럲럳럵",6,"럾렂",4,"렊렋렍렎렏렑",6,"렚렜렞",5,"렦렧렩렪렫렭",6,"렶렺",5,"롁롂롃롅",11,"롒롔",7,"롞롟롡롢롣롥",6,"롮롰롲",5,"롹롺롻롽",7], +["8f41","뢅",7,"뢎",17], +["8f61","뢠",7,"뢩",6,"뢱뢲뢳뢵뢶뢷뢹",4], +["8f81","뢾뢿룂룄룆",5,"룍룎룏룑룒룓룕",7,"룞룠룢",5,"룪룫룭룮룯룱",6,"룺룼룾",5,"뤅",18,"뤙",6,"뤡",26,"뤾뤿륁륂륃륅",6,"륍륎륐륒",5], +["9041","륚륛륝륞륟륡",6,"륪륬륮",5,"륶륷륹륺륻륽"], +["9061","륾",5,"릆릈릋릌릏",15], +["9081","릟",12,"릮릯릱릲릳릵",6,"릾맀맂",5,"맊맋맍맓",4,"맚맜맟맠맢맦맧맩맪맫맭",6,"맶맻",4,"먂",5,"먉",11,"먖",33,"먺먻먽먾먿멁멃멄멅멆"], +["9141","멇멊멌멏멐멑멒멖멗멙멚멛멝",6,"멦멪",5], +["9161","멲멳멵멶멷멹",9,"몆몈몉몊몋몍",5], +["9181","몓",20,"몪몭몮몯몱몳",4,"몺몼몾",5,"뫅뫆뫇뫉",14,"뫚",33,"뫽뫾뫿묁묂묃묅",7,"묎묐묒",5,"묙묚묛묝묞묟묡",6], +["9241","묨묪묬",7,"묷묹묺묿",4,"뭆뭈뭊뭋뭌뭎뭑뭒"], +["9261","뭓뭕뭖뭗뭙",7,"뭢뭤",7,"뭭",4], +["9281","뭲",21,"뮉뮊뮋뮍뮎뮏뮑",18,"뮥뮦뮧뮩뮪뮫뮭",6,"뮵뮶뮸",7,"믁믂믃믅믆믇믉",6,"믑믒믔",35,"믺믻믽믾밁"], +["9341","밃",4,"밊밎밐밒밓밙밚밠밡밢밣밦밨밪밫밬밮밯밲밳밵"], +["9361","밶밷밹",6,"뱂뱆뱇뱈뱊뱋뱎뱏뱑",8], +["9381","뱚뱛뱜뱞",37,"벆벇벉벊벍벏",4,"벖벘벛",4,"벢벣벥벦벩",6,"벲벶",5,"벾벿볁볂볃볅",7,"볎볒볓볔볖볗볙볚볛볝",22,"볷볹볺볻볽"], +["9441","볾",5,"봆봈봊",5,"봑봒봓봕",8], +["9461","봞",5,"봥",6,"봭",12], +["9481","봺",5,"뵁",6,"뵊뵋뵍뵎뵏뵑",6,"뵚",9,"뵥뵦뵧뵩",22,"붂붃붅붆붋",4,"붒붔붖붗붘붛붝",6,"붥",10,"붱",6,"붹",24], +["9541","뷒뷓뷖뷗뷙뷚뷛뷝",11,"뷪",5,"뷱"], +["9561","뷲뷳뷵뷶뷷뷹",6,"븁븂븄븆",5,"븎븏븑븒븓"], +["9581","븕",6,"븞븠",35,"빆빇빉빊빋빍빏",4,"빖빘빜빝빞빟빢빣빥빦빧빩빫",4,"빲빶",4,"빾빿뺁뺂뺃뺅",6,"뺎뺒",5,"뺚",13,"뺩",14], +["9641","뺸",23,"뻒뻓"], +["9661","뻕뻖뻙",6,"뻡뻢뻦",5,"뻭",8], +["9681","뻶",10,"뼂",5,"뼊",13,"뼚뼞",33,"뽂뽃뽅뽆뽇뽉",6,"뽒뽓뽔뽖",44], +["9741","뾃",16,"뾕",8], +["9761","뾞",17,"뾱",7], +["9781","뾹",11,"뿆",5,"뿎뿏뿑뿒뿓뿕",6,"뿝뿞뿠뿢",89,"쀽쀾쀿"], +["9841","쁀",16,"쁒",5,"쁙쁚쁛"], +["9861","쁝쁞쁟쁡",6,"쁪",15], +["9881","쁺",21,"삒삓삕삖삗삙",6,"삢삤삦",5,"삮삱삲삷",4,"삾샂샃샄샆샇샊샋샍샎샏샑",6,"샚샞",5,"샦샧샩샪샫샭",6,"샶샸샺",5,"섁섂섃섅섆섇섉",6,"섑섒섓섔섖",5,"섡섢섥섨섩섪섫섮"], +["9941","섲섳섴섵섷섺섻섽섾섿셁",6,"셊셎",5,"셖셗"], +["9961","셙셚셛셝",6,"셦셪",5,"셱셲셳셵셶셷셹셺셻"], +["9981","셼",8,"솆",5,"솏솑솒솓솕솗",4,"솞솠솢솣솤솦솧솪솫솭솮솯솱",11,"솾",5,"쇅쇆쇇쇉쇊쇋쇍",6,"쇕쇖쇙",6,"쇡쇢쇣쇥쇦쇧쇩",6,"쇲쇴",7,"쇾쇿숁숂숃숅",6,"숎숐숒",5,"숚숛숝숞숡숢숣"], +["9a41","숤숥숦숧숪숬숮숰숳숵",16], +["9a61","쉆쉇쉉",6,"쉒쉓쉕쉖쉗쉙",6,"쉡쉢쉣쉤쉦"], +["9a81","쉧",4,"쉮쉯쉱쉲쉳쉵",6,"쉾슀슂",5,"슊",5,"슑",6,"슙슚슜슞",5,"슦슧슩슪슫슮",5,"슶슸슺",33,"싞싟싡싢싥",5,"싮싰싲싳싴싵싷싺싽싾싿쌁",6,"쌊쌋쌎쌏"], +["9b41","쌐쌑쌒쌖쌗쌙쌚쌛쌝",6,"쌦쌧쌪",8], +["9b61","쌳",17,"썆",7], +["9b81","썎",25,"썪썫썭썮썯썱썳",4,"썺썻썾",5,"쎅쎆쎇쎉쎊쎋쎍",50,"쏁",22,"쏚"], +["9c41","쏛쏝쏞쏡쏣",4,"쏪쏫쏬쏮",5,"쏶쏷쏹",5], +["9c61","쏿",8,"쐉",6,"쐑",9], +["9c81","쐛",8,"쐥",6,"쐭쐮쐯쐱쐲쐳쐵",6,"쐾",9,"쑉",26,"쑦쑧쑩쑪쑫쑭",6,"쑶쑷쑸쑺",5,"쒁",18,"쒕",6,"쒝",12], +["9d41","쒪",13,"쒹쒺쒻쒽",8], +["9d61","쓆",25], +["9d81","쓠",8,"쓪",5,"쓲쓳쓵쓶쓷쓹쓻쓼쓽쓾씂",9,"씍씎씏씑씒씓씕",6,"씝",10,"씪씫씭씮씯씱",6,"씺씼씾",5,"앆앇앋앏앐앑앒앖앚앛앜앟앢앣앥앦앧앩",6,"앲앶",5,"앾앿얁얂얃얅얆얈얉얊얋얎얐얒얓얔"], +["9e41","얖얙얚얛얝얞얟얡",7,"얪",9,"얶"], +["9e61","얷얺얿",4,"엋엍엏엒엓엕엖엗엙",6,"엢엤엦엧"], +["9e81","엨엩엪엫엯엱엲엳엵엸엹엺엻옂옃옄옉옊옋옍옎옏옑",6,"옚옝",6,"옦옧옩옪옫옯옱옲옶옸옺옼옽옾옿왂왃왅왆왇왉",6,"왒왖",5,"왞왟왡",10,"왭왮왰왲",5,"왺왻왽왾왿욁",6,"욊욌욎",5,"욖욗욙욚욛욝",6,"욦"], +["9f41","욨욪",5,"욲욳욵욶욷욻",4,"웂웄웆",5,"웎"], +["9f61","웏웑웒웓웕",6,"웞웟웢",5,"웪웫웭웮웯웱웲"], +["9f81","웳",4,"웺웻웼웾",5,"윆윇윉윊윋윍",6,"윖윘윚",5,"윢윣윥윦윧윩",6,"윲윴윶윸윹윺윻윾윿읁읂읃읅",4,"읋읎읐읙읚읛읝읞읟읡",6,"읩읪읬",7,"읶읷읹읺읻읿잀잁잂잆잋잌잍잏잒잓잕잙잛",4,"잢잧",4,"잮잯잱잲잳잵잶잷"], +["a041","잸잹잺잻잾쟂",5,"쟊쟋쟍쟏쟑",6,"쟙쟚쟛쟜"], +["a061","쟞",5,"쟥쟦쟧쟩쟪쟫쟭",13], +["a081","쟻",4,"젂젃젅젆젇젉젋",4,"젒젔젗",4,"젞젟젡젢젣젥",6,"젮젰젲",5,"젹젺젻젽젾젿졁",6,"졊졋졎",5,"졕",26,"졲졳졵졶졷졹졻",4,"좂좄좈좉좊좎",5,"좕",7,"좞좠좢좣좤"], +["a141","좥좦좧좩",18,"좾좿죀죁"], +["a161","죂죃죅죆죇죉죊죋죍",6,"죖죘죚",5,"죢죣죥"], +["a181","죦",14,"죶",5,"죾죿줁줂줃줇",4,"줎 、。·‥…¨〃­―∥\∼‘’“”〔〕〈",9,"±×÷≠≤≥∞∴°′″℃Å¢£¥♂♀∠⊥⌒∂∇≡≒§※☆★○●◎◇◆□■△▲▽▼→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨¬"], +["a241","줐줒",5,"줙",18], +["a261","줭",6,"줵",18], +["a281","쥈",7,"쥒쥓쥕쥖쥗쥙",6,"쥢쥤",7,"쥭쥮쥯⇒⇔∀∃´~ˇ˘˝˚˙¸˛¡¿ː∮∑∏¤℉‰◁◀▷▶♤♠♡♥♧♣⊙◈▣◐◑▒▤▥▨▧▦▩♨☏☎☜☞¶†‡↕↗↙↖↘♭♩♪♬㉿㈜№㏇™㏂㏘℡€®"], +["a341","쥱쥲쥳쥵",6,"쥽",10,"즊즋즍즎즏"], +["a361","즑",6,"즚즜즞",16], +["a381","즯",16,"짂짃짅짆짉짋",4,"짒짔짗짘짛!",58,"₩]",32," ̄"], +["a441","짞짟짡짣짥짦짨짩짪짫짮짲",5,"짺짻짽짾짿쨁쨂쨃쨄"], +["a461","쨅쨆쨇쨊쨎",5,"쨕쨖쨗쨙",12], +["a481","쨦쨧쨨쨪",28,"ㄱ",93], +["a541","쩇",4,"쩎쩏쩑쩒쩓쩕",6,"쩞쩢",5,"쩩쩪"], +["a561","쩫",17,"쩾",5,"쪅쪆"], +["a581","쪇",16,"쪙",14,"ⅰ",9], +["a5b0","Ⅰ",9], +["a5c1","Α",16,"Σ",6], +["a5e1","α",16,"σ",6], +["a641","쪨",19,"쪾쪿쫁쫂쫃쫅"], +["a661","쫆",5,"쫎쫐쫒쫔쫕쫖쫗쫚",5,"쫡",6], +["a681","쫨쫩쫪쫫쫭",6,"쫵",18,"쬉쬊─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂┒┑┚┙┖┕┎┍┞┟┡┢┦┧┩┪┭┮┱┲┵┶┹┺┽┾╀╁╃",7], +["a741","쬋",4,"쬑쬒쬓쬕쬖쬗쬙",6,"쬢",7], +["a761","쬪",22,"쭂쭃쭄"], +["a781","쭅쭆쭇쭊쭋쭍쭎쭏쭑",6,"쭚쭛쭜쭞",5,"쭥",7,"㎕㎖㎗ℓ㎘㏄㎣㎤㎥㎦㎙",9,"㏊㎍㎎㎏㏏㎈㎉㏈㎧㎨㎰",9,"㎀",4,"㎺",5,"㎐",4,"Ω㏀㏁㎊㎋㎌㏖㏅㎭㎮㎯㏛㎩㎪㎫㎬㏝㏐㏓㏃㏉㏜㏆"], +["a841","쭭",10,"쭺",14], +["a861","쮉",18,"쮝",6], +["a881","쮤",19,"쮹",11,"ÆÐªĦ"], +["a8a6","IJ"], +["a8a8","ĿŁØŒºÞŦŊ"], +["a8b1","㉠",27,"ⓐ",25,"①",14,"½⅓⅔¼¾⅛⅜⅝⅞"], +["a941","쯅",14,"쯕",10], +["a961","쯠쯡쯢쯣쯥쯦쯨쯪",18], +["a981","쯽",14,"찎찏찑찒찓찕",6,"찞찟찠찣찤æđðħıijĸŀłøœßþŧŋʼn㈀",27,"⒜",25,"⑴",14,"¹²³⁴ⁿ₁₂₃₄"], +["aa41","찥찦찪찫찭찯찱",6,"찺찿",4,"챆챇챉챊챋챍챎"], +["aa61","챏",4,"챖챚",5,"챡챢챣챥챧챩",6,"챱챲"], +["aa81","챳챴챶",29,"ぁ",82], +["ab41","첔첕첖첗첚첛첝첞첟첡",6,"첪첮",5,"첶첷첹"], +["ab61","첺첻첽",6,"쳆쳈쳊",5,"쳑쳒쳓쳕",5], +["ab81","쳛",8,"쳥",6,"쳭쳮쳯쳱",12,"ァ",85], +["ac41","쳾쳿촀촂",5,"촊촋촍촎촏촑",6,"촚촜촞촟촠"], +["ac61","촡촢촣촥촦촧촩촪촫촭",11,"촺",4], +["ac81","촿",28,"쵝쵞쵟А",5,"ЁЖ",25], +["acd1","а",5,"ёж",25], +["ad41","쵡쵢쵣쵥",6,"쵮쵰쵲",5,"쵹",7], +["ad61","춁",6,"춉",10,"춖춗춙춚춛춝춞춟"], +["ad81","춠춡춢춣춦춨춪",5,"춱",18,"췅"], +["ae41","췆",5,"췍췎췏췑",16], +["ae61","췢",5,"췩췪췫췭췮췯췱",6,"췺췼췾",4], +["ae81","츃츅츆츇츉츊츋츍",6,"츕츖츗츘츚",5,"츢츣츥츦츧츩츪츫"], +["af41","츬츭츮츯츲츴츶",19], +["af61","칊",13,"칚칛칝칞칢",5,"칪칬"], +["af81","칮",5,"칶칷칹칺칻칽",6,"캆캈캊",5,"캒캓캕캖캗캙"], +["b041","캚",5,"캢캦",5,"캮",12], +["b061","캻",5,"컂",19], +["b081","컖",13,"컦컧컩컪컭",6,"컶컺",5,"가각간갇갈갉갊감",7,"같",4,"갠갤갬갭갯갰갱갸갹갼걀걋걍걔걘걜거걱건걷걸걺검겁것겄겅겆겉겊겋게겐겔겜겝겟겠겡겨격겪견겯결겸겹겻겼경곁계곈곌곕곗고곡곤곧골곪곬곯곰곱곳공곶과곽관괄괆"], +["b141","켂켃켅켆켇켉",6,"켒켔켖",5,"켝켞켟켡켢켣"], +["b161","켥",6,"켮켲",5,"켹",11], +["b181","콅",14,"콖콗콙콚콛콝",6,"콦콨콪콫콬괌괍괏광괘괜괠괩괬괭괴괵괸괼굄굅굇굉교굔굘굡굣구국군굳굴굵굶굻굼굽굿궁궂궈궉권궐궜궝궤궷귀귁귄귈귐귑귓규균귤그극근귿글긁금급긋긍긔기긱긴긷길긺김깁깃깅깆깊까깍깎깐깔깖깜깝깟깠깡깥깨깩깬깰깸"], +["b241","콭콮콯콲콳콵콶콷콹",6,"쾁쾂쾃쾄쾆",5,"쾍"], +["b261","쾎",18,"쾢",5,"쾩"], +["b281","쾪",5,"쾱",18,"쿅",6,"깹깻깼깽꺄꺅꺌꺼꺽꺾껀껄껌껍껏껐껑께껙껜껨껫껭껴껸껼꼇꼈꼍꼐꼬꼭꼰꼲꼴꼼꼽꼿꽁꽂꽃꽈꽉꽐꽜꽝꽤꽥꽹꾀꾄꾈꾐꾑꾕꾜꾸꾹꾼꿀꿇꿈꿉꿋꿍꿎꿔꿜꿨꿩꿰꿱꿴꿸뀀뀁뀄뀌뀐뀔뀜뀝뀨끄끅끈끊끌끎끓끔끕끗끙"], +["b341","쿌",19,"쿢쿣쿥쿦쿧쿩"], +["b361","쿪",5,"쿲쿴쿶",5,"쿽쿾쿿퀁퀂퀃퀅",5], +["b381","퀋",5,"퀒",5,"퀙",19,"끝끼끽낀낄낌낍낏낑나낙낚난낟날낡낢남납낫",4,"낱낳내낵낸낼냄냅냇냈냉냐냑냔냘냠냥너넉넋넌널넒넓넘넙넛넜넝넣네넥넨넬넴넵넷넸넹녀녁년녈념녑녔녕녘녜녠노녹논놀놂놈놉놋농높놓놔놘놜놨뇌뇐뇔뇜뇝"], +["b441","퀮",5,"퀶퀷퀹퀺퀻퀽",6,"큆큈큊",5], +["b461","큑큒큓큕큖큗큙",6,"큡",10,"큮큯"], +["b481","큱큲큳큵",6,"큾큿킀킂",18,"뇟뇨뇩뇬뇰뇹뇻뇽누눅눈눋눌눔눕눗눙눠눴눼뉘뉜뉠뉨뉩뉴뉵뉼늄늅늉느늑는늘늙늚늠늡늣능늦늪늬늰늴니닉닌닐닒님닙닛닝닢다닥닦단닫",4,"닳담답닷",4,"닿대댁댄댈댐댑댓댔댕댜더덕덖던덛덜덞덟덤덥"], +["b541","킕",14,"킦킧킩킪킫킭",5], +["b561","킳킶킸킺",5,"탂탃탅탆탇탊",5,"탒탖",4], +["b581","탛탞탟탡탢탣탥",6,"탮탲",5,"탹",11,"덧덩덫덮데덱덴델뎀뎁뎃뎄뎅뎌뎐뎔뎠뎡뎨뎬도독돈돋돌돎돐돔돕돗동돛돝돠돤돨돼됐되된될됨됩됫됴두둑둔둘둠둡둣둥둬뒀뒈뒝뒤뒨뒬뒵뒷뒹듀듄듈듐듕드득든듣들듦듬듭듯등듸디딕딘딛딜딤딥딧딨딩딪따딱딴딸"], +["b641","턅",7,"턎",17], +["b661","턠",15,"턲턳턵턶턷턹턻턼턽턾"], +["b681","턿텂텆",5,"텎텏텑텒텓텕",6,"텞텠텢",5,"텩텪텫텭땀땁땃땄땅땋때땍땐땔땜땝땟땠땡떠떡떤떨떪떫떰떱떳떴떵떻떼떽뗀뗄뗌뗍뗏뗐뗑뗘뗬또똑똔똘똥똬똴뙈뙤뙨뚜뚝뚠뚤뚫뚬뚱뛔뛰뛴뛸뜀뜁뜅뜨뜩뜬뜯뜰뜸뜹뜻띄띈띌띔띕띠띤띨띰띱띳띵라락란랄람랍랏랐랑랒랖랗"], +["b741","텮",13,"텽",6,"톅톆톇톉톊"], +["b761","톋",20,"톢톣톥톦톧"], +["b781","톩",6,"톲톴톶톷톸톹톻톽톾톿퇁",14,"래랙랜랠램랩랫랬랭랴략랸럇량러럭런럴럼럽럿렀렁렇레렉렌렐렘렙렛렝려력련렬렴렵렷렸령례롄롑롓로록론롤롬롭롯롱롸롼뢍뢨뢰뢴뢸룀룁룃룅료룐룔룝룟룡루룩룬룰룸룹룻룽뤄뤘뤠뤼뤽륀륄륌륏륑류륙륜률륨륩"], +["b841","퇐",7,"퇙",17], +["b861","퇫",8,"퇵퇶퇷퇹",13], +["b881","툈툊",5,"툑",24,"륫륭르륵른를름릅릇릉릊릍릎리릭린릴림립릿링마막만많",4,"맘맙맛망맞맡맣매맥맨맬맴맵맷맸맹맺먀먁먈먕머먹먼멀멂멈멉멋멍멎멓메멕멘멜멤멥멧멨멩며멱면멸몃몄명몇몌모목몫몬몰몲몸몹못몽뫄뫈뫘뫙뫼"], +["b941","툪툫툮툯툱툲툳툵",6,"툾퉀퉂",5,"퉉퉊퉋퉌"], +["b961","퉍",14,"퉝",6,"퉥퉦퉧퉨"], +["b981","퉩",22,"튂튃튅튆튇튉튊튋튌묀묄묍묏묑묘묜묠묩묫무묵묶문묻물묽묾뭄뭅뭇뭉뭍뭏뭐뭔뭘뭡뭣뭬뮈뮌뮐뮤뮨뮬뮴뮷므믄믈믐믓미믹민믿밀밂밈밉밋밌밍및밑바",4,"받",4,"밤밥밧방밭배백밴밸뱀뱁뱃뱄뱅뱉뱌뱍뱐뱝버벅번벋벌벎범법벗"], +["ba41","튍튎튏튒튓튔튖",5,"튝튞튟튡튢튣튥",6,"튭"], +["ba61","튮튯튰튲",5,"튺튻튽튾틁틃",4,"틊틌",5], +["ba81","틒틓틕틖틗틙틚틛틝",6,"틦",9,"틲틳틵틶틷틹틺벙벚베벡벤벧벨벰벱벳벴벵벼벽변별볍볏볐병볕볘볜보복볶본볼봄봅봇봉봐봔봤봬뵀뵈뵉뵌뵐뵘뵙뵤뵨부북분붇불붉붊붐붑붓붕붙붚붜붤붰붸뷔뷕뷘뷜뷩뷰뷴뷸븀븃븅브븍븐블븜븝븟비빅빈빌빎빔빕빗빙빚빛빠빡빤"], +["bb41","틻",4,"팂팄팆",5,"팏팑팒팓팕팗",4,"팞팢팣"], +["bb61","팤팦팧팪팫팭팮팯팱",6,"팺팾",5,"퍆퍇퍈퍉"], +["bb81","퍊",31,"빨빪빰빱빳빴빵빻빼빽뺀뺄뺌뺍뺏뺐뺑뺘뺙뺨뻐뻑뻔뻗뻘뻠뻣뻤뻥뻬뼁뼈뼉뼘뼙뼛뼜뼝뽀뽁뽄뽈뽐뽑뽕뾔뾰뿅뿌뿍뿐뿔뿜뿟뿡쀼쁑쁘쁜쁠쁨쁩삐삑삔삘삠삡삣삥사삭삯산삳살삵삶삼삽삿샀상샅새색샌샐샘샙샛샜생샤"], +["bc41","퍪",17,"퍾퍿펁펂펃펅펆펇"], +["bc61","펈펉펊펋펎펒",5,"펚펛펝펞펟펡",6,"펪펬펮"], +["bc81","펯",4,"펵펶펷펹펺펻펽",6,"폆폇폊",5,"폑",5,"샥샨샬샴샵샷샹섀섄섈섐섕서",4,"섣설섦섧섬섭섯섰성섶세섹센셀셈셉셋셌셍셔셕션셜셤셥셧셨셩셰셴셸솅소속솎손솔솖솜솝솟송솥솨솩솬솰솽쇄쇈쇌쇔쇗쇘쇠쇤쇨쇰쇱쇳쇼쇽숀숄숌숍숏숑수숙순숟술숨숩숫숭"], +["bd41","폗폙",7,"폢폤",7,"폮폯폱폲폳폵폶폷"], +["bd61","폸폹폺폻폾퐀퐂",5,"퐉",13], +["bd81","퐗",5,"퐞",25,"숯숱숲숴쉈쉐쉑쉔쉘쉠쉥쉬쉭쉰쉴쉼쉽쉿슁슈슉슐슘슛슝스슥슨슬슭슴습슷승시식신싣실싫심십싯싱싶싸싹싻싼쌀쌈쌉쌌쌍쌓쌔쌕쌘쌜쌤쌥쌨쌩썅써썩썬썰썲썸썹썼썽쎄쎈쎌쏀쏘쏙쏜쏟쏠쏢쏨쏩쏭쏴쏵쏸쐈쐐쐤쐬쐰"], +["be41","퐸",7,"푁푂푃푅",14], +["be61","푔",7,"푝푞푟푡푢푣푥",7,"푮푰푱푲"], +["be81","푳",4,"푺푻푽푾풁풃",4,"풊풌풎",5,"풕",8,"쐴쐼쐽쑈쑤쑥쑨쑬쑴쑵쑹쒀쒔쒜쒸쒼쓩쓰쓱쓴쓸쓺쓿씀씁씌씐씔씜씨씩씬씰씸씹씻씽아악안앉않알앍앎앓암압앗았앙앝앞애액앤앨앰앱앳앴앵야약얀얄얇얌얍얏양얕얗얘얜얠얩어억언얹얻얼얽얾엄",6,"엌엎"], +["bf41","풞",10,"풪",14], +["bf61","풹",18,"퓍퓎퓏퓑퓒퓓퓕"], +["bf81","퓖",5,"퓝퓞퓠",7,"퓩퓪퓫퓭퓮퓯퓱",6,"퓹퓺퓼에엑엔엘엠엡엣엥여역엮연열엶엷염",5,"옅옆옇예옌옐옘옙옛옜오옥온올옭옮옰옳옴옵옷옹옻와왁완왈왐왑왓왔왕왜왝왠왬왯왱외왹왼욀욈욉욋욍요욕욘욜욤욥욧용우욱운울욹욺움웁웃웅워웍원월웜웝웠웡웨"], +["c041","퓾",5,"픅픆픇픉픊픋픍",6,"픖픘",5], +["c061","픞",25], +["c081","픸픹픺픻픾픿핁핂핃핅",6,"핎핐핒",5,"핚핛핝핞핟핡핢핣웩웬웰웸웹웽위윅윈윌윔윕윗윙유육윤율윰윱윳융윷으윽은을읊음읍읏응",7,"읜읠읨읫이익인일읽읾잃임입잇있잉잊잎자작잔잖잗잘잚잠잡잣잤장잦재잭잰잴잼잽잿쟀쟁쟈쟉쟌쟎쟐쟘쟝쟤쟨쟬저적전절젊"], +["c141","핤핦핧핪핬핮",5,"핶핷핹핺핻핽",6,"햆햊햋"], +["c161","햌햍햎햏햑",19,"햦햧"], +["c181","햨",31,"점접젓정젖제젝젠젤젬젭젯젱져젼졀졈졉졌졍졔조족존졸졺좀좁좃종좆좇좋좌좍좔좝좟좡좨좼좽죄죈죌죔죕죗죙죠죡죤죵주죽준줄줅줆줌줍줏중줘줬줴쥐쥑쥔쥘쥠쥡쥣쥬쥰쥴쥼즈즉즌즐즘즙즛증지직진짇질짊짐집짓"], +["c241","헊헋헍헎헏헑헓",4,"헚헜헞",5,"헦헧헩헪헫헭헮"], +["c261","헯",4,"헶헸헺",5,"혂혃혅혆혇혉",6,"혒"], +["c281","혖",5,"혝혞혟혡혢혣혥",7,"혮",9,"혺혻징짖짙짚짜짝짠짢짤짧짬짭짯짰짱째짹짼쨀쨈쨉쨋쨌쨍쨔쨘쨩쩌쩍쩐쩔쩜쩝쩟쩠쩡쩨쩽쪄쪘쪼쪽쫀쫄쫌쫍쫏쫑쫓쫘쫙쫠쫬쫴쬈쬐쬔쬘쬠쬡쭁쭈쭉쭌쭐쭘쭙쭝쭤쭸쭹쮜쮸쯔쯤쯧쯩찌찍찐찔찜찝찡찢찧차착찬찮찰참찹찻"], +["c341","혽혾혿홁홂홃홄홆홇홊홌홎홏홐홒홓홖홗홙홚홛홝",4], +["c361","홢",4,"홨홪",5,"홲홳홵",11], +["c381","횁횂횄횆",5,"횎횏횑횒횓횕",7,"횞횠횢",5,"횩횪찼창찾채책챈챌챔챕챗챘챙챠챤챦챨챰챵처척천철첨첩첫첬청체첵첸첼쳄쳅쳇쳉쳐쳔쳤쳬쳰촁초촉촌촐촘촙촛총촤촨촬촹최쵠쵤쵬쵭쵯쵱쵸춈추축춘출춤춥춧충춰췄췌췐취췬췰췸췹췻췽츄츈츌츔츙츠측츤츨츰츱츳층"], +["c441","횫횭횮횯횱",7,"횺횼",7,"훆훇훉훊훋"], +["c461","훍훎훏훐훒훓훕훖훘훚",5,"훡훢훣훥훦훧훩",4], +["c481","훮훯훱훲훳훴훶",5,"훾훿휁휂휃휅",11,"휒휓휔치칙친칟칠칡침칩칫칭카칵칸칼캄캅캇캉캐캑캔캘캠캡캣캤캥캬캭컁커컥컨컫컬컴컵컷컸컹케켁켄켈켐켑켓켕켜켠켤켬켭켯켰켱켸코콕콘콜콤콥콧콩콰콱콴콸쾀쾅쾌쾡쾨쾰쿄쿠쿡쿤쿨쿰쿱쿳쿵쿼퀀퀄퀑퀘퀭퀴퀵퀸퀼"], +["c541","휕휖휗휚휛휝휞휟휡",6,"휪휬휮",5,"휶휷휹"], +["c561","휺휻휽",6,"흅흆흈흊",5,"흒흓흕흚",4], +["c581","흟흢흤흦흧흨흪흫흭흮흯흱흲흳흵",6,"흾흿힀힂",5,"힊힋큄큅큇큉큐큔큘큠크큭큰클큼큽킁키킥킨킬킴킵킷킹타탁탄탈탉탐탑탓탔탕태택탠탤탬탭탯탰탱탸턍터턱턴털턺텀텁텃텄텅테텍텐텔템텝텟텡텨텬텼톄톈토톡톤톨톰톱톳통톺톼퇀퇘퇴퇸툇툉툐투툭툰툴툼툽툿퉁퉈퉜"], +["c641","힍힎힏힑",6,"힚힜힞",5], +["c6a1","퉤튀튁튄튈튐튑튕튜튠튤튬튱트특튼튿틀틂틈틉틋틔틘틜틤틥티틱틴틸팀팁팃팅파팍팎판팔팖팜팝팟팠팡팥패팩팬팰팸팹팻팼팽퍄퍅퍼퍽펀펄펌펍펏펐펑페펙펜펠펨펩펫펭펴편펼폄폅폈평폐폘폡폣포폭폰폴폼폽폿퐁"], +["c7a1","퐈퐝푀푄표푠푤푭푯푸푹푼푿풀풂품풉풋풍풔풩퓌퓐퓔퓜퓟퓨퓬퓰퓸퓻퓽프픈플픔픕픗피픽핀필핌핍핏핑하학한할핥함합핫항해핵핸핼햄햅햇했행햐향허헉헌헐헒험헙헛헝헤헥헨헬헴헵헷헹혀혁현혈혐협혓혔형혜혠"], +["c8a1","혤혭호혹혼홀홅홈홉홋홍홑화확환활홧황홰홱홴횃횅회획횐횔횝횟횡효횬횰횹횻후훅훈훌훑훔훗훙훠훤훨훰훵훼훽휀휄휑휘휙휜휠휨휩휫휭휴휵휸휼흄흇흉흐흑흔흖흗흘흙흠흡흣흥흩희흰흴흼흽힁히힉힌힐힘힙힛힝"], +["caa1","伽佳假價加可呵哥嘉嫁家暇架枷柯歌珂痂稼苛茄街袈訶賈跏軻迦駕刻却各恪慤殼珏脚覺角閣侃刊墾奸姦干幹懇揀杆柬桿澗癎看磵稈竿簡肝艮艱諫間乫喝曷渴碣竭葛褐蝎鞨勘坎堪嵌感憾戡敢柑橄減甘疳監瞰紺邯鑑鑒龕"], +["cba1","匣岬甲胛鉀閘剛堈姜岡崗康强彊慷江畺疆糠絳綱羌腔舡薑襁講鋼降鱇介价個凱塏愷愾慨改槪漑疥皆盖箇芥蓋豈鎧開喀客坑更粳羹醵倨去居巨拒据據擧渠炬祛距踞車遽鉅鋸乾件健巾建愆楗腱虔蹇鍵騫乞傑杰桀儉劍劒檢"], +["cca1","瞼鈐黔劫怯迲偈憩揭擊格檄激膈覡隔堅牽犬甄絹繭肩見譴遣鵑抉決潔結缺訣兼慊箝謙鉗鎌京俓倞傾儆勁勍卿坰境庚徑慶憬擎敬景暻更梗涇炅烱璟璥瓊痙硬磬竟競絅經耕耿脛莖警輕逕鏡頃頸驚鯨係啓堺契季屆悸戒桂械"], +["cda1","棨溪界癸磎稽系繫繼計誡谿階鷄古叩告呱固姑孤尻庫拷攷故敲暠枯槁沽痼皐睾稿羔考股膏苦苽菰藁蠱袴誥賈辜錮雇顧高鼓哭斛曲梏穀谷鵠困坤崑昆梱棍滾琨袞鯤汨滑骨供公共功孔工恐恭拱控攻珙空蚣貢鞏串寡戈果瓜"], +["cea1","科菓誇課跨過鍋顆廓槨藿郭串冠官寬慣棺款灌琯瓘管罐菅觀貫關館刮恝括适侊光匡壙廣曠洸炚狂珖筐胱鑛卦掛罫乖傀塊壞怪愧拐槐魁宏紘肱轟交僑咬喬嬌嶠巧攪敎校橋狡皎矯絞翹膠蕎蛟較轎郊餃驕鮫丘久九仇俱具勾"], +["cfa1","區口句咎嘔坵垢寇嶇廐懼拘救枸柩構歐毆毬求溝灸狗玖球瞿矩究絿耉臼舅舊苟衢謳購軀逑邱鉤銶駒驅鳩鷗龜國局菊鞠鞫麴君窘群裙軍郡堀屈掘窟宮弓穹窮芎躬倦券勸卷圈拳捲權淃眷厥獗蕨蹶闕机櫃潰詭軌饋句晷歸貴"], +["d0a1","鬼龜叫圭奎揆槻珪硅窺竅糾葵規赳逵閨勻均畇筠菌鈞龜橘克剋劇戟棘極隙僅劤勤懃斤根槿瑾筋芹菫覲謹近饉契今妗擒昑檎琴禁禽芩衾衿襟金錦伋及急扱汲級給亘兢矜肯企伎其冀嗜器圻基埼夔奇妓寄岐崎己幾忌技旗旣"], +["d1a1","朞期杞棋棄機欺氣汽沂淇玘琦琪璂璣畸畿碁磯祁祇祈祺箕紀綺羈耆耭肌記譏豈起錡錤飢饑騎騏驥麒緊佶吉拮桔金喫儺喇奈娜懦懶拏拿癩",5,"那樂",4,"諾酪駱亂卵暖欄煖爛蘭難鸞捏捺南嵐枏楠湳濫男藍襤拉"], +["d2a1","納臘蠟衲囊娘廊",4,"乃來內奈柰耐冷女年撚秊念恬拈捻寧寗努勞奴弩怒擄櫓爐瑙盧",5,"駑魯",10,"濃籠聾膿農惱牢磊腦賂雷尿壘",7,"嫩訥杻紐勒",5,"能菱陵尼泥匿溺多茶"], +["d3a1","丹亶但單團壇彖斷旦檀段湍短端簞緞蛋袒鄲鍛撻澾獺疸達啖坍憺擔曇淡湛潭澹痰聃膽蕁覃談譚錟沓畓答踏遝唐堂塘幢戇撞棠當糖螳黨代垈坮大對岱帶待戴擡玳臺袋貸隊黛宅德悳倒刀到圖堵塗導屠島嶋度徒悼挑掉搗桃"], +["d4a1","棹櫂淘渡滔濤燾盜睹禱稻萄覩賭跳蹈逃途道都鍍陶韜毒瀆牘犢獨督禿篤纛讀墩惇敦旽暾沌焞燉豚頓乭突仝冬凍動同憧東桐棟洞潼疼瞳童胴董銅兜斗杜枓痘竇荳讀豆逗頭屯臀芚遁遯鈍得嶝橙燈登等藤謄鄧騰喇懶拏癩羅"], +["d5a1","蘿螺裸邏樂洛烙珞絡落諾酪駱丹亂卵欄欒瀾爛蘭鸞剌辣嵐擥攬欖濫籃纜藍襤覽拉臘蠟廊朗浪狼琅瑯螂郞來崍徠萊冷掠略亮倆兩凉梁樑粮粱糧良諒輛量侶儷勵呂廬慮戾旅櫚濾礪藜蠣閭驢驪麗黎力曆歷瀝礫轢靂憐戀攣漣"], +["d6a1","煉璉練聯蓮輦連鍊冽列劣洌烈裂廉斂殮濂簾獵令伶囹寧岺嶺怜玲笭羚翎聆逞鈴零靈領齡例澧禮醴隷勞怒撈擄櫓潞瀘爐盧老蘆虜路輅露魯鷺鹵碌祿綠菉錄鹿麓論壟弄朧瀧瓏籠聾儡瀨牢磊賂賚賴雷了僚寮廖料燎療瞭聊蓼"], +["d7a1","遼鬧龍壘婁屢樓淚漏瘻累縷蔞褸鏤陋劉旒柳榴流溜瀏琉瑠留瘤硫謬類六戮陸侖倫崙淪綸輪律慄栗率隆勒肋凜凌楞稜綾菱陵俚利厘吏唎履悧李梨浬犁狸理璃異痢籬罹羸莉裏裡里釐離鯉吝潾燐璘藺躪隣鱗麟林淋琳臨霖砬"], +["d8a1","立笠粒摩瑪痲碼磨馬魔麻寞幕漠膜莫邈万卍娩巒彎慢挽晩曼滿漫灣瞞萬蔓蠻輓饅鰻唜抹末沫茉襪靺亡妄忘忙望網罔芒茫莽輞邙埋妹媒寐昧枚梅每煤罵買賣邁魅脈貊陌驀麥孟氓猛盲盟萌冪覓免冕勉棉沔眄眠綿緬面麵滅"], +["d9a1","蔑冥名命明暝椧溟皿瞑茗蓂螟酩銘鳴袂侮冒募姆帽慕摸摹暮某模母毛牟牡瑁眸矛耗芼茅謀謨貌木沐牧目睦穆鶩歿沒夢朦蒙卯墓妙廟描昴杳渺猫竗苗錨務巫憮懋戊拇撫无楙武毋無珷畝繆舞茂蕪誣貿霧鵡墨默們刎吻問文"], +["daa1","汶紊紋聞蚊門雯勿沕物味媚尾嵋彌微未梶楣渼湄眉米美薇謎迷靡黴岷悶愍憫敏旻旼民泯玟珉緡閔密蜜謐剝博拍搏撲朴樸泊珀璞箔粕縛膊舶薄迫雹駁伴半反叛拌搬攀斑槃泮潘班畔瘢盤盼磐磻礬絆般蟠返頒飯勃拔撥渤潑"], +["dba1","發跋醱鉢髮魃倣傍坊妨尨幇彷房放方旁昉枋榜滂磅紡肪膀舫芳蒡蚌訪謗邦防龐倍俳北培徘拜排杯湃焙盃背胚裴裵褙賠輩配陪伯佰帛柏栢白百魄幡樊煩燔番磻繁蕃藩飜伐筏罰閥凡帆梵氾汎泛犯範范法琺僻劈壁擘檗璧癖"], +["dca1","碧蘗闢霹便卞弁變辨辯邊別瞥鱉鼈丙倂兵屛幷昞昺柄棅炳甁病秉竝輧餠騈保堡報寶普步洑湺潽珤甫菩補褓譜輔伏僕匐卜宓復服福腹茯蔔複覆輹輻馥鰒本乶俸奉封峯峰捧棒烽熢琫縫蓬蜂逢鋒鳳不付俯傅剖副否咐埠夫婦"], +["dda1","孚孵富府復扶敷斧浮溥父符簿缶腐腑膚艀芙莩訃負賦賻赴趺部釜阜附駙鳧北分吩噴墳奔奮忿憤扮昐汾焚盆粉糞紛芬賁雰不佛弗彿拂崩朋棚硼繃鵬丕備匕匪卑妃婢庇悲憊扉批斐枇榧比毖毗毘沸泌琵痺砒碑秕秘粃緋翡肥"], +["dea1","脾臂菲蜚裨誹譬費鄙非飛鼻嚬嬪彬斌檳殯浜濱瀕牝玭貧賓頻憑氷聘騁乍事些仕伺似使俟僿史司唆嗣四士奢娑寫寺射巳師徙思捨斜斯柶査梭死沙泗渣瀉獅砂社祀祠私篩紗絲肆舍莎蓑蛇裟詐詞謝賜赦辭邪飼駟麝削數朔索"], +["dfa1","傘刪山散汕珊産疝算蒜酸霰乷撒殺煞薩三參杉森渗芟蔘衫揷澁鈒颯上傷像償商喪嘗孀尙峠常床庠廂想桑橡湘爽牀狀相祥箱翔裳觴詳象賞霜塞璽賽嗇塞穡索色牲生甥省笙墅壻嶼序庶徐恕抒捿敍暑曙書栖棲犀瑞筮絮緖署"], +["e0a1","胥舒薯西誓逝鋤黍鼠夕奭席惜昔晳析汐淅潟石碩蓆釋錫仙僊先善嬋宣扇敾旋渲煽琁瑄璇璿癬禪線繕羨腺膳船蘚蟬詵跣選銑鐥饍鮮卨屑楔泄洩渫舌薛褻設說雪齧剡暹殲纖蟾贍閃陝攝涉燮葉城姓宬性惺成星晟猩珹盛省筬"], +["e1a1","聖聲腥誠醒世勢歲洗稅笹細說貰召嘯塑宵小少巢所掃搔昭梳沼消溯瀟炤燒甦疏疎瘙笑篠簫素紹蔬蕭蘇訴逍遡邵銷韶騷俗屬束涑粟續謖贖速孫巽損蓀遜飡率宋悚松淞訟誦送頌刷殺灑碎鎖衰釗修受嗽囚垂壽嫂守岫峀帥愁"], +["e2a1","戍手授搜收數樹殊水洙漱燧狩獸琇璲瘦睡秀穗竪粹綏綬繡羞脩茱蒐蓚藪袖誰讐輸遂邃酬銖銹隋隧隨雖需須首髓鬚叔塾夙孰宿淑潚熟琡璹肅菽巡徇循恂旬栒楯橓殉洵淳珣盾瞬筍純脣舜荀蓴蕣詢諄醇錞順馴戌術述鉥崇崧"], +["e3a1","嵩瑟膝蝨濕拾習褶襲丞乘僧勝升承昇繩蠅陞侍匙嘶始媤尸屎屍市弑恃施是時枾柴猜矢示翅蒔蓍視試詩諡豕豺埴寔式息拭植殖湜熄篒蝕識軾食飾伸侁信呻娠宸愼新晨燼申神紳腎臣莘薪藎蜃訊身辛辰迅失室實悉審尋心沁"], +["e4a1","沈深瀋甚芯諶什十拾雙氏亞俄兒啞娥峨我牙芽莪蛾衙訝阿雅餓鴉鵝堊岳嶽幄惡愕握樂渥鄂鍔顎鰐齷安岸按晏案眼雁鞍顔鮟斡謁軋閼唵岩巖庵暗癌菴闇壓押狎鴨仰央怏昻殃秧鴦厓哀埃崖愛曖涯碍艾隘靄厄扼掖液縊腋額"], +["e5a1","櫻罌鶯鸚也倻冶夜惹揶椰爺耶若野弱掠略約若葯蒻藥躍亮佯兩凉壤孃恙揚攘敭暘梁楊樣洋瀁煬痒瘍禳穰糧羊良襄諒讓釀陽量養圄御於漁瘀禦語馭魚齬億憶抑檍臆偃堰彦焉言諺孼蘖俺儼嚴奄掩淹嶪業円予余勵呂女如廬"], +["e6a1","旅歟汝濾璵礖礪與艅茹輿轝閭餘驪麗黎亦力域役易曆歷疫繹譯轢逆驛嚥堧姸娟宴年延憐戀捐挻撚椽沇沿涎涓淵演漣烟然煙煉燃燕璉硏硯秊筵緣練縯聯衍軟輦蓮連鉛鍊鳶列劣咽悅涅烈熱裂說閱厭廉念捻染殮炎焰琰艶苒"], +["e7a1","簾閻髥鹽曄獵燁葉令囹塋寧嶺嶸影怜映暎楹榮永泳渶潁濚瀛瀯煐營獰玲瑛瑩瓔盈穎纓羚聆英詠迎鈴鍈零霙靈領乂倪例刈叡曳汭濊猊睿穢芮藝蘂禮裔詣譽豫醴銳隸霓預五伍俉傲午吾吳嗚塢墺奧娛寤悟惡懊敖旿晤梧汚澳"], +["e8a1","烏熬獒筽蜈誤鰲鼇屋沃獄玉鈺溫瑥瘟穩縕蘊兀壅擁瓮甕癰翁邕雍饔渦瓦窩窪臥蛙蝸訛婉完宛梡椀浣玩琓琬碗緩翫脘腕莞豌阮頑曰往旺枉汪王倭娃歪矮外嵬巍猥畏了僚僥凹堯夭妖姚寥寮尿嶢拗搖撓擾料曜樂橈燎燿瑤療"], +["e9a1","窈窯繇繞耀腰蓼蟯要謠遙遼邀饒慾欲浴縟褥辱俑傭冗勇埇墉容庸慂榕涌湧溶熔瑢用甬聳茸蓉踊鎔鏞龍于佑偶優又友右宇寓尤愚憂旴牛玗瑀盂祐禑禹紆羽芋藕虞迂遇郵釪隅雨雩勖彧旭昱栯煜稶郁頊云暈橒殞澐熉耘芸蕓"], +["eaa1","運隕雲韻蔚鬱亐熊雄元原員圓園垣媛嫄寃怨愿援沅洹湲源爰猿瑗苑袁轅遠阮院願鴛月越鉞位偉僞危圍委威尉慰暐渭爲瑋緯胃萎葦蔿蝟衛褘謂違韋魏乳侑儒兪劉唯喩孺宥幼幽庾悠惟愈愉揄攸有杻柔柚柳楡楢油洧流游溜"], +["eba1","濡猶猷琉瑜由留癒硫紐維臾萸裕誘諛諭踰蹂遊逾遺酉釉鍮類六堉戮毓肉育陸倫允奫尹崙淪潤玧胤贇輪鈗閏律慄栗率聿戎瀜絨融隆垠恩慇殷誾銀隱乙吟淫蔭陰音飮揖泣邑凝應膺鷹依倚儀宜意懿擬椅毅疑矣義艤薏蟻衣誼"], +["eca1","議醫二以伊利吏夷姨履已弛彛怡易李梨泥爾珥理異痍痢移罹而耳肄苡荑裏裡貽貳邇里離飴餌匿溺瀷益翊翌翼謚人仁刃印吝咽因姻寅引忍湮燐璘絪茵藺蚓認隣靭靷鱗麟一佚佾壹日溢逸鎰馹任壬妊姙恁林淋稔臨荏賃入卄"], +["eda1","立笠粒仍剩孕芿仔刺咨姉姿子字孜恣慈滋炙煮玆瓷疵磁紫者自茨蔗藉諮資雌作勺嚼斫昨灼炸爵綽芍酌雀鵲孱棧殘潺盞岑暫潛箴簪蠶雜丈仗匠場墻壯奬將帳庄張掌暲杖樟檣欌漿牆狀獐璋章粧腸臟臧莊葬蔣薔藏裝贓醬長"], +["eea1","障再哉在宰才材栽梓渽滓災縡裁財載齋齎爭箏諍錚佇低儲咀姐底抵杵楮樗沮渚狙猪疽箸紵苧菹著藷詛貯躇這邸雎齟勣吊嫡寂摘敵滴狄炙的積笛籍績翟荻謫賊赤跡蹟迪迹適鏑佃佺傳全典前剪塡塼奠專展廛悛戰栓殿氈澱"], +["efa1","煎琠田甸畑癲筌箋箭篆纏詮輾轉鈿銓錢鐫電顚顫餞切截折浙癤竊節絶占岾店漸点粘霑鮎點接摺蝶丁井亭停偵呈姃定幀庭廷征情挺政整旌晶晸柾楨檉正汀淀淨渟湞瀞炡玎珽町睛碇禎程穽精綎艇訂諪貞鄭酊釘鉦鋌錠霆靖"], +["f0a1","靜頂鼎制劑啼堤帝弟悌提梯濟祭第臍薺製諸蹄醍除際霽題齊俎兆凋助嘲弔彫措操早晁曺曹朝條棗槽漕潮照燥爪璪眺祖祚租稠窕粗糟組繰肇藻蚤詔調趙躁造遭釣阻雕鳥族簇足鏃存尊卒拙猝倧宗從悰慫棕淙琮種終綜縱腫"], +["f1a1","踪踵鍾鐘佐坐左座挫罪主住侏做姝胄呪周嗾奏宙州廚晝朱柱株注洲湊澍炷珠疇籌紂紬綢舟蛛註誅走躊輳週酎酒鑄駐竹粥俊儁准埈寯峻晙樽浚準濬焌畯竣蠢逡遵雋駿茁中仲衆重卽櫛楫汁葺增憎曾拯烝甑症繒蒸證贈之只"], +["f2a1","咫地址志持指摯支旨智枝枳止池沚漬知砥祉祗紙肢脂至芝芷蜘誌識贄趾遲直稙稷織職唇嗔塵振搢晉晋桭榛殄津溱珍瑨璡畛疹盡眞瞋秦縉縝臻蔯袗診賑軫辰進鎭陣陳震侄叱姪嫉帙桎瓆疾秩窒膣蛭質跌迭斟朕什執潗緝輯"], +["f3a1","鏶集徵懲澄且侘借叉嗟嵯差次此磋箚茶蹉車遮捉搾着窄錯鑿齪撰澯燦璨瓚竄簒纂粲纘讚贊鑽餐饌刹察擦札紮僭參塹慘慙懺斬站讒讖倉倡創唱娼廠彰愴敞昌昶暢槍滄漲猖瘡窓脹艙菖蒼債埰寀寨彩採砦綵菜蔡采釵冊柵策"], +["f4a1","責凄妻悽處倜刺剔尺慽戚拓擲斥滌瘠脊蹠陟隻仟千喘天川擅泉淺玔穿舛薦賤踐遷釧闡阡韆凸哲喆徹撤澈綴輟轍鐵僉尖沾添甛瞻簽籤詹諂堞妾帖捷牒疊睫諜貼輒廳晴淸聽菁請靑鯖切剃替涕滯締諦逮遞體初剿哨憔抄招梢"], +["f5a1","椒楚樵炒焦硝礁礎秒稍肖艸苕草蕉貂超酢醋醮促囑燭矗蜀觸寸忖村邨叢塚寵悤憁摠總聰蔥銃撮催崔最墜抽推椎楸樞湫皺秋芻萩諏趨追鄒酋醜錐錘鎚雛騶鰍丑畜祝竺筑築縮蓄蹙蹴軸逐春椿瑃出朮黜充忠沖蟲衝衷悴膵萃"], +["f6a1","贅取吹嘴娶就炊翠聚脆臭趣醉驟鷲側仄厠惻測層侈値嗤峙幟恥梔治淄熾痔痴癡稚穉緇緻置致蚩輜雉馳齒則勅飭親七柒漆侵寢枕沈浸琛砧針鍼蟄秤稱快他咤唾墮妥惰打拖朶楕舵陀馱駝倬卓啄坼度托拓擢晫柝濁濯琢琸託"], +["f7a1","鐸呑嘆坦彈憚歎灘炭綻誕奪脫探眈耽貪塔搭榻宕帑湯糖蕩兌台太怠態殆汰泰笞胎苔跆邰颱宅擇澤撑攄兎吐土討慟桶洞痛筒統通堆槌腿褪退頹偸套妬投透鬪慝特闖坡婆巴把播擺杷波派爬琶破罷芭跛頗判坂板版瓣販辦鈑"], +["f8a1","阪八叭捌佩唄悖敗沛浿牌狽稗覇貝彭澎烹膨愎便偏扁片篇編翩遍鞭騙貶坪平枰萍評吠嬖幣廢弊斃肺蔽閉陛佈包匍匏咆哺圃布怖抛抱捕暴泡浦疱砲胞脯苞葡蒲袍褒逋鋪飽鮑幅暴曝瀑爆輻俵剽彪慓杓標漂瓢票表豹飇飄驃"], +["f9a1","品稟楓諷豊風馮彼披疲皮被避陂匹弼必泌珌畢疋筆苾馝乏逼下何厦夏廈昰河瑕荷蝦賀遐霞鰕壑學虐謔鶴寒恨悍旱汗漢澣瀚罕翰閑閒限韓割轄函含咸啣喊檻涵緘艦銜陷鹹合哈盒蛤閤闔陜亢伉姮嫦巷恒抗杭桁沆港缸肛航"], +["faa1","行降項亥偕咳垓奚孩害懈楷海瀣蟹解該諧邂駭骸劾核倖幸杏荇行享向嚮珦鄕響餉饗香噓墟虛許憲櫶獻軒歇險驗奕爀赫革俔峴弦懸晛泫炫玄玹現眩睍絃絢縣舷衒見賢鉉顯孑穴血頁嫌俠協夾峽挾浹狹脅脇莢鋏頰亨兄刑型"], +["fba1","形泂滎瀅灐炯熒珩瑩荊螢衡逈邢鎣馨兮彗惠慧暳蕙蹊醯鞋乎互呼壕壺好岵弧戶扈昊晧毫浩淏湖滸澔濠濩灝狐琥瑚瓠皓祜糊縞胡芦葫蒿虎號蝴護豪鎬頀顥惑或酷婚昏混渾琿魂忽惚笏哄弘汞泓洪烘紅虹訌鴻化和嬅樺火畵"], +["fca1","禍禾花華話譁貨靴廓擴攫確碻穫丸喚奐宦幻患換歡晥桓渙煥環紈還驩鰥活滑猾豁闊凰幌徨恍惶愰慌晃晄榥況湟滉潢煌璜皇篁簧荒蝗遑隍黃匯回廻徊恢悔懷晦會檜淮澮灰獪繪膾茴蛔誨賄劃獲宖橫鐄哮嚆孝效斅曉梟涍淆"], +["fda1","爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"] +] diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp950.json b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp950.json new file mode 100644 index 0000000000000000000000000000000000000000..d8bc87178dd38fca1829b9e2109c6f71e9721bdf --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/cp950.json @@ -0,0 +1,177 @@ +[ +["0","\u0000",127], +["a140"," ,、。.‧;:?!︰…‥﹐﹑﹒·﹔﹕﹖﹗|–︱—︳╴︴﹏()︵︶{}︷︸〔〕︹︺【】︻︼《》︽︾〈〉︿﹀「」﹁﹂『』﹃﹄﹙﹚"], +["a1a1","﹛﹜﹝﹞‘’“”〝〞‵′#&*※§〃○●△▲◎☆★◇◆□■▽▼㊣℅¯ ̄_ˍ﹉﹊﹍﹎﹋﹌﹟﹠﹡+-×÷±√<>=≦≧≠∞≒≡﹢",4,"~∩∪⊥∠∟⊿㏒㏑∫∮∵∴♀♂⊕⊙↑↓←→↖↗↙↘∥∣/"], +["a240","\∕﹨$¥〒¢£%@℃℉﹩﹪﹫㏕㎜㎝㎞㏎㎡㎎㎏㏄°兙兛兞兝兡兣嗧瓩糎▁",7,"▏▎▍▌▋▊▉┼┴┬┤├▔─│▕┌┐└┘╭"], +["a2a1","╮╰╯═╞╪╡◢◣◥◤╱╲╳0",9,"Ⅰ",9,"〡",8,"十卄卅A",25,"a",21], +["a340","wxyzΑ",16,"Σ",6,"α",16,"σ",6,"ㄅ",10], +["a3a1","ㄐ",25,"˙ˉˊˇˋ"], +["a3e1","€"], +["a440","一乙丁七乃九了二人儿入八几刀刁力匕十卜又三下丈上丫丸凡久么也乞于亡兀刃勺千叉口土士夕大女子孑孓寸小尢尸山川工己已巳巾干廾弋弓才"], +["a4a1","丑丐不中丰丹之尹予云井互五亢仁什仃仆仇仍今介仄元允內六兮公冗凶分切刈勻勾勿化匹午升卅卞厄友及反壬天夫太夭孔少尤尺屯巴幻廿弔引心戈戶手扎支文斗斤方日曰月木欠止歹毋比毛氏水火爪父爻片牙牛犬王丙"], +["a540","世丕且丘主乍乏乎以付仔仕他仗代令仙仞充兄冉冊冬凹出凸刊加功包匆北匝仟半卉卡占卯卮去可古右召叮叩叨叼司叵叫另只史叱台句叭叻四囚外"], +["a5a1","央失奴奶孕它尼巨巧左市布平幼弁弘弗必戊打扔扒扑斥旦朮本未末札正母民氐永汁汀氾犯玄玉瓜瓦甘生用甩田由甲申疋白皮皿目矛矢石示禾穴立丞丟乒乓乩亙交亦亥仿伉伙伊伕伍伐休伏仲件任仰仳份企伋光兇兆先全"], +["a640","共再冰列刑划刎刖劣匈匡匠印危吉吏同吊吐吁吋各向名合吃后吆吒因回囝圳地在圭圬圯圩夙多夷夸妄奸妃好她如妁字存宇守宅安寺尖屹州帆并年"], +["a6a1","式弛忙忖戎戌戍成扣扛托收早旨旬旭曲曳有朽朴朱朵次此死氖汝汗汙江池汐汕污汛汍汎灰牟牝百竹米糸缶羊羽老考而耒耳聿肉肋肌臣自至臼舌舛舟艮色艾虫血行衣西阡串亨位住佇佗佞伴佛何估佐佑伽伺伸佃佔似但佣"], +["a740","作你伯低伶余佝佈佚兌克免兵冶冷別判利刪刨劫助努劬匣即卵吝吭吞吾否呎吧呆呃吳呈呂君吩告吹吻吸吮吵吶吠吼呀吱含吟听囪困囤囫坊坑址坍"], +["a7a1","均坎圾坐坏圻壯夾妝妒妨妞妣妙妖妍妤妓妊妥孝孜孚孛完宋宏尬局屁尿尾岐岑岔岌巫希序庇床廷弄弟彤形彷役忘忌志忍忱快忸忪戒我抄抗抖技扶抉扭把扼找批扳抒扯折扮投抓抑抆改攻攸旱更束李杏材村杜杖杞杉杆杠"], +["a840","杓杗步每求汞沙沁沈沉沅沛汪決沐汰沌汨沖沒汽沃汲汾汴沆汶沍沔沘沂灶灼災灸牢牡牠狄狂玖甬甫男甸皂盯矣私秀禿究系罕肖肓肝肘肛肚育良芒"], +["a8a1","芋芍見角言谷豆豕貝赤走足身車辛辰迂迆迅迄巡邑邢邪邦那酉釆里防阮阱阪阬並乖乳事些亞享京佯依侍佳使佬供例來侃佰併侈佩佻侖佾侏侑佺兔兒兕兩具其典冽函刻券刷刺到刮制剁劾劻卒協卓卑卦卷卸卹取叔受味呵"], +["a940","咖呸咕咀呻呷咄咒咆呼咐呱呶和咚呢周咋命咎固垃坷坪坩坡坦坤坼夜奉奇奈奄奔妾妻委妹妮姑姆姐姍始姓姊妯妳姒姅孟孤季宗定官宜宙宛尚屈居"], +["a9a1","屆岷岡岸岩岫岱岳帘帚帖帕帛帑幸庚店府底庖延弦弧弩往征彿彼忝忠忽念忿怏怔怯怵怖怪怕怡性怩怫怛或戕房戾所承拉拌拄抿拂抹拒招披拓拔拋拈抨抽押拐拙拇拍抵拚抱拘拖拗拆抬拎放斧於旺昔易昌昆昂明昀昏昕昊"], +["aa40","昇服朋杭枋枕東果杳杷枇枝林杯杰板枉松析杵枚枓杼杪杲欣武歧歿氓氛泣注泳沱泌泥河沽沾沼波沫法泓沸泄油況沮泗泅泱沿治泡泛泊沬泯泜泖泠"], +["aaa1","炕炎炒炊炙爬爭爸版牧物狀狎狙狗狐玩玨玟玫玥甽疝疙疚的盂盲直知矽社祀祁秉秈空穹竺糾罔羌羋者肺肥肢肱股肫肩肴肪肯臥臾舍芳芝芙芭芽芟芹花芬芥芯芸芣芰芾芷虎虱初表軋迎返近邵邸邱邶采金長門阜陀阿阻附"], +["ab40","陂隹雨青非亟亭亮信侵侯便俠俑俏保促侶俘俟俊俗侮俐俄係俚俎俞侷兗冒冑冠剎剃削前剌剋則勇勉勃勁匍南卻厚叛咬哀咨哎哉咸咦咳哇哂咽咪品"], +["aba1","哄哈咯咫咱咻咩咧咿囿垂型垠垣垢城垮垓奕契奏奎奐姜姘姿姣姨娃姥姪姚姦威姻孩宣宦室客宥封屎屏屍屋峙峒巷帝帥帟幽庠度建弈弭彥很待徊律徇後徉怒思怠急怎怨恍恰恨恢恆恃恬恫恪恤扁拜挖按拼拭持拮拽指拱拷"], +["ac40","拯括拾拴挑挂政故斫施既春昭映昧是星昨昱昤曷柿染柱柔某柬架枯柵柩柯柄柑枴柚查枸柏柞柳枰柙柢柝柒歪殃殆段毒毗氟泉洋洲洪流津洌洱洞洗"], +["aca1","活洽派洶洛泵洹洧洸洩洮洵洎洫炫為炳炬炯炭炸炮炤爰牲牯牴狩狠狡玷珊玻玲珍珀玳甚甭畏界畎畋疫疤疥疢疣癸皆皇皈盈盆盃盅省盹相眉看盾盼眇矜砂研砌砍祆祉祈祇禹禺科秒秋穿突竿竽籽紂紅紀紉紇約紆缸美羿耄"], +["ad40","耐耍耑耶胖胥胚胃胄背胡胛胎胞胤胝致舢苧范茅苣苛苦茄若茂茉苒苗英茁苜苔苑苞苓苟苯茆虐虹虻虺衍衫要觔計訂訃貞負赴赳趴軍軌述迦迢迪迥"], +["ada1","迭迫迤迨郊郎郁郃酋酊重閂限陋陌降面革韋韭音頁風飛食首香乘亳倌倍倣俯倦倥俸倩倖倆值借倚倒們俺倀倔倨俱倡個候倘俳修倭倪俾倫倉兼冤冥冢凍凌准凋剖剜剔剛剝匪卿原厝叟哨唐唁唷哼哥哲唆哺唔哩哭員唉哮哪"], +["ae40","哦唧唇哽唏圃圄埂埔埋埃堉夏套奘奚娑娘娜娟娛娓姬娠娣娩娥娌娉孫屘宰害家宴宮宵容宸射屑展屐峭峽峻峪峨峰島崁峴差席師庫庭座弱徒徑徐恙"], +["aea1","恣恥恐恕恭恩息悄悟悚悍悔悌悅悖扇拳挈拿捎挾振捕捂捆捏捉挺捐挽挪挫挨捍捌效敉料旁旅時晉晏晃晒晌晅晁書朔朕朗校核案框桓根桂桔栩梳栗桌桑栽柴桐桀格桃株桅栓栘桁殊殉殷氣氧氨氦氤泰浪涕消涇浦浸海浙涓"], +["af40","浬涉浮浚浴浩涌涊浹涅浥涔烊烘烤烙烈烏爹特狼狹狽狸狷玆班琉珮珠珪珞畔畝畜畚留疾病症疲疳疽疼疹痂疸皋皰益盍盎眩真眠眨矩砰砧砸砝破砷"], +["afa1","砥砭砠砟砲祕祐祠祟祖神祝祗祚秤秣秧租秦秩秘窄窈站笆笑粉紡紗紋紊素索純紐紕級紜納紙紛缺罟羔翅翁耆耘耕耙耗耽耿胱脂胰脅胭胴脆胸胳脈能脊胼胯臭臬舀舐航舫舨般芻茫荒荔荊茸荐草茵茴荏茲茹茶茗荀茱茨荃"], +["b040","虔蚊蚪蚓蚤蚩蚌蚣蚜衰衷袁袂衽衹記訐討訌訕訊託訓訖訏訑豈豺豹財貢起躬軒軔軏辱送逆迷退迺迴逃追逅迸邕郡郝郢酒配酌釘針釗釜釙閃院陣陡"], +["b0a1","陛陝除陘陞隻飢馬骨高鬥鬲鬼乾偺偽停假偃偌做偉健偶偎偕偵側偷偏倏偯偭兜冕凰剪副勒務勘動匐匏匙匿區匾參曼商啪啦啄啞啡啃啊唱啖問啕唯啤唸售啜唬啣唳啁啗圈國圉域堅堊堆埠埤基堂堵執培夠奢娶婁婉婦婪婀"], +["b140","娼婢婚婆婊孰寇寅寄寂宿密尉專將屠屜屝崇崆崎崛崖崢崑崩崔崙崤崧崗巢常帶帳帷康庸庶庵庾張強彗彬彩彫得徙從徘御徠徜恿患悉悠您惋悴惦悽"], +["b1a1","情悻悵惜悼惘惕惆惟悸惚惇戚戛扈掠控捲掖探接捷捧掘措捱掩掉掃掛捫推掄授掙採掬排掏掀捻捩捨捺敝敖救教敗啟敏敘敕敔斜斛斬族旋旌旎晝晚晤晨晦晞曹勗望梁梯梢梓梵桿桶梱梧梗械梃棄梭梆梅梔條梨梟梡梂欲殺"], +["b240","毫毬氫涎涼淳淙液淡淌淤添淺清淇淋涯淑涮淞淹涸混淵淅淒渚涵淚淫淘淪深淮淨淆淄涪淬涿淦烹焉焊烽烯爽牽犁猜猛猖猓猙率琅琊球理現琍瓠瓶"], +["b2a1","瓷甜產略畦畢異疏痔痕疵痊痍皎盔盒盛眷眾眼眶眸眺硫硃硎祥票祭移窒窕笠笨笛第符笙笞笮粒粗粕絆絃統紮紹紼絀細紳組累終紲紱缽羞羚翌翎習耜聊聆脯脖脣脫脩脰脤舂舵舷舶船莎莞莘荸莢莖莽莫莒莊莓莉莠荷荻荼"], +["b340","莆莧處彪蛇蛀蚶蛄蚵蛆蛋蚱蚯蛉術袞袈被袒袖袍袋覓規訪訝訣訥許設訟訛訢豉豚販責貫貨貪貧赧赦趾趺軛軟這逍通逗連速逝逐逕逞造透逢逖逛途"], +["b3a1","部郭都酗野釵釦釣釧釭釩閉陪陵陳陸陰陴陶陷陬雀雪雩章竟頂頃魚鳥鹵鹿麥麻傢傍傅備傑傀傖傘傚最凱割剴創剩勞勝勛博厥啻喀喧啼喊喝喘喂喜喪喔喇喋喃喳單喟唾喲喚喻喬喱啾喉喫喙圍堯堪場堤堰報堡堝堠壹壺奠"], +["b440","婷媚婿媒媛媧孳孱寒富寓寐尊尋就嵌嵐崴嵇巽幅帽幀幃幾廊廁廂廄弼彭復循徨惑惡悲悶惠愜愣惺愕惰惻惴慨惱愎惶愉愀愒戟扉掣掌描揀揩揉揆揍"], +["b4a1","插揣提握揖揭揮捶援揪換摒揚揹敞敦敢散斑斐斯普晰晴晶景暑智晾晷曾替期朝棺棕棠棘棗椅棟棵森棧棹棒棲棣棋棍植椒椎棉棚楮棻款欺欽殘殖殼毯氮氯氬港游湔渡渲湧湊渠渥渣減湛湘渤湖湮渭渦湯渴湍渺測湃渝渾滋"], +["b540","溉渙湎湣湄湲湩湟焙焚焦焰無然煮焜牌犄犀猶猥猴猩琺琪琳琢琥琵琶琴琯琛琦琨甥甦畫番痢痛痣痙痘痞痠登發皖皓皴盜睏短硝硬硯稍稈程稅稀窘"], +["b5a1","窗窖童竣等策筆筐筒答筍筋筏筑粟粥絞結絨絕紫絮絲絡給絢絰絳善翔翕耋聒肅腕腔腋腑腎脹腆脾腌腓腴舒舜菩萃菸萍菠菅萋菁華菱菴著萊菰萌菌菽菲菊萸萎萄菜萇菔菟虛蛟蛙蛭蛔蛛蛤蛐蛞街裁裂袱覃視註詠評詞証詁"], +["b640","詔詛詐詆訴診訶詖象貂貯貼貳貽賁費賀貴買貶貿貸越超趁跎距跋跚跑跌跛跆軻軸軼辜逮逵週逸進逶鄂郵鄉郾酣酥量鈔鈕鈣鈉鈞鈍鈐鈇鈑閔閏開閑"], +["b6a1","間閒閎隊階隋陽隅隆隍陲隄雁雅雄集雇雯雲韌項順須飧飪飯飩飲飭馮馭黃黍黑亂傭債傲傳僅傾催傷傻傯僇剿剷剽募勦勤勢勣匯嗟嗨嗓嗦嗎嗜嗇嗑嗣嗤嗯嗚嗡嗅嗆嗥嗉園圓塞塑塘塗塚塔填塌塭塊塢塒塋奧嫁嫉嫌媾媽媼"], +["b740","媳嫂媲嵩嵯幌幹廉廈弒彙徬微愚意慈感想愛惹愁愈慎慌慄慍愾愴愧愍愆愷戡戢搓搾搞搪搭搽搬搏搜搔損搶搖搗搆敬斟新暗暉暇暈暖暄暘暍會榔業"], +["b7a1","楚楷楠楔極椰概楊楨楫楞楓楹榆楝楣楛歇歲毀殿毓毽溢溯滓溶滂源溝滇滅溥溘溼溺溫滑準溜滄滔溪溧溴煎煙煩煤煉照煜煬煦煌煥煞煆煨煖爺牒猷獅猿猾瑯瑚瑕瑟瑞瑁琿瑙瑛瑜當畸瘀痰瘁痲痱痺痿痴痳盞盟睛睫睦睞督"], +["b840","睹睪睬睜睥睨睢矮碎碰碗碘碌碉硼碑碓硿祺祿禁萬禽稜稚稠稔稟稞窟窠筷節筠筮筧粱粳粵經絹綑綁綏絛置罩罪署義羨群聖聘肆肄腱腰腸腥腮腳腫"], +["b8a1","腹腺腦舅艇蒂葷落萱葵葦葫葉葬葛萼萵葡董葩葭葆虞虜號蛹蜓蜈蜇蜀蛾蛻蜂蜃蜆蜊衙裟裔裙補裘裝裡裊裕裒覜解詫該詳試詩詰誇詼詣誠話誅詭詢詮詬詹詻訾詨豢貊貉賊資賈賄貲賃賂賅跡跟跨路跳跺跪跤跦躲較載軾輊"], +["b940","辟農運遊道遂達逼違遐遇遏過遍遑逾遁鄒鄗酬酪酩釉鈷鉗鈸鈽鉀鈾鉛鉋鉤鉑鈴鉉鉍鉅鈹鈿鉚閘隘隔隕雍雋雉雊雷電雹零靖靴靶預頑頓頊頒頌飼飴"], +["b9a1","飽飾馳馱馴髡鳩麂鼎鼓鼠僧僮僥僖僭僚僕像僑僱僎僩兢凳劃劂匱厭嗾嘀嘛嘗嗽嘔嘆嘉嘍嘎嗷嘖嘟嘈嘐嗶團圖塵塾境墓墊塹墅塽壽夥夢夤奪奩嫡嫦嫩嫗嫖嫘嫣孵寞寧寡寥實寨寢寤察對屢嶄嶇幛幣幕幗幔廓廖弊彆彰徹慇"], +["ba40","愿態慷慢慣慟慚慘慵截撇摘摔撤摸摟摺摑摧搴摭摻敲斡旗旖暢暨暝榜榨榕槁榮槓構榛榷榻榫榴槐槍榭槌榦槃榣歉歌氳漳演滾漓滴漩漾漠漬漏漂漢"], +["baa1","滿滯漆漱漸漲漣漕漫漯澈漪滬漁滲滌滷熔熙煽熊熄熒爾犒犖獄獐瑤瑣瑪瑰瑭甄疑瘧瘍瘋瘉瘓盡監瞄睽睿睡磁碟碧碳碩碣禎福禍種稱窪窩竭端管箕箋筵算箝箔箏箸箇箄粹粽精綻綰綜綽綾綠緊綴網綱綺綢綿綵綸維緒緇綬"], +["bb40","罰翠翡翟聞聚肇腐膀膏膈膊腿膂臧臺與舔舞艋蓉蒿蓆蓄蒙蒞蒲蒜蓋蒸蓀蓓蒐蒼蓑蓊蜿蜜蜻蜢蜥蜴蜘蝕蜷蜩裳褂裴裹裸製裨褚裯誦誌語誣認誡誓誤"], +["bba1","說誥誨誘誑誚誧豪貍貌賓賑賒赫趙趕跼輔輒輕輓辣遠遘遜遣遙遞遢遝遛鄙鄘鄞酵酸酷酴鉸銀銅銘銖鉻銓銜銨鉼銑閡閨閩閣閥閤隙障際雌雒需靼鞅韶頗領颯颱餃餅餌餉駁骯骰髦魁魂鳴鳶鳳麼鼻齊億儀僻僵價儂儈儉儅凜"], +["bc40","劇劈劉劍劊勰厲嘮嘻嘹嘲嘿嘴嘩噓噎噗噴嘶嘯嘰墀墟增墳墜墮墩墦奭嬉嫻嬋嫵嬌嬈寮寬審寫層履嶝嶔幢幟幡廢廚廟廝廣廠彈影德徵慶慧慮慝慕憂"], +["bca1","慼慰慫慾憧憐憫憎憬憚憤憔憮戮摩摯摹撞撲撈撐撰撥撓撕撩撒撮播撫撚撬撙撢撳敵敷數暮暫暴暱樣樟槨樁樞標槽模樓樊槳樂樅槭樑歐歎殤毅毆漿潼澄潑潦潔澆潭潛潸潮澎潺潰潤澗潘滕潯潠潟熟熬熱熨牖犛獎獗瑩璋璃"], +["bd40","瑾璀畿瘠瘩瘟瘤瘦瘡瘢皚皺盤瞎瞇瞌瞑瞋磋磅確磊碾磕碼磐稿稼穀稽稷稻窯窮箭箱範箴篆篇篁箠篌糊締練緯緻緘緬緝編緣線緞緩綞緙緲緹罵罷羯"], +["bda1","翩耦膛膜膝膠膚膘蔗蔽蔚蓮蔬蔭蔓蔑蔣蔡蔔蓬蔥蓿蔆螂蝴蝶蝠蝦蝸蝨蝙蝗蝌蝓衛衝褐複褒褓褕褊誼諒談諄誕請諸課諉諂調誰論諍誶誹諛豌豎豬賠賞賦賤賬賭賢賣賜質賡赭趟趣踫踐踝踢踏踩踟踡踞躺輝輛輟輩輦輪輜輞"], +["be40","輥適遮遨遭遷鄰鄭鄧鄱醇醉醋醃鋅銻銷鋪銬鋤鋁銳銼鋒鋇鋰銲閭閱霄霆震霉靠鞍鞋鞏頡頫頜颳養餓餒餘駝駐駟駛駑駕駒駙骷髮髯鬧魅魄魷魯鴆鴉"], +["bea1","鴃麩麾黎墨齒儒儘儔儐儕冀冪凝劑劓勳噙噫噹噩噤噸噪器噥噱噯噬噢噶壁墾壇壅奮嬝嬴學寰導彊憲憑憩憊懍憶憾懊懈戰擅擁擋撻撼據擄擇擂操撿擒擔撾整曆曉暹曄曇暸樽樸樺橙橫橘樹橄橢橡橋橇樵機橈歙歷氅濂澱澡"], +["bf40","濃澤濁澧澳激澹澶澦澠澴熾燉燐燒燈燕熹燎燙燜燃燄獨璜璣璘璟璞瓢甌甍瘴瘸瘺盧盥瞠瞞瞟瞥磨磚磬磧禦積穎穆穌穋窺篙簑築篤篛篡篩篦糕糖縊"], +["bfa1","縑縈縛縣縞縝縉縐罹羲翰翱翮耨膳膩膨臻興艘艙蕊蕙蕈蕨蕩蕃蕉蕭蕪蕞螃螟螞螢融衡褪褲褥褫褡親覦諦諺諫諱謀諜諧諮諾謁謂諷諭諳諶諼豫豭貓賴蹄踱踴蹂踹踵輻輯輸輳辨辦遵遴選遲遼遺鄴醒錠錶鋸錳錯錢鋼錫錄錚"], +["c040","錐錦錡錕錮錙閻隧隨險雕霎霑霖霍霓霏靛靜靦鞘頰頸頻頷頭頹頤餐館餞餛餡餚駭駢駱骸骼髻髭鬨鮑鴕鴣鴦鴨鴒鴛默黔龍龜優償儡儲勵嚎嚀嚐嚅嚇"], +["c0a1","嚏壕壓壑壎嬰嬪嬤孺尷屨嶼嶺嶽嶸幫彌徽應懂懇懦懋戲戴擎擊擘擠擰擦擬擱擢擭斂斃曙曖檀檔檄檢檜櫛檣橾檗檐檠歜殮毚氈濘濱濟濠濛濤濫濯澀濬濡濩濕濮濰燧營燮燦燥燭燬燴燠爵牆獰獲璩環璦璨癆療癌盪瞳瞪瞰瞬"], +["c140","瞧瞭矯磷磺磴磯礁禧禪穗窿簇簍篾篷簌篠糠糜糞糢糟糙糝縮績繆縷縲繃縫總縱繅繁縴縹繈縵縿縯罄翳翼聱聲聰聯聳臆臃膺臂臀膿膽臉膾臨舉艱薪"], +["c1a1","薄蕾薜薑薔薯薛薇薨薊虧蟀蟑螳蟒蟆螫螻螺蟈蟋褻褶襄褸褽覬謎謗謙講謊謠謝謄謐豁谿豳賺賽購賸賻趨蹉蹋蹈蹊轄輾轂轅輿避遽還邁邂邀鄹醣醞醜鍍鎂錨鍵鍊鍥鍋錘鍾鍬鍛鍰鍚鍔闊闋闌闈闆隱隸雖霜霞鞠韓顆颶餵騁"], +["c240","駿鮮鮫鮪鮭鴻鴿麋黏點黜黝黛鼾齋叢嚕嚮壙壘嬸彝懣戳擴擲擾攆擺擻擷斷曜朦檳檬櫃檻檸櫂檮檯歟歸殯瀉瀋濾瀆濺瀑瀏燻燼燾燸獷獵璧璿甕癖癘"], +["c2a1","癒瞽瞿瞻瞼礎禮穡穢穠竄竅簫簧簪簞簣簡糧織繕繞繚繡繒繙罈翹翻職聶臍臏舊藏薩藍藐藉薰薺薹薦蟯蟬蟲蟠覆覲觴謨謹謬謫豐贅蹙蹣蹦蹤蹟蹕軀轉轍邇邃邈醫醬釐鎔鎊鎖鎢鎳鎮鎬鎰鎘鎚鎗闔闖闐闕離雜雙雛雞霤鞣鞦"], +["c340","鞭韹額顏題顎顓颺餾餿餽餮馥騎髁鬃鬆魏魎魍鯊鯉鯽鯈鯀鵑鵝鵠黠鼕鼬儳嚥壞壟壢寵龐廬懲懷懶懵攀攏曠曝櫥櫝櫚櫓瀛瀟瀨瀚瀝瀕瀘爆爍牘犢獸"], +["c3a1","獺璽瓊瓣疇疆癟癡矇礙禱穫穩簾簿簸簽簷籀繫繭繹繩繪羅繳羶羹羸臘藩藝藪藕藤藥藷蟻蠅蠍蟹蟾襠襟襖襞譁譜識證譚譎譏譆譙贈贊蹼蹲躇蹶蹬蹺蹴轔轎辭邊邋醱醮鏡鏑鏟鏃鏈鏜鏝鏖鏢鏍鏘鏤鏗鏨關隴難霪霧靡韜韻類"], +["c440","願顛颼饅饉騖騙鬍鯨鯧鯖鯛鶉鵡鵲鵪鵬麒麗麓麴勸嚨嚷嚶嚴嚼壤孀孃孽寶巉懸懺攘攔攙曦朧櫬瀾瀰瀲爐獻瓏癢癥礦礪礬礫竇競籌籃籍糯糰辮繽繼"], +["c4a1","纂罌耀臚艦藻藹蘑藺蘆蘋蘇蘊蠔蠕襤覺觸議譬警譯譟譫贏贍躉躁躅躂醴釋鐘鐃鏽闡霰飄饒饑馨騫騰騷騵鰓鰍鹹麵黨鼯齟齣齡儷儸囁囀囂夔屬巍懼懾攝攜斕曩櫻欄櫺殲灌爛犧瓖瓔癩矓籐纏續羼蘗蘭蘚蠣蠢蠡蠟襪襬覽譴"], +["c540","護譽贓躊躍躋轟辯醺鐮鐳鐵鐺鐸鐲鐫闢霸霹露響顧顥饗驅驃驀騾髏魔魑鰭鰥鶯鶴鷂鶸麝黯鼙齜齦齧儼儻囈囊囉孿巔巒彎懿攤權歡灑灘玀瓤疊癮癬"], +["c5a1","禳籠籟聾聽臟襲襯觼讀贖贗躑躓轡酈鑄鑑鑒霽霾韃韁顫饕驕驍髒鬚鱉鰱鰾鰻鷓鷗鼴齬齪龔囌巖戀攣攫攪曬欐瓚竊籤籣籥纓纖纔臢蘸蘿蠱變邐邏鑣鑠鑤靨顯饜驚驛驗髓體髑鱔鱗鱖鷥麟黴囑壩攬灞癱癲矗罐羈蠶蠹衢讓讒"], +["c640","讖艷贛釀鑪靂靈靄韆顰驟鬢魘鱟鷹鷺鹼鹽鼇齷齲廳欖灣籬籮蠻觀躡釁鑲鑰顱饞髖鬣黌灤矚讚鑷韉驢驥纜讜躪釅鑽鑾鑼鱷鱸黷豔鑿鸚爨驪鬱鸛鸞籲"], +["c940","乂乜凵匚厂万丌乇亍囗兀屮彳丏冇与丮亓仂仉仈冘勼卬厹圠夃夬尐巿旡殳毌气爿丱丼仨仜仩仡仝仚刌匜卌圢圣夗夯宁宄尒尻屴屳帄庀庂忉戉扐氕"], +["c9a1","氶汃氿氻犮犰玊禸肊阞伎优伬仵伔仱伀价伈伝伂伅伢伓伄仴伒冱刓刉刐劦匢匟卍厊吇囡囟圮圪圴夼妀奼妅奻奾奷奿孖尕尥屼屺屻屾巟幵庄异弚彴忕忔忏扜扞扤扡扦扢扙扠扚扥旯旮朾朹朸朻机朿朼朳氘汆汒汜汏汊汔汋"], +["ca40","汌灱牞犴犵玎甪癿穵网艸艼芀艽艿虍襾邙邗邘邛邔阢阤阠阣佖伻佢佉体佤伾佧佒佟佁佘伭伳伿佡冏冹刜刞刡劭劮匉卣卲厎厏吰吷吪呔呅吙吜吥吘"], +["caa1","吽呏呁吨吤呇囮囧囥坁坅坌坉坋坒夆奀妦妘妠妗妎妢妐妏妧妡宎宒尨尪岍岏岈岋岉岒岊岆岓岕巠帊帎庋庉庌庈庍弅弝彸彶忒忑忐忭忨忮忳忡忤忣忺忯忷忻怀忴戺抃抌抎抏抔抇扱扻扺扰抁抈扷扽扲扴攷旰旴旳旲旵杅杇"], +["cb40","杙杕杌杈杝杍杚杋毐氙氚汸汧汫沄沋沏汱汯汩沚汭沇沕沜汦汳汥汻沎灴灺牣犿犽狃狆狁犺狅玕玗玓玔玒町甹疔疕皁礽耴肕肙肐肒肜芐芏芅芎芑芓"], +["cba1","芊芃芄豸迉辿邟邡邥邞邧邠阰阨阯阭丳侘佼侅佽侀侇佶佴侉侄佷佌侗佪侚佹侁佸侐侜侔侞侒侂侕佫佮冞冼冾刵刲刳剆刱劼匊匋匼厒厔咇呿咁咑咂咈呫呺呾呥呬呴呦咍呯呡呠咘呣呧呤囷囹坯坲坭坫坱坰坶垀坵坻坳坴坢"], +["cc40","坨坽夌奅妵妺姏姎妲姌姁妶妼姃姖妱妽姀姈妴姇孢孥宓宕屄屇岮岤岠岵岯岨岬岟岣岭岢岪岧岝岥岶岰岦帗帔帙弨弢弣弤彔徂彾彽忞忥怭怦怙怲怋"], +["cca1","怴怊怗怳怚怞怬怢怍怐怮怓怑怌怉怜戔戽抭抴拑抾抪抶拊抮抳抯抻抩抰抸攽斨斻昉旼昄昒昈旻昃昋昍昅旽昑昐曶朊枅杬枎枒杶杻枘枆构杴枍枌杺枟枑枙枃杽极杸杹枔欥殀歾毞氝沓泬泫泮泙沶泔沭泧沷泐泂沺泃泆泭泲"], +["cd40","泒泝沴沊沝沀泞泀洰泍泇沰泹泏泩泑炔炘炅炓炆炄炑炖炂炚炃牪狖狋狘狉狜狒狔狚狌狑玤玡玭玦玢玠玬玝瓝瓨甿畀甾疌疘皯盳盱盰盵矸矼矹矻矺"], +["cda1","矷祂礿秅穸穻竻籵糽耵肏肮肣肸肵肭舠芠苀芫芚芘芛芵芧芮芼芞芺芴芨芡芩苂芤苃芶芢虰虯虭虮豖迒迋迓迍迖迕迗邲邴邯邳邰阹阽阼阺陃俍俅俓侲俉俋俁俔俜俙侻侳俛俇俖侺俀侹俬剄剉勀勂匽卼厗厖厙厘咺咡咭咥哏"], +["ce40","哃茍咷咮哖咶哅哆咠呰咼咢咾呲哞咰垵垞垟垤垌垗垝垛垔垘垏垙垥垚垕壴复奓姡姞姮娀姱姝姺姽姼姶姤姲姷姛姩姳姵姠姾姴姭宨屌峐峘峌峗峋峛"], +["cea1","峞峚峉峇峊峖峓峔峏峈峆峎峟峸巹帡帢帣帠帤庰庤庢庛庣庥弇弮彖徆怷怹恔恲恞恅恓恇恉恛恌恀恂恟怤恄恘恦恮扂扃拏挍挋拵挎挃拫拹挏挌拸拶挀挓挔拺挕拻拰敁敃斪斿昶昡昲昵昜昦昢昳昫昺昝昴昹昮朏朐柁柲柈枺"], +["cf40","柜枻柸柘柀枷柅柫柤柟枵柍枳柷柶柮柣柂枹柎柧柰枲柼柆柭柌枮柦柛柺柉柊柃柪柋欨殂殄殶毖毘毠氠氡洨洴洭洟洼洿洒洊泚洳洄洙洺洚洑洀洝浂"], +["cfa1","洁洘洷洃洏浀洇洠洬洈洢洉洐炷炟炾炱炰炡炴炵炩牁牉牊牬牰牳牮狊狤狨狫狟狪狦狣玅珌珂珈珅玹玶玵玴珫玿珇玾珃珆玸珋瓬瓮甮畇畈疧疪癹盄眈眃眄眅眊盷盻盺矧矨砆砑砒砅砐砏砎砉砃砓祊祌祋祅祄秕种秏秖秎窀"], +["d040","穾竑笀笁籺籸籹籿粀粁紃紈紁罘羑羍羾耇耎耏耔耷胘胇胠胑胈胂胐胅胣胙胜胊胕胉胏胗胦胍臿舡芔苙苾苹茇苨茀苕茺苫苖苴苬苡苲苵茌苻苶苰苪"], +["d0a1","苤苠苺苳苭虷虴虼虳衁衎衧衪衩觓訄訇赲迣迡迮迠郱邽邿郕郅邾郇郋郈釔釓陔陏陑陓陊陎倞倅倇倓倢倰倛俵俴倳倷倬俶俷倗倜倠倧倵倯倱倎党冔冓凊凄凅凈凎剡剚剒剞剟剕剢勍匎厞唦哢唗唒哧哳哤唚哿唄唈哫唑唅哱"], +["d140","唊哻哷哸哠唎唃唋圁圂埌堲埕埒垺埆垽垼垸垶垿埇埐垹埁夎奊娙娖娭娮娕娏娗娊娞娳孬宧宭宬尃屖屔峬峿峮峱峷崀峹帩帨庨庮庪庬弳弰彧恝恚恧"], +["d1a1","恁悢悈悀悒悁悝悃悕悛悗悇悜悎戙扆拲挐捖挬捄捅挶捃揤挹捋捊挼挩捁挴捘捔捙挭捇挳捚捑挸捗捀捈敊敆旆旃旄旂晊晟晇晑朒朓栟栚桉栲栳栻桋桏栖栱栜栵栫栭栯桎桄栴栝栒栔栦栨栮桍栺栥栠欬欯欭欱欴歭肂殈毦毤"], +["d240","毨毣毢毧氥浺浣浤浶洍浡涒浘浢浭浯涑涍淯浿涆浞浧浠涗浰浼浟涂涘洯浨涋浾涀涄洖涃浻浽浵涐烜烓烑烝烋缹烢烗烒烞烠烔烍烅烆烇烚烎烡牂牸"], +["d2a1","牷牶猀狺狴狾狶狳狻猁珓珙珥珖玼珧珣珩珜珒珛珔珝珚珗珘珨瓞瓟瓴瓵甡畛畟疰痁疻痄痀疿疶疺皊盉眝眛眐眓眒眣眑眕眙眚眢眧砣砬砢砵砯砨砮砫砡砩砳砪砱祔祛祏祜祓祒祑秫秬秠秮秭秪秜秞秝窆窉窅窋窌窊窇竘笐"], +["d340","笄笓笅笏笈笊笎笉笒粄粑粊粌粈粍粅紞紝紑紎紘紖紓紟紒紏紌罜罡罞罠罝罛羖羒翃翂翀耖耾耹胺胲胹胵脁胻脀舁舯舥茳茭荄茙荑茥荖茿荁茦茜茢"], +["d3a1","荂荎茛茪茈茼荍茖茤茠茷茯茩荇荅荌荓茞茬荋茧荈虓虒蚢蚨蚖蚍蚑蚞蚇蚗蚆蚋蚚蚅蚥蚙蚡蚧蚕蚘蚎蚝蚐蚔衃衄衭衵衶衲袀衱衿衯袃衾衴衼訒豇豗豻貤貣赶赸趵趷趶軑軓迾迵适迿迻逄迼迶郖郠郙郚郣郟郥郘郛郗郜郤酐"], +["d440","酎酏釕釢釚陜陟隼飣髟鬯乿偰偪偡偞偠偓偋偝偲偈偍偁偛偊偢倕偅偟偩偫偣偤偆偀偮偳偗偑凐剫剭剬剮勖勓匭厜啵啶唼啍啐唴唪啑啢唶唵唰啒啅"], +["d4a1","唌唲啥啎唹啈唭唻啀啋圊圇埻堔埢埶埜埴堀埭埽堈埸堋埳埏堇埮埣埲埥埬埡堎埼堐埧堁堌埱埩埰堍堄奜婠婘婕婧婞娸娵婭婐婟婥婬婓婤婗婃婝婒婄婛婈媎娾婍娹婌婰婩婇婑婖婂婜孲孮寁寀屙崞崋崝崚崠崌崨崍崦崥崏"], +["d540","崰崒崣崟崮帾帴庱庴庹庲庳弶弸徛徖徟悊悐悆悾悰悺惓惔惏惤惙惝惈悱惛悷惊悿惃惍惀挲捥掊掂捽掽掞掭掝掗掫掎捯掇掐据掯捵掜捭掮捼掤挻掟"], +["d5a1","捸掅掁掑掍捰敓旍晥晡晛晙晜晢朘桹梇梐梜桭桮梮梫楖桯梣梬梩桵桴梲梏桷梒桼桫桲梪梀桱桾梛梖梋梠梉梤桸桻梑梌梊桽欶欳欷欸殑殏殍殎殌氪淀涫涴涳湴涬淩淢涷淶淔渀淈淠淟淖涾淥淜淝淛淴淊涽淭淰涺淕淂淏淉"], +["d640","淐淲淓淽淗淍淣涻烺焍烷焗烴焌烰焄烳焐烼烿焆焓焀烸烶焋焂焎牾牻牼牿猝猗猇猑猘猊猈狿猏猞玈珶珸珵琄琁珽琇琀珺珼珿琌琋珴琈畤畣痎痒痏"], +["d6a1","痋痌痑痐皏皉盓眹眯眭眱眲眴眳眽眥眻眵硈硒硉硍硊硌砦硅硐祤祧祩祪祣祫祡离秺秸秶秷窏窔窐笵筇笴笥笰笢笤笳笘笪笝笱笫笭笯笲笸笚笣粔粘粖粣紵紽紸紶紺絅紬紩絁絇紾紿絊紻紨罣羕羜羝羛翊翋翍翐翑翇翏翉耟"], +["d740","耞耛聇聃聈脘脥脙脛脭脟脬脞脡脕脧脝脢舑舸舳舺舴舲艴莐莣莨莍荺荳莤荴莏莁莕莙荵莔莩荽莃莌莝莛莪莋荾莥莯莈莗莰荿莦莇莮荶莚虙虖蚿蚷"], +["d7a1","蛂蛁蛅蚺蚰蛈蚹蚳蚸蛌蚴蚻蚼蛃蚽蚾衒袉袕袨袢袪袚袑袡袟袘袧袙袛袗袤袬袌袓袎覂觖觙觕訰訧訬訞谹谻豜豝豽貥赽赻赹趼跂趹趿跁軘軞軝軜軗軠軡逤逋逑逜逌逡郯郪郰郴郲郳郔郫郬郩酖酘酚酓酕釬釴釱釳釸釤釹釪"], +["d840","釫釷釨釮镺閆閈陼陭陫陱陯隿靪頄飥馗傛傕傔傞傋傣傃傌傎傝偨傜傒傂傇兟凔匒匑厤厧喑喨喥喭啷噅喢喓喈喏喵喁喣喒喤啽喌喦啿喕喡喎圌堩堷"], +["d8a1","堙堞堧堣堨埵塈堥堜堛堳堿堶堮堹堸堭堬堻奡媯媔媟婺媢媞婸媦婼媥媬媕媮娷媄媊媗媃媋媩婻婽媌媜媏媓媝寪寍寋寔寑寊寎尌尰崷嵃嵫嵁嵋崿崵嵑嵎嵕崳崺嵒崽崱嵙嵂崹嵉崸崼崲崶嵀嵅幄幁彘徦徥徫惉悹惌惢惎惄愔"], +["d940","惲愊愖愅惵愓惸惼惾惁愃愘愝愐惿愄愋扊掔掱掰揎揥揨揯揃撝揳揊揠揶揕揲揵摡揟掾揝揜揄揘揓揂揇揌揋揈揰揗揙攲敧敪敤敜敨敥斌斝斞斮旐旒"], +["d9a1","晼晬晻暀晱晹晪晲朁椌棓椄棜椪棬棪棱椏棖棷棫棤棶椓椐棳棡椇棌椈楰梴椑棯棆椔棸棐棽棼棨椋椊椗棎棈棝棞棦棴棑椆棔棩椕椥棇欹欻欿欼殔殗殙殕殽毰毲毳氰淼湆湇渟湉溈渼渽湅湢渫渿湁湝湳渜渳湋湀湑渻渃渮湞"], +["da40","湨湜湡渱渨湠湱湫渹渢渰湓湥渧湸湤湷湕湹湒湦渵渶湚焠焞焯烻焮焱焣焥焢焲焟焨焺焛牋牚犈犉犆犅犋猒猋猰猢猱猳猧猲猭猦猣猵猌琮琬琰琫琖"], +["daa1","琚琡琭琱琤琣琝琩琠琲瓻甯畯畬痧痚痡痦痝痟痤痗皕皒盚睆睇睄睍睅睊睎睋睌矞矬硠硤硥硜硭硱硪确硰硩硨硞硢祴祳祲祰稂稊稃稌稄窙竦竤筊笻筄筈筌筎筀筘筅粢粞粨粡絘絯絣絓絖絧絪絏絭絜絫絒絔絩絑絟絎缾缿罥"], +["db40","罦羢羠羡翗聑聏聐胾胔腃腊腒腏腇脽腍脺臦臮臷臸臹舄舼舽舿艵茻菏菹萣菀菨萒菧菤菼菶萐菆菈菫菣莿萁菝菥菘菿菡菋菎菖菵菉萉萏菞萑萆菂菳"], +["dba1","菕菺菇菑菪萓菃菬菮菄菻菗菢萛菛菾蛘蛢蛦蛓蛣蛚蛪蛝蛫蛜蛬蛩蛗蛨蛑衈衖衕袺裗袹袸裀袾袶袼袷袽袲褁裉覕覘覗觝觚觛詎詍訹詙詀詗詘詄詅詒詈詑詊詌詏豟貁貀貺貾貰貹貵趄趀趉跘跓跍跇跖跜跏跕跙跈跗跅軯軷軺"], +["dc40","軹軦軮軥軵軧軨軶軫軱軬軴軩逭逴逯鄆鄬鄄郿郼鄈郹郻鄁鄀鄇鄅鄃酡酤酟酢酠鈁鈊鈥鈃鈚鈦鈏鈌鈀鈒釿釽鈆鈄鈧鈂鈜鈤鈙鈗鈅鈖镻閍閌閐隇陾隈"], +["dca1","隉隃隀雂雈雃雱雰靬靰靮頇颩飫鳦黹亃亄亶傽傿僆傮僄僊傴僈僂傰僁傺傱僋僉傶傸凗剺剸剻剼嗃嗛嗌嗐嗋嗊嗝嗀嗔嗄嗩喿嗒喍嗏嗕嗢嗖嗈嗲嗍嗙嗂圔塓塨塤塏塍塉塯塕塎塝塙塥塛堽塣塱壼嫇嫄嫋媺媸媱媵媰媿嫈媻嫆"], +["dd40","媷嫀嫊媴媶嫍媹媐寖寘寙尟尳嵱嵣嵊嵥嵲嵬嵞嵨嵧嵢巰幏幎幊幍幋廅廌廆廋廇彀徯徭惷慉慊愫慅愶愲愮慆愯慏愩慀戠酨戣戥戤揅揱揫搐搒搉搠搤"], +["dda1","搳摃搟搕搘搹搷搢搣搌搦搰搨摁搵搯搊搚摀搥搧搋揧搛搮搡搎敯斒旓暆暌暕暐暋暊暙暔晸朠楦楟椸楎楢楱椿楅楪椹楂楗楙楺楈楉椵楬椳椽楥棰楸椴楩楀楯楄楶楘楁楴楌椻楋椷楜楏楑椲楒椯楻椼歆歅歃歂歈歁殛嗀毻毼"], +["de40","毹毷毸溛滖滈溏滀溟溓溔溠溱溹滆滒溽滁溞滉溷溰滍溦滏溲溾滃滜滘溙溒溎溍溤溡溿溳滐滊溗溮溣煇煔煒煣煠煁煝煢煲煸煪煡煂煘煃煋煰煟煐煓"], +["dea1","煄煍煚牏犍犌犑犐犎猼獂猻猺獀獊獉瑄瑊瑋瑒瑑瑗瑀瑏瑐瑎瑂瑆瑍瑔瓡瓿瓾瓽甝畹畷榃痯瘏瘃痷痾痼痹痸瘐痻痶痭痵痽皙皵盝睕睟睠睒睖睚睩睧睔睙睭矠碇碚碔碏碄碕碅碆碡碃硹碙碀碖硻祼禂祽祹稑稘稙稒稗稕稢稓"], +["df40","稛稐窣窢窞竫筦筤筭筴筩筲筥筳筱筰筡筸筶筣粲粴粯綈綆綀綍絿綅絺綎絻綃絼綌綔綄絽綒罭罫罧罨罬羦羥羧翛翜耡腤腠腷腜腩腛腢腲朡腞腶腧腯"], +["dfa1","腄腡舝艉艄艀艂艅蓱萿葖葶葹蒏蒍葥葑葀蒆葧萰葍葽葚葙葴葳葝蔇葞萷萺萴葺葃葸萲葅萩菙葋萯葂萭葟葰萹葎葌葒葯蓅蒎萻葇萶萳葨葾葄萫葠葔葮葐蜋蜄蛷蜌蛺蛖蛵蝍蛸蜎蜉蜁蛶蜍蜅裖裋裍裎裞裛裚裌裐覅覛觟觥觤"], +["e040","觡觠觢觜触詶誆詿詡訿詷誂誄詵誃誁詴詺谼豋豊豥豤豦貆貄貅賌赨赩趑趌趎趏趍趓趔趐趒跰跠跬跱跮跐跩跣跢跧跲跫跴輆軿輁輀輅輇輈輂輋遒逿"], +["e0a1","遄遉逽鄐鄍鄏鄑鄖鄔鄋鄎酮酯鉈鉒鈰鈺鉦鈳鉥鉞銃鈮鉊鉆鉭鉬鉏鉠鉧鉯鈶鉡鉰鈱鉔鉣鉐鉲鉎鉓鉌鉖鈲閟閜閞閛隒隓隑隗雎雺雽雸雵靳靷靸靲頏頍頎颬飶飹馯馲馰馵骭骫魛鳪鳭鳧麀黽僦僔僗僨僳僛僪僝僤僓僬僰僯僣僠"], +["e140","凘劀劁勩勫匰厬嘧嘕嘌嘒嗼嘏嘜嘁嘓嘂嗺嘝嘄嗿嗹墉塼墐墘墆墁塿塴墋塺墇墑墎塶墂墈塻墔墏壾奫嫜嫮嫥嫕嫪嫚嫭嫫嫳嫢嫠嫛嫬嫞嫝嫙嫨嫟孷寠"], +["e1a1","寣屣嶂嶀嵽嶆嵺嶁嵷嶊嶉嶈嵾嵼嶍嵹嵿幘幙幓廘廑廗廎廜廕廙廒廔彄彃彯徶愬愨慁慞慱慳慒慓慲慬憀慴慔慺慛慥愻慪慡慖戩戧戫搫摍摛摝摴摶摲摳摽摵摦撦摎撂摞摜摋摓摠摐摿搿摬摫摙摥摷敳斠暡暠暟朅朄朢榱榶槉"], +["e240","榠槎榖榰榬榼榑榙榎榧榍榩榾榯榿槄榽榤槔榹槊榚槏榳榓榪榡榞槙榗榐槂榵榥槆歊歍歋殞殟殠毃毄毾滎滵滱漃漥滸漷滻漮漉潎漙漚漧漘漻漒滭漊"], +["e2a1","漶潳滹滮漭潀漰漼漵滫漇漎潃漅滽滶漹漜滼漺漟漍漞漈漡熇熐熉熀熅熂熏煻熆熁熗牄牓犗犕犓獃獍獑獌瑢瑳瑱瑵瑲瑧瑮甀甂甃畽疐瘖瘈瘌瘕瘑瘊瘔皸瞁睼瞅瞂睮瞀睯睾瞃碲碪碴碭碨硾碫碞碥碠碬碢碤禘禊禋禖禕禔禓"], +["e340","禗禈禒禐稫穊稰稯稨稦窨窫窬竮箈箜箊箑箐箖箍箌箛箎箅箘劄箙箤箂粻粿粼粺綧綷緂綣綪緁緀緅綝緎緄緆緋緌綯綹綖綼綟綦綮綩綡緉罳翢翣翥翞"], +["e3a1","耤聝聜膉膆膃膇膍膌膋舕蒗蒤蒡蒟蒺蓎蓂蒬蒮蒫蒹蒴蓁蓍蒪蒚蒱蓐蒝蒧蒻蒢蒔蓇蓌蒛蒩蒯蒨蓖蒘蒶蓏蒠蓗蓔蓒蓛蒰蒑虡蜳蜣蜨蝫蝀蜮蜞蜡蜙蜛蝃蜬蝁蜾蝆蜠蜲蜪蜭蜼蜒蜺蜱蜵蝂蜦蜧蜸蜤蜚蜰蜑裷裧裱裲裺裾裮裼裶裻"], +["e440","裰裬裫覝覡覟覞觩觫觨誫誙誋誒誏誖谽豨豩賕賏賗趖踉踂跿踍跽踊踃踇踆踅跾踀踄輐輑輎輍鄣鄜鄠鄢鄟鄝鄚鄤鄡鄛酺酲酹酳銥銤鉶銛鉺銠銔銪銍"], +["e4a1","銦銚銫鉹銗鉿銣鋮銎銂銕銢鉽銈銡銊銆銌銙銧鉾銇銩銝銋鈭隞隡雿靘靽靺靾鞃鞀鞂靻鞄鞁靿韎韍頖颭颮餂餀餇馝馜駃馹馻馺駂馽駇骱髣髧鬾鬿魠魡魟鳱鳲鳵麧僿儃儰僸儆儇僶僾儋儌僽儊劋劌勱勯噈噂噌嘵噁噊噉噆噘"], +["e540","噚噀嘳嘽嘬嘾嘸嘪嘺圚墫墝墱墠墣墯墬墥墡壿嫿嫴嫽嫷嫶嬃嫸嬂嫹嬁嬇嬅嬏屧嶙嶗嶟嶒嶢嶓嶕嶠嶜嶡嶚嶞幩幝幠幜緳廛廞廡彉徲憋憃慹憱憰憢憉"], +["e5a1","憛憓憯憭憟憒憪憡憍慦憳戭摮摰撖撠撅撗撜撏撋撊撌撣撟摨撱撘敶敺敹敻斲斳暵暰暩暲暷暪暯樀樆樗槥槸樕槱槤樠槿槬槢樛樝槾樧槲槮樔槷槧橀樈槦槻樍槼槫樉樄樘樥樏槶樦樇槴樖歑殥殣殢殦氁氀毿氂潁漦潾澇濆澒"], +["e640","澍澉澌潢潏澅潚澖潶潬澂潕潲潒潐潗澔澓潝漀潡潫潽潧澐潓澋潩潿澕潣潷潪潻熲熯熛熰熠熚熩熵熝熥熞熤熡熪熜熧熳犘犚獘獒獞獟獠獝獛獡獚獙"], +["e6a1","獢璇璉璊璆璁瑽璅璈瑼瑹甈甇畾瘥瘞瘙瘝瘜瘣瘚瘨瘛皜皝皞皛瞍瞏瞉瞈磍碻磏磌磑磎磔磈磃磄磉禚禡禠禜禢禛歶稹窲窴窳箷篋箾箬篎箯箹篊箵糅糈糌糋緷緛緪緧緗緡縃緺緦緶緱緰緮緟罶羬羰羭翭翫翪翬翦翨聤聧膣膟"], +["e740","膞膕膢膙膗舖艏艓艒艐艎艑蔤蔻蔏蔀蔩蔎蔉蔍蔟蔊蔧蔜蓻蔫蓺蔈蔌蓴蔪蓲蔕蓷蓫蓳蓼蔒蓪蓩蔖蓾蔨蔝蔮蔂蓽蔞蓶蔱蔦蓧蓨蓰蓯蓹蔘蔠蔰蔋蔙蔯虢"], +["e7a1","蝖蝣蝤蝷蟡蝳蝘蝔蝛蝒蝡蝚蝑蝞蝭蝪蝐蝎蝟蝝蝯蝬蝺蝮蝜蝥蝏蝻蝵蝢蝧蝩衚褅褌褔褋褗褘褙褆褖褑褎褉覢覤覣觭觰觬諏諆誸諓諑諔諕誻諗誾諀諅諘諃誺誽諙谾豍貏賥賟賙賨賚賝賧趠趜趡趛踠踣踥踤踮踕踛踖踑踙踦踧"], +["e840","踔踒踘踓踜踗踚輬輤輘輚輠輣輖輗遳遰遯遧遫鄯鄫鄩鄪鄲鄦鄮醅醆醊醁醂醄醀鋐鋃鋄鋀鋙銶鋏鋱鋟鋘鋩鋗鋝鋌鋯鋂鋨鋊鋈鋎鋦鋍鋕鋉鋠鋞鋧鋑鋓"], +["e8a1","銵鋡鋆銴镼閬閫閮閰隤隢雓霅霈霂靚鞊鞎鞈韐韏頞頝頦頩頨頠頛頧颲餈飺餑餔餖餗餕駜駍駏駓駔駎駉駖駘駋駗駌骳髬髫髳髲髱魆魃魧魴魱魦魶魵魰魨魤魬鳼鳺鳽鳿鳷鴇鴀鳹鳻鴈鴅鴄麃黓鼏鼐儜儓儗儚儑凞匴叡噰噠噮"], +["e940","噳噦噣噭噲噞噷圜圛壈墽壉墿墺壂墼壆嬗嬙嬛嬡嬔嬓嬐嬖嬨嬚嬠嬞寯嶬嶱嶩嶧嶵嶰嶮嶪嶨嶲嶭嶯嶴幧幨幦幯廩廧廦廨廥彋徼憝憨憖懅憴懆懁懌憺"], +["e9a1","憿憸憌擗擖擐擏擉撽撉擃擛擳擙攳敿敼斢曈暾曀曊曋曏暽暻暺曌朣樴橦橉橧樲橨樾橝橭橶橛橑樨橚樻樿橁橪橤橐橏橔橯橩橠樼橞橖橕橍橎橆歕歔歖殧殪殫毈毇氄氃氆澭濋澣濇澼濎濈潞濄澽澞濊澨瀄澥澮澺澬澪濏澿澸"], +["ea40","澢濉澫濍澯澲澰燅燂熿熸燖燀燁燋燔燊燇燏熽燘熼燆燚燛犝犞獩獦獧獬獥獫獪瑿璚璠璔璒璕璡甋疀瘯瘭瘱瘽瘳瘼瘵瘲瘰皻盦瞚瞝瞡瞜瞛瞢瞣瞕瞙"], +["eaa1","瞗磝磩磥磪磞磣磛磡磢磭磟磠禤穄穈穇窶窸窵窱窷篞篣篧篝篕篥篚篨篹篔篪篢篜篫篘篟糒糔糗糐糑縒縡縗縌縟縠縓縎縜縕縚縢縋縏縖縍縔縥縤罃罻罼罺羱翯耪耩聬膱膦膮膹膵膫膰膬膴膲膷膧臲艕艖艗蕖蕅蕫蕍蕓蕡蕘"], +["eb40","蕀蕆蕤蕁蕢蕄蕑蕇蕣蔾蕛蕱蕎蕮蕵蕕蕧蕠薌蕦蕝蕔蕥蕬虣虥虤螛螏螗螓螒螈螁螖螘蝹螇螣螅螐螑螝螄螔螜螚螉褞褦褰褭褮褧褱褢褩褣褯褬褟觱諠"], +["eba1","諢諲諴諵諝謔諤諟諰諈諞諡諨諿諯諻貑貒貐賵賮賱賰賳赬赮趥趧踳踾踸蹀蹅踶踼踽蹁踰踿躽輶輮輵輲輹輷輴遶遹遻邆郺鄳鄵鄶醓醐醑醍醏錧錞錈錟錆錏鍺錸錼錛錣錒錁鍆錭錎錍鋋錝鋺錥錓鋹鋷錴錂錤鋿錩錹錵錪錔錌"], +["ec40","錋鋾錉錀鋻錖閼闍閾閹閺閶閿閵閽隩雔霋霒霐鞙鞗鞔韰韸頵頯頲餤餟餧餩馞駮駬駥駤駰駣駪駩駧骹骿骴骻髶髺髹髷鬳鮀鮅鮇魼魾魻鮂鮓鮒鮐魺鮕"], +["eca1","魽鮈鴥鴗鴠鴞鴔鴩鴝鴘鴢鴐鴙鴟麈麆麇麮麭黕黖黺鼒鼽儦儥儢儤儠儩勴嚓嚌嚍嚆嚄嚃噾嚂噿嚁壖壔壏壒嬭嬥嬲嬣嬬嬧嬦嬯嬮孻寱寲嶷幬幪徾徻懃憵憼懧懠懥懤懨懞擯擩擣擫擤擨斁斀斶旚曒檍檖檁檥檉檟檛檡檞檇檓檎"], +["ed40","檕檃檨檤檑橿檦檚檅檌檒歛殭氉濌澩濴濔濣濜濭濧濦濞濲濝濢濨燡燱燨燲燤燰燢獳獮獯璗璲璫璐璪璭璱璥璯甐甑甒甏疄癃癈癉癇皤盩瞵瞫瞲瞷瞶"], +["eda1","瞴瞱瞨矰磳磽礂磻磼磲礅磹磾礄禫禨穜穛穖穘穔穚窾竀竁簅簏篲簀篿篻簎篴簋篳簂簉簃簁篸篽簆篰篱簐簊糨縭縼繂縳顈縸縪繉繀繇縩繌縰縻縶繄縺罅罿罾罽翴翲耬膻臄臌臊臅臇膼臩艛艚艜薃薀薏薧薕薠薋薣蕻薤薚薞"], +["ee40","蕷蕼薉薡蕺蕸蕗薎薖薆薍薙薝薁薢薂薈薅蕹蕶薘薐薟虨螾螪螭蟅螰螬螹螵螼螮蟉蟃蟂蟌螷螯蟄蟊螴螶螿螸螽蟞螲褵褳褼褾襁襒褷襂覭覯覮觲觳謞"], +["eea1","謘謖謑謅謋謢謏謒謕謇謍謈謆謜謓謚豏豰豲豱豯貕貔賹赯蹎蹍蹓蹐蹌蹇轃轀邅遾鄸醚醢醛醙醟醡醝醠鎡鎃鎯鍤鍖鍇鍼鍘鍜鍶鍉鍐鍑鍠鍭鎏鍌鍪鍹鍗鍕鍒鍏鍱鍷鍻鍡鍞鍣鍧鎀鍎鍙闇闀闉闃闅閷隮隰隬霠霟霘霝霙鞚鞡鞜"], +["ef40","鞞鞝韕韔韱顁顄顊顉顅顃餥餫餬餪餳餲餯餭餱餰馘馣馡騂駺駴駷駹駸駶駻駽駾駼騃骾髾髽鬁髼魈鮚鮨鮞鮛鮦鮡鮥鮤鮆鮢鮠鮯鴳鵁鵧鴶鴮鴯鴱鴸鴰"], +["efa1","鵅鵂鵃鴾鴷鵀鴽翵鴭麊麉麍麰黈黚黻黿鼤鼣鼢齔龠儱儭儮嚘嚜嚗嚚嚝嚙奰嬼屩屪巀幭幮懘懟懭懮懱懪懰懫懖懩擿攄擽擸攁攃擼斔旛曚曛曘櫅檹檽櫡櫆檺檶檷櫇檴檭歞毉氋瀇瀌瀍瀁瀅瀔瀎濿瀀濻瀦濼濷瀊爁燿燹爃燽獶"], +["f040","璸瓀璵瓁璾璶璻瓂甔甓癜癤癙癐癓癗癚皦皽盬矂瞺磿礌礓礔礉礐礒礑禭禬穟簜簩簙簠簟簭簝簦簨簢簥簰繜繐繖繣繘繢繟繑繠繗繓羵羳翷翸聵臑臒"], +["f0a1","臐艟艞薴藆藀藃藂薳薵薽藇藄薿藋藎藈藅薱薶藒蘤薸薷薾虩蟧蟦蟢蟛蟫蟪蟥蟟蟳蟤蟔蟜蟓蟭蟘蟣螤蟗蟙蠁蟴蟨蟝襓襋襏襌襆襐襑襉謪謧謣謳謰謵譇謯謼謾謱謥謷謦謶謮謤謻謽謺豂豵貙貘貗賾贄贂贀蹜蹢蹠蹗蹖蹞蹥蹧"], +["f140","蹛蹚蹡蹝蹩蹔轆轇轈轋鄨鄺鄻鄾醨醥醧醯醪鎵鎌鎒鎷鎛鎝鎉鎧鎎鎪鎞鎦鎕鎈鎙鎟鎍鎱鎑鎲鎤鎨鎴鎣鎥闒闓闑隳雗雚巂雟雘雝霣霢霥鞬鞮鞨鞫鞤鞪"], +["f1a1","鞢鞥韗韙韖韘韺顐顑顒颸饁餼餺騏騋騉騍騄騑騊騅騇騆髀髜鬈鬄鬅鬩鬵魊魌魋鯇鯆鯃鮿鯁鮵鮸鯓鮶鯄鮹鮽鵜鵓鵏鵊鵛鵋鵙鵖鵌鵗鵒鵔鵟鵘鵚麎麌黟鼁鼀鼖鼥鼫鼪鼩鼨齌齕儴儵劖勷厴嚫嚭嚦嚧嚪嚬壚壝壛夒嬽嬾嬿巃幰"], +["f240","徿懻攇攐攍攉攌攎斄旞旝曞櫧櫠櫌櫑櫙櫋櫟櫜櫐櫫櫏櫍櫞歠殰氌瀙瀧瀠瀖瀫瀡瀢瀣瀩瀗瀤瀜瀪爌爊爇爂爅犥犦犤犣犡瓋瓅璷瓃甖癠矉矊矄矱礝礛"], +["f2a1","礡礜礗礞禰穧穨簳簼簹簬簻糬糪繶繵繸繰繷繯繺繲繴繨罋罊羃羆羷翽翾聸臗臕艤艡艣藫藱藭藙藡藨藚藗藬藲藸藘藟藣藜藑藰藦藯藞藢蠀蟺蠃蟶蟷蠉蠌蠋蠆蟼蠈蟿蠊蠂襢襚襛襗襡襜襘襝襙覈覷覶觶譐譈譊譀譓譖譔譋譕"], +["f340","譑譂譒譗豃豷豶貚贆贇贉趬趪趭趫蹭蹸蹳蹪蹯蹻軂轒轑轏轐轓辴酀鄿醰醭鏞鏇鏏鏂鏚鏐鏹鏬鏌鏙鎩鏦鏊鏔鏮鏣鏕鏄鏎鏀鏒鏧镽闚闛雡霩霫霬霨霦"], +["f3a1","鞳鞷鞶韝韞韟顜顙顝顗颿颽颻颾饈饇饃馦馧騚騕騥騝騤騛騢騠騧騣騞騜騔髂鬋鬊鬎鬌鬷鯪鯫鯠鯞鯤鯦鯢鯰鯔鯗鯬鯜鯙鯥鯕鯡鯚鵷鶁鶊鶄鶈鵱鶀鵸鶆鶋鶌鵽鵫鵴鵵鵰鵩鶅鵳鵻鶂鵯鵹鵿鶇鵨麔麑黀黼鼭齀齁齍齖齗齘匷嚲"], +["f440","嚵嚳壣孅巆巇廮廯忀忁懹攗攖攕攓旟曨曣曤櫳櫰櫪櫨櫹櫱櫮櫯瀼瀵瀯瀷瀴瀱灂瀸瀿瀺瀹灀瀻瀳灁爓爔犨獽獼璺皫皪皾盭矌矎矏矍矲礥礣礧礨礤礩"], +["f4a1","禲穮穬穭竷籉籈籊籇籅糮繻繾纁纀羺翿聹臛臙舋艨艩蘢藿蘁藾蘛蘀藶蘄蘉蘅蘌藽蠙蠐蠑蠗蠓蠖襣襦覹觷譠譪譝譨譣譥譧譭趮躆躈躄轙轖轗轕轘轚邍酃酁醷醵醲醳鐋鐓鏻鐠鐏鐔鏾鐕鐐鐨鐙鐍鏵鐀鏷鐇鐎鐖鐒鏺鐉鏸鐊鏿"], +["f540","鏼鐌鏶鐑鐆闞闠闟霮霯鞹鞻韽韾顠顢顣顟飁飂饐饎饙饌饋饓騲騴騱騬騪騶騩騮騸騭髇髊髆鬐鬒鬑鰋鰈鯷鰅鰒鯸鱀鰇鰎鰆鰗鰔鰉鶟鶙鶤鶝鶒鶘鶐鶛"], +["f5a1","鶠鶔鶜鶪鶗鶡鶚鶢鶨鶞鶣鶿鶩鶖鶦鶧麙麛麚黥黤黧黦鼰鼮齛齠齞齝齙龑儺儹劘劗囃嚽嚾孈孇巋巏廱懽攛欂櫼欃櫸欀灃灄灊灈灉灅灆爝爚爙獾甗癪矐礭礱礯籔籓糲纊纇纈纋纆纍罍羻耰臝蘘蘪蘦蘟蘣蘜蘙蘧蘮蘡蘠蘩蘞蘥"], +["f640","蠩蠝蠛蠠蠤蠜蠫衊襭襩襮襫觺譹譸譅譺譻贐贔趯躎躌轞轛轝酆酄酅醹鐿鐻鐶鐩鐽鐼鐰鐹鐪鐷鐬鑀鐱闥闤闣霵霺鞿韡顤飉飆飀饘饖騹騽驆驄驂驁騺"], +["f6a1","騿髍鬕鬗鬘鬖鬺魒鰫鰝鰜鰬鰣鰨鰩鰤鰡鶷鶶鶼鷁鷇鷊鷏鶾鷅鷃鶻鶵鷎鶹鶺鶬鷈鶱鶭鷌鶳鷍鶲鹺麜黫黮黭鼛鼘鼚鼱齎齥齤龒亹囆囅囋奱孋孌巕巑廲攡攠攦攢欋欈欉氍灕灖灗灒爞爟犩獿瓘瓕瓙瓗癭皭礵禴穰穱籗籜籙籛籚"], +["f740","糴糱纑罏羇臞艫蘴蘵蘳蘬蘲蘶蠬蠨蠦蠪蠥襱覿覾觻譾讄讂讆讅譿贕躕躔躚躒躐躖躗轠轢酇鑌鑐鑊鑋鑏鑇鑅鑈鑉鑆霿韣顪顩飋饔饛驎驓驔驌驏驈驊"], +["f7a1","驉驒驐髐鬙鬫鬻魖魕鱆鱈鰿鱄鰹鰳鱁鰼鰷鰴鰲鰽鰶鷛鷒鷞鷚鷋鷐鷜鷑鷟鷩鷙鷘鷖鷵鷕鷝麶黰鼵鼳鼲齂齫龕龢儽劙壨壧奲孍巘蠯彏戁戃戄攩攥斖曫欑欒欏毊灛灚爢玂玁玃癰矔籧籦纕艬蘺虀蘹蘼蘱蘻蘾蠰蠲蠮蠳襶襴襳觾"], +["f840","讌讎讋讈豅贙躘轤轣醼鑢鑕鑝鑗鑞韄韅頀驖驙鬞鬟鬠鱒鱘鱐鱊鱍鱋鱕鱙鱌鱎鷻鷷鷯鷣鷫鷸鷤鷶鷡鷮鷦鷲鷰鷢鷬鷴鷳鷨鷭黂黐黲黳鼆鼜鼸鼷鼶齃齏"], +["f8a1","齱齰齮齯囓囍孎屭攭曭曮欓灟灡灝灠爣瓛瓥矕礸禷禶籪纗羉艭虃蠸蠷蠵衋讔讕躞躟躠躝醾醽釂鑫鑨鑩雥靆靃靇韇韥驞髕魙鱣鱧鱦鱢鱞鱠鸂鷾鸇鸃鸆鸅鸀鸁鸉鷿鷽鸄麠鼞齆齴齵齶囔攮斸欘欙欗欚灢爦犪矘矙礹籩籫糶纚"], +["f940","纘纛纙臠臡虆虇虈襹襺襼襻觿讘讙躥躤躣鑮鑭鑯鑱鑳靉顲饟鱨鱮鱭鸋鸍鸐鸏鸒鸑麡黵鼉齇齸齻齺齹圞灦籯蠼趲躦釃鑴鑸鑶鑵驠鱴鱳鱱鱵鸔鸓黶鼊"], +["f9a1","龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"] +] diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/eucjp.json b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/eucjp.json new file mode 100644 index 0000000000000000000000000000000000000000..4fa61ca116009efc18ecbd1531538f31234ad103 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/eucjp.json @@ -0,0 +1,182 @@ +[ +["0","\u0000",127], +["8ea1","。",62], +["a1a1"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇"], +["a2a1","◆□■△▲▽▼※〒→←↑↓〓"], +["a2ba","∈∋⊆⊇⊂⊃∪∩"], +["a2ca","∧∨¬⇒⇔∀∃"], +["a2dc","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["a2f2","ʼn♯♭♪†‡¶"], +["a2fe","◯"], +["a3b0","0",9], +["a3c1","A",25], +["a3e1","a",25], +["a4a1","ぁ",82], +["a5a1","ァ",85], +["a6a1","Α",16,"Σ",6], +["a6c1","α",16,"σ",6], +["a7a1","А",5,"ЁЖ",25], +["a7d1","а",5,"ёж",25], +["a8a1","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["ada1","①",19,"Ⅰ",9], +["adc0","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["addf","㍻〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["b0a1","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["b1a1","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応"], +["b2a1","押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["b3a1","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱"], +["b4a1","粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["b5a1","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京"], +["b6a1","供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["b7a1","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲"], +["b8a1","検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["b9a1","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込"], +["baa1","此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["bba1","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時"], +["bca1","次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["bda1","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償"], +["bea1","勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["bfa1","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾"], +["c0a1","澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["c1a1","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎"], +["c2a1","臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["c3a1","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵"], +["c4a1","帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["c5a1","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到"], +["c6a1","董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["c7a1","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦"], +["c8a1","函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["c9a1","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服"], +["caa1","福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["cba1","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満"], +["cca1","漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["cda1","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃"], +["cea1","痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["cfa1","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["d0a1","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["d1a1","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨"], +["d2a1","辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["d3a1","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉"], +["d4a1","圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["d5a1","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓"], +["d6a1","屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["d7a1","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚"], +["d8a1","悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["d9a1","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼"], +["daa1","據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["dba1","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍"], +["dca1","棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["dda1","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾"], +["dea1","沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["dfa1","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼"], +["e0a1","燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e1a1","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰"], +["e2a1","癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e3a1","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐"], +["e4a1","筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e5a1","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺"], +["e6a1","罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e7a1","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙"], +["e8a1","茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e9a1","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙"], +["eaa1","蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["eba1","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫"], +["eca1","譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["eda1","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸"], +["eea1","遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["efa1","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞"], +["f0a1","陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["f1a1","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷"], +["f2a1","髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["f3a1","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠"], +["f4a1","堯槇遙瑤凜熙"], +["f9a1","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德"], +["faa1","忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["fba1","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚"], +["fca1","釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["fcf1","ⅰ",9,"¬¦'""], +["8fa2af","˘ˇ¸˙˝¯˛˚~΄΅"], +["8fa2c2","¡¦¿"], +["8fa2eb","ºª©®™¤№"], +["8fa6e1","ΆΈΉΊΪ"], +["8fa6e7","Ό"], +["8fa6e9","ΎΫ"], +["8fa6ec","Ώ"], +["8fa6f1","άέήίϊΐόςύϋΰώ"], +["8fa7c2","Ђ",10,"ЎЏ"], +["8fa7f2","ђ",10,"ўџ"], +["8fa9a1","ÆĐ"], +["8fa9a4","Ħ"], +["8fa9a6","IJ"], +["8fa9a8","ŁĿ"], +["8fa9ab","ŊØŒ"], +["8fa9af","ŦÞ"], +["8fa9c1","æđðħıijĸłŀʼnŋøœßŧþ"], +["8faaa1","ÁÀÄÂĂǍĀĄÅÃĆĈČÇĊĎÉÈËÊĚĖĒĘ"], +["8faaba","ĜĞĢĠĤÍÌÏÎǏİĪĮĨĴĶĹĽĻŃŇŅÑÓÒÖÔǑŐŌÕŔŘŖŚŜŠŞŤŢÚÙÜÛŬǓŰŪŲŮŨǗǛǙǕŴÝŸŶŹŽŻ"], +["8faba1","áàäâăǎāąåãćĉčçċďéèëêěėēęǵĝğ"], +["8fabbd","ġĥíìïîǐ"], +["8fabc5","īįĩĵķĺľļńňņñóòöôǒőōõŕřŗśŝšşťţúùüûŭǔűūųůũǘǜǚǖŵýÿŷźžż"], +["8fb0a1","丂丄丅丌丒丟丣两丨丫丮丯丰丵乀乁乄乇乑乚乜乣乨乩乴乵乹乿亍亖亗亝亯亹仃仐仚仛仠仡仢仨仯仱仳仵份仾仿伀伂伃伈伋伌伒伕伖众伙伮伱你伳伵伷伹伻伾佀佂佈佉佋佌佒佔佖佘佟佣佪佬佮佱佷佸佹佺佽佾侁侂侄"], +["8fb1a1","侅侉侊侌侎侐侒侓侔侗侙侚侞侟侲侷侹侻侼侽侾俀俁俅俆俈俉俋俌俍俏俒俜俠俢俰俲俼俽俿倀倁倄倇倊倌倎倐倓倗倘倛倜倝倞倢倧倮倰倲倳倵偀偁偂偅偆偊偌偎偑偒偓偗偙偟偠偢偣偦偧偪偭偰偱倻傁傃傄傆傊傎傏傐"], +["8fb2a1","傒傓傔傖傛傜傞",4,"傪傯傰傹傺傽僀僃僄僇僌僎僐僓僔僘僜僝僟僢僤僦僨僩僯僱僶僺僾儃儆儇儈儋儌儍儎僲儐儗儙儛儜儝儞儣儧儨儬儭儯儱儳儴儵儸儹兂兊兏兓兕兗兘兟兤兦兾冃冄冋冎冘冝冡冣冭冸冺冼冾冿凂"], +["8fb3a1","凈减凑凒凓凕凘凞凢凥凮凲凳凴凷刁刂刅划刓刕刖刘刢刨刱刲刵刼剅剉剕剗剘剚剜剟剠剡剦剮剷剸剹劀劂劅劊劌劓劕劖劗劘劚劜劤劥劦劧劯劰劶劷劸劺劻劽勀勄勆勈勌勏勑勔勖勛勜勡勥勨勩勪勬勰勱勴勶勷匀匃匊匋"], +["8fb4a1","匌匑匓匘匛匜匞匟匥匧匨匩匫匬匭匰匲匵匼匽匾卂卌卋卙卛卡卣卥卬卭卲卹卾厃厇厈厎厓厔厙厝厡厤厪厫厯厲厴厵厷厸厺厽叀叅叏叒叓叕叚叝叞叠另叧叵吂吓吚吡吧吨吪启吱吴吵呃呄呇呍呏呞呢呤呦呧呩呫呭呮呴呿"], +["8fb5a1","咁咃咅咈咉咍咑咕咖咜咟咡咦咧咩咪咭咮咱咷咹咺咻咿哆哊响哎哠哪哬哯哶哼哾哿唀唁唅唈唉唌唍唎唕唪唫唲唵唶唻唼唽啁啇啉啊啍啐啑啘啚啛啞啠啡啤啦啿喁喂喆喈喎喏喑喒喓喔喗喣喤喭喲喿嗁嗃嗆嗉嗋嗌嗎嗑嗒"], +["8fb6a1","嗓嗗嗘嗛嗞嗢嗩嗶嗿嘅嘈嘊嘍",5,"嘙嘬嘰嘳嘵嘷嘹嘻嘼嘽嘿噀噁噃噄噆噉噋噍噏噔噞噠噡噢噣噦噩噭噯噱噲噵嚄嚅嚈嚋嚌嚕嚙嚚嚝嚞嚟嚦嚧嚨嚩嚫嚬嚭嚱嚳嚷嚾囅囉囊囋囏囐囌囍囙囜囝囟囡囤",4,"囱囫园"], +["8fb7a1","囶囷圁圂圇圊圌圑圕圚圛圝圠圢圣圤圥圩圪圬圮圯圳圴圽圾圿坅坆坌坍坒坢坥坧坨坫坭",4,"坳坴坵坷坹坺坻坼坾垁垃垌垔垗垙垚垜垝垞垟垡垕垧垨垩垬垸垽埇埈埌埏埕埝埞埤埦埧埩埭埰埵埶埸埽埾埿堃堄堈堉埡"], +["8fb8a1","堌堍堛堞堟堠堦堧堭堲堹堿塉塌塍塏塐塕塟塡塤塧塨塸塼塿墀墁墇墈墉墊墌墍墏墐墔墖墝墠墡墢墦墩墱墲壄墼壂壈壍壎壐壒壔壖壚壝壡壢壩壳夅夆夋夌夒夓夔虁夝夡夣夤夨夯夰夳夵夶夿奃奆奒奓奙奛奝奞奟奡奣奫奭"], +["8fb9a1","奯奲奵奶她奻奼妋妌妎妒妕妗妟妤妧妭妮妯妰妳妷妺妼姁姃姄姈姊姍姒姝姞姟姣姤姧姮姯姱姲姴姷娀娄娌娍娎娒娓娞娣娤娧娨娪娭娰婄婅婇婈婌婐婕婞婣婥婧婭婷婺婻婾媋媐媓媖媙媜媞媟媠媢媧媬媱媲媳媵媸媺媻媿"], +["8fbaa1","嫄嫆嫈嫏嫚嫜嫠嫥嫪嫮嫵嫶嫽嬀嬁嬈嬗嬴嬙嬛嬝嬡嬥嬭嬸孁孋孌孒孖孞孨孮孯孼孽孾孿宁宄宆宊宎宐宑宓宔宖宨宩宬宭宯宱宲宷宺宼寀寁寍寏寖",4,"寠寯寱寴寽尌尗尞尟尣尦尩尫尬尮尰尲尵尶屙屚屜屢屣屧屨屩"], +["8fbba1","屭屰屴屵屺屻屼屽岇岈岊岏岒岝岟岠岢岣岦岪岲岴岵岺峉峋峒峝峗峮峱峲峴崁崆崍崒崫崣崤崦崧崱崴崹崽崿嵂嵃嵆嵈嵕嵑嵙嵊嵟嵠嵡嵢嵤嵪嵭嵰嵹嵺嵾嵿嶁嶃嶈嶊嶒嶓嶔嶕嶙嶛嶟嶠嶧嶫嶰嶴嶸嶹巃巇巋巐巎巘巙巠巤"], +["8fbca1","巩巸巹帀帇帍帒帔帕帘帟帠帮帨帲帵帾幋幐幉幑幖幘幛幜幞幨幪",4,"幰庀庋庎庢庤庥庨庪庬庱庳庽庾庿廆廌廋廎廑廒廔廕廜廞廥廫异弆弇弈弎弙弜弝弡弢弣弤弨弫弬弮弰弴弶弻弽弿彀彄彅彇彍彐彔彘彛彠彣彤彧"], +["8fbda1","彯彲彴彵彸彺彽彾徉徍徏徖徜徝徢徧徫徤徬徯徰徱徸忄忇忈忉忋忐",4,"忞忡忢忨忩忪忬忭忮忯忲忳忶忺忼怇怊怍怓怔怗怘怚怟怤怭怳怵恀恇恈恉恌恑恔恖恗恝恡恧恱恾恿悂悆悈悊悎悑悓悕悘悝悞悢悤悥您悰悱悷"], +["8fbea1","悻悾惂惄惈惉惊惋惎惏惔惕惙惛惝惞惢惥惲惵惸惼惽愂愇愊愌愐",4,"愖愗愙愜愞愢愪愫愰愱愵愶愷愹慁慅慆慉慞慠慬慲慸慻慼慿憀憁憃憄憋憍憒憓憗憘憜憝憟憠憥憨憪憭憸憹憼懀懁懂懎懏懕懜懝懞懟懡懢懧懩懥"], +["8fbfa1","懬懭懯戁戃戄戇戓戕戜戠戢戣戧戩戫戹戽扂扃扄扆扌扐扑扒扔扖扚扜扤扭扯扳扺扽抍抎抏抐抦抨抳抶抷抺抾抿拄拎拕拖拚拪拲拴拼拽挃挄挊挋挍挐挓挖挘挩挪挭挵挶挹挼捁捂捃捄捆捊捋捎捒捓捔捘捛捥捦捬捭捱捴捵"], +["8fc0a1","捸捼捽捿掂掄掇掊掐掔掕掙掚掞掤掦掭掮掯掽揁揅揈揎揑揓揔揕揜揠揥揪揬揲揳揵揸揹搉搊搐搒搔搘搞搠搢搤搥搩搪搯搰搵搽搿摋摏摑摒摓摔摚摛摜摝摟摠摡摣摭摳摴摻摽撅撇撏撐撑撘撙撛撝撟撡撣撦撨撬撳撽撾撿"], +["8fc1a1","擄擉擊擋擌擎擐擑擕擗擤擥擩擪擭擰擵擷擻擿攁攄攈攉攊攏攓攔攖攙攛攞攟攢攦攩攮攱攺攼攽敃敇敉敐敒敔敟敠敧敫敺敽斁斅斊斒斕斘斝斠斣斦斮斲斳斴斿旂旈旉旎旐旔旖旘旟旰旲旴旵旹旾旿昀昄昈昉昍昑昒昕昖昝"], +["8fc2a1","昞昡昢昣昤昦昩昪昫昬昮昰昱昳昹昷晀晅晆晊晌晑晎晗晘晙晛晜晠晡曻晪晫晬晾晳晵晿晷晸晹晻暀晼暋暌暍暐暒暙暚暛暜暟暠暤暭暱暲暵暻暿曀曂曃曈曌曎曏曔曛曟曨曫曬曮曺朅朇朎朓朙朜朠朢朳朾杅杇杈杌杔杕杝"], +["8fc3a1","杦杬杮杴杶杻极构枎枏枑枓枖枘枙枛枰枱枲枵枻枼枽柹柀柂柃柅柈柉柒柗柙柜柡柦柰柲柶柷桒栔栙栝栟栨栧栬栭栯栰栱栳栻栿桄桅桊桌桕桗桘桛桫桮",4,"桵桹桺桻桼梂梄梆梈梖梘梚梜梡梣梥梩梪梮梲梻棅棈棌棏"], +["8fc4a1","棐棑棓棖棙棜棝棥棨棪棫棬棭棰棱棵棶棻棼棽椆椉椊椐椑椓椖椗椱椳椵椸椻楂楅楉楎楗楛楣楤楥楦楨楩楬楰楱楲楺楻楿榀榍榒榖榘榡榥榦榨榫榭榯榷榸榺榼槅槈槑槖槗槢槥槮槯槱槳槵槾樀樁樃樏樑樕樚樝樠樤樨樰樲"], +["8fc5a1","樴樷樻樾樿橅橆橉橊橎橐橑橒橕橖橛橤橧橪橱橳橾檁檃檆檇檉檋檑檛檝檞檟檥檫檯檰檱檴檽檾檿櫆櫉櫈櫌櫐櫔櫕櫖櫜櫝櫤櫧櫬櫰櫱櫲櫼櫽欂欃欆欇欉欏欐欑欗欛欞欤欨欫欬欯欵欶欻欿歆歊歍歒歖歘歝歠歧歫歮歰歵歽"], +["8fc6a1","歾殂殅殗殛殟殠殢殣殨殩殬殭殮殰殸殹殽殾毃毄毉毌毖毚毡毣毦毧毮毱毷毹毿氂氄氅氉氍氎氐氒氙氟氦氧氨氬氮氳氵氶氺氻氿汊汋汍汏汒汔汙汛汜汫汭汯汴汶汸汹汻沅沆沇沉沔沕沗沘沜沟沰沲沴泂泆泍泏泐泑泒泔泖"], +["8fc7a1","泚泜泠泧泩泫泬泮泲泴洄洇洊洎洏洑洓洚洦洧洨汧洮洯洱洹洼洿浗浞浟浡浥浧浯浰浼涂涇涑涒涔涖涗涘涪涬涴涷涹涽涿淄淈淊淎淏淖淛淝淟淠淢淥淩淯淰淴淶淼渀渄渞渢渧渲渶渹渻渼湄湅湈湉湋湏湑湒湓湔湗湜湝湞"], +["8fc8a1","湢湣湨湳湻湽溍溓溙溠溧溭溮溱溳溻溿滀滁滃滇滈滊滍滎滏滫滭滮滹滻滽漄漈漊漌漍漖漘漚漛漦漩漪漯漰漳漶漻漼漭潏潑潒潓潗潙潚潝潞潡潢潨潬潽潾澃澇澈澋澌澍澐澒澓澔澖澚澟澠澥澦澧澨澮澯澰澵澶澼濅濇濈濊"], +["8fc9a1","濚濞濨濩濰濵濹濼濽瀀瀅瀆瀇瀍瀗瀠瀣瀯瀴瀷瀹瀼灃灄灈灉灊灋灔灕灝灞灎灤灥灬灮灵灶灾炁炅炆炔",4,"炛炤炫炰炱炴炷烊烑烓烔烕烖烘烜烤烺焃",4,"焋焌焏焞焠焫焭焯焰焱焸煁煅煆煇煊煋煐煒煗煚煜煞煠"], +["8fcaa1","煨煹熀熅熇熌熒熚熛熠熢熯熰熲熳熺熿燀燁燄燋燌燓燖燙燚燜燸燾爀爇爈爉爓爗爚爝爟爤爫爯爴爸爹牁牂牃牅牎牏牐牓牕牖牚牜牞牠牣牨牫牮牯牱牷牸牻牼牿犄犉犍犎犓犛犨犭犮犱犴犾狁狇狉狌狕狖狘狟狥狳狴狺狻"], +["8fcba1","狾猂猄猅猇猋猍猒猓猘猙猞猢猤猧猨猬猱猲猵猺猻猽獃獍獐獒獖獘獝獞獟獠獦獧獩獫獬獮獯獱獷獹獼玀玁玃玅玆玎玐玓玕玗玘玜玞玟玠玢玥玦玪玫玭玵玷玹玼玽玿珅珆珉珋珌珏珒珓珖珙珝珡珣珦珧珩珴珵珷珹珺珻珽"], +["8fcca1","珿琀琁琄琇琊琑琚琛琤琦琨",9,"琹瑀瑃瑄瑆瑇瑋瑍瑑瑒瑗瑝瑢瑦瑧瑨瑫瑭瑮瑱瑲璀璁璅璆璇璉璏璐璑璒璘璙璚璜璟璠璡璣璦璨璩璪璫璮璯璱璲璵璹璻璿瓈瓉瓌瓐瓓瓘瓚瓛瓞瓟瓤瓨瓪瓫瓯瓴瓺瓻瓼瓿甆"], +["8fcda1","甒甖甗甠甡甤甧甩甪甯甶甹甽甾甿畀畃畇畈畎畐畒畗畞畟畡畯畱畹",5,"疁疅疐疒疓疕疙疜疢疤疴疺疿痀痁痄痆痌痎痏痗痜痟痠痡痤痧痬痮痯痱痹瘀瘂瘃瘄瘇瘈瘊瘌瘏瘒瘓瘕瘖瘙瘛瘜瘝瘞瘣瘥瘦瘩瘭瘲瘳瘵瘸瘹"], +["8fcea1","瘺瘼癊癀癁癃癄癅癉癋癕癙癟癤癥癭癮癯癱癴皁皅皌皍皕皛皜皝皟皠皢",6,"皪皭皽盁盅盉盋盌盎盔盙盠盦盨盬盰盱盶盹盼眀眆眊眎眒眔眕眗眙眚眜眢眨眭眮眯眴眵眶眹眽眾睂睅睆睊睍睎睏睒睖睗睜睞睟睠睢"], +["8fcfa1","睤睧睪睬睰睲睳睴睺睽瞀瞄瞌瞍瞔瞕瞖瞚瞟瞢瞧瞪瞮瞯瞱瞵瞾矃矉矑矒矕矙矞矟矠矤矦矪矬矰矱矴矸矻砅砆砉砍砎砑砝砡砢砣砭砮砰砵砷硃硄硇硈硌硎硒硜硞硠硡硣硤硨硪确硺硾碊碏碔碘碡碝碞碟碤碨碬碭碰碱碲碳"], +["8fd0a1","碻碽碿磇磈磉磌磎磒磓磕磖磤磛磟磠磡磦磪磲磳礀磶磷磺磻磿礆礌礐礚礜礞礟礠礥礧礩礭礱礴礵礻礽礿祄祅祆祊祋祏祑祔祘祛祜祧祩祫祲祹祻祼祾禋禌禑禓禔禕禖禘禛禜禡禨禩禫禯禱禴禸离秂秄秇秈秊秏秔秖秚秝秞"], +["8fd1a1","秠秢秥秪秫秭秱秸秼稂稃稇稉稊稌稑稕稛稞稡稧稫稭稯稰稴稵稸稹稺穄穅穇穈穌穕穖穙穜穝穟穠穥穧穪穭穵穸穾窀窂窅窆窊窋窐窑窔窞窠窣窬窳窵窹窻窼竆竉竌竎竑竛竨竩竫竬竱竴竻竽竾笇笔笟笣笧笩笪笫笭笮笯笰"], +["8fd2a1","笱笴笽笿筀筁筇筎筕筠筤筦筩筪筭筯筲筳筷箄箉箎箐箑箖箛箞箠箥箬箯箰箲箵箶箺箻箼箽篂篅篈篊篔篖篗篙篚篛篨篪篲篴篵篸篹篺篼篾簁簂簃簄簆簉簋簌簎簏簙簛簠簥簦簨簬簱簳簴簶簹簺籆籊籕籑籒籓籙",5], +["8fd3a1","籡籣籧籩籭籮籰籲籹籼籽粆粇粏粔粞粠粦粰粶粷粺粻粼粿糄糇糈糉糍糏糓糔糕糗糙糚糝糦糩糫糵紃紇紈紉紏紑紒紓紖紝紞紣紦紪紭紱紼紽紾絀絁絇絈絍絑絓絗絙絚絜絝絥絧絪絰絸絺絻絿綁綂綃綅綆綈綋綌綍綑綖綗綝"], +["8fd4a1","綞綦綧綪綳綶綷綹緂",4,"緌緍緎緗緙縀緢緥緦緪緫緭緱緵緶緹緺縈縐縑縕縗縜縝縠縧縨縬縭縯縳縶縿繄繅繇繎繐繒繘繟繡繢繥繫繮繯繳繸繾纁纆纇纊纍纑纕纘纚纝纞缼缻缽缾缿罃罄罇罏罒罓罛罜罝罡罣罤罥罦罭"], +["8fd5a1","罱罽罾罿羀羋羍羏羐羑羖羗羜羡羢羦羪羭羴羼羿翀翃翈翎翏翛翟翣翥翨翬翮翯翲翺翽翾翿耇耈耊耍耎耏耑耓耔耖耝耞耟耠耤耦耬耮耰耴耵耷耹耺耼耾聀聄聠聤聦聭聱聵肁肈肎肜肞肦肧肫肸肹胈胍胏胒胔胕胗胘胠胭胮"], +["8fd6a1","胰胲胳胶胹胺胾脃脋脖脗脘脜脞脠脤脧脬脰脵脺脼腅腇腊腌腒腗腠腡腧腨腩腭腯腷膁膐膄膅膆膋膎膖膘膛膞膢膮膲膴膻臋臃臅臊臎臏臕臗臛臝臞臡臤臫臬臰臱臲臵臶臸臹臽臿舀舃舏舓舔舙舚舝舡舢舨舲舴舺艃艄艅艆"], +["8fd7a1","艋艎艏艑艖艜艠艣艧艭艴艻艽艿芀芁芃芄芇芉芊芎芑芔芖芘芚芛芠芡芣芤芧芨芩芪芮芰芲芴芷芺芼芾芿苆苐苕苚苠苢苤苨苪苭苯苶苷苽苾茀茁茇茈茊茋荔茛茝茞茟茡茢茬茭茮茰茳茷茺茼茽荂荃荄荇荍荎荑荕荖荗荰荸"], +["8fd8a1","荽荿莀莂莄莆莍莒莔莕莘莙莛莜莝莦莧莩莬莾莿菀菇菉菏菐菑菔菝荓菨菪菶菸菹菼萁萆萊萏萑萕萙莭萯萹葅葇葈葊葍葏葑葒葖葘葙葚葜葠葤葥葧葪葰葳葴葶葸葼葽蒁蒅蒒蒓蒕蒞蒦蒨蒩蒪蒯蒱蒴蒺蒽蒾蓀蓂蓇蓈蓌蓏蓓"], +["8fd9a1","蓜蓧蓪蓯蓰蓱蓲蓷蔲蓺蓻蓽蔂蔃蔇蔌蔎蔐蔜蔞蔢蔣蔤蔥蔧蔪蔫蔯蔳蔴蔶蔿蕆蕏",4,"蕖蕙蕜",6,"蕤蕫蕯蕹蕺蕻蕽蕿薁薅薆薉薋薌薏薓薘薝薟薠薢薥薧薴薶薷薸薼薽薾薿藂藇藊藋藎薭藘藚藟藠藦藨藭藳藶藼"], +["8fdaa1","藿蘀蘄蘅蘍蘎蘐蘑蘒蘘蘙蘛蘞蘡蘧蘩蘶蘸蘺蘼蘽虀虂虆虒虓虖虗虘虙虝虠",4,"虩虬虯虵虶虷虺蚍蚑蚖蚘蚚蚜蚡蚦蚧蚨蚭蚱蚳蚴蚵蚷蚸蚹蚿蛀蛁蛃蛅蛑蛒蛕蛗蛚蛜蛠蛣蛥蛧蚈蛺蛼蛽蜄蜅蜇蜋蜎蜏蜐蜓蜔蜙蜞蜟蜡蜣"], +["8fdba1","蜨蜮蜯蜱蜲蜹蜺蜼蜽蜾蝀蝃蝅蝍蝘蝝蝡蝤蝥蝯蝱蝲蝻螃",6,"螋螌螐螓螕螗螘螙螞螠螣螧螬螭螮螱螵螾螿蟁蟈蟉蟊蟎蟕蟖蟙蟚蟜蟟蟢蟣蟤蟪蟫蟭蟱蟳蟸蟺蟿蠁蠃蠆蠉蠊蠋蠐蠙蠒蠓蠔蠘蠚蠛蠜蠞蠟蠨蠭蠮蠰蠲蠵"], +["8fdca1","蠺蠼衁衃衅衈衉衊衋衎衑衕衖衘衚衜衟衠衤衩衱衹衻袀袘袚袛袜袟袠袨袪袺袽袾裀裊",4,"裑裒裓裛裞裧裯裰裱裵裷褁褆褍褎褏褕褖褘褙褚褜褠褦褧褨褰褱褲褵褹褺褾襀襂襅襆襉襏襒襗襚襛襜襡襢襣襫襮襰襳襵襺"], +["8fdda1","襻襼襽覉覍覐覔覕覛覜覟覠覥覰覴覵覶覷覼觔",4,"觥觩觫觭觱觳觶觹觽觿訄訅訇訏訑訒訔訕訞訠訢訤訦訫訬訯訵訷訽訾詀詃詅詇詉詍詎詓詖詗詘詜詝詡詥詧詵詶詷詹詺詻詾詿誀誃誆誋誏誐誒誖誗誙誟誧誩誮誯誳"], +["8fdea1","誶誷誻誾諃諆諈諉諊諑諓諔諕諗諝諟諬諰諴諵諶諼諿謅謆謋謑謜謞謟謊謭謰謷謼譂",4,"譈譒譓譔譙譍譞譣譭譶譸譹譼譾讁讄讅讋讍讏讔讕讜讞讟谸谹谽谾豅豇豉豋豏豑豓豔豗豘豛豝豙豣豤豦豨豩豭豳豵豶豻豾貆"], +["8fdfa1","貇貋貐貒貓貙貛貜貤貹貺賅賆賉賋賏賖賕賙賝賡賨賬賯賰賲賵賷賸賾賿贁贃贉贒贗贛赥赩赬赮赿趂趄趈趍趐趑趕趞趟趠趦趫趬趯趲趵趷趹趻跀跅跆跇跈跊跎跑跔跕跗跙跤跥跧跬跰趼跱跲跴跽踁踄踅踆踋踑踔踖踠踡踢"], +["8fe0a1","踣踦踧踱踳踶踷踸踹踽蹀蹁蹋蹍蹎蹏蹔蹛蹜蹝蹞蹡蹢蹩蹬蹭蹯蹰蹱蹹蹺蹻躂躃躉躐躒躕躚躛躝躞躢躧躩躭躮躳躵躺躻軀軁軃軄軇軏軑軔軜軨軮軰軱軷軹軺軭輀輂輇輈輏輐輖輗輘輞輠輡輣輥輧輨輬輭輮輴輵輶輷輺轀轁"], +["8fe1a1","轃轇轏轑",4,"轘轝轞轥辝辠辡辤辥辦辵辶辸达迀迁迆迊迋迍运迒迓迕迠迣迤迨迮迱迵迶迻迾适逄逈逌逘逛逨逩逯逪逬逭逳逴逷逿遃遄遌遛遝遢遦遧遬遰遴遹邅邈邋邌邎邐邕邗邘邙邛邠邡邢邥邰邲邳邴邶邽郌邾郃"], +["8fe2a1","郄郅郇郈郕郗郘郙郜郝郟郥郒郶郫郯郰郴郾郿鄀鄄鄅鄆鄈鄍鄐鄔鄖鄗鄘鄚鄜鄞鄠鄥鄢鄣鄧鄩鄮鄯鄱鄴鄶鄷鄹鄺鄼鄽酃酇酈酏酓酗酙酚酛酡酤酧酭酴酹酺酻醁醃醅醆醊醎醑醓醔醕醘醞醡醦醨醬醭醮醰醱醲醳醶醻醼醽醿"], +["8fe3a1","釂釃釅釓釔釗釙釚釞釤釥釩釪釬",5,"釷釹釻釽鈀鈁鈄鈅鈆鈇鈉鈊鈌鈐鈒鈓鈖鈘鈜鈝鈣鈤鈥鈦鈨鈮鈯鈰鈳鈵鈶鈸鈹鈺鈼鈾鉀鉂鉃鉆鉇鉊鉍鉎鉏鉑鉘鉙鉜鉝鉠鉡鉥鉧鉨鉩鉮鉯鉰鉵",4,"鉻鉼鉽鉿銈銉銊銍銎銒銗"], +["8fe4a1","銙銟銠銤銥銧銨銫銯銲銶銸銺銻銼銽銿",4,"鋅鋆鋇鋈鋋鋌鋍鋎鋐鋓鋕鋗鋘鋙鋜鋝鋟鋠鋡鋣鋥鋧鋨鋬鋮鋰鋹鋻鋿錀錂錈錍錑錔錕錜錝錞錟錡錤錥錧錩錪錳錴錶錷鍇鍈鍉鍐鍑鍒鍕鍗鍘鍚鍞鍤鍥鍧鍩鍪鍭鍯鍰鍱鍳鍴鍶"], +["8fe5a1","鍺鍽鍿鎀鎁鎂鎈鎊鎋鎍鎏鎒鎕鎘鎛鎞鎡鎣鎤鎦鎨鎫鎴鎵鎶鎺鎩鏁鏄鏅鏆鏇鏉",4,"鏓鏙鏜鏞鏟鏢鏦鏧鏹鏷鏸鏺鏻鏽鐁鐂鐄鐈鐉鐍鐎鐏鐕鐖鐗鐟鐮鐯鐱鐲鐳鐴鐻鐿鐽鑃鑅鑈鑊鑌鑕鑙鑜鑟鑡鑣鑨鑫鑭鑮鑯鑱鑲钄钃镸镹"], +["8fe6a1","镾閄閈閌閍閎閝閞閟閡閦閩閫閬閴閶閺閽閿闆闈闉闋闐闑闒闓闙闚闝闞闟闠闤闦阝阞阢阤阥阦阬阱阳阷阸阹阺阼阽陁陒陔陖陗陘陡陮陴陻陼陾陿隁隂隃隄隉隑隖隚隝隟隤隥隦隩隮隯隳隺雊雒嶲雘雚雝雞雟雩雯雱雺霂"], +["8fe7a1","霃霅霉霚霛霝霡霢霣霨霱霳靁靃靊靎靏靕靗靘靚靛靣靧靪靮靳靶靷靸靻靽靿鞀鞉鞕鞖鞗鞙鞚鞞鞟鞢鞬鞮鞱鞲鞵鞶鞸鞹鞺鞼鞾鞿韁韄韅韇韉韊韌韍韎韐韑韔韗韘韙韝韞韠韛韡韤韯韱韴韷韸韺頇頊頙頍頎頔頖頜頞頠頣頦"], +["8fe8a1","頫頮頯頰頲頳頵頥頾顄顇顊顑顒顓顖顗顙顚顢顣顥顦顪顬颫颭颮颰颴颷颸颺颻颿飂飅飈飌飡飣飥飦飧飪飳飶餂餇餈餑餕餖餗餚餛餜餟餢餦餧餫餱",4,"餹餺餻餼饀饁饆饇饈饍饎饔饘饙饛饜饞饟饠馛馝馟馦馰馱馲馵"], +["8fe9a1","馹馺馽馿駃駉駓駔駙駚駜駞駧駪駫駬駰駴駵駹駽駾騂騃騄騋騌騐騑騖騞騠騢騣騤騧騭騮騳騵騶騸驇驁驄驊驋驌驎驑驔驖驝骪骬骮骯骲骴骵骶骹骻骾骿髁髃髆髈髎髐髒髕髖髗髛髜髠髤髥髧髩髬髲髳髵髹髺髽髿",4], +["8feaa1","鬄鬅鬈鬉鬋鬌鬍鬎鬐鬒鬖鬙鬛鬜鬠鬦鬫鬭鬳鬴鬵鬷鬹鬺鬽魈魋魌魕魖魗魛魞魡魣魥魦魨魪",4,"魳魵魷魸魹魿鮀鮄鮅鮆鮇鮉鮊鮋鮍鮏鮐鮔鮚鮝鮞鮦鮧鮩鮬鮰鮱鮲鮷鮸鮻鮼鮾鮿鯁鯇鯈鯎鯐鯗鯘鯝鯟鯥鯧鯪鯫鯯鯳鯷鯸"], +["8feba1","鯹鯺鯽鯿鰀鰂鰋鰏鰑鰖鰘鰙鰚鰜鰞鰢鰣鰦",4,"鰱鰵鰶鰷鰽鱁鱃鱄鱅鱉鱊鱎鱏鱐鱓鱔鱖鱘鱛鱝鱞鱟鱣鱩鱪鱜鱫鱨鱮鱰鱲鱵鱷鱻鳦鳲鳷鳹鴋鴂鴑鴗鴘鴜鴝鴞鴯鴰鴲鴳鴴鴺鴼鵅鴽鵂鵃鵇鵊鵓鵔鵟鵣鵢鵥鵩鵪鵫鵰鵶鵷鵻"], +["8feca1","鵼鵾鶃鶄鶆鶊鶍鶎鶒鶓鶕鶖鶗鶘鶡鶪鶬鶮鶱鶵鶹鶼鶿鷃鷇鷉鷊鷔鷕鷖鷗鷚鷞鷟鷠鷥鷧鷩鷫鷮鷰鷳鷴鷾鸊鸂鸇鸎鸐鸑鸒鸕鸖鸙鸜鸝鹺鹻鹼麀麂麃麄麅麇麎麏麖麘麛麞麤麨麬麮麯麰麳麴麵黆黈黋黕黟黤黧黬黭黮黰黱黲黵"], +["8feda1","黸黿鼂鼃鼉鼏鼐鼑鼒鼔鼖鼗鼙鼚鼛鼟鼢鼦鼪鼫鼯鼱鼲鼴鼷鼹鼺鼼鼽鼿齁齃",4,"齓齕齖齗齘齚齝齞齨齩齭",4,"齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"] +] diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json new file mode 100644 index 0000000000000000000000000000000000000000..85c6934757761e98580abf0c26c351b6fdfd6ad5 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json @@ -0,0 +1 @@ +{"uChars":[128,165,169,178,184,216,226,235,238,244,248,251,253,258,276,284,300,325,329,334,364,463,465,467,469,471,473,475,477,506,594,610,712,716,730,930,938,962,970,1026,1104,1106,8209,8215,8218,8222,8231,8241,8244,8246,8252,8365,8452,8454,8458,8471,8482,8556,8570,8596,8602,8713,8720,8722,8726,8731,8737,8740,8742,8748,8751,8760,8766,8777,8781,8787,8802,8808,8816,8854,8858,8870,8896,8979,9322,9372,9548,9588,9616,9622,9634,9652,9662,9672,9676,9680,9702,9735,9738,9793,9795,11906,11909,11913,11917,11928,11944,11947,11951,11956,11960,11964,11979,12284,12292,12312,12319,12330,12351,12436,12447,12535,12543,12586,12842,12850,12964,13200,13215,13218,13253,13263,13267,13270,13384,13428,13727,13839,13851,14617,14703,14801,14816,14964,15183,15471,15585,16471,16736,17208,17325,17330,17374,17623,17997,18018,18212,18218,18301,18318,18760,18811,18814,18820,18823,18844,18848,18872,19576,19620,19738,19887,40870,59244,59336,59367,59413,59417,59423,59431,59437,59443,59452,59460,59478,59493,63789,63866,63894,63976,63986,64016,64018,64021,64025,64034,64037,64042,65074,65093,65107,65112,65127,65132,65375,65510,65536],"gbChars":[0,36,38,45,50,81,89,95,96,100,103,104,105,109,126,133,148,172,175,179,208,306,307,308,309,310,311,312,313,341,428,443,544,545,558,741,742,749,750,805,819,820,7922,7924,7925,7927,7934,7943,7944,7945,7950,8062,8148,8149,8152,8164,8174,8236,8240,8262,8264,8374,8380,8381,8384,8388,8390,8392,8393,8394,8396,8401,8406,8416,8419,8424,8437,8439,8445,8482,8485,8496,8521,8603,8936,8946,9046,9050,9063,9066,9076,9092,9100,9108,9111,9113,9131,9162,9164,9218,9219,11329,11331,11334,11336,11346,11361,11363,11366,11370,11372,11375,11389,11682,11686,11687,11692,11694,11714,11716,11723,11725,11730,11736,11982,11989,12102,12336,12348,12350,12384,12393,12395,12397,12510,12553,12851,12962,12973,13738,13823,13919,13933,14080,14298,14585,14698,15583,15847,16318,16434,16438,16481,16729,17102,17122,17315,17320,17402,17418,17859,17909,17911,17915,17916,17936,17939,17961,18664,18703,18814,18962,19043,33469,33470,33471,33484,33485,33490,33497,33501,33505,33513,33520,33536,33550,37845,37921,37948,38029,38038,38064,38065,38066,38069,38075,38076,38078,39108,39109,39113,39114,39115,39116,39265,39394,189000]} \ No newline at end of file diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json new file mode 100644 index 0000000000000000000000000000000000000000..b742e368f560003b9c95c3ae9b96633034d6f9e9 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/gbk-added.json @@ -0,0 +1,56 @@ +[ +["a140","",62], +["a180","",32], +["a240","",62], +["a280","",32], +["a2ab","",5], +["a2e3","€"], +["a2ef",""], +["a2fd",""], +["a340","",62], +["a380","",31," "], +["a440","",62], +["a480","",32], +["a4f4","",10], +["a540","",62], +["a580","",32], +["a5f7","",7], +["a640","",62], +["a680","",32], +["a6b9","",7], +["a6d9","",6], +["a6ec",""], +["a6f3",""], +["a6f6","",8], +["a740","",62], +["a780","",32], +["a7c2","",14], +["a7f2","",12], +["a896","",10], +["a8bc","ḿ"], +["a8bf","ǹ"], +["a8c1",""], +["a8ea","",20], +["a958",""], +["a95b",""], +["a95d",""], +["a989","〾⿰",11], +["a997","",12], +["a9f0","",14], +["aaa1","",93], +["aba1","",93], +["aca1","",93], +["ada1","",93], +["aea1","",93], +["afa1","",93], +["d7fa","",4], +["f8a1","",93], +["f9a1","",93], +["faa1","",93], +["fba1","",93], +["fca1","",93], +["fda1","",93], +["fe50","⺁⺄㑳㑇⺈⺋㖞㘚㘎⺌⺗㥮㤘㧏㧟㩳㧐㭎㱮㳠⺧⺪䁖䅟⺮䌷⺳⺶⺷䎱䎬⺻䏝䓖䙡䙌"], +["fe80","䜣䜩䝼䞍⻊䥇䥺䥽䦂䦃䦅䦆䦟䦛䦷䦶䲣䲟䲠䲡䱷䲢䴓",6,"䶮",93], +["8135f437",""] +] diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json new file mode 100644 index 0000000000000000000000000000000000000000..5a3a43cf8cf6d20324a49b75aff87d1bf902d108 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/tables/shiftjis.json @@ -0,0 +1,125 @@ +[ +["0","\u0000",128], +["a1","。",62], +["8140"," 、。,.・:;?!゛゜´`¨^ ̄_ヽヾゝゞ〃仝々〆〇ー―‐/\~∥|…‥‘’“”()〔〕[]{}〈",9,"+-±×"], +["8180","÷=≠<>≦≧∞∴♂♀°′″℃¥$¢£%#&*@§☆★○●◎◇◆□■△▲▽▼※〒→←↑↓〓"], +["81b8","∈∋⊆⊇⊂⊃∪∩"], +["81c8","∧∨¬⇒⇔∀∃"], +["81da","∠⊥⌒∂∇≡≒≪≫√∽∝∵∫∬"], +["81f0","ʼn♯♭♪†‡¶"], +["81fc","◯"], +["824f","0",9], +["8260","A",25], +["8281","a",25], +["829f","ぁ",82], +["8340","ァ",62], +["8380","ム",22], +["839f","Α",16,"Σ",6], +["83bf","α",16,"σ",6], +["8440","А",5,"ЁЖ",25], +["8470","а",5,"ёж",7], +["8480","о",17], +["849f","─│┌┐┘└├┬┤┴┼━┃┏┓┛┗┣┳┫┻╋┠┯┨┷┿┝┰┥┸╂"], +["8740","①",19,"Ⅰ",9], +["875f","㍉㌔㌢㍍㌘㌧㌃㌶㍑㍗㌍㌦㌣㌫㍊㌻㎜㎝㎞㎎㎏㏄㎡"], +["877e","㍻"], +["8780","〝〟№㏍℡㊤",4,"㈱㈲㈹㍾㍽㍼≒≡∫∮∑√⊥∠∟⊿∵∩∪"], +["889f","亜唖娃阿哀愛挨姶逢葵茜穐悪握渥旭葦芦鯵梓圧斡扱宛姐虻飴絢綾鮎或粟袷安庵按暗案闇鞍杏以伊位依偉囲夷委威尉惟意慰易椅為畏異移維緯胃萎衣謂違遺医井亥域育郁磯一壱溢逸稲茨芋鰯允印咽員因姻引飲淫胤蔭"], +["8940","院陰隠韻吋右宇烏羽迂雨卯鵜窺丑碓臼渦嘘唄欝蔚鰻姥厩浦瓜閏噂云運雲荏餌叡営嬰影映曳栄永泳洩瑛盈穎頴英衛詠鋭液疫益駅悦謁越閲榎厭円"], +["8980","園堰奄宴延怨掩援沿演炎焔煙燕猿縁艶苑薗遠鉛鴛塩於汚甥凹央奥往応押旺横欧殴王翁襖鴬鴎黄岡沖荻億屋憶臆桶牡乙俺卸恩温穏音下化仮何伽価佳加可嘉夏嫁家寡科暇果架歌河火珂禍禾稼箇花苛茄荷華菓蝦課嘩貨迦過霞蚊俄峨我牙画臥芽蛾賀雅餓駕介会解回塊壊廻快怪悔恢懐戒拐改"], +["8a40","魁晦械海灰界皆絵芥蟹開階貝凱劾外咳害崖慨概涯碍蓋街該鎧骸浬馨蛙垣柿蛎鈎劃嚇各廓拡撹格核殻獲確穫覚角赫較郭閣隔革学岳楽額顎掛笠樫"], +["8a80","橿梶鰍潟割喝恰括活渇滑葛褐轄且鰹叶椛樺鞄株兜竃蒲釜鎌噛鴨栢茅萱粥刈苅瓦乾侃冠寒刊勘勧巻喚堪姦完官寛干幹患感慣憾換敢柑桓棺款歓汗漢澗潅環甘監看竿管簡緩缶翰肝艦莞観諌貫還鑑間閑関陥韓館舘丸含岸巌玩癌眼岩翫贋雁頑顔願企伎危喜器基奇嬉寄岐希幾忌揮机旗既期棋棄"], +["8b40","機帰毅気汽畿祈季稀紀徽規記貴起軌輝飢騎鬼亀偽儀妓宜戯技擬欺犠疑祇義蟻誼議掬菊鞠吉吃喫桔橘詰砧杵黍却客脚虐逆丘久仇休及吸宮弓急救"], +["8b80","朽求汲泣灸球究窮笈級糾給旧牛去居巨拒拠挙渠虚許距鋸漁禦魚亨享京供侠僑兇競共凶協匡卿叫喬境峡強彊怯恐恭挟教橋況狂狭矯胸脅興蕎郷鏡響饗驚仰凝尭暁業局曲極玉桐粁僅勤均巾錦斤欣欽琴禁禽筋緊芹菌衿襟謹近金吟銀九倶句区狗玖矩苦躯駆駈駒具愚虞喰空偶寓遇隅串櫛釧屑屈"], +["8c40","掘窟沓靴轡窪熊隈粂栗繰桑鍬勲君薫訓群軍郡卦袈祁係傾刑兄啓圭珪型契形径恵慶慧憩掲携敬景桂渓畦稽系経継繋罫茎荊蛍計詣警軽頚鶏芸迎鯨"], +["8c80","劇戟撃激隙桁傑欠決潔穴結血訣月件倹倦健兼券剣喧圏堅嫌建憲懸拳捲検権牽犬献研硯絹県肩見謙賢軒遣鍵険顕験鹸元原厳幻弦減源玄現絃舷言諺限乎個古呼固姑孤己庫弧戸故枯湖狐糊袴股胡菰虎誇跨鈷雇顧鼓五互伍午呉吾娯後御悟梧檎瑚碁語誤護醐乞鯉交佼侯候倖光公功効勾厚口向"], +["8d40","后喉坑垢好孔孝宏工巧巷幸広庚康弘恒慌抗拘控攻昂晃更杭校梗構江洪浩港溝甲皇硬稿糠紅紘絞綱耕考肯肱腔膏航荒行衡講貢購郊酵鉱砿鋼閤降"], +["8d80","項香高鴻剛劫号合壕拷濠豪轟麹克刻告国穀酷鵠黒獄漉腰甑忽惚骨狛込此頃今困坤墾婚恨懇昏昆根梱混痕紺艮魂些佐叉唆嵯左差査沙瑳砂詐鎖裟坐座挫債催再最哉塞妻宰彩才採栽歳済災采犀砕砦祭斎細菜裁載際剤在材罪財冴坂阪堺榊肴咲崎埼碕鷺作削咋搾昨朔柵窄策索錯桜鮭笹匙冊刷"], +["8e40","察拶撮擦札殺薩雑皐鯖捌錆鮫皿晒三傘参山惨撒散桟燦珊産算纂蚕讃賛酸餐斬暫残仕仔伺使刺司史嗣四士始姉姿子屍市師志思指支孜斯施旨枝止"], +["8e80","死氏獅祉私糸紙紫肢脂至視詞詩試誌諮資賜雌飼歯事似侍児字寺慈持時次滋治爾璽痔磁示而耳自蒔辞汐鹿式識鴫竺軸宍雫七叱執失嫉室悉湿漆疾質実蔀篠偲柴芝屡蕊縞舎写射捨赦斜煮社紗者謝車遮蛇邪借勺尺杓灼爵酌釈錫若寂弱惹主取守手朱殊狩珠種腫趣酒首儒受呪寿授樹綬需囚収周"], +["8f40","宗就州修愁拾洲秀秋終繍習臭舟蒐衆襲讐蹴輯週酋酬集醜什住充十従戎柔汁渋獣縦重銃叔夙宿淑祝縮粛塾熟出術述俊峻春瞬竣舜駿准循旬楯殉淳"], +["8f80","準潤盾純巡遵醇順処初所暑曙渚庶緒署書薯藷諸助叙女序徐恕鋤除傷償勝匠升召哨商唱嘗奨妾娼宵将小少尚庄床廠彰承抄招掌捷昇昌昭晶松梢樟樵沼消渉湘焼焦照症省硝礁祥称章笑粧紹肖菖蒋蕉衝裳訟証詔詳象賞醤鉦鍾鐘障鞘上丈丞乗冗剰城場壌嬢常情擾条杖浄状畳穣蒸譲醸錠嘱埴飾"], +["9040","拭植殖燭織職色触食蝕辱尻伸信侵唇娠寝審心慎振新晋森榛浸深申疹真神秦紳臣芯薪親診身辛進針震人仁刃塵壬尋甚尽腎訊迅陣靭笥諏須酢図厨"], +["9080","逗吹垂帥推水炊睡粋翠衰遂酔錐錘随瑞髄崇嵩数枢趨雛据杉椙菅頗雀裾澄摺寸世瀬畝是凄制勢姓征性成政整星晴棲栖正清牲生盛精聖声製西誠誓請逝醒青静斉税脆隻席惜戚斥昔析石積籍績脊責赤跡蹟碩切拙接摂折設窃節説雪絶舌蝉仙先千占宣専尖川戦扇撰栓栴泉浅洗染潜煎煽旋穿箭線"], +["9140","繊羨腺舛船薦詮賎践選遷銭銑閃鮮前善漸然全禅繕膳糎噌塑岨措曾曽楚狙疏疎礎祖租粗素組蘇訴阻遡鼠僧創双叢倉喪壮奏爽宋層匝惣想捜掃挿掻"], +["9180","操早曹巣槍槽漕燥争痩相窓糟総綜聡草荘葬蒼藻装走送遭鎗霜騒像増憎臓蔵贈造促側則即息捉束測足速俗属賊族続卒袖其揃存孫尊損村遜他多太汰詑唾堕妥惰打柁舵楕陀駄騨体堆対耐岱帯待怠態戴替泰滞胎腿苔袋貸退逮隊黛鯛代台大第醍題鷹滝瀧卓啄宅托択拓沢濯琢託鐸濁諾茸凧蛸只"], +["9240","叩但達辰奪脱巽竪辿棚谷狸鱈樽誰丹単嘆坦担探旦歎淡湛炭短端箪綻耽胆蛋誕鍛団壇弾断暖檀段男談値知地弛恥智池痴稚置致蜘遅馳築畜竹筑蓄"], +["9280","逐秩窒茶嫡着中仲宙忠抽昼柱注虫衷註酎鋳駐樗瀦猪苧著貯丁兆凋喋寵帖帳庁弔張彫徴懲挑暢朝潮牒町眺聴脹腸蝶調諜超跳銚長頂鳥勅捗直朕沈珍賃鎮陳津墜椎槌追鎚痛通塚栂掴槻佃漬柘辻蔦綴鍔椿潰坪壷嬬紬爪吊釣鶴亭低停偵剃貞呈堤定帝底庭廷弟悌抵挺提梯汀碇禎程締艇訂諦蹄逓"], +["9340","邸鄭釘鼎泥摘擢敵滴的笛適鏑溺哲徹撤轍迭鉄典填天展店添纏甜貼転顛点伝殿澱田電兎吐堵塗妬屠徒斗杜渡登菟賭途都鍍砥砺努度土奴怒倒党冬"], +["9380","凍刀唐塔塘套宕島嶋悼投搭東桃梼棟盗淘湯涛灯燈当痘祷等答筒糖統到董蕩藤討謄豆踏逃透鐙陶頭騰闘働動同堂導憧撞洞瞳童胴萄道銅峠鴇匿得徳涜特督禿篤毒独読栃橡凸突椴届鳶苫寅酉瀞噸屯惇敦沌豚遁頓呑曇鈍奈那内乍凪薙謎灘捺鍋楢馴縄畷南楠軟難汝二尼弐迩匂賑肉虹廿日乳入"], +["9440","如尿韮任妊忍認濡禰祢寧葱猫熱年念捻撚燃粘乃廼之埜嚢悩濃納能脳膿農覗蚤巴把播覇杷波派琶破婆罵芭馬俳廃拝排敗杯盃牌背肺輩配倍培媒梅"], +["9480","楳煤狽買売賠陪這蝿秤矧萩伯剥博拍柏泊白箔粕舶薄迫曝漠爆縛莫駁麦函箱硲箸肇筈櫨幡肌畑畠八鉢溌発醗髪伐罰抜筏閥鳩噺塙蛤隼伴判半反叛帆搬斑板氾汎版犯班畔繁般藩販範釆煩頒飯挽晩番盤磐蕃蛮匪卑否妃庇彼悲扉批披斐比泌疲皮碑秘緋罷肥被誹費避非飛樋簸備尾微枇毘琵眉美"], +["9540","鼻柊稗匹疋髭彦膝菱肘弼必畢筆逼桧姫媛紐百謬俵彪標氷漂瓢票表評豹廟描病秒苗錨鋲蒜蛭鰭品彬斌浜瀕貧賓頻敏瓶不付埠夫婦富冨布府怖扶敷"], +["9580","斧普浮父符腐膚芙譜負賦赴阜附侮撫武舞葡蕪部封楓風葺蕗伏副復幅服福腹複覆淵弗払沸仏物鮒分吻噴墳憤扮焚奮粉糞紛雰文聞丙併兵塀幣平弊柄並蔽閉陛米頁僻壁癖碧別瞥蔑箆偏変片篇編辺返遍便勉娩弁鞭保舗鋪圃捕歩甫補輔穂募墓慕戊暮母簿菩倣俸包呆報奉宝峰峯崩庖抱捧放方朋"], +["9640","法泡烹砲縫胞芳萌蓬蜂褒訪豊邦鋒飽鳳鵬乏亡傍剖坊妨帽忘忙房暴望某棒冒紡肪膨謀貌貿鉾防吠頬北僕卜墨撲朴牧睦穆釦勃没殆堀幌奔本翻凡盆"], +["9680","摩磨魔麻埋妹昧枚毎哩槙幕膜枕鮪柾鱒桝亦俣又抹末沫迄侭繭麿万慢満漫蔓味未魅巳箕岬密蜜湊蓑稔脈妙粍民眠務夢無牟矛霧鵡椋婿娘冥名命明盟迷銘鳴姪牝滅免棉綿緬面麺摸模茂妄孟毛猛盲網耗蒙儲木黙目杢勿餅尤戻籾貰問悶紋門匁也冶夜爺耶野弥矢厄役約薬訳躍靖柳薮鑓愉愈油癒"], +["9740","諭輸唯佑優勇友宥幽悠憂揖有柚湧涌猶猷由祐裕誘遊邑郵雄融夕予余与誉輿預傭幼妖容庸揚揺擁曜楊様洋溶熔用窯羊耀葉蓉要謡踊遥陽養慾抑欲"], +["9780","沃浴翌翼淀羅螺裸来莱頼雷洛絡落酪乱卵嵐欄濫藍蘭覧利吏履李梨理璃痢裏裡里離陸律率立葎掠略劉流溜琉留硫粒隆竜龍侶慮旅虜了亮僚両凌寮料梁涼猟療瞭稜糧良諒遼量陵領力緑倫厘林淋燐琳臨輪隣鱗麟瑠塁涙累類令伶例冷励嶺怜玲礼苓鈴隷零霊麗齢暦歴列劣烈裂廉恋憐漣煉簾練聯"], +["9840","蓮連錬呂魯櫓炉賂路露労婁廊弄朗楼榔浪漏牢狼篭老聾蝋郎六麓禄肋録論倭和話歪賄脇惑枠鷲亙亘鰐詫藁蕨椀湾碗腕"], +["989f","弌丐丕个丱丶丼丿乂乖乘亂亅豫亊舒弍于亞亟亠亢亰亳亶从仍仄仆仂仗仞仭仟价伉佚估佛佝佗佇佶侈侏侘佻佩佰侑佯來侖儘俔俟俎俘俛俑俚俐俤俥倚倨倔倪倥倅伜俶倡倩倬俾俯們倆偃假會偕偐偈做偖偬偸傀傚傅傴傲"], +["9940","僉僊傳僂僖僞僥僭僣僮價僵儉儁儂儖儕儔儚儡儺儷儼儻儿兀兒兌兔兢竸兩兪兮冀冂囘册冉冏冑冓冕冖冤冦冢冩冪冫决冱冲冰况冽凅凉凛几處凩凭"], +["9980","凰凵凾刄刋刔刎刧刪刮刳刹剏剄剋剌剞剔剪剴剩剳剿剽劍劔劒剱劈劑辨辧劬劭劼劵勁勍勗勞勣勦飭勠勳勵勸勹匆匈甸匍匐匏匕匚匣匯匱匳匸區卆卅丗卉卍凖卞卩卮夘卻卷厂厖厠厦厥厮厰厶參簒雙叟曼燮叮叨叭叺吁吽呀听吭吼吮吶吩吝呎咏呵咎呟呱呷呰咒呻咀呶咄咐咆哇咢咸咥咬哄哈咨"], +["9a40","咫哂咤咾咼哘哥哦唏唔哽哮哭哺哢唹啀啣啌售啜啅啖啗唸唳啝喙喀咯喊喟啻啾喘喞單啼喃喩喇喨嗚嗅嗟嗄嗜嗤嗔嘔嗷嘖嗾嗽嘛嗹噎噐營嘴嘶嘲嘸"], +["9a80","噫噤嘯噬噪嚆嚀嚊嚠嚔嚏嚥嚮嚶嚴囂嚼囁囃囀囈囎囑囓囗囮囹圀囿圄圉圈國圍圓團圖嗇圜圦圷圸坎圻址坏坩埀垈坡坿垉垓垠垳垤垪垰埃埆埔埒埓堊埖埣堋堙堝塲堡塢塋塰毀塒堽塹墅墹墟墫墺壞墻墸墮壅壓壑壗壙壘壥壜壤壟壯壺壹壻壼壽夂夊夐夛梦夥夬夭夲夸夾竒奕奐奎奚奘奢奠奧奬奩"], +["9b40","奸妁妝佞侫妣妲姆姨姜妍姙姚娥娟娑娜娉娚婀婬婉娵娶婢婪媚媼媾嫋嫂媽嫣嫗嫦嫩嫖嫺嫻嬌嬋嬖嬲嫐嬪嬶嬾孃孅孀孑孕孚孛孥孩孰孳孵學斈孺宀"], +["9b80","它宦宸寃寇寉寔寐寤實寢寞寥寫寰寶寳尅將專對尓尠尢尨尸尹屁屆屎屓屐屏孱屬屮乢屶屹岌岑岔妛岫岻岶岼岷峅岾峇峙峩峽峺峭嶌峪崋崕崗嵜崟崛崑崔崢崚崙崘嵌嵒嵎嵋嵬嵳嵶嶇嶄嶂嶢嶝嶬嶮嶽嶐嶷嶼巉巍巓巒巖巛巫已巵帋帚帙帑帛帶帷幄幃幀幎幗幔幟幢幤幇幵并幺麼广庠廁廂廈廐廏"], +["9c40","廖廣廝廚廛廢廡廨廩廬廱廳廰廴廸廾弃弉彝彜弋弑弖弩弭弸彁彈彌彎弯彑彖彗彙彡彭彳彷徃徂彿徊很徑徇從徙徘徠徨徭徼忖忻忤忸忱忝悳忿怡恠"], +["9c80","怙怐怩怎怱怛怕怫怦怏怺恚恁恪恷恟恊恆恍恣恃恤恂恬恫恙悁悍惧悃悚悄悛悖悗悒悧悋惡悸惠惓悴忰悽惆悵惘慍愕愆惶惷愀惴惺愃愡惻惱愍愎慇愾愨愧慊愿愼愬愴愽慂慄慳慷慘慙慚慫慴慯慥慱慟慝慓慵憙憖憇憬憔憚憊憑憫憮懌懊應懷懈懃懆憺懋罹懍懦懣懶懺懴懿懽懼懾戀戈戉戍戌戔戛"], +["9d40","戞戡截戮戰戲戳扁扎扞扣扛扠扨扼抂抉找抒抓抖拔抃抔拗拑抻拏拿拆擔拈拜拌拊拂拇抛拉挌拮拱挧挂挈拯拵捐挾捍搜捏掖掎掀掫捶掣掏掉掟掵捫"], +["9d80","捩掾揩揀揆揣揉插揶揄搖搴搆搓搦搶攝搗搨搏摧摯摶摎攪撕撓撥撩撈撼據擒擅擇撻擘擂擱擧舉擠擡抬擣擯攬擶擴擲擺攀擽攘攜攅攤攣攫攴攵攷收攸畋效敖敕敍敘敞敝敲數斂斃變斛斟斫斷旃旆旁旄旌旒旛旙无旡旱杲昊昃旻杳昵昶昴昜晏晄晉晁晞晝晤晧晨晟晢晰暃暈暎暉暄暘暝曁暹曉暾暼"], +["9e40","曄暸曖曚曠昿曦曩曰曵曷朏朖朞朦朧霸朮朿朶杁朸朷杆杞杠杙杣杤枉杰枩杼杪枌枋枦枡枅枷柯枴柬枳柩枸柤柞柝柢柮枹柎柆柧檜栞框栩桀桍栲桎"], +["9e80","梳栫桙档桷桿梟梏梭梔條梛梃檮梹桴梵梠梺椏梍桾椁棊椈棘椢椦棡椌棍棔棧棕椶椒椄棗棣椥棹棠棯椨椪椚椣椡棆楹楷楜楸楫楔楾楮椹楴椽楙椰楡楞楝榁楪榲榮槐榿槁槓榾槎寨槊槝榻槃榧樮榑榠榜榕榴槞槨樂樛槿權槹槲槧樅榱樞槭樔槫樊樒櫁樣樓橄樌橲樶橸橇橢橙橦橈樸樢檐檍檠檄檢檣"], +["9f40","檗蘗檻櫃櫂檸檳檬櫞櫑櫟檪櫚櫪櫻欅蘖櫺欒欖鬱欟欸欷盜欹飮歇歃歉歐歙歔歛歟歡歸歹歿殀殄殃殍殘殕殞殤殪殫殯殲殱殳殷殼毆毋毓毟毬毫毳毯"], +["9f80","麾氈氓气氛氤氣汞汕汢汪沂沍沚沁沛汾汨汳沒沐泄泱泓沽泗泅泝沮沱沾沺泛泯泙泪洟衍洶洫洽洸洙洵洳洒洌浣涓浤浚浹浙涎涕濤涅淹渕渊涵淇淦涸淆淬淞淌淨淒淅淺淙淤淕淪淮渭湮渮渙湲湟渾渣湫渫湶湍渟湃渺湎渤滿渝游溂溪溘滉溷滓溽溯滄溲滔滕溏溥滂溟潁漑灌滬滸滾漿滲漱滯漲滌"], +["e040","漾漓滷澆潺潸澁澀潯潛濳潭澂潼潘澎澑濂潦澳澣澡澤澹濆澪濟濕濬濔濘濱濮濛瀉瀋濺瀑瀁瀏濾瀛瀚潴瀝瀘瀟瀰瀾瀲灑灣炙炒炯烱炬炸炳炮烟烋烝"], +["e080","烙焉烽焜焙煥煕熈煦煢煌煖煬熏燻熄熕熨熬燗熹熾燒燉燔燎燠燬燧燵燼燹燿爍爐爛爨爭爬爰爲爻爼爿牀牆牋牘牴牾犂犁犇犒犖犢犧犹犲狃狆狄狎狒狢狠狡狹狷倏猗猊猜猖猝猴猯猩猥猾獎獏默獗獪獨獰獸獵獻獺珈玳珎玻珀珥珮珞璢琅瑯琥珸琲琺瑕琿瑟瑙瑁瑜瑩瑰瑣瑪瑶瑾璋璞璧瓊瓏瓔珱"], +["e140","瓠瓣瓧瓩瓮瓲瓰瓱瓸瓷甄甃甅甌甎甍甕甓甞甦甬甼畄畍畊畉畛畆畚畩畤畧畫畭畸當疆疇畴疊疉疂疔疚疝疥疣痂疳痃疵疽疸疼疱痍痊痒痙痣痞痾痿"], +["e180","痼瘁痰痺痲痳瘋瘍瘉瘟瘧瘠瘡瘢瘤瘴瘰瘻癇癈癆癜癘癡癢癨癩癪癧癬癰癲癶癸發皀皃皈皋皎皖皓皙皚皰皴皸皹皺盂盍盖盒盞盡盥盧盪蘯盻眈眇眄眩眤眞眥眦眛眷眸睇睚睨睫睛睥睿睾睹瞎瞋瞑瞠瞞瞰瞶瞹瞿瞼瞽瞻矇矍矗矚矜矣矮矼砌砒礦砠礪硅碎硴碆硼碚碌碣碵碪碯磑磆磋磔碾碼磅磊磬"], +["e240","磧磚磽磴礇礒礑礙礬礫祀祠祗祟祚祕祓祺祿禊禝禧齋禪禮禳禹禺秉秕秧秬秡秣稈稍稘稙稠稟禀稱稻稾稷穃穗穉穡穢穩龝穰穹穽窈窗窕窘窖窩竈窰"], +["e280","窶竅竄窿邃竇竊竍竏竕竓站竚竝竡竢竦竭竰笂笏笊笆笳笘笙笞笵笨笶筐筺笄筍笋筌筅筵筥筴筧筰筱筬筮箝箘箟箍箜箚箋箒箏筝箙篋篁篌篏箴篆篝篩簑簔篦篥籠簀簇簓篳篷簗簍篶簣簧簪簟簷簫簽籌籃籔籏籀籐籘籟籤籖籥籬籵粃粐粤粭粢粫粡粨粳粲粱粮粹粽糀糅糂糘糒糜糢鬻糯糲糴糶糺紆"], +["e340","紂紜紕紊絅絋紮紲紿紵絆絳絖絎絲絨絮絏絣經綉絛綏絽綛綺綮綣綵緇綽綫總綢綯緜綸綟綰緘緝緤緞緻緲緡縅縊縣縡縒縱縟縉縋縢繆繦縻縵縹繃縷"], +["e380","縲縺繧繝繖繞繙繚繹繪繩繼繻纃緕繽辮繿纈纉續纒纐纓纔纖纎纛纜缸缺罅罌罍罎罐网罕罔罘罟罠罨罩罧罸羂羆羃羈羇羌羔羞羝羚羣羯羲羹羮羶羸譱翅翆翊翕翔翡翦翩翳翹飜耆耄耋耒耘耙耜耡耨耿耻聊聆聒聘聚聟聢聨聳聲聰聶聹聽聿肄肆肅肛肓肚肭冐肬胛胥胙胝胄胚胖脉胯胱脛脩脣脯腋"], +["e440","隋腆脾腓腑胼腱腮腥腦腴膃膈膊膀膂膠膕膤膣腟膓膩膰膵膾膸膽臀臂膺臉臍臑臙臘臈臚臟臠臧臺臻臾舁舂舅與舊舍舐舖舩舫舸舳艀艙艘艝艚艟艤"], +["e480","艢艨艪艫舮艱艷艸艾芍芒芫芟芻芬苡苣苟苒苴苳苺莓范苻苹苞茆苜茉苙茵茴茖茲茱荀茹荐荅茯茫茗茘莅莚莪莟莢莖茣莎莇莊荼莵荳荵莠莉莨菴萓菫菎菽萃菘萋菁菷萇菠菲萍萢萠莽萸蔆菻葭萪萼蕚蒄葷葫蒭葮蒂葩葆萬葯葹萵蓊葢蒹蒿蒟蓙蓍蒻蓚蓐蓁蓆蓖蒡蔡蓿蓴蔗蔘蔬蔟蔕蔔蓼蕀蕣蕘蕈"], +["e540","蕁蘂蕋蕕薀薤薈薑薊薨蕭薔薛藪薇薜蕷蕾薐藉薺藏薹藐藕藝藥藜藹蘊蘓蘋藾藺蘆蘢蘚蘰蘿虍乕虔號虧虱蚓蚣蚩蚪蚋蚌蚶蚯蛄蛆蚰蛉蠣蚫蛔蛞蛩蛬"], +["e580","蛟蛛蛯蜒蜆蜈蜀蜃蛻蜑蜉蜍蛹蜊蜴蜿蜷蜻蜥蜩蜚蝠蝟蝸蝌蝎蝴蝗蝨蝮蝙蝓蝣蝪蠅螢螟螂螯蟋螽蟀蟐雖螫蟄螳蟇蟆螻蟯蟲蟠蠏蠍蟾蟶蟷蠎蟒蠑蠖蠕蠢蠡蠱蠶蠹蠧蠻衄衂衒衙衞衢衫袁衾袞衵衽袵衲袂袗袒袮袙袢袍袤袰袿袱裃裄裔裘裙裝裹褂裼裴裨裲褄褌褊褓襃褞褥褪褫襁襄褻褶褸襌褝襠襞"], +["e640","襦襤襭襪襯襴襷襾覃覈覊覓覘覡覩覦覬覯覲覺覽覿觀觚觜觝觧觴觸訃訖訐訌訛訝訥訶詁詛詒詆詈詼詭詬詢誅誂誄誨誡誑誥誦誚誣諄諍諂諚諫諳諧"], +["e680","諤諱謔諠諢諷諞諛謌謇謚諡謖謐謗謠謳鞫謦謫謾謨譁譌譏譎證譖譛譚譫譟譬譯譴譽讀讌讎讒讓讖讙讚谺豁谿豈豌豎豐豕豢豬豸豺貂貉貅貊貍貎貔豼貘戝貭貪貽貲貳貮貶賈賁賤賣賚賽賺賻贄贅贊贇贏贍贐齎贓賍贔贖赧赭赱赳趁趙跂趾趺跏跚跖跌跛跋跪跫跟跣跼踈踉跿踝踞踐踟蹂踵踰踴蹊"], +["e740","蹇蹉蹌蹐蹈蹙蹤蹠踪蹣蹕蹶蹲蹼躁躇躅躄躋躊躓躑躔躙躪躡躬躰軆躱躾軅軈軋軛軣軼軻軫軾輊輅輕輒輙輓輜輟輛輌輦輳輻輹轅轂輾轌轉轆轎轗轜"], +["e780","轢轣轤辜辟辣辭辯辷迚迥迢迪迯邇迴逅迹迺逑逕逡逍逞逖逋逧逶逵逹迸遏遐遑遒逎遉逾遖遘遞遨遯遶隨遲邂遽邁邀邊邉邏邨邯邱邵郢郤扈郛鄂鄒鄙鄲鄰酊酖酘酣酥酩酳酲醋醉醂醢醫醯醪醵醴醺釀釁釉釋釐釖釟釡釛釼釵釶鈞釿鈔鈬鈕鈑鉞鉗鉅鉉鉤鉈銕鈿鉋鉐銜銖銓銛鉚鋏銹銷鋩錏鋺鍄錮"], +["e840","錙錢錚錣錺錵錻鍜鍠鍼鍮鍖鎰鎬鎭鎔鎹鏖鏗鏨鏥鏘鏃鏝鏐鏈鏤鐚鐔鐓鐃鐇鐐鐶鐫鐵鐡鐺鑁鑒鑄鑛鑠鑢鑞鑪鈩鑰鑵鑷鑽鑚鑼鑾钁鑿閂閇閊閔閖閘閙"], +["e880","閠閨閧閭閼閻閹閾闊濶闃闍闌闕闔闖關闡闥闢阡阨阮阯陂陌陏陋陷陜陞陝陟陦陲陬隍隘隕隗險隧隱隲隰隴隶隸隹雎雋雉雍襍雜霍雕雹霄霆霈霓霎霑霏霖霙霤霪霰霹霽霾靄靆靈靂靉靜靠靤靦靨勒靫靱靹鞅靼鞁靺鞆鞋鞏鞐鞜鞨鞦鞣鞳鞴韃韆韈韋韜韭齏韲竟韶韵頏頌頸頤頡頷頽顆顏顋顫顯顰"], +["e940","顱顴顳颪颯颱颶飄飃飆飩飫餃餉餒餔餘餡餝餞餤餠餬餮餽餾饂饉饅饐饋饑饒饌饕馗馘馥馭馮馼駟駛駝駘駑駭駮駱駲駻駸騁騏騅駢騙騫騷驅驂驀驃"], +["e980","騾驕驍驛驗驟驢驥驤驩驫驪骭骰骼髀髏髑髓體髞髟髢髣髦髯髫髮髴髱髷髻鬆鬘鬚鬟鬢鬣鬥鬧鬨鬩鬪鬮鬯鬲魄魃魏魍魎魑魘魴鮓鮃鮑鮖鮗鮟鮠鮨鮴鯀鯊鮹鯆鯏鯑鯒鯣鯢鯤鯔鯡鰺鯲鯱鯰鰕鰔鰉鰓鰌鰆鰈鰒鰊鰄鰮鰛鰥鰤鰡鰰鱇鰲鱆鰾鱚鱠鱧鱶鱸鳧鳬鳰鴉鴈鳫鴃鴆鴪鴦鶯鴣鴟鵄鴕鴒鵁鴿鴾鵆鵈"], +["ea40","鵝鵞鵤鵑鵐鵙鵲鶉鶇鶫鵯鵺鶚鶤鶩鶲鷄鷁鶻鶸鶺鷆鷏鷂鷙鷓鷸鷦鷭鷯鷽鸚鸛鸞鹵鹹鹽麁麈麋麌麒麕麑麝麥麩麸麪麭靡黌黎黏黐黔黜點黝黠黥黨黯"], +["ea80","黴黶黷黹黻黼黽鼇鼈皷鼕鼡鼬鼾齊齒齔齣齟齠齡齦齧齬齪齷齲齶龕龜龠堯槇遙瑤凜熙"], +["ed40","纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏"], +["ed80","塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱"], +["ee40","犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙"], +["ee80","蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"], +["eeef","ⅰ",9,"¬¦'""], +["f040","",62], +["f080","",124], +["f140","",62], +["f180","",124], +["f240","",62], +["f280","",124], +["f340","",62], +["f380","",124], +["f440","",62], +["f480","",124], +["f540","",62], +["f580","",124], +["f640","",62], +["f680","",124], +["f740","",62], +["f780","",124], +["f840","",62], +["f880","",124], +["f940",""], +["fa40","ⅰ",9,"Ⅰ",9,"¬¦'"㈱№℡∵纊褜鍈銈蓜俉炻昱棈鋹曻彅丨仡仼伀伃伹佖侒侊侚侔俍偀倢俿倞偆偰偂傔僴僘兊"], +["fa80","兤冝冾凬刕劜劦勀勛匀匇匤卲厓厲叝﨎咜咊咩哿喆坙坥垬埈埇﨏塚增墲夋奓奛奝奣妤妺孖寀甯寘寬尞岦岺峵崧嵓﨑嵂嵭嶸嶹巐弡弴彧德忞恝悅悊惞惕愠惲愑愷愰憘戓抦揵摠撝擎敎昀昕昻昉昮昞昤晥晗晙晴晳暙暠暲暿曺朎朗杦枻桒柀栁桄棏﨓楨﨔榘槢樰橫橆橳橾櫢櫤毖氿汜沆汯泚洄涇浯"], +["fb40","涖涬淏淸淲淼渹湜渧渼溿澈澵濵瀅瀇瀨炅炫焏焄煜煆煇凞燁燾犱犾猤猪獷玽珉珖珣珒琇珵琦琪琩琮瑢璉璟甁畯皂皜皞皛皦益睆劯砡硎硤硺礰礼神"], +["fb80","祥禔福禛竑竧靖竫箞精絈絜綷綠緖繒罇羡羽茁荢荿菇菶葈蒴蕓蕙蕫﨟薰蘒﨡蠇裵訒訷詹誧誾諟諸諶譓譿賰賴贒赶﨣軏﨤逸遧郞都鄕鄧釚釗釞釭釮釤釥鈆鈐鈊鈺鉀鈼鉎鉙鉑鈹鉧銧鉷鉸鋧鋗鋙鋐﨧鋕鋠鋓錥錡鋻﨨錞鋿錝錂鍰鍗鎤鏆鏞鏸鐱鑅鑈閒隆﨩隝隯霳霻靃靍靏靑靕顗顥飯飼餧館馞驎髙"], +["fc40","髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"] +] diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/utf16.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/utf16.js new file mode 100644 index 0000000000000000000000000000000000000000..97d066925bbd5dfaa7213e0433570a113c461f3e --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/utf16.js @@ -0,0 +1,197 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// Note: UTF16-LE (or UCS2) codec is Node.js native. See encodings/internal.js + +// == UTF16-BE codec. ========================================================== + +exports.utf16be = Utf16BECodec; +function Utf16BECodec() { +} + +Utf16BECodec.prototype.encoder = Utf16BEEncoder; +Utf16BECodec.prototype.decoder = Utf16BEDecoder; +Utf16BECodec.prototype.bomAware = true; + + +// -- Encoding + +function Utf16BEEncoder() { +} + +Utf16BEEncoder.prototype.write = function(str) { + var buf = Buffer.from(str, 'ucs2'); + for (var i = 0; i < buf.length; i += 2) { + var tmp = buf[i]; buf[i] = buf[i+1]; buf[i+1] = tmp; + } + return buf; +} + +Utf16BEEncoder.prototype.end = function() { +} + + +// -- Decoding + +function Utf16BEDecoder() { + this.overflowByte = -1; +} + +Utf16BEDecoder.prototype.write = function(buf) { + if (buf.length == 0) + return ''; + + var buf2 = Buffer.alloc(buf.length + 1), + i = 0, j = 0; + + if (this.overflowByte !== -1) { + buf2[0] = buf[0]; + buf2[1] = this.overflowByte; + i = 1; j = 2; + } + + for (; i < buf.length-1; i += 2, j+= 2) { + buf2[j] = buf[i+1]; + buf2[j+1] = buf[i]; + } + + this.overflowByte = (i == buf.length-1) ? buf[buf.length-1] : -1; + + return buf2.slice(0, j).toString('ucs2'); +} + +Utf16BEDecoder.prototype.end = function() { + this.overflowByte = -1; +} + + +// == UTF-16 codec ============================================================= +// Decoder chooses automatically from UTF-16LE and UTF-16BE using BOM and space-based heuristic. +// Defaults to UTF-16LE, as it's prevalent and default in Node. +// http://en.wikipedia.org/wiki/UTF-16 and http://encoding.spec.whatwg.org/#utf-16le +// Decoder default can be changed: iconv.decode(buf, 'utf16', {defaultEncoding: 'utf-16be'}); + +// Encoder uses UTF-16LE and prepends BOM (which can be overridden with addBOM: false). + +exports.utf16 = Utf16Codec; +function Utf16Codec(codecOptions, iconv) { + this.iconv = iconv; +} + +Utf16Codec.prototype.encoder = Utf16Encoder; +Utf16Codec.prototype.decoder = Utf16Decoder; + + +// -- Encoding (pass-through) + +function Utf16Encoder(options, codec) { + options = options || {}; + if (options.addBOM === undefined) + options.addBOM = true; + this.encoder = codec.iconv.getEncoder('utf-16le', options); +} + +Utf16Encoder.prototype.write = function(str) { + return this.encoder.write(str); +} + +Utf16Encoder.prototype.end = function() { + return this.encoder.end(); +} + + +// -- Decoding + +function Utf16Decoder(options, codec) { + this.decoder = null; + this.initialBufs = []; + this.initialBufsLen = 0; + + this.options = options || {}; + this.iconv = codec.iconv; +} + +Utf16Decoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; + + if (this.initialBufsLen < 16) // We need more bytes to use space heuristic (see below) + return ''; + + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } + + return this.decoder.write(buf); +} + +Utf16Decoder.prototype.end = function() { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); + + var trail = this.decoder.end(); + if (trail) + resStr += trail; + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } + return this.decoder.end(); +} + +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var asciiCharsLE = 0, asciiCharsBE = 0; // Number of ASCII chars when decoded as LE or BE. + + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 2) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE) return 'utf-16le'; + if (b[0] === 0xFE && b[1] === 0xFF) return 'utf-16be'; + } + + if (b[0] === 0 && b[1] !== 0) asciiCharsBE++; + if (b[0] !== 0 && b[1] === 0) asciiCharsLE++; + + b.length = 0; + charsProcessed++; + + if (charsProcessed >= 100) { + break outer_loop; + } + } + } + } + + // Make decisions. + // Most of the time, the content has ASCII chars (U+00**), but the opposite (U+**00) is uncommon. + // So, we count ASCII as if it was LE or BE, and decide from that. + if (asciiCharsBE > asciiCharsLE) return 'utf-16be'; + if (asciiCharsBE < asciiCharsLE) return 'utf-16le'; + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-16le'; +} + + diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/utf32.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/utf32.js new file mode 100644 index 0000000000000000000000000000000000000000..2fa900a12eb3562e38fc9442dd3f57ea919b3c74 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/utf32.js @@ -0,0 +1,319 @@ +'use strict'; + +var Buffer = require('safer-buffer').Buffer; + +// == UTF32-LE/BE codec. ========================================================== + +exports._utf32 = Utf32Codec; + +function Utf32Codec(codecOptions, iconv) { + this.iconv = iconv; + this.bomAware = true; + this.isLE = codecOptions.isLE; +} + +exports.utf32le = { type: '_utf32', isLE: true }; +exports.utf32be = { type: '_utf32', isLE: false }; + +// Aliases +exports.ucs4le = 'utf32le'; +exports.ucs4be = 'utf32be'; + +Utf32Codec.prototype.encoder = Utf32Encoder; +Utf32Codec.prototype.decoder = Utf32Decoder; + +// -- Encoding + +function Utf32Encoder(options, codec) { + this.isLE = codec.isLE; + this.highSurrogate = 0; +} + +Utf32Encoder.prototype.write = function(str) { + var src = Buffer.from(str, 'ucs2'); + var dst = Buffer.alloc(src.length * 2); + var write32 = this.isLE ? dst.writeUInt32LE : dst.writeUInt32BE; + var offset = 0; + + for (var i = 0; i < src.length; i += 2) { + var code = src.readUInt16LE(i); + var isHighSurrogate = (0xD800 <= code && code < 0xDC00); + var isLowSurrogate = (0xDC00 <= code && code < 0xE000); + + if (this.highSurrogate) { + if (isHighSurrogate || !isLowSurrogate) { + // There shouldn't be two high surrogates in a row, nor a high surrogate which isn't followed by a low + // surrogate. If this happens, keep the pending high surrogate as a stand-alone semi-invalid character + // (technically wrong, but expected by some applications, like Windows file names). + write32.call(dst, this.highSurrogate, offset); + offset += 4; + } + else { + // Create 32-bit value from high and low surrogates; + var codepoint = (((this.highSurrogate - 0xD800) << 10) | (code - 0xDC00)) + 0x10000; + + write32.call(dst, codepoint, offset); + offset += 4; + this.highSurrogate = 0; + + continue; + } + } + + if (isHighSurrogate) + this.highSurrogate = code; + else { + // Even if the current character is a low surrogate, with no previous high surrogate, we'll + // encode it as a semi-invalid stand-alone character for the same reasons expressed above for + // unpaired high surrogates. + write32.call(dst, code, offset); + offset += 4; + this.highSurrogate = 0; + } + } + + if (offset < dst.length) + dst = dst.slice(0, offset); + + return dst; +}; + +Utf32Encoder.prototype.end = function() { + // Treat any leftover high surrogate as a semi-valid independent character. + if (!this.highSurrogate) + return; + + var buf = Buffer.alloc(4); + + if (this.isLE) + buf.writeUInt32LE(this.highSurrogate, 0); + else + buf.writeUInt32BE(this.highSurrogate, 0); + + this.highSurrogate = 0; + + return buf; +}; + +// -- Decoding + +function Utf32Decoder(options, codec) { + this.isLE = codec.isLE; + this.badChar = codec.iconv.defaultCharUnicode.charCodeAt(0); + this.overflow = []; +} + +Utf32Decoder.prototype.write = function(src) { + if (src.length === 0) + return ''; + + var i = 0; + var codepoint = 0; + var dst = Buffer.alloc(src.length + 4); + var offset = 0; + var isLE = this.isLE; + var overflow = this.overflow; + var badChar = this.badChar; + + if (overflow.length > 0) { + for (; i < src.length && overflow.length < 4; i++) + overflow.push(src[i]); + + if (overflow.length === 4) { + // NOTE: codepoint is a signed int32 and can be negative. + // NOTE: We copied this block from below to help V8 optimize it (it works with array, not buffer). + if (isLE) { + codepoint = overflow[i] | (overflow[i+1] << 8) | (overflow[i+2] << 16) | (overflow[i+3] << 24); + } else { + codepoint = overflow[i+3] | (overflow[i+2] << 8) | (overflow[i+1] << 16) | (overflow[i] << 24); + } + overflow.length = 0; + + offset = _writeCodepoint(dst, offset, codepoint, badChar); + } + } + + // Main loop. Should be as optimized as possible. + for (; i < src.length - 3; i += 4) { + // NOTE: codepoint is a signed int32 and can be negative. + if (isLE) { + codepoint = src[i] | (src[i+1] << 8) | (src[i+2] << 16) | (src[i+3] << 24); + } else { + codepoint = src[i+3] | (src[i+2] << 8) | (src[i+1] << 16) | (src[i] << 24); + } + offset = _writeCodepoint(dst, offset, codepoint, badChar); + } + + // Keep overflowing bytes. + for (; i < src.length; i++) { + overflow.push(src[i]); + } + + return dst.slice(0, offset).toString('ucs2'); +}; + +function _writeCodepoint(dst, offset, codepoint, badChar) { + // NOTE: codepoint is signed int32 and can be negative. We keep it that way to help V8 with optimizations. + if (codepoint < 0 || codepoint > 0x10FFFF) { + // Not a valid Unicode codepoint + codepoint = badChar; + } + + // Ephemeral Planes: Write high surrogate. + if (codepoint >= 0x10000) { + codepoint -= 0x10000; + + var high = 0xD800 | (codepoint >> 10); + dst[offset++] = high & 0xff; + dst[offset++] = high >> 8; + + // Low surrogate is written below. + var codepoint = 0xDC00 | (codepoint & 0x3FF); + } + + // Write BMP char or low surrogate. + dst[offset++] = codepoint & 0xff; + dst[offset++] = codepoint >> 8; + + return offset; +}; + +Utf32Decoder.prototype.end = function() { + this.overflow.length = 0; +}; + +// == UTF-32 Auto codec ============================================================= +// Decoder chooses automatically from UTF-32LE and UTF-32BE using BOM and space-based heuristic. +// Defaults to UTF-32LE. http://en.wikipedia.org/wiki/UTF-32 +// Encoder/decoder default can be changed: iconv.decode(buf, 'utf32', {defaultEncoding: 'utf-32be'}); + +// Encoder prepends BOM (which can be overridden with (addBOM: false}). + +exports.utf32 = Utf32AutoCodec; +exports.ucs4 = 'utf32'; + +function Utf32AutoCodec(options, iconv) { + this.iconv = iconv; +} + +Utf32AutoCodec.prototype.encoder = Utf32AutoEncoder; +Utf32AutoCodec.prototype.decoder = Utf32AutoDecoder; + +// -- Encoding + +function Utf32AutoEncoder(options, codec) { + options = options || {}; + + if (options.addBOM === undefined) + options.addBOM = true; + + this.encoder = codec.iconv.getEncoder(options.defaultEncoding || 'utf-32le', options); +} + +Utf32AutoEncoder.prototype.write = function(str) { + return this.encoder.write(str); +}; + +Utf32AutoEncoder.prototype.end = function() { + return this.encoder.end(); +}; + +// -- Decoding + +function Utf32AutoDecoder(options, codec) { + this.decoder = null; + this.initialBufs = []; + this.initialBufsLen = 0; + this.options = options || {}; + this.iconv = codec.iconv; +} + +Utf32AutoDecoder.prototype.write = function(buf) { + if (!this.decoder) { + // Codec is not chosen yet. Accumulate initial bytes. + this.initialBufs.push(buf); + this.initialBufsLen += buf.length; + + if (this.initialBufsLen < 32) // We need more bytes to use space heuristic (see below) + return ''; + + // We have enough bytes -> detect endianness. + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } + + return this.decoder.write(buf); +}; + +Utf32AutoDecoder.prototype.end = function() { + if (!this.decoder) { + var encoding = detectEncoding(this.initialBufs, this.options.defaultEncoding); + this.decoder = this.iconv.getDecoder(encoding, this.options); + + var resStr = ''; + for (var i = 0; i < this.initialBufs.length; i++) + resStr += this.decoder.write(this.initialBufs[i]); + + var trail = this.decoder.end(); + if (trail) + resStr += trail; + + this.initialBufs.length = this.initialBufsLen = 0; + return resStr; + } + + return this.decoder.end(); +}; + +function detectEncoding(bufs, defaultEncoding) { + var b = []; + var charsProcessed = 0; + var invalidLE = 0, invalidBE = 0; // Number of invalid chars when decoded as LE or BE. + var bmpCharsLE = 0, bmpCharsBE = 0; // Number of BMP chars when decoded as LE or BE. + + outer_loop: + for (var i = 0; i < bufs.length; i++) { + var buf = bufs[i]; + for (var j = 0; j < buf.length; j++) { + b.push(buf[j]); + if (b.length === 4) { + if (charsProcessed === 0) { + // Check BOM first. + if (b[0] === 0xFF && b[1] === 0xFE && b[2] === 0 && b[3] === 0) { + return 'utf-32le'; + } + if (b[0] === 0 && b[1] === 0 && b[2] === 0xFE && b[3] === 0xFF) { + return 'utf-32be'; + } + } + + if (b[0] !== 0 || b[1] > 0x10) invalidBE++; + if (b[3] !== 0 || b[2] > 0x10) invalidLE++; + + if (b[0] === 0 && b[1] === 0 && (b[2] !== 0 || b[3] !== 0)) bmpCharsBE++; + if ((b[0] !== 0 || b[1] !== 0) && b[2] === 0 && b[3] === 0) bmpCharsLE++; + + b.length = 0; + charsProcessed++; + + if (charsProcessed >= 100) { + break outer_loop; + } + } + } + } + + // Make decisions. + if (bmpCharsBE - invalidBE > bmpCharsLE - invalidLE) return 'utf-32be'; + if (bmpCharsBE - invalidBE < bmpCharsLE - invalidLE) return 'utf-32le'; + + // Couldn't decide (likely all zeros or not enough data). + return defaultEncoding || 'utf-32le'; +} diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/utf7.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/utf7.js new file mode 100644 index 0000000000000000000000000000000000000000..eacae34d5f80d0b406ad63104406ddd5f3232f4a --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/encodings/utf7.js @@ -0,0 +1,290 @@ +"use strict"; +var Buffer = require("safer-buffer").Buffer; + +// UTF-7 codec, according to https://tools.ietf.org/html/rfc2152 +// See also below a UTF-7-IMAP codec, according to http://tools.ietf.org/html/rfc3501#section-5.1.3 + +exports.utf7 = Utf7Codec; +exports.unicode11utf7 = 'utf7'; // Alias UNICODE-1-1-UTF-7 +function Utf7Codec(codecOptions, iconv) { + this.iconv = iconv; +}; + +Utf7Codec.prototype.encoder = Utf7Encoder; +Utf7Codec.prototype.decoder = Utf7Decoder; +Utf7Codec.prototype.bomAware = true; + + +// -- Encoding + +var nonDirectChars = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g; + +function Utf7Encoder(options, codec) { + this.iconv = codec.iconv; +} + +Utf7Encoder.prototype.write = function(str) { + // Naive implementation. + // Non-direct chars are encoded as "+-"; single "+" char is encoded as "+-". + return Buffer.from(str.replace(nonDirectChars, function(chunk) { + return "+" + (chunk === '+' ? '' : + this.iconv.encode(chunk, 'utf16-be').toString('base64').replace(/=+$/, '')) + + "-"; + }.bind(this))); +} + +Utf7Encoder.prototype.end = function() { +} + + +// -- Decoding + +function Utf7Decoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} + +var base64Regex = /[A-Za-z0-9\/+]/; +var base64Chars = []; +for (var i = 0; i < 256; i++) + base64Chars[i] = base64Regex.test(String.fromCharCode(i)); + +var plusChar = '+'.charCodeAt(0), + minusChar = '-'.charCodeAt(0), + andChar = '&'.charCodeAt(0); + +Utf7Decoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; + + // The decoder is more involved as we must handle chunks in stream. + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '+' + if (buf[i] == plusChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64Chars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) {// "+-" -> "+" + res += "+"; + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii"); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + if (buf[i] != minusChar) // Minus is absorbed after base64. + i--; + + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii"); + + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); + + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + + return res; +} + +Utf7Decoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); + + this.inBase64 = false; + this.base64Accum = ''; + return res; +} + + +// UTF-7-IMAP codec. +// RFC3501 Sec. 5.1.3 Modified UTF-7 (http://tools.ietf.org/html/rfc3501#section-5.1.3) +// Differences: +// * Base64 part is started by "&" instead of "+" +// * Direct characters are 0x20-0x7E, except "&" (0x26) +// * In Base64, "," is used instead of "/" +// * Base64 must not be used to represent direct characters. +// * No implicit shift back from Base64 (should always end with '-') +// * String must end in non-shifted position. +// * "-&" while in base64 is not allowed. + + +exports.utf7imap = Utf7IMAPCodec; +function Utf7IMAPCodec(codecOptions, iconv) { + this.iconv = iconv; +}; + +Utf7IMAPCodec.prototype.encoder = Utf7IMAPEncoder; +Utf7IMAPCodec.prototype.decoder = Utf7IMAPDecoder; +Utf7IMAPCodec.prototype.bomAware = true; + + +// -- Encoding + +function Utf7IMAPEncoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = Buffer.alloc(6); + this.base64AccumIdx = 0; +} + +Utf7IMAPEncoder.prototype.write = function(str) { + var inBase64 = this.inBase64, + base64Accum = this.base64Accum, + base64AccumIdx = this.base64AccumIdx, + buf = Buffer.alloc(str.length*5 + 10), bufIdx = 0; + + for (var i = 0; i < str.length; i++) { + var uChar = str.charCodeAt(i); + if (0x20 <= uChar && uChar <= 0x7E) { // Direct character or '&'. + if (inBase64) { + if (base64AccumIdx > 0) { + bufIdx += buf.write(base64Accum.slice(0, base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + base64AccumIdx = 0; + } + + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + inBase64 = false; + } + + if (!inBase64) { + buf[bufIdx++] = uChar; // Write direct character + + if (uChar === andChar) // Ampersand -> '&-' + buf[bufIdx++] = minusChar; + } + + } else { // Non-direct character + if (!inBase64) { + buf[bufIdx++] = andChar; // Write '&', then go to base64 mode. + inBase64 = true; + } + if (inBase64) { + base64Accum[base64AccumIdx++] = uChar >> 8; + base64Accum[base64AccumIdx++] = uChar & 0xFF; + + if (base64AccumIdx == base64Accum.length) { + bufIdx += buf.write(base64Accum.toString('base64').replace(/\//g, ','), bufIdx); + base64AccumIdx = 0; + } + } + } + } + + this.inBase64 = inBase64; + this.base64AccumIdx = base64AccumIdx; + + return buf.slice(0, bufIdx); +} + +Utf7IMAPEncoder.prototype.end = function() { + var buf = Buffer.alloc(10), bufIdx = 0; + if (this.inBase64) { + if (this.base64AccumIdx > 0) { + bufIdx += buf.write(this.base64Accum.slice(0, this.base64AccumIdx).toString('base64').replace(/\//g, ',').replace(/=+$/, ''), bufIdx); + this.base64AccumIdx = 0; + } + + buf[bufIdx++] = minusChar; // Write '-', then go to direct mode. + this.inBase64 = false; + } + + return buf.slice(0, bufIdx); +} + + +// -- Decoding + +function Utf7IMAPDecoder(options, codec) { + this.iconv = codec.iconv; + this.inBase64 = false; + this.base64Accum = ''; +} + +var base64IMAPChars = base64Chars.slice(); +base64IMAPChars[','.charCodeAt(0)] = true; + +Utf7IMAPDecoder.prototype.write = function(buf) { + var res = "", lastI = 0, + inBase64 = this.inBase64, + base64Accum = this.base64Accum; + + // The decoder is more involved as we must handle chunks in stream. + // It is forgiving, closer to standard UTF-7 (for example, '-' is optional at the end). + + for (var i = 0; i < buf.length; i++) { + if (!inBase64) { // We're in direct mode. + // Write direct chars until '&' + if (buf[i] == andChar) { + res += this.iconv.decode(buf.slice(lastI, i), "ascii"); // Write direct chars. + lastI = i+1; + inBase64 = true; + } + } else { // We decode base64. + if (!base64IMAPChars[buf[i]]) { // Base64 ended. + if (i == lastI && buf[i] == minusChar) { // "&-" -> "&" + res += "&"; + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI, i), "ascii").replace(/,/g, '/'); + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + if (buf[i] != minusChar) // Minus may be absorbed after base64. + i--; + + lastI = i+1; + inBase64 = false; + base64Accum = ''; + } + } + } + + if (!inBase64) { + res += this.iconv.decode(buf.slice(lastI), "ascii"); // Write direct chars. + } else { + var b64str = base64Accum + this.iconv.decode(buf.slice(lastI), "ascii").replace(/,/g, '/'); + + var canBeDecoded = b64str.length - (b64str.length % 8); // Minimal chunk: 2 quads -> 2x3 bytes -> 3 chars. + base64Accum = b64str.slice(canBeDecoded); // The rest will be decoded in future. + b64str = b64str.slice(0, canBeDecoded); + + res += this.iconv.decode(Buffer.from(b64str, 'base64'), "utf16-be"); + } + + this.inBase64 = inBase64; + this.base64Accum = base64Accum; + + return res; +} + +Utf7IMAPDecoder.prototype.end = function() { + var res = ""; + if (this.inBase64 && this.base64Accum.length > 0) + res = this.iconv.decode(Buffer.from(this.base64Accum, 'base64'), "utf16-be"); + + this.inBase64 = false; + this.base64Accum = ''; + return res; +} + + diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/bom-handling.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/bom-handling.js new file mode 100644 index 0000000000000000000000000000000000000000..1050872385c7f96b4f54d50ebc873b1031e2528c --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/bom-handling.js @@ -0,0 +1,52 @@ +"use strict"; + +var BOMChar = '\uFEFF'; + +exports.PrependBOM = PrependBOMWrapper +function PrependBOMWrapper(encoder, options) { + this.encoder = encoder; + this.addBOM = true; +} + +PrependBOMWrapper.prototype.write = function(str) { + if (this.addBOM) { + str = BOMChar + str; + this.addBOM = false; + } + + return this.encoder.write(str); +} + +PrependBOMWrapper.prototype.end = function() { + return this.encoder.end(); +} + + +//------------------------------------------------------------------------------ + +exports.StripBOM = StripBOMWrapper; +function StripBOMWrapper(decoder, options) { + this.decoder = decoder; + this.pass = false; + this.options = options || {}; +} + +StripBOMWrapper.prototype.write = function(buf) { + var res = this.decoder.write(buf); + if (this.pass || !res) + return res; + + if (res[0] === BOMChar) { + res = res.slice(1); + if (typeof this.options.stripBOM === 'function') + this.options.stripBOM(); + } + + this.pass = true; + return res; +} + +StripBOMWrapper.prototype.end = function() { + return this.decoder.end(); +} + diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/index.d.ts b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..99f200f4ab04c365baa41f89070972d5408de410 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/index.d.ts @@ -0,0 +1,41 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. + * REQUIREMENT: This definition is dependent on the @types/node definition. + * Install with `npm install @types/node --save-dev` + *--------------------------------------------------------------------------------------------*/ + +declare module 'iconv-lite' { + // Basic API + export function decode(buffer: Buffer, encoding: string, options?: Options): string; + + export function encode(content: string, encoding: string, options?: Options): Buffer; + + export function encodingExists(encoding: string): boolean; + + // Stream API + export function decodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; + + export function encodeStream(encoding: string, options?: Options): NodeJS.ReadWriteStream; + + // Low-level stream APIs + export function getEncoder(encoding: string, options?: Options): EncoderStream; + + export function getDecoder(encoding: string, options?: Options): DecoderStream; +} + +export interface Options { + stripBOM?: boolean; + addBOM?: boolean; + defaultEncoding?: string; +} + +export interface EncoderStream { + write(str: string): Buffer; + end(): Buffer | undefined; +} + +export interface DecoderStream { + write(buf: Buffer): string; + end(): string | undefined; +} diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/index.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..657701c38d243b8af1cd3d4a67056e095a0ede5e --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/index.js @@ -0,0 +1,180 @@ +"use strict"; + +var Buffer = require("safer-buffer").Buffer; + +var bomHandling = require("./bom-handling"), + iconv = module.exports; + +// All codecs and aliases are kept here, keyed by encoding name/alias. +// They are lazy loaded in `iconv.getCodec` from `encodings/index.js`. +iconv.encodings = null; + +// Characters emitted in case of error. +iconv.defaultCharUnicode = '�'; +iconv.defaultCharSingleByte = '?'; + +// Public API. +iconv.encode = function encode(str, encoding, options) { + str = "" + (str || ""); // Ensure string. + + var encoder = iconv.getEncoder(encoding, options); + + var res = encoder.write(str); + var trail = encoder.end(); + + return (trail && trail.length > 0) ? Buffer.concat([res, trail]) : res; +} + +iconv.decode = function decode(buf, encoding, options) { + if (typeof buf === 'string') { + if (!iconv.skipDecodeWarning) { + console.error('Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding'); + iconv.skipDecodeWarning = true; + } + + buf = Buffer.from("" + (buf || ""), "binary"); // Ensure buffer. + } + + var decoder = iconv.getDecoder(encoding, options); + + var res = decoder.write(buf); + var trail = decoder.end(); + + return trail ? (res + trail) : res; +} + +iconv.encodingExists = function encodingExists(enc) { + try { + iconv.getCodec(enc); + return true; + } catch (e) { + return false; + } +} + +// Legacy aliases to convert functions +iconv.toEncoding = iconv.encode; +iconv.fromEncoding = iconv.decode; + +// Search for a codec in iconv.encodings. Cache codec data in iconv._codecDataCache. +iconv._codecDataCache = {}; +iconv.getCodec = function getCodec(encoding) { + if (!iconv.encodings) + iconv.encodings = require("../encodings"); // Lazy load all encoding definitions. + + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + var enc = iconv._canonicalizeEncoding(encoding); + + // Traverse iconv.encodings to find actual codec. + var codecOptions = {}; + while (true) { + var codec = iconv._codecDataCache[enc]; + if (codec) + return codec; + + var codecDef = iconv.encodings[enc]; + + switch (typeof codecDef) { + case "string": // Direct alias to other encoding. + enc = codecDef; + break; + + case "object": // Alias with options. Can be layered. + for (var key in codecDef) + codecOptions[key] = codecDef[key]; + + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + enc = codecDef.type; + break; + + case "function": // Codec itself. + if (!codecOptions.encodingName) + codecOptions.encodingName = enc; + + // The codec function must load all tables and return object with .encoder and .decoder methods. + // It'll be called only once (for each different options object). + codec = new codecDef(codecOptions, iconv); + + iconv._codecDataCache[codecOptions.encodingName] = codec; // Save it to be reused later. + return codec; + + default: + throw new Error("Encoding not recognized: '" + encoding + "' (searched as: '"+enc+"')"); + } + } +} + +iconv._canonicalizeEncoding = function(encoding) { + // Canonicalize encoding name: strip all non-alphanumeric chars and appended year. + return (''+encoding).toLowerCase().replace(/:\d{4}$|[^0-9a-z]/g, ""); +} + +iconv.getEncoder = function getEncoder(encoding, options) { + var codec = iconv.getCodec(encoding), + encoder = new codec.encoder(options, codec); + + if (codec.bomAware && options && options.addBOM) + encoder = new bomHandling.PrependBOM(encoder, options); + + return encoder; +} + +iconv.getDecoder = function getDecoder(encoding, options) { + var codec = iconv.getCodec(encoding), + decoder = new codec.decoder(options, codec); + + if (codec.bomAware && !(options && options.stripBOM === false)) + decoder = new bomHandling.StripBOM(decoder, options); + + return decoder; +} + +// Streaming API +// NOTE: Streaming API naturally depends on 'stream' module from Node.js. Unfortunately in browser environments this module can add +// up to 100Kb to the output bundle. To avoid unnecessary code bloat, we don't enable Streaming API in browser by default. +// If you would like to enable it explicitly, please add the following code to your app: +// > iconv.enableStreamingAPI(require('stream')); +iconv.enableStreamingAPI = function enableStreamingAPI(stream_module) { + if (iconv.supportsStreams) + return; + + // Dependency-inject stream module to create IconvLite stream classes. + var streams = require("./streams")(stream_module); + + // Not public API yet, but expose the stream classes. + iconv.IconvLiteEncoderStream = streams.IconvLiteEncoderStream; + iconv.IconvLiteDecoderStream = streams.IconvLiteDecoderStream; + + // Streaming API. + iconv.encodeStream = function encodeStream(encoding, options) { + return new iconv.IconvLiteEncoderStream(iconv.getEncoder(encoding, options), options); + } + + iconv.decodeStream = function decodeStream(encoding, options) { + return new iconv.IconvLiteDecoderStream(iconv.getDecoder(encoding, options), options); + } + + iconv.supportsStreams = true; +} + +// Enable Streaming API automatically if 'stream' module is available and non-empty (the majority of environments). +var stream_module; +try { + stream_module = require("stream"); +} catch (e) {} + +if (stream_module && stream_module.Transform) { + iconv.enableStreamingAPI(stream_module); + +} else { + // In rare cases where 'stream' module is not available by default, throw a helpful exception. + iconv.encodeStream = iconv.decodeStream = function() { + throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it."); + }; +} + +if ("Ā" != "\u0100") { + console.error("iconv-lite warning: js files use non-utf8 encoding. See https://github.com/ashtuchkin/iconv-lite/wiki/Javascript-source-file-encodings for more info."); +} diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/streams.js b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/streams.js new file mode 100644 index 0000000000000000000000000000000000000000..a1506482f580162d5b3a07b1ef82fcca22b40e5a --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/lib/streams.js @@ -0,0 +1,109 @@ +"use strict"; + +var Buffer = require("safer-buffer").Buffer; + +// NOTE: Due to 'stream' module being pretty large (~100Kb, significant in browser environments), +// we opt to dependency-inject it instead of creating a hard dependency. +module.exports = function(stream_module) { + var Transform = stream_module.Transform; + + // == Encoder stream ======================================================= + + function IconvLiteEncoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.decodeStrings = false; // We accept only strings, so we don't need to decode them. + Transform.call(this, options); + } + + IconvLiteEncoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteEncoderStream } + }); + + IconvLiteEncoderStream.prototype._transform = function(chunk, encoding, done) { + if (typeof chunk != 'string') + return done(new Error("Iconv encoding stream needs strings as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteEncoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteEncoderStream.prototype.collect = function(cb) { + var chunks = []; + this.on('error', cb); + this.on('data', function(chunk) { chunks.push(chunk); }); + this.on('end', function() { + cb(null, Buffer.concat(chunks)); + }); + return this; + } + + + // == Decoder stream ======================================================= + + function IconvLiteDecoderStream(conv, options) { + this.conv = conv; + options = options || {}; + options.encoding = this.encoding = 'utf8'; // We output strings. + Transform.call(this, options); + } + + IconvLiteDecoderStream.prototype = Object.create(Transform.prototype, { + constructor: { value: IconvLiteDecoderStream } + }); + + IconvLiteDecoderStream.prototype._transform = function(chunk, encoding, done) { + if (!Buffer.isBuffer(chunk) && !(chunk instanceof Uint8Array)) + return done(new Error("Iconv decoding stream needs buffers as its input.")); + try { + var res = this.conv.write(chunk); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteDecoderStream.prototype._flush = function(done) { + try { + var res = this.conv.end(); + if (res && res.length) this.push(res, this.encoding); + done(); + } + catch (e) { + done(e); + } + } + + IconvLiteDecoderStream.prototype.collect = function(cb) { + var res = ''; + this.on('error', cb); + this.on('data', function(chunk) { res += chunk; }); + this.on('end', function() { + cb(null, res); + }); + return this; + } + + return { + IconvLiteEncoderStream: IconvLiteEncoderStream, + IconvLiteDecoderStream: IconvLiteDecoderStream, + }; +}; diff --git a/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/package.json b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d351115a839fa05fe3a3b70114e7484d77e3dcda --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/node_modules/iconv-lite/package.json @@ -0,0 +1,44 @@ +{ + "name": "iconv-lite", + "description": "Convert character encodings in pure javascript.", + "version": "0.6.3", + "license": "MIT", + "keywords": [ + "iconv", + "convert", + "charset", + "icu" + ], + "author": "Alexander Shtuchkin ", + "main": "./lib/index.js", + "typings": "./lib/index.d.ts", + "homepage": "https://github.com/ashtuchkin/iconv-lite", + "bugs": "https://github.com/ashtuchkin/iconv-lite/issues", + "repository": { + "type": "git", + "url": "git://github.com/ashtuchkin/iconv-lite.git" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "coverage": "c8 _mocha --grep .", + "test": "mocha --reporter spec --grep ." + }, + "browser": { + "stream": false + }, + "devDependencies": { + "async": "^3.2.0", + "c8": "^7.2.0", + "errto": "^0.2.1", + "iconv": "^2.3.5", + "mocha": "^3.5.3", + "request": "^2.88.2", + "semver": "^6.3.0", + "unorm": "^1.6.0" + }, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + } +} diff --git a/tools/ui/node_modules/whatwg-encoding/package.json b/tools/ui/node_modules/whatwg-encoding/package.json new file mode 100644 index 0000000000000000000000000000000000000000..27ca6ffba921aa7c6b4f4452609db14f17ef9c32 --- /dev/null +++ b/tools/ui/node_modules/whatwg-encoding/package.json @@ -0,0 +1,33 @@ +{ + "name": "whatwg-encoding", + "description": "Decode strings according to the WHATWG Encoding Standard", + "keywords": [ + "encoding", + "whatwg" + ], + "version": "2.0.0", + "author": "Domenic Denicola (https://domenic.me/)", + "license": "MIT", + "repository": "jsdom/whatwg-encoding", + "main": "lib/whatwg-encoding.js", + "files": [ + "lib/" + ], + "scripts": { + "test": "mocha", + "lint": "eslint .", + "prepare": "node scripts/update.js" + }, + "dependencies": { + "iconv-lite": "0.6.3" + }, + "devDependencies": { + "@domenic/eslint-config": "^1.3.0", + "eslint": "^7.32.0", + "minipass-fetch": "^1.4.1", + "mocha": "^9.1.1" + }, + "engines": { + "node": ">=12" + } +} diff --git a/tools/ui/node_modules/whatwg-url/LICENSE.txt b/tools/ui/node_modules/whatwg-url/LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..54dfac39d9f523b2c14548f4574076f587c767e2 --- /dev/null +++ b/tools/ui/node_modules/whatwg-url/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2015–2016 Sebastian Mayr + +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/whatwg-url/README.md b/tools/ui/node_modules/whatwg-url/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f937292b4817da978d462e495178ed30e673bf7f --- /dev/null +++ b/tools/ui/node_modules/whatwg-url/README.md @@ -0,0 +1,98 @@ +# whatwg-url + +whatwg-url is a full implementation of the WHATWG [URL Standard](https://url.spec.whatwg.org/). It can be used standalone, but it also exposes a lot of the internal algorithms that are useful for integrating a URL parser into a project like [jsdom](https://github.com/tmpvar/jsdom). + +## Specification conformance + +whatwg-url is currently up to date with the URL spec up to commit [7ae1c69](https://github.com/whatwg/url/commit/7ae1c691c96f0d82fafa24c33aa1e8df9ffbf2bc). + +For `file:` URLs, whose [origin is left unspecified](https://url.spec.whatwg.org/#concept-url-origin), whatwg-url chooses to use a new opaque origin (which serializes to `"null"`). + +## API + +### The `URL` and `URLSearchParams` classes + +The main API is provided by the [`URL`](https://url.spec.whatwg.org/#url-class) and [`URLSearchParams`](https://url.spec.whatwg.org/#interface-urlsearchparams) exports, which follows the spec's behavior in all ways (including e.g. `USVString` conversion). Most consumers of this library will want to use these. + +### Low-level URL Standard API + +The following methods are exported for use by places like jsdom that need to implement things like [`HTMLHyperlinkElementUtils`](https://html.spec.whatwg.org/#htmlhyperlinkelementutils). They mostly operate on or return an "internal URL" or ["URL record"](https://url.spec.whatwg.org/#concept-url) type. + +- [URL parser](https://url.spec.whatwg.org/#concept-url-parser): `parseURL(input, { baseURL, encodingOverride })` +- [Basic URL parser](https://url.spec.whatwg.org/#concept-basic-url-parser): `basicURLParse(input, { baseURL, encodingOverride, url, stateOverride })` +- [URL serializer](https://url.spec.whatwg.org/#concept-url-serializer): `serializeURL(urlRecord, excludeFragment)` +- [Host serializer](https://url.spec.whatwg.org/#concept-host-serializer): `serializeHost(hostFromURLRecord)` +- [Serialize an integer](https://url.spec.whatwg.org/#serialize-an-integer): `serializeInteger(number)` +- [Origin](https://url.spec.whatwg.org/#concept-url-origin) [serializer](https://html.spec.whatwg.org/multipage/origin.html#ascii-serialisation-of-an-origin): `serializeURLOrigin(urlRecord)` +- [Set the username](https://url.spec.whatwg.org/#set-the-username): `setTheUsername(urlRecord, usernameString)` +- [Set the password](https://url.spec.whatwg.org/#set-the-password): `setThePassword(urlRecord, passwordString)` +- [Cannot have a username/password/port](https://url.spec.whatwg.org/#cannot-have-a-username-password-port): `cannotHaveAUsernamePasswordPort(urlRecord)` +- [Percent decode](https://url.spec.whatwg.org/#percent-decode): `percentDecode(buffer)` + +The `stateOverride` parameter is one of the following strings: + +- [`"scheme start"`](https://url.spec.whatwg.org/#scheme-start-state) +- [`"scheme"`](https://url.spec.whatwg.org/#scheme-state) +- [`"no scheme"`](https://url.spec.whatwg.org/#no-scheme-state) +- [`"special relative or authority"`](https://url.spec.whatwg.org/#special-relative-or-authority-state) +- [`"path or authority"`](https://url.spec.whatwg.org/#path-or-authority-state) +- [`"relative"`](https://url.spec.whatwg.org/#relative-state) +- [`"relative slash"`](https://url.spec.whatwg.org/#relative-slash-state) +- [`"special authority slashes"`](https://url.spec.whatwg.org/#special-authority-slashes-state) +- [`"special authority ignore slashes"`](https://url.spec.whatwg.org/#special-authority-ignore-slashes-state) +- [`"authority"`](https://url.spec.whatwg.org/#authority-state) +- [`"host"`](https://url.spec.whatwg.org/#host-state) +- [`"hostname"`](https://url.spec.whatwg.org/#hostname-state) +- [`"port"`](https://url.spec.whatwg.org/#port-state) +- [`"file"`](https://url.spec.whatwg.org/#file-state) +- [`"file slash"`](https://url.spec.whatwg.org/#file-slash-state) +- [`"file host"`](https://url.spec.whatwg.org/#file-host-state) +- [`"path start"`](https://url.spec.whatwg.org/#path-start-state) +- [`"path"`](https://url.spec.whatwg.org/#path-state) +- [`"cannot-be-a-base-URL path"`](https://url.spec.whatwg.org/#cannot-be-a-base-url-path-state) +- [`"query"`](https://url.spec.whatwg.org/#query-state) +- [`"fragment"`](https://url.spec.whatwg.org/#fragment-state) + +The URL record type has the following API: + +- [`scheme`](https://url.spec.whatwg.org/#concept-url-scheme) +- [`username`](https://url.spec.whatwg.org/#concept-url-username) +- [`password`](https://url.spec.whatwg.org/#concept-url-password) +- [`host`](https://url.spec.whatwg.org/#concept-url-host) +- [`port`](https://url.spec.whatwg.org/#concept-url-port) +- [`path`](https://url.spec.whatwg.org/#concept-url-path) (as an array) +- [`query`](https://url.spec.whatwg.org/#concept-url-query) +- [`fragment`](https://url.spec.whatwg.org/#concept-url-fragment) +- [`cannotBeABaseURL`](https://url.spec.whatwg.org/#url-cannot-be-a-base-url-flag) (as a boolean) + +These properties should be treated with care, as in general changing them will cause the URL record to be in an inconsistent state until the appropriate invocation of `basicURLParse` is used to fix it up. You can see examples of this in the URL Standard, where there are many step sequences like "4. Set context object’s url’s fragment to the empty string. 5. Basic URL parse _input_ with context object’s url as _url_ and fragment state as _state override_." In between those two steps, a URL record is in an unusable state. + +The return value of "failure" in the spec is represented by `null`. That is, functions like `parseURL` and `basicURLParse` can return _either_ a URL record _or_ `null`. + +## Development instructions + +First, install [Node.js](https://nodejs.org/). Then, fetch the dependencies of whatwg-url, by running from this directory: + + npm install + +To run tests: + + npm test + +To generate a coverage report: + + npm run coverage + +To build and run the live viewer: + + npm run build + npm run build-live-viewer + +Serve the contents of the `live-viewer` directory using any web server. + +## Supporting whatwg-url + +The jsdom project (including whatwg-url) is a community-driven project maintained by a team of [volunteers](https://github.com/orgs/jsdom/people). You could support us by: + +- [Getting professional support for whatwg-url](https://tidelift.com/subscription/pkg/npm-whatwg-url?utm_source=npm-whatwg-url&utm_medium=referral&utm_campaign=readme) as part of a Tidelift subscription. Tidelift helps making open source sustainable for us while giving teams assurances for maintenance, licensing, and security. +- Contributing directly to the project. diff --git a/tools/ui/node_modules/whatwg-url/lib/URL-impl.js b/tools/ui/node_modules/whatwg-url/lib/URL-impl.js new file mode 100644 index 0000000000000000000000000000000000000000..79d7ad55ef510bb117895cb800c874a4b79c10fc --- /dev/null +++ b/tools/ui/node_modules/whatwg-url/lib/URL-impl.js @@ -0,0 +1,217 @@ +"use strict"; +const usm = require("./url-state-machine"); +const urlencoded = require("./urlencoded"); +const URLSearchParams = require("./URLSearchParams"); + +exports.implementation = class URLImpl { + constructor(constructorArgs) { + const url = constructorArgs[0]; + const base = constructorArgs[1]; + + let parsedBase = null; + if (base !== undefined) { + parsedBase = usm.basicURLParse(base); + if (parsedBase === null) { + throw new TypeError(`Invalid base URL: ${base}`); + } + } + + const parsedURL = usm.basicURLParse(url, { baseURL: parsedBase }); + if (parsedURL === null) { + throw new TypeError(`Invalid URL: ${url}`); + } + + const query = parsedURL.query !== null ? parsedURL.query : ""; + + this._url = parsedURL; + + // We cannot invoke the "new URLSearchParams object" algorithm without going through the constructor, which strips + // question mark by default. Therefore the doNotStripQMark hack is used. + this._query = URLSearchParams.createImpl([query], { doNotStripQMark: true }); + this._query._url = this; + } + + get href() { + return usm.serializeURL(this._url); + } + + set href(v) { + const parsedURL = usm.basicURLParse(v); + if (parsedURL === null) { + throw new TypeError(`Invalid URL: ${v}`); + } + + this._url = parsedURL; + + this._query._list.splice(0); + const { query } = parsedURL; + if (query !== null) { + this._query._list = urlencoded.parseUrlencoded(query); + } + } + + get origin() { + return usm.serializeURLOrigin(this._url); + } + + get protocol() { + return this._url.scheme + ":"; + } + + set protocol(v) { + usm.basicURLParse(v + ":", { url: this._url, stateOverride: "scheme start" }); + } + + get username() { + return this._url.username; + } + + set username(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setTheUsername(this._url, v); + } + + get password() { + return this._url.password; + } + + set password(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + usm.setThePassword(this._url, v); + } + + get host() { + const url = this._url; + + if (url.host === null) { + return ""; + } + + if (url.port === null) { + return usm.serializeHost(url.host); + } + + return usm.serializeHost(url.host) + ":" + usm.serializeInteger(url.port); + } + + set host(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "host" }); + } + + get hostname() { + if (this._url.host === null) { + return ""; + } + + return usm.serializeHost(this._url.host); + } + + set hostname(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + usm.basicURLParse(v, { url: this._url, stateOverride: "hostname" }); + } + + get port() { + if (this._url.port === null) { + return ""; + } + + return usm.serializeInteger(this._url.port); + } + + set port(v) { + if (usm.cannotHaveAUsernamePasswordPort(this._url)) { + return; + } + + if (v === "") { + this._url.port = null; + } else { + usm.basicURLParse(v, { url: this._url, stateOverride: "port" }); + } + } + + get pathname() { + if (this._url.cannotBeABaseURL) { + return this._url.path[0]; + } + + if (this._url.path.length === 0) { + return ""; + } + + return "/" + this._url.path.join("/"); + } + + set pathname(v) { + if (this._url.cannotBeABaseURL) { + return; + } + + this._url.path = []; + usm.basicURLParse(v, { url: this._url, stateOverride: "path start" }); + } + + get search() { + if (this._url.query === null || this._url.query === "") { + return ""; + } + + return "?" + this._url.query; + } + + set search(v) { + const url = this._url; + + if (v === "") { + url.query = null; + this._query._list = []; + return; + } + + const input = v[0] === "?" ? v.substring(1) : v; + url.query = ""; + usm.basicURLParse(input, { url, stateOverride: "query" }); + this._query._list = urlencoded.parseUrlencoded(input); + } + + get searchParams() { + return this._query; + } + + get hash() { + if (this._url.fragment === null || this._url.fragment === "") { + return ""; + } + + return "#" + this._url.fragment; + } + + set hash(v) { + if (v === "") { + this._url.fragment = null; + return; + } + + const input = v[0] === "#" ? v.substring(1) : v; + this._url.fragment = ""; + usm.basicURLParse(input, { url: this._url, stateOverride: "fragment" }); + } + + toJSON() { + return this.href; + } +}; diff --git a/tools/ui/node_modules/whatwg-url/lib/URL.js b/tools/ui/node_modules/whatwg-url/lib/URL.js new file mode 100644 index 0000000000000000000000000000000000000000..e98524fd4640515a7c3555590637544472cc7347 --- /dev/null +++ b/tools/ui/node_modules/whatwg-url/lib/URL.js @@ -0,0 +1,335 @@ +"use strict"; + +const conversions = require("webidl-conversions"); +const utils = require("./utils.js"); + +const impl = utils.implSymbol; + +class URL { + constructor(url) { + if (arguments.length < 1) { + throw new TypeError("Failed to construct 'URL': 1 argument required, but only " + arguments.length + " present."); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { context: "Failed to construct 'URL': parameter 1" }); + args.push(curArg); + } + { + let curArg = arguments[1]; + if (curArg !== undefined) { + curArg = conversions["USVString"](curArg, { context: "Failed to construct 'URL': parameter 2" }); + } + args.push(curArg); + } + return iface.setup(Object.create(new.target.prototype), args); + } + + toJSON() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl].toJSON(); + } + + get href() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl]["href"]; + } + + set href(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = conversions["USVString"](V, { context: "Failed to set the 'href' property on 'URL': The provided value" }); + + this[impl]["href"] = V; + } + + toString() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + return this[impl]["href"]; + } + + get origin() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl]["origin"]; + } + + get protocol() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl]["protocol"]; + } + + set protocol(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = conversions["USVString"](V, { context: "Failed to set the 'protocol' property on 'URL': The provided value" }); + + this[impl]["protocol"] = V; + } + + get username() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl]["username"]; + } + + set username(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = conversions["USVString"](V, { context: "Failed to set the 'username' property on 'URL': The provided value" }); + + this[impl]["username"] = V; + } + + get password() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl]["password"]; + } + + set password(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = conversions["USVString"](V, { context: "Failed to set the 'password' property on 'URL': The provided value" }); + + this[impl]["password"] = V; + } + + get host() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl]["host"]; + } + + set host(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = conversions["USVString"](V, { context: "Failed to set the 'host' property on 'URL': The provided value" }); + + this[impl]["host"] = V; + } + + get hostname() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl]["hostname"]; + } + + set hostname(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = conversions["USVString"](V, { context: "Failed to set the 'hostname' property on 'URL': The provided value" }); + + this[impl]["hostname"] = V; + } + + get port() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl]["port"]; + } + + set port(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = conversions["USVString"](V, { context: "Failed to set the 'port' property on 'URL': The provided value" }); + + this[impl]["port"] = V; + } + + get pathname() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl]["pathname"]; + } + + set pathname(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = conversions["USVString"](V, { context: "Failed to set the 'pathname' property on 'URL': The provided value" }); + + this[impl]["pathname"] = V; + } + + get search() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl]["search"]; + } + + set search(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = conversions["USVString"](V, { context: "Failed to set the 'search' property on 'URL': The provided value" }); + + this[impl]["search"] = V; + } + + get searchParams() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return utils.getSameObject(this, "searchParams", () => { + return utils.tryWrapperForImpl(this[impl]["searchParams"]); + }); + } + + get hash() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl]["hash"]; + } + + set hash(V) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + V = conversions["USVString"](V, { context: "Failed to set the 'hash' property on 'URL': The provided value" }); + + this[impl]["hash"] = V; + } +} +Object.defineProperties(URL.prototype, { + toJSON: { enumerable: true }, + href: { enumerable: true }, + toString: { enumerable: true }, + origin: { enumerable: true }, + protocol: { enumerable: true }, + username: { enumerable: true }, + password: { enumerable: true }, + host: { enumerable: true }, + hostname: { enumerable: true }, + port: { enumerable: true }, + pathname: { enumerable: true }, + search: { enumerable: true }, + searchParams: { enumerable: true }, + hash: { enumerable: true }, + [Symbol.toStringTag]: { value: "URL", configurable: true } +}); +const iface = { + // When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()` + // method into this array. It allows objects that directly implements *those* interfaces to be recognized as + // implementing this mixin interface. + _mixedIntoPredicates: [], + is(obj) { + if (obj) { + if (utils.hasOwn(obj, impl) && obj[impl] instanceof Impl.implementation) { + return true; + } + for (const isMixedInto of module.exports._mixedIntoPredicates) { + if (isMixedInto(obj)) { + return true; + } + } + } + return false; + }, + isImpl(obj) { + if (obj) { + if (obj instanceof Impl.implementation) { + return true; + } + + const wrapper = utils.wrapperForImpl(obj); + for (const isMixedInto of module.exports._mixedIntoPredicates) { + if (isMixedInto(wrapper)) { + return true; + } + } + } + return false; + }, + convert(obj, { context = "The provided value" } = {}) { + if (module.exports.is(obj)) { + return utils.implForWrapper(obj); + } + throw new TypeError(`${context} is not of type 'URL'.`); + }, + + create(constructorArgs, privateData) { + let obj = Object.create(URL.prototype); + obj = this.setup(obj, constructorArgs, privateData); + return obj; + }, + createImpl(constructorArgs, privateData) { + let obj = Object.create(URL.prototype); + obj = this.setup(obj, constructorArgs, privateData); + return utils.implForWrapper(obj); + }, + _internalSetup(obj) {}, + setup(obj, constructorArgs, privateData) { + if (!privateData) privateData = {}; + + privateData.wrapper = obj; + + this._internalSetup(obj); + Object.defineProperty(obj, impl, { + value: new Impl.implementation(constructorArgs, privateData), + configurable: true + }); + + obj[impl][utils.wrapperSymbol] = obj; + if (Impl.init) { + Impl.init(obj[impl], privateData); + } + return obj; + }, + interface: URL, + expose: { + Window: { URL }, + Worker: { URL } + } +}; // iface +module.exports = iface; + +const Impl = require("./URL-impl.js"); diff --git a/tools/ui/node_modules/whatwg-url/lib/URLSearchParams-impl.js b/tools/ui/node_modules/whatwg-url/lib/URLSearchParams-impl.js new file mode 100644 index 0000000000000000000000000000000000000000..70535ae6766a0da8f6a74a98067f36649b5eb5db --- /dev/null +++ b/tools/ui/node_modules/whatwg-url/lib/URLSearchParams-impl.js @@ -0,0 +1,122 @@ +"use strict"; +const stableSortBy = require("lodash.sortby"); +const urlencoded = require("./urlencoded"); + +exports.implementation = class URLSearchParamsImpl { + constructor(constructorArgs, { doNotStripQMark = false }) { + let init = constructorArgs[0]; + this._list = []; + this._url = null; + + if (!doNotStripQMark && typeof init === "string" && init[0] === "?") { + init = init.slice(1); + } + + if (Array.isArray(init)) { + for (const pair of init) { + if (pair.length !== 2) { + throw new TypeError("Failed to construct 'URLSearchParams': parameter 1 sequence's element does not " + + "contain exactly two elements."); + } + this._list.push([pair[0], pair[1]]); + } + } else if (typeof init === "object" && Object.getPrototypeOf(init) === null) { + for (const name of Object.keys(init)) { + const value = init[name]; + this._list.push([name, value]); + } + } else { + this._list = urlencoded.parseUrlencoded(init); + } + } + + _updateSteps() { + if (this._url !== null) { + let query = urlencoded.serializeUrlencoded(this._list); + if (query === "") { + query = null; + } + this._url._url.query = query; + } + } + + append(name, value) { + this._list.push([name, value]); + this._updateSteps(); + } + + delete(name) { + let i = 0; + while (i < this._list.length) { + if (this._list[i][0] === name) { + this._list.splice(i, 1); + } else { + i++; + } + } + this._updateSteps(); + } + + get(name) { + for (const tuple of this._list) { + if (tuple[0] === name) { + return tuple[1]; + } + } + return null; + } + + getAll(name) { + const output = []; + for (const tuple of this._list) { + if (tuple[0] === name) { + output.push(tuple[1]); + } + } + return output; + } + + has(name) { + for (const tuple of this._list) { + if (tuple[0] === name) { + return true; + } + } + return false; + } + + set(name, value) { + let found = false; + let i = 0; + while (i < this._list.length) { + if (this._list[i][0] === name) { + if (found) { + this._list.splice(i, 1); + } else { + found = true; + this._list[i][1] = value; + i++; + } + } else { + i++; + } + } + if (!found) { + this._list.push([name, value]); + } + this._updateSteps(); + } + + sort() { + this._list = stableSortBy(this._list, [0]); + this._updateSteps(); + } + + [Symbol.iterator]() { + return this._list[Symbol.iterator](); + } + + toString() { + return urlencoded.serializeUrlencoded(this._list); + } +}; diff --git a/tools/ui/node_modules/whatwg-url/lib/URLSearchParams.js b/tools/ui/node_modules/whatwg-url/lib/URLSearchParams.js new file mode 100644 index 0000000000000000000000000000000000000000..d99a9a4e2b0fea8bec870e0a11ddf69844b09053 --- /dev/null +++ b/tools/ui/node_modules/whatwg-url/lib/URLSearchParams.js @@ -0,0 +1,432 @@ +"use strict"; + +const conversions = require("webidl-conversions"); +const utils = require("./utils.js"); + +const impl = utils.implSymbol; + +const IteratorPrototype = Object.create(utils.IteratorPrototype, { + next: { + value: function next() { + const internal = this[utils.iterInternalSymbol]; + const { target, kind, index } = internal; + const values = Array.from(target[impl]); + const len = values.length; + if (index >= len) { + return { value: undefined, done: true }; + } + + const pair = values[index]; + internal.index = index + 1; + const [key, value] = pair.map(utils.tryWrapperForImpl); + + let result; + switch (kind) { + case "key": + result = key; + break; + case "value": + result = value; + break; + case "key+value": + result = [key, value]; + break; + } + return { value: result, done: false }; + }, + writable: true, + enumerable: true, + configurable: true + }, + [Symbol.toStringTag]: { + value: "URLSearchParams Iterator", + configurable: true + } +}); +class URLSearchParams { + constructor() { + const args = []; + { + let curArg = arguments[0]; + if (curArg !== undefined) { + if (utils.isObject(curArg)) { + if (curArg[Symbol.iterator] !== undefined) { + if (!utils.isObject(curArg)) { + throw new TypeError( + "Failed to construct 'URLSearchParams': parameter 1" + " sequence" + " is not an iterable object." + ); + } else { + const V = []; + const tmp = curArg; + for (let nextItem of tmp) { + if (!utils.isObject(nextItem)) { + throw new TypeError( + "Failed to construct 'URLSearchParams': parameter 1" + + " sequence" + + "'s element" + + " is not an iterable object." + ); + } else { + const V = []; + const tmp = nextItem; + for (let nextItem of tmp) { + nextItem = conversions["USVString"](nextItem, { + context: + "Failed to construct 'URLSearchParams': parameter 1" + " sequence" + "'s element" + "'s element" + }); + + V.push(nextItem); + } + nextItem = V; + } + + V.push(nextItem); + } + curArg = V; + } + } else { + if (!utils.isObject(curArg)) { + throw new TypeError( + "Failed to construct 'URLSearchParams': parameter 1" + " record" + " is not an object." + ); + } else { + const result = Object.create(null); + for (const key of Reflect.ownKeys(curArg)) { + const desc = Object.getOwnPropertyDescriptor(curArg, key); + if (desc && desc.enumerable) { + let typedKey = key; + let typedValue = curArg[key]; + + typedKey = conversions["USVString"](typedKey, { + context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s key" + }); + + typedValue = conversions["USVString"](typedValue, { + context: "Failed to construct 'URLSearchParams': parameter 1" + " record" + "'s value" + }); + + result[typedKey] = typedValue; + } + } + curArg = result; + } + } + } else { + curArg = conversions["USVString"](curArg, { context: "Failed to construct 'URLSearchParams': parameter 1" }); + } + } else { + curArg = ""; + } + args.push(curArg); + } + return iface.setup(Object.create(new.target.prototype), args); + } + + append(name, value) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 2) { + throw new TypeError( + "Failed to execute 'append' on 'URLSearchParams': 2 arguments required, but only " + + arguments.length + + " present." + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'append' on 'URLSearchParams': parameter 1" + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'append' on 'URLSearchParams': parameter 2" + }); + args.push(curArg); + } + return this[impl].append(...args); + } + + delete(name) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 1) { + throw new TypeError( + "Failed to execute 'delete' on 'URLSearchParams': 1 argument required, but only " + + arguments.length + + " present." + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'delete' on 'URLSearchParams': parameter 1" + }); + args.push(curArg); + } + return this[impl].delete(...args); + } + + get(name) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 1) { + throw new TypeError( + "Failed to execute 'get' on 'URLSearchParams': 1 argument required, but only " + arguments.length + " present." + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'get' on 'URLSearchParams': parameter 1" + }); + args.push(curArg); + } + return this[impl].get(...args); + } + + getAll(name) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 1) { + throw new TypeError( + "Failed to execute 'getAll' on 'URLSearchParams': 1 argument required, but only " + + arguments.length + + " present." + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'getAll' on 'URLSearchParams': parameter 1" + }); + args.push(curArg); + } + return utils.tryWrapperForImpl(this[impl].getAll(...args)); + } + + has(name) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 1) { + throw new TypeError( + "Failed to execute 'has' on 'URLSearchParams': 1 argument required, but only " + arguments.length + " present." + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'has' on 'URLSearchParams': parameter 1" + }); + args.push(curArg); + } + return this[impl].has(...args); + } + + set(name, value) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + if (arguments.length < 2) { + throw new TypeError( + "Failed to execute 'set' on 'URLSearchParams': 2 arguments required, but only " + arguments.length + " present." + ); + } + const args = []; + { + let curArg = arguments[0]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'set' on 'URLSearchParams': parameter 1" + }); + args.push(curArg); + } + { + let curArg = arguments[1]; + curArg = conversions["USVString"](curArg, { + context: "Failed to execute 'set' on 'URLSearchParams': parameter 2" + }); + args.push(curArg); + } + return this[impl].set(...args); + } + + sort() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl].sort(); + } + + toString() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + + return this[impl].toString(); + } + + keys() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + return module.exports.createDefaultIterator(this, "key"); + } + + values() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + return module.exports.createDefaultIterator(this, "value"); + } + + entries() { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + return module.exports.createDefaultIterator(this, "key+value"); + } + + forEach(callback) { + if (!this || !module.exports.is(this)) { + throw new TypeError("Illegal invocation"); + } + if (arguments.length < 1) { + throw new TypeError("Failed to execute 'forEach' on 'iterable': 1 argument required, " + "but only 0 present."); + } + if (typeof callback !== "function") { + throw new TypeError( + "Failed to execute 'forEach' on 'iterable': The callback provided " + "as parameter 1 is not a function." + ); + } + const thisArg = arguments[1]; + let pairs = Array.from(this[impl]); + let i = 0; + while (i < pairs.length) { + const [key, value] = pairs[i].map(utils.tryWrapperForImpl); + callback.call(thisArg, value, key, this); + pairs = Array.from(this[impl]); + i++; + } + } +} +Object.defineProperties(URLSearchParams.prototype, { + append: { enumerable: true }, + delete: { enumerable: true }, + get: { enumerable: true }, + getAll: { enumerable: true }, + has: { enumerable: true }, + set: { enumerable: true }, + sort: { enumerable: true }, + toString: { enumerable: true }, + keys: { enumerable: true }, + values: { enumerable: true }, + entries: { enumerable: true }, + forEach: { enumerable: true }, + [Symbol.toStringTag]: { value: "URLSearchParams", configurable: true }, + [Symbol.iterator]: { value: URLSearchParams.prototype.entries, configurable: true, writable: true } +}); +const iface = { + // When an interface-module that implements this interface as a mixin is loaded, it will append its own `.is()` + // method into this array. It allows objects that directly implements *those* interfaces to be recognized as + // implementing this mixin interface. + _mixedIntoPredicates: [], + is(obj) { + if (obj) { + if (utils.hasOwn(obj, impl) && obj[impl] instanceof Impl.implementation) { + return true; + } + for (const isMixedInto of module.exports._mixedIntoPredicates) { + if (isMixedInto(obj)) { + return true; + } + } + } + return false; + }, + isImpl(obj) { + if (obj) { + if (obj instanceof Impl.implementation) { + return true; + } + + const wrapper = utils.wrapperForImpl(obj); + for (const isMixedInto of module.exports._mixedIntoPredicates) { + if (isMixedInto(wrapper)) { + return true; + } + } + } + return false; + }, + convert(obj, { context = "The provided value" } = {}) { + if (module.exports.is(obj)) { + return utils.implForWrapper(obj); + } + throw new TypeError(`${context} is not of type 'URLSearchParams'.`); + }, + + createDefaultIterator(target, kind) { + const iterator = Object.create(IteratorPrototype); + Object.defineProperty(iterator, utils.iterInternalSymbol, { + value: { target, kind, index: 0 }, + configurable: true + }); + return iterator; + }, + + create(constructorArgs, privateData) { + let obj = Object.create(URLSearchParams.prototype); + obj = this.setup(obj, constructorArgs, privateData); + return obj; + }, + createImpl(constructorArgs, privateData) { + let obj = Object.create(URLSearchParams.prototype); + obj = this.setup(obj, constructorArgs, privateData); + return utils.implForWrapper(obj); + }, + _internalSetup(obj) {}, + setup(obj, constructorArgs, privateData) { + if (!privateData) privateData = {}; + + privateData.wrapper = obj; + + this._internalSetup(obj); + Object.defineProperty(obj, impl, { + value: new Impl.implementation(constructorArgs, privateData), + configurable: true + }); + + obj[impl][utils.wrapperSymbol] = obj; + if (Impl.init) { + Impl.init(obj[impl], privateData); + } + return obj; + }, + interface: URLSearchParams, + expose: { + Window: { URLSearchParams }, + Worker: { URLSearchParams } + } +}; // iface +module.exports = iface; + +const Impl = require("./URLSearchParams-impl.js"); diff --git a/tools/ui/node_modules/whatwg-url/lib/infra.js b/tools/ui/node_modules/whatwg-url/lib/infra.js new file mode 100644 index 0000000000000000000000000000000000000000..2a712f8fc0d4d39d61f67a2a8bd07dadf5a6b2b7 --- /dev/null +++ b/tools/ui/node_modules/whatwg-url/lib/infra.js @@ -0,0 +1,24 @@ +"use strict"; + +function isASCIIDigit(c) { + return c >= 0x30 && c <= 0x39; +} + +function isASCIIAlpha(c) { + return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A); +} + +function isASCIIAlphanumeric(c) { + return isASCIIAlpha(c) || isASCIIDigit(c); +} + +function isASCIIHex(c) { + return isASCIIDigit(c) || (c >= 0x41 && c <= 0x46) || (c >= 0x61 && c <= 0x66); +} + +module.exports = { + isASCIIDigit, + isASCIIAlpha, + isASCIIAlphanumeric, + isASCIIHex +}; diff --git a/tools/ui/node_modules/whatwg-url/lib/public-api.js b/tools/ui/node_modules/whatwg-url/lib/public-api.js new file mode 100644 index 0000000000000000000000000000000000000000..5135b07078549c1133b286fcfbe8c26c787ec810 --- /dev/null +++ b/tools/ui/node_modules/whatwg-url/lib/public-api.js @@ -0,0 +1,16 @@ +"use strict"; + +exports.URL = require("./URL").interface; +exports.URLSearchParams = require("./URLSearchParams").interface; + +exports.parseURL = require("./url-state-machine").parseURL; +exports.basicURLParse = require("./url-state-machine").basicURLParse; +exports.serializeURL = require("./url-state-machine").serializeURL; +exports.serializeHost = require("./url-state-machine").serializeHost; +exports.serializeInteger = require("./url-state-machine").serializeInteger; +exports.serializeURLOrigin = require("./url-state-machine").serializeURLOrigin; +exports.setTheUsername = require("./url-state-machine").setTheUsername; +exports.setThePassword = require("./url-state-machine").setThePassword; +exports.cannotHaveAUsernamePasswordPort = require("./url-state-machine").cannotHaveAUsernamePasswordPort; + +exports.percentDecode = require("./urlencoded").percentDecode; diff --git a/tools/ui/node_modules/whatwg-url/lib/url-state-machine.js b/tools/ui/node_modules/whatwg-url/lib/url-state-machine.js new file mode 100644 index 0000000000000000000000000000000000000000..f76a87063caea2a553df543b95a3ac6987736373 --- /dev/null +++ b/tools/ui/node_modules/whatwg-url/lib/url-state-machine.js @@ -0,0 +1,1303 @@ +"use strict"; +const punycode = require("punycode"); +const tr46 = require("tr46"); + +const infra = require("./infra"); +const { percentEncode, percentDecode } = require("./urlencoded"); + +const specialSchemes = { + ftp: 21, + file: null, + http: 80, + https: 443, + ws: 80, + wss: 443 +}; + +const failure = Symbol("failure"); + +function countSymbols(str) { + return punycode.ucs2.decode(str).length; +} + +function at(input, idx) { + const c = input[idx]; + return isNaN(c) ? undefined : String.fromCodePoint(c); +} + +function isSingleDot(buffer) { + return buffer === "." || buffer.toLowerCase() === "%2e"; +} + +function isDoubleDot(buffer) { + buffer = buffer.toLowerCase(); + return buffer === ".." || buffer === "%2e." || buffer === ".%2e" || buffer === "%2e%2e"; +} + +function isWindowsDriveLetterCodePoints(cp1, cp2) { + return infra.isASCIIAlpha(cp1) && (cp2 === 58 || cp2 === 124); +} + +function isWindowsDriveLetterString(string) { + return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && (string[1] === ":" || string[1] === "|"); +} + +function isNormalizedWindowsDriveLetterString(string) { + return string.length === 2 && infra.isASCIIAlpha(string.codePointAt(0)) && string[1] === ":"; +} + +function containsForbiddenHostCodePoint(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|%|\/|:|\?|@|\[|\\|\]/) !== -1; +} + +function containsForbiddenHostCodePointExcludingPercent(string) { + return string.search(/\u0000|\u0009|\u000A|\u000D|\u0020|#|\/|:|\?|@|\[|\\|\]/) !== -1; +} + +function isSpecialScheme(scheme) { + return specialSchemes[scheme] !== undefined; +} + +function isSpecial(url) { + return isSpecialScheme(url.scheme); +} + +function isNotSpecial(url) { + return !isSpecialScheme(url.scheme); +} + +function defaultPort(scheme) { + return specialSchemes[scheme]; +} + +function utf8PercentEncode(c) { + const buf = Buffer.from(c); + + let str = ""; + + for (let i = 0; i < buf.length; ++i) { + str += percentEncode(buf[i]); + } + + return str; +} + +function isC0ControlPercentEncode(c) { + return c <= 0x1F || c > 0x7E; +} + +const extraUserinfoPercentEncodeSet = + new Set([47, 58, 59, 61, 64, 91, 92, 93, 94, 124]); +function isUserinfoPercentEncode(c) { + return isPathPercentEncode(c) || extraUserinfoPercentEncodeSet.has(c); +} + +const extraFragmentPercentEncodeSet = new Set([32, 34, 60, 62, 96]); +function isFragmentPercentEncode(c) { + return isC0ControlPercentEncode(c) || extraFragmentPercentEncodeSet.has(c); +} + +const extraPathPercentEncodeSet = new Set([35, 63, 123, 125]); +function isPathPercentEncode(c) { + return isFragmentPercentEncode(c) || extraPathPercentEncodeSet.has(c); +} + +function percentEncodeChar(c, encodeSetPredicate) { + const cStr = String.fromCodePoint(c); + + if (encodeSetPredicate(c)) { + return utf8PercentEncode(cStr); + } + + return cStr; +} + +function parseIPv4Number(input) { + let R = 10; + + if (input.length >= 2 && input.charAt(0) === "0" && input.charAt(1).toLowerCase() === "x") { + input = input.substring(2); + R = 16; + } else if (input.length >= 2 && input.charAt(0) === "0") { + input = input.substring(1); + R = 8; + } + + if (input === "") { + return 0; + } + + let regex = /[^0-7]/; + if (R === 10) { + regex = /[^0-9]/; + } + if (R === 16) { + regex = /[^0-9A-Fa-f]/; + } + + if (regex.test(input)) { + return failure; + } + + return parseInt(input, R); +} + +function parseIPv4(input) { + const parts = input.split("."); + if (parts[parts.length - 1] === "") { + if (parts.length > 1) { + parts.pop(); + } + } + + if (parts.length > 4) { + return input; + } + + const numbers = []; + for (const part of parts) { + if (part === "") { + return input; + } + const n = parseIPv4Number(part); + if (n === failure) { + return input; + } + + numbers.push(n); + } + + for (let i = 0; i < numbers.length - 1; ++i) { + if (numbers[i] > 255) { + return failure; + } + } + if (numbers[numbers.length - 1] >= Math.pow(256, 5 - numbers.length)) { + return failure; + } + + let ipv4 = numbers.pop(); + let counter = 0; + + for (const n of numbers) { + ipv4 += n * Math.pow(256, 3 - counter); + ++counter; + } + + return ipv4; +} + +function serializeIPv4(address) { + let output = ""; + let n = address; + + for (let i = 1; i <= 4; ++i) { + output = String(n % 256) + output; + if (i !== 4) { + output = "." + output; + } + n = Math.floor(n / 256); + } + + return output; +} + +function parseIPv6(input) { + const address = [0, 0, 0, 0, 0, 0, 0, 0]; + let pieceIndex = 0; + let compress = null; + let pointer = 0; + + input = punycode.ucs2.decode(input); + + if (input[pointer] === 58) { + if (input[pointer + 1] !== 58) { + return failure; + } + + pointer += 2; + ++pieceIndex; + compress = pieceIndex; + } + + while (pointer < input.length) { + if (pieceIndex === 8) { + return failure; + } + + if (input[pointer] === 58) { + if (compress !== null) { + return failure; + } + ++pointer; + ++pieceIndex; + compress = pieceIndex; + continue; + } + + let value = 0; + let length = 0; + + while (length < 4 && infra.isASCIIHex(input[pointer])) { + value = value * 0x10 + parseInt(at(input, pointer), 16); + ++pointer; + ++length; + } + + if (input[pointer] === 46) { + if (length === 0) { + return failure; + } + + pointer -= length; + + if (pieceIndex > 6) { + return failure; + } + + let numbersSeen = 0; + + while (input[pointer] !== undefined) { + let ipv4Piece = null; + + if (numbersSeen > 0) { + if (input[pointer] === 46 && numbersSeen < 4) { + ++pointer; + } else { + return failure; + } + } + + if (!infra.isASCIIDigit(input[pointer])) { + return failure; + } + + while (infra.isASCIIDigit(input[pointer])) { + const number = parseInt(at(input, pointer)); + if (ipv4Piece === null) { + ipv4Piece = number; + } else if (ipv4Piece === 0) { + return failure; + } else { + ipv4Piece = ipv4Piece * 10 + number; + } + if (ipv4Piece > 255) { + return failure; + } + ++pointer; + } + + address[pieceIndex] = address[pieceIndex] * 0x100 + ipv4Piece; + + ++numbersSeen; + + if (numbersSeen === 2 || numbersSeen === 4) { + ++pieceIndex; + } + } + + if (numbersSeen !== 4) { + return failure; + } + + break; + } else if (input[pointer] === 58) { + ++pointer; + if (input[pointer] === undefined) { + return failure; + } + } else if (input[pointer] !== undefined) { + return failure; + } + + address[pieceIndex] = value; + ++pieceIndex; + } + + if (compress !== null) { + let swaps = pieceIndex - compress; + pieceIndex = 7; + while (pieceIndex !== 0 && swaps > 0) { + const temp = address[compress + swaps - 1]; + address[compress + swaps - 1] = address[pieceIndex]; + address[pieceIndex] = temp; + --pieceIndex; + --swaps; + } + } else if (compress === null && pieceIndex !== 8) { + return failure; + } + + return address; +} + +function serializeIPv6(address) { + let output = ""; + const seqResult = findLongestZeroSequence(address); + const compress = seqResult.idx; + let ignore0 = false; + + for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) { + if (ignore0 && address[pieceIndex] === 0) { + continue; + } else if (ignore0) { + ignore0 = false; + } + + if (compress === pieceIndex) { + const separator = pieceIndex === 0 ? "::" : ":"; + output += separator; + ignore0 = true; + continue; + } + + output += address[pieceIndex].toString(16); + + if (pieceIndex !== 7) { + output += ":"; + } + } + + return output; +} + +function parseHost(input, isNotSpecialArg = false) { + if (input[0] === "[") { + if (input[input.length - 1] !== "]") { + return failure; + } + + return parseIPv6(input.substring(1, input.length - 1)); + } + + if (isNotSpecialArg) { + return parseOpaqueHost(input); + } + + const domain = percentDecode(Buffer.from(input)).toString(); + const asciiDomain = domainToASCII(domain); + if (asciiDomain === failure) { + return failure; + } + + if (containsForbiddenHostCodePoint(asciiDomain)) { + return failure; + } + + const ipv4Host = parseIPv4(asciiDomain); + if (typeof ipv4Host === "number" || ipv4Host === failure) { + return ipv4Host; + } + + return asciiDomain; +} + +function parseOpaqueHost(input) { + if (containsForbiddenHostCodePointExcludingPercent(input)) { + return failure; + } + + let output = ""; + const decoded = punycode.ucs2.decode(input); + for (let i = 0; i < decoded.length; ++i) { + output += percentEncodeChar(decoded[i], isC0ControlPercentEncode); + } + return output; +} + +function findLongestZeroSequence(arr) { + let maxIdx = null; + let maxLen = 1; // only find elements > 1 + let currStart = null; + let currLen = 0; + + for (let i = 0; i < arr.length; ++i) { + if (arr[i] !== 0) { + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + currStart = null; + currLen = 0; + } else { + if (currStart === null) { + currStart = i; + } + ++currLen; + } + } + + // if trailing zeros + if (currLen > maxLen) { + maxIdx = currStart; + maxLen = currLen; + } + + return { + idx: maxIdx, + len: maxLen + }; +} + +function serializeHost(host) { + if (typeof host === "number") { + return serializeIPv4(host); + } + + // IPv6 serializer + if (host instanceof Array) { + return "[" + serializeIPv6(host) + "]"; + } + + return host; +} + +function domainToASCII(domain, beStrict = false) { + const result = tr46.toASCII(domain, { + checkBidi: true, + checkHyphens: false, + checkJoiners: true, + useSTD3ASCIIRules: beStrict, + verifyDNSLength: beStrict + }); + if (result === null) { + return failure; + } + return result; +} + +function trimControlChars(url) { + return url.replace(/^[\u0000-\u001F\u0020]+|[\u0000-\u001F\u0020]+$/g, ""); +} + +function trimTabAndNewline(url) { + return url.replace(/\u0009|\u000A|\u000D/g, ""); +} + +function shortenPath(url) { + const { path } = url; + if (path.length === 0) { + return; + } + if (url.scheme === "file" && path.length === 1 && isNormalizedWindowsDriveLetter(path[0])) { + return; + } + + path.pop(); +} + +function includesCredentials(url) { + return url.username !== "" || url.password !== ""; +} + +function cannotHaveAUsernamePasswordPort(url) { + return url.host === null || url.host === "" || url.cannotBeABaseURL || url.scheme === "file"; +} + +function isNormalizedWindowsDriveLetter(string) { + return /^[A-Za-z]:$/.test(string); +} + +function URLStateMachine(input, base, encodingOverride, url, stateOverride) { + this.pointer = 0; + this.input = input; + this.base = base || null; + this.encodingOverride = encodingOverride || "utf-8"; + this.stateOverride = stateOverride; + this.url = url; + this.failure = false; + this.parseError = false; + + if (!this.url) { + this.url = { + scheme: "", + username: "", + password: "", + host: null, + port: null, + path: [], + query: null, + fragment: null, + + cannotBeABaseURL: false + }; + + const res = trimControlChars(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + } + + const res = trimTabAndNewline(this.input); + if (res !== this.input) { + this.parseError = true; + } + this.input = res; + + this.state = stateOverride || "scheme start"; + + this.buffer = ""; + this.atFlag = false; + this.arrFlag = false; + this.passwordTokenSeenFlag = false; + + this.input = punycode.ucs2.decode(this.input); + + for (; this.pointer <= this.input.length; ++this.pointer) { + const c = this.input[this.pointer]; + const cStr = isNaN(c) ? undefined : String.fromCodePoint(c); + + // exec state machine + const ret = this["parse " + this.state](c, cStr); + if (!ret) { + break; // terminate algorithm + } else if (ret === failure) { + this.failure = true; + break; + } + } +} + +URLStateMachine.prototype["parse scheme start"] = function parseSchemeStart(c, cStr) { + if (infra.isASCIIAlpha(c)) { + this.buffer += cStr.toLowerCase(); + this.state = "scheme"; + } else if (!this.stateOverride) { + this.state = "no scheme"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse scheme"] = function parseScheme(c, cStr) { + if (infra.isASCIIAlphanumeric(c) || c === 43 || c === 45 || c === 46) { + this.buffer += cStr.toLowerCase(); + } else if (c === 58) { + if (this.stateOverride) { + if (isSpecial(this.url) && !isSpecialScheme(this.buffer)) { + return false; + } + + if (!isSpecial(this.url) && isSpecialScheme(this.buffer)) { + return false; + } + + if ((includesCredentials(this.url) || this.url.port !== null) && this.buffer === "file") { + return false; + } + + if (this.url.scheme === "file" && (this.url.host === "" || this.url.host === null)) { + return false; + } + } + this.url.scheme = this.buffer; + if (this.stateOverride) { + if (this.url.port === defaultPort(this.url.scheme)) { + this.url.port = null; + } + return false; + } + this.buffer = ""; + if (this.url.scheme === "file") { + if (this.input[this.pointer + 1] !== 47 || this.input[this.pointer + 2] !== 47) { + this.parseError = true; + } + this.state = "file"; + } else if (isSpecial(this.url) && this.base !== null && this.base.scheme === this.url.scheme) { + this.state = "special relative or authority"; + } else if (isSpecial(this.url)) { + this.state = "special authority slashes"; + } else if (this.input[this.pointer + 1] === 47) { + this.state = "path or authority"; + ++this.pointer; + } else { + this.url.cannotBeABaseURL = true; + this.url.path.push(""); + this.state = "cannot-be-a-base-URL path"; + } + } else if (!this.stateOverride) { + this.buffer = ""; + this.state = "no scheme"; + this.pointer = -1; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +URLStateMachine.prototype["parse no scheme"] = function parseNoScheme(c) { + if (this.base === null || (this.base.cannotBeABaseURL && c !== 35)) { + return failure; + } else if (this.base.cannotBeABaseURL && c === 35) { + this.url.scheme = this.base.scheme; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.url.cannotBeABaseURL = true; + this.state = "fragment"; + } else if (this.base.scheme === "file") { + this.state = "file"; + --this.pointer; + } else { + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special relative or authority"] = function parseSpecialRelativeOrAuthority(c) { + if (c === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "relative"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse path or authority"] = function parsePathOrAuthority(c) { + if (c === 47) { + this.state = "authority"; + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse relative"] = function parseRelative(c) { + this.url.scheme = this.base.scheme; + if (isNaN(c)) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c === 47) { + this.state = "relative slash"; + } else if (c === 63) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else if (isSpecial(this.url) && c === 92) { + this.parseError = true; + this.state = "relative slash"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.url.path = this.base.path.slice(0, this.base.path.length - 1); + + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse relative slash"] = function parseRelativeSlash(c) { + if (isSpecial(this.url) && (c === 47 || c === 92)) { + if (c === 92) { + this.parseError = true; + } + this.state = "special authority ignore slashes"; + } else if (c === 47) { + this.state = "authority"; + } else { + this.url.username = this.base.username; + this.url.password = this.base.password; + this.url.host = this.base.host; + this.url.port = this.base.port; + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority slashes"] = function parseSpecialAuthoritySlashes(c) { + if (c === 47 && this.input[this.pointer + 1] === 47) { + this.state = "special authority ignore slashes"; + ++this.pointer; + } else { + this.parseError = true; + this.state = "special authority ignore slashes"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse special authority ignore slashes"] = function parseSpecialAuthorityIgnoreSlashes(c) { + if (c !== 47 && c !== 92) { + this.state = "authority"; + --this.pointer; + } else { + this.parseError = true; + } + + return true; +}; + +URLStateMachine.prototype["parse authority"] = function parseAuthority(c, cStr) { + if (c === 64) { + this.parseError = true; + if (this.atFlag) { + this.buffer = "%40" + this.buffer; + } + this.atFlag = true; + + // careful, this is based on buffer and has its own pointer (this.pointer != pointer) and inner chars + const len = countSymbols(this.buffer); + for (let pointer = 0; pointer < len; ++pointer) { + const codePoint = this.buffer.codePointAt(pointer); + + if (codePoint === 58 && !this.passwordTokenSeenFlag) { + this.passwordTokenSeenFlag = true; + continue; + } + const encodedCodePoints = percentEncodeChar(codePoint, isUserinfoPercentEncode); + if (this.passwordTokenSeenFlag) { + this.url.password += encodedCodePoints; + } else { + this.url.username += encodedCodePoints; + } + } + this.buffer = ""; + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || + (isSpecial(this.url) && c === 92)) { + if (this.atFlag && this.buffer === "") { + this.parseError = true; + return failure; + } + this.pointer -= countSymbols(this.buffer) + 1; + this.buffer = ""; + this.state = "host"; + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse hostname"] = +URLStateMachine.prototype["parse host"] = function parseHostName(c, cStr) { + if (this.stateOverride && this.url.scheme === "file") { + --this.pointer; + this.state = "file host"; + } else if (c === 58 && !this.arrFlag) { + if (this.buffer === "") { + this.parseError = true; + return failure; + } + + const host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "port"; + if (this.stateOverride === "hostname") { + return false; + } + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || + (isSpecial(this.url) && c === 92)) { + --this.pointer; + if (isSpecial(this.url) && this.buffer === "") { + this.parseError = true; + return failure; + } else if (this.stateOverride && this.buffer === "" && + (includesCredentials(this.url) || this.url.port !== null)) { + this.parseError = true; + return false; + } + + const host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + + this.url.host = host; + this.buffer = ""; + this.state = "path start"; + if (this.stateOverride) { + return false; + } + } else { + if (c === 91) { + this.arrFlag = true; + } else if (c === 93) { + this.arrFlag = false; + } + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse port"] = function parsePort(c, cStr) { + if (infra.isASCIIDigit(c)) { + this.buffer += cStr; + } else if (isNaN(c) || c === 47 || c === 63 || c === 35 || + (isSpecial(this.url) && c === 92) || + this.stateOverride) { + if (this.buffer !== "") { + const port = parseInt(this.buffer); + if (port > Math.pow(2, 16) - 1) { + this.parseError = true; + return failure; + } + this.url.port = port === defaultPort(this.url.scheme) ? null : port; + this.buffer = ""; + } + if (this.stateOverride) { + return false; + } + this.state = "path start"; + --this.pointer; + } else { + this.parseError = true; + return failure; + } + + return true; +}; + +const fileOtherwiseCodePoints = new Set([47, 92, 63, 35]); + +function startsWithWindowsDriveLetter(input, pointer) { + const length = input.length - pointer; + return length >= 2 && + isWindowsDriveLetterCodePoints(input[pointer], input[pointer + 1]) && + (length === 2 || fileOtherwiseCodePoints.has(input[pointer + 2])); +} + +URLStateMachine.prototype["parse file"] = function parseFile(c) { + this.url.scheme = "file"; + + if (c === 47 || c === 92) { + if (c === 92) { + this.parseError = true; + } + this.state = "file slash"; + } else if (this.base !== null && this.base.scheme === "file") { + if (isNaN(c)) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + } else if (c === 63) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + this.url.query = this.base.query; + this.url.fragment = ""; + this.state = "fragment"; + } else { + if (!startsWithWindowsDriveLetter(this.input, this.pointer)) { + this.url.host = this.base.host; + this.url.path = this.base.path.slice(); + shortenPath(this.url); + } else { + this.parseError = true; + } + + this.state = "path"; + --this.pointer; + } + } else { + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file slash"] = function parseFileSlash(c) { + if (c === 47 || c === 92) { + if (c === 92) { + this.parseError = true; + } + this.state = "file host"; + } else { + if (this.base !== null && this.base.scheme === "file" && + !startsWithWindowsDriveLetter(this.input, this.pointer)) { + if (isNormalizedWindowsDriveLetterString(this.base.path[0])) { + this.url.path.push(this.base.path[0]); + } else { + this.url.host = this.base.host; + } + } + this.state = "path"; + --this.pointer; + } + + return true; +}; + +URLStateMachine.prototype["parse file host"] = function parseFileHost(c, cStr) { + if (isNaN(c) || c === 47 || c === 92 || c === 63 || c === 35) { + --this.pointer; + if (!this.stateOverride && isWindowsDriveLetterString(this.buffer)) { + this.parseError = true; + this.state = "path"; + } else if (this.buffer === "") { + this.url.host = ""; + if (this.stateOverride) { + return false; + } + this.state = "path start"; + } else { + let host = parseHost(this.buffer, isNotSpecial(this.url)); + if (host === failure) { + return failure; + } + if (host === "localhost") { + host = ""; + } + this.url.host = host; + + if (this.stateOverride) { + return false; + } + + this.buffer = ""; + this.state = "path start"; + } + } else { + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse path start"] = function parsePathStart(c) { + if (isSpecial(this.url)) { + if (c === 92) { + this.parseError = true; + } + this.state = "path"; + + if (c !== 47 && c !== 92) { + --this.pointer; + } + } else if (!this.stateOverride && c === 63) { + this.url.query = ""; + this.state = "query"; + } else if (!this.stateOverride && c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else if (c !== undefined) { + this.state = "path"; + if (c !== 47) { + --this.pointer; + } + } + + return true; +}; + +URLStateMachine.prototype["parse path"] = function parsePath(c) { + if (isNaN(c) || c === 47 || (isSpecial(this.url) && c === 92) || + (!this.stateOverride && (c === 63 || c === 35))) { + if (isSpecial(this.url) && c === 92) { + this.parseError = true; + } + + if (isDoubleDot(this.buffer)) { + shortenPath(this.url); + if (c !== 47 && !(isSpecial(this.url) && c === 92)) { + this.url.path.push(""); + } + } else if (isSingleDot(this.buffer) && c !== 47 && + !(isSpecial(this.url) && c === 92)) { + this.url.path.push(""); + } else if (!isSingleDot(this.buffer)) { + if (this.url.scheme === "file" && this.url.path.length === 0 && isWindowsDriveLetterString(this.buffer)) { + if (this.url.host !== "" && this.url.host !== null) { + this.parseError = true; + this.url.host = ""; + } + this.buffer = this.buffer[0] + ":"; + } + this.url.path.push(this.buffer); + } + this.buffer = ""; + if (this.url.scheme === "file" && (c === undefined || c === 63 || c === 35)) { + while (this.url.path.length > 1 && this.url.path[0] === "") { + this.parseError = true; + this.url.path.shift(); + } + } + if (c === 63) { + this.url.query = ""; + this.state = "query"; + } + if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + + if (c === 37 && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += percentEncodeChar(c, isPathPercentEncode); + } + + return true; +}; + +URLStateMachine.prototype["parse cannot-be-a-base-URL path"] = function parseCannotBeABaseURLPath(c) { + if (c === 63) { + this.url.query = ""; + this.state = "query"; + } else if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } else { + // TODO: Add: not a URL code point + if (!isNaN(c) && c !== 37) { + this.parseError = true; + } + + if (c === 37 && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + if (!isNaN(c)) { + this.url.path[0] = this.url.path[0] + percentEncodeChar(c, isC0ControlPercentEncode); + } + } + + return true; +}; + +URLStateMachine.prototype["parse query"] = function parseQuery(c, cStr) { + if (isNaN(c) || (!this.stateOverride && c === 35)) { + if (!isSpecial(this.url) || this.url.scheme === "ws" || this.url.scheme === "wss") { + this.encodingOverride = "utf-8"; + } + + const buffer = Buffer.from(this.buffer); // TODO: Use encoding override instead + for (let i = 0; i < buffer.length; ++i) { + if (buffer[i] < 0x21 || + buffer[i] > 0x7E || + buffer[i] === 0x22 || buffer[i] === 0x23 || buffer[i] === 0x3C || buffer[i] === 0x3E || + (buffer[i] === 0x27 && isSpecial(this.url))) { + this.url.query += percentEncode(buffer[i]); + } else { + this.url.query += String.fromCodePoint(buffer[i]); + } + } + + this.buffer = ""; + if (c === 35) { + this.url.fragment = ""; + this.state = "fragment"; + } + } else { + // TODO: If c is not a URL code point and not "%", parse error. + if (c === 37 && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.buffer += cStr; + } + + return true; +}; + +URLStateMachine.prototype["parse fragment"] = function parseFragment(c) { + if (isNaN(c)) { // do nothing + } else if (c === 0x0) { + this.parseError = true; + } else { + // TODO: If c is not a URL code point and not "%", parse error. + if (c === 37 && + (!infra.isASCIIHex(this.input[this.pointer + 1]) || + !infra.isASCIIHex(this.input[this.pointer + 2]))) { + this.parseError = true; + } + + this.url.fragment += percentEncodeChar(c, isFragmentPercentEncode); + } + + return true; +}; + +function serializeURL(url, excludeFragment) { + let output = url.scheme + ":"; + if (url.host !== null) { + output += "//"; + + if (url.username !== "" || url.password !== "") { + output += url.username; + if (url.password !== "") { + output += ":" + url.password; + } + output += "@"; + } + + output += serializeHost(url.host); + + if (url.port !== null) { + output += ":" + url.port; + } + } else if (url.host === null && url.scheme === "file") { + output += "//"; + } + + if (url.cannotBeABaseURL) { + output += url.path[0]; + } else { + for (const string of url.path) { + output += "/" + string; + } + } + + if (url.query !== null) { + output += "?" + url.query; + } + + if (!excludeFragment && url.fragment !== null) { + output += "#" + url.fragment; + } + + return output; +} + +function serializeOrigin(tuple) { + let result = tuple.scheme + "://"; + result += serializeHost(tuple.host); + + if (tuple.port !== null) { + result += ":" + tuple.port; + } + + return result; +} + +module.exports.serializeURL = serializeURL; + +module.exports.serializeURLOrigin = function (url) { + // https://url.spec.whatwg.org/#concept-url-origin + switch (url.scheme) { + case "blob": + try { + return module.exports.serializeURLOrigin(module.exports.parseURL(url.path[0])); + } catch (e) { + // serializing an opaque origin returns "null" + return "null"; + } + case "ftp": + case "http": + case "https": + case "ws": + case "wss": + return serializeOrigin({ + scheme: url.scheme, + host: url.host, + port: url.port + }); + case "file": + // The spec says: + // > Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new opaque origin. + // Browsers tested so far: + // - Chrome says "file://", but treats file: URLs as cross-origin for most (all?) purposes; see e.g. + // https://bugs.chromium.org/p/chromium/issues/detail?id=37586 + // - Firefox says "null", but treats file: URLs as same-origin sometimes based on directory stuff; see + // https://developer.mozilla.org/en-US/docs/Archive/Misc_top_level/Same-origin_policy_for_file:_URIs + return "null"; + default: + // serializing an opaque origin returns "null" + return "null"; + } +}; + +module.exports.basicURLParse = function (input, options) { + if (options === undefined) { + options = {}; + } + + const usm = new URLStateMachine(input, options.baseURL, options.encodingOverride, options.url, options.stateOverride); + if (usm.failure) { + return null; + } + + return usm.url; +}; + +module.exports.setTheUsername = function (url, username) { + url.username = ""; + const decoded = punycode.ucs2.decode(username); + for (let i = 0; i < decoded.length; ++i) { + url.username += percentEncodeChar(decoded[i], isUserinfoPercentEncode); + } +}; + +module.exports.setThePassword = function (url, password) { + url.password = ""; + const decoded = punycode.ucs2.decode(password); + for (let i = 0; i < decoded.length; ++i) { + url.password += percentEncodeChar(decoded[i], isUserinfoPercentEncode); + } +}; + +module.exports.serializeHost = serializeHost; + +module.exports.cannotHaveAUsernamePasswordPort = cannotHaveAUsernamePasswordPort; + +module.exports.serializeInteger = function (integer) { + return String(integer); +}; + +module.exports.parseURL = function (input, options) { + if (options === undefined) { + options = {}; + } + + // We don't handle blobs, so this just delegates: + return module.exports.basicURLParse(input, { baseURL: options.baseURL, encodingOverride: options.encodingOverride }); +}; diff --git a/tools/ui/node_modules/whatwg-url/lib/urlencoded.js b/tools/ui/node_modules/whatwg-url/lib/urlencoded.js new file mode 100644 index 0000000000000000000000000000000000000000..b9020792383c8c8937d5e0febf8633f0b61ae6c6 --- /dev/null +++ b/tools/ui/node_modules/whatwg-url/lib/urlencoded.js @@ -0,0 +1,138 @@ +"use strict"; +const { isASCIIHex } = require("./infra"); + +function strictlySplitByteSequence(buf, cp) { + const list = []; + let last = 0; + let i = buf.indexOf(cp); + while (i >= 0) { + list.push(buf.slice(last, i)); + last = i + 1; + i = buf.indexOf(cp, last); + } + if (last !== buf.length) { + list.push(buf.slice(last)); + } + return list; +} + +function replaceByteInByteSequence(buf, from, to) { + let i = buf.indexOf(from); + while (i >= 0) { + buf[i] = to; + i = buf.indexOf(from, i + 1); + } + return buf; +} + +function percentEncode(c) { + let hex = c.toString(16).toUpperCase(); + if (hex.length === 1) { + hex = "0" + hex; + } + + return "%" + hex; +} + +function percentDecode(input) { + const output = Buffer.alloc(input.byteLength); + let ptr = 0; + for (let i = 0; i < input.length; ++i) { + if (input[i] !== 37 || !isASCIIHex(input[i + 1]) || !isASCIIHex(input[i + 2])) { + output[ptr++] = input[i]; + } else { + output[ptr++] = parseInt(input.slice(i + 1, i + 3).toString(), 16); + i += 2; + } + } + return output.slice(0, ptr); +} + +function parseUrlencoded(input) { + const sequences = strictlySplitByteSequence(input, 38); + const output = []; + for (const bytes of sequences) { + if (bytes.length === 0) { + continue; + } + + let name; + let value; + const indexOfEqual = bytes.indexOf(61); + + if (indexOfEqual >= 0) { + name = bytes.slice(0, indexOfEqual); + value = bytes.slice(indexOfEqual + 1); + } else { + name = bytes; + value = Buffer.alloc(0); + } + + name = replaceByteInByteSequence(Buffer.from(name), 43, 32); + value = replaceByteInByteSequence(Buffer.from(value), 43, 32); + + output.push([percentDecode(name).toString(), percentDecode(value).toString()]); + } + return output; +} + +function serializeUrlencodedByte(input) { + let output = ""; + for (const byte of input) { + if (byte === 32) { + output += "+"; + } else if (byte === 42 || + byte === 45 || + byte === 46 || + (byte >= 48 && byte <= 57) || + (byte >= 65 && byte <= 90) || + byte === 95 || + (byte >= 97 && byte <= 122)) { + output += String.fromCodePoint(byte); + } else { + output += percentEncode(byte); + } + } + return output; +} + +function serializeUrlencoded(tuples, encodingOverride = undefined) { + let encoding = "utf-8"; + if (encodingOverride !== undefined) { + encoding = encodingOverride; + } + + let output = ""; + for (const [i, tuple] of tuples.entries()) { + // TODO: handle encoding override + const name = serializeUrlencodedByte(Buffer.from(tuple[0])); + let value = tuple[1]; + if (tuple.length > 2 && tuple[2] !== undefined) { + if (tuple[2] === "hidden" && name === "_charset_") { + value = encoding; + } else if (tuple[2] === "file") { + // value is a File object + value = value.name; + } + } + value = serializeUrlencodedByte(Buffer.from(value)); + if (i !== 0) { + output += "&"; + } + output += `${name}=${value}`; + } + return output; +} + +module.exports = { + percentEncode, + percentDecode, + + // application/x-www-form-urlencoded string parser + parseUrlencoded(input) { + return parseUrlencoded(Buffer.from(input)); + }, + + // application/x-www-form-urlencoded serializer + serializeUrlencoded +}; diff --git a/tools/ui/node_modules/whatwg-url/lib/utils.js b/tools/ui/node_modules/whatwg-url/lib/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..12e23aa33e6bc8e82d26ca676ba1ed5c481d3594 --- /dev/null +++ b/tools/ui/node_modules/whatwg-url/lib/utils.js @@ -0,0 +1,127 @@ +"use strict"; + +// Returns "Type(value) is Object" in ES terminology. +function isObject(value) { + return typeof value === "object" && value !== null || typeof value === "function"; +} + +function hasOwn(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +const getOwnPropertyDescriptors = typeof Object.getOwnPropertyDescriptors === "function" ? + Object.getOwnPropertyDescriptors : + // Polyfill exists until we require Node.js v8.x + // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors + obj => { + if (obj === undefined || obj === null) { + throw new TypeError("Cannot convert undefined or null to object"); + } + obj = Object(obj); + const ownKeys = Reflect.ownKeys(obj); + const descriptors = {}; + for (const key of ownKeys) { + const descriptor = Reflect.getOwnPropertyDescriptor(obj, key); + if (descriptor !== undefined) { + Reflect.defineProperty(descriptors, key, { + value: descriptor, + writable: true, + enumerable: true, + configurable: true + }); + } + } + return descriptors; + }; + +const wrapperSymbol = Symbol("wrapper"); +const implSymbol = Symbol("impl"); +const sameObjectCaches = Symbol("SameObject caches"); + +function getSameObject(wrapper, prop, creator) { + if (!wrapper[sameObjectCaches]) { + wrapper[sameObjectCaches] = Object.create(null); + } + + if (prop in wrapper[sameObjectCaches]) { + return wrapper[sameObjectCaches][prop]; + } + + wrapper[sameObjectCaches][prop] = creator(); + return wrapper[sameObjectCaches][prop]; +} + +function wrapperForImpl(impl) { + return impl ? impl[wrapperSymbol] : null; +} + +function implForWrapper(wrapper) { + return wrapper ? wrapper[implSymbol] : null; +} + +function tryWrapperForImpl(impl) { + const wrapper = wrapperForImpl(impl); + return wrapper ? wrapper : impl; +} + +function tryImplForWrapper(wrapper) { + const impl = implForWrapper(wrapper); + return impl ? impl : wrapper; +} + +const iterInternalSymbol = Symbol("internal"); +const IteratorPrototype = Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())); + +function isArrayIndexPropName(P) { + if (typeof P !== "string") { + return false; + } + const i = P >>> 0; + if (i === Math.pow(2, 32) - 1) { + return false; + } + const s = `${i}`; + if (P !== s) { + return false; + } + return true; +} + +const supportsPropertyIndex = Symbol("supports property index"); +const supportedPropertyIndices = Symbol("supported property indices"); +const supportsPropertyName = Symbol("supports property name"); +const supportedPropertyNames = Symbol("supported property names"); +const indexedGet = Symbol("indexed property get"); +const indexedSetNew = Symbol("indexed property set new"); +const indexedSetExisting = Symbol("indexed property set existing"); +const namedGet = Symbol("named property get"); +const namedSetNew = Symbol("named property set new"); +const namedSetExisting = Symbol("named property set existing"); +const namedDelete = Symbol("named property delete"); + +module.exports = exports = { + isObject, + hasOwn, + getOwnPropertyDescriptors, + wrapperSymbol, + implSymbol, + getSameObject, + wrapperForImpl, + implForWrapper, + tryWrapperForImpl, + tryImplForWrapper, + iterInternalSymbol, + IteratorPrototype, + isArrayIndexPropName, + supportsPropertyIndex, + supportedPropertyIndices, + supportsPropertyName, + supportedPropertyNames, + indexedGet, + indexedSetNew, + indexedSetExisting, + namedGet, + namedSetNew, + namedSetExisting, + namedDelete +}; diff --git a/tools/ui/node_modules/whatwg-url/package.json b/tools/ui/node_modules/whatwg-url/package.json new file mode 100644 index 0000000000000000000000000000000000000000..67ec1e0ec0ade3f073973ccaddea594bec4797b4 --- /dev/null +++ b/tools/ui/node_modules/whatwg-url/package.json @@ -0,0 +1,54 @@ +{ + "name": "whatwg-url", + "version": "7.1.0", + "description": "An implementation of the WHATWG URL Standard's URL API and parsing machinery", + "main": "lib/public-api.js", + "files": [ + "lib/" + ], + "author": "Sebastian Mayr ", + "license": "MIT", + "repository": "jsdom/whatwg-url", + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + }, + "devDependencies": { + "browserify": "^16.2.2", + "domexception": "^1.0.1", + "eslint": "^5.4.0", + "got": "^9.2.2", + "jest": "^23.5.0", + "recast": "^0.15.3", + "webidl2js": "^9.0.1" + }, + "scripts": { + "build": "node scripts/transform.js && node scripts/convert-idl.js", + "coverage": "jest --coverage", + "lint": "eslint .", + "prepublish": "node scripts/transform.js && node scripts/convert-idl.js", + "pretest": "node scripts/get-latest-platform-tests.js && node scripts/transform.js && node scripts/convert-idl.js", + "build-live-viewer": "browserify lib/public-api.js --standalone whatwgURL > live-viewer/whatwg-url.js", + "test": "jest" + }, + "jest": { + "collectCoverageFrom": [ + "lib/**/*.js", + "!lib/utils.js" + ], + "coverageDirectory": "coverage", + "coverageReporters": [ + "lcov", + "text-summary" + ], + "testEnvironment": "node", + "testMatch": [ + "/test/**/*.js" + ], + "testPathIgnorePatterns": [ + "^/test/testharness.js$", + "^/test/web-platform-tests/" + ] + } +} diff --git a/tools/ui/node_modules/which-boxed-primitive/.editorconfig b/tools/ui/node_modules/which-boxed-primitive/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..bc228f8269443bf772b437890dde7756a3e8a894 --- /dev/null +++ b/tools/ui/node_modules/which-boxed-primitive/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/tools/ui/node_modules/which-boxed-primitive/.eslintrc b/tools/ui/node_modules/which-boxed-primitive/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..3b5d9e90ec405f85dd7f9066656efccc51193697 --- /dev/null +++ b/tools/ui/node_modules/which-boxed-primitive/.eslintrc @@ -0,0 +1,5 @@ +{ + "root": true, + + "extends": "@ljharb", +} diff --git a/tools/ui/node_modules/which-boxed-primitive/.github/FUNDING.yml b/tools/ui/node_modules/which-boxed-primitive/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..0cdbbd8130831c331989f7f972f193ad11180579 --- /dev/null +++ b/tools/ui/node_modules/which-boxed-primitive/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/which-boxed-primitive +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/tools/ui/node_modules/which-boxed-primitive/.nycrc b/tools/ui/node_modules/which-boxed-primitive/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..1826526e091b89c896e7099ccd891db79165e329 --- /dev/null +++ b/tools/ui/node_modules/which-boxed-primitive/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/tools/ui/node_modules/which-boxed-primitive/CHANGELOG.md b/tools/ui/node_modules/which-boxed-primitive/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..1f94157617f474932efaf41962e9bc16c44da649 --- /dev/null +++ b/tools/ui/node_modules/which-boxed-primitive/CHANGELOG.md @@ -0,0 +1,82 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.1](https://github.com/inspect-js/which-boxed-primitive/compare/v1.1.0...v1.1.1) - 2024-12-15 + +### Commits + +- [Deps] update `is-boolean-object`, `is-number-object`, `is-string`, `is-symbol` [`5266e0c`](https://github.com/inspect-js/which-boxed-primitive/commit/5266e0cb87a814e42b4e8de9574430d27e562070) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape` [`a660339`](https://github.com/inspect-js/which-boxed-primitive/commit/a66033981b3f2b4ba4261cf477fd5a6dc40b38d6) + +## [v1.1.0](https://github.com/inspect-js/which-boxed-primitive/compare/v1.0.2...v1.1.0) - 2024-12-02 + +### Commits + +- [actions] reuse common workflows [`893df44`](https://github.com/inspect-js/which-boxed-primitive/commit/893df44f4d4ad653878aa0b470fc3437f25ad240) +- [meta] use `npmignore` to autogenerate an npmignore file [`bab1ff8`](https://github.com/inspect-js/which-boxed-primitive/commit/bab1ff84d391d94a419bb22a0be3d589b16732a4) +- [Tests] use `es-value-fixtures` and `for-each` [`ecacfa0`](https://github.com/inspect-js/which-boxed-primitive/commit/ecacfa01438228830b77fc006e3d366c8227c2b3) +- [New] add types [`ab38e78`](https://github.com/inspect-js/which-boxed-primitive/commit/ab38e78885752258f1e90487f2793173a3e81e5e) +- [actions] split out node 10-20, and 20+ [`7ee9c3c`](https://github.com/inspect-js/which-boxed-primitive/commit/7ee9c3c27b31289db6970cb2024621cdef4dc5ae) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `safe-publish-latest`, `tape` [`142215a`](https://github.com/inspect-js/which-boxed-primitive/commit/142215aeb898604e356e46708a7fad0d1113d764) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `has-symbols`, `object-inspect`, `tape` [`3559371`](https://github.com/inspect-js/which-boxed-primitive/commit/3559371556c26688418e6ea06e52dfd51cce29e7) +- [actions] update rebase action to use reusable workflow [`928901a`](https://github.com/inspect-js/which-boxed-primitive/commit/928901a781ddcb75cec158f3d0a273100d8f3f80) +- [Deps] update `is-bigint`, `is-boolean-object`, `is-number-object`, `is-string`, `is-symbol` [`f7b14be`](https://github.com/inspect-js/which-boxed-primitive/commit/f7b14bed64b6f784221dfe229b583c512d2bcb2c) +- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `npmignore`, `object-inspect`, `tape` [`5296738`](https://github.com/inspect-js/which-boxed-primitive/commit/5296738a192d9d006a5874dcc262080df108da62) +- [Deps] update `is-bigint`, `is-boolean-object`, `is-number-object`, `is-string`, `is-symbol` [`caa6d1c`](https://github.com/inspect-js/which-boxed-primitive/commit/caa6d1cb8e44c6b8100431dd643e9817f361921c) +- [meta] add missing `engines.node` [`ca40880`](https://github.com/inspect-js/which-boxed-primitive/commit/ca40880bb94282871229a7f1d678609b71f4d120) +- [Tests] replace `aud` with `npm audit` [`b0f4069`](https://github.com/inspect-js/which-boxed-primitive/commit/b0f40690697c2a963dd7100eec500f138a79f4ae) +- [Dev Deps] update `aud` [`8d0e336`](https://github.com/inspect-js/which-boxed-primitive/commit/8d0e336ee7385ed6a94d6362e62e25c54d155a2d) +- [Deps] update `is-number-object` [`eafcabf`](https://github.com/inspect-js/which-boxed-primitive/commit/eafcabf3f00c7d716bffdfc0ceeca62387349c7d) +- [Dev Deps] add missing peer dep [`ec4dd52`](https://github.com/inspect-js/which-boxed-primitive/commit/ec4dd520dbe77e33341d94479aec3b42817b4cbf) + +## [v1.0.2](https://github.com/inspect-js/which-boxed-primitive/compare/v1.0.1...v1.0.2) - 2020-12-14 + +### Commits + +- [Tests] use shared travis-ci configs [`8674582`](https://github.com/inspect-js/which-boxed-primitive/commit/86745829b6a92cff2cfb0d3c0414ec9afdc2a087) +- [Tests] migrate tests to Github Actions [`dff6643`](https://github.com/inspect-js/which-boxed-primitive/commit/dff6643405ba4d6dc6694a25904c8f72f273ece8) +- [meta] do not publish github action workflow files [`b26112a`](https://github.com/inspect-js/which-boxed-primitive/commit/b26112a4e4ac6beec8f54c734135dbf9e9ba16f9) +- [meta] make `auto-changelog` config consistent [`8d10175`](https://github.com/inspect-js/which-boxed-primitive/commit/8d10175171154cd6c8f8a016aa7fb71b5044acf6) +- [readme] fix repo URLs, remove defunct badges [`ab8db24`](https://github.com/inspect-js/which-boxed-primitive/commit/ab8db247573723dbcda68469118d08c7c2692c67) +- [Tests] run `nyc` on all tests; use `tape` runner [`7d084df`](https://github.com/inspect-js/which-boxed-primitive/commit/7d084dfc5251230e9399a81782c0b9d7ae5d1901) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`576f6f3`](https://github.com/inspect-js/which-boxed-primitive/commit/576f6f308aed35ef1d3392bb9472def59482ed13) +- [actions] add automatic rebasing / merge commit blocking [`97efa53`](https://github.com/inspect-js/which-boxed-primitive/commit/97efa53a307678323e63f576c07db9ff84846fd3) +- [actions] add "Allow Edits" workflow [`fb1b4f7`](https://github.com/inspect-js/which-boxed-primitive/commit/fb1b4f7cd753fcced74ac054b20c8b2bfafe7953) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `has-symbols`, `object-inspect`, `safe-publish-latest` [`1e03c61`](https://github.com/inspect-js/which-boxed-primitive/commit/1e03c6153693d385833acc15178f675e6ce5ddd0) +- [Deps] update `is-boolean-object`, `is-number-object`, `is-string`, `is-symbol` [`13673df`](https://github.com/inspect-js/which-boxed-primitive/commit/13673dff6e43f0a915377c3e5740ec24e86d6bb7) +- [Dev Deps] update `auto-changelog`, `in-publish`, `tape` [`65a0e15`](https://github.com/inspect-js/which-boxed-primitive/commit/65a0e155fc46a9237692233a51ec9573621135d2) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`f8a0afe`](https://github.com/inspect-js/which-boxed-primitive/commit/f8a0afea82938d64f3d2d240268afbd346d0c4da) +- [Deps] update `is-bigint`, `is-boolean-object` [`e7a1ce2`](https://github.com/inspect-js/which-boxed-primitive/commit/e7a1ce25371c00ee726f1c0cc5b6acf10d51ec50) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`e46f193`](https://github.com/inspect-js/which-boxed-primitive/commit/e46f193298b158db5c8aba889803513e4ee38957) +- [Dev Deps] update `@ljharb/eslint-config`, `tape` [`df3da14`](https://github.com/inspect-js/which-boxed-primitive/commit/df3da1424552a5d22e203a0abf1710106bfd4ae2) +- [Dev Deps] update `auto-changelog`; add `aud` [`e2e8a12`](https://github.com/inspect-js/which-boxed-primitive/commit/e2e8a12c6fbf8c48e760ea1d1ccd5e8d2d6fbf24) +- [meta] add `funding` field [`7df404b`](https://github.com/inspect-js/which-boxed-primitive/commit/7df404b20cd50b2b87e6645b130fefa8ee98810e) +- [Dev Deps] update `auto-changelog` [`0d6b76d`](https://github.com/inspect-js/which-boxed-primitive/commit/0d6b76dbbe760581fa86a0c3f254988fe5d27770) +- [Tests] only audit prod deps [`246151c`](https://github.com/inspect-js/which-boxed-primitive/commit/246151cc1407b3b1ef42014db993f62670bd82ff) +- [meta] fix changelog [`c2d1685`](https://github.com/inspect-js/which-boxed-primitive/commit/c2d16856deffbf86e0b5029e69b65d8aa758ec3d) +- [readme] Fix spelling error [`25fb2b5`](https://github.com/inspect-js/which-boxed-primitive/commit/25fb2b56e1f708c6364923e4bae384f818ecf57f) + +## [v1.0.1](https://github.com/inspect-js/which-boxed-primitive/compare/v1.0.0...v1.0.1) - 2019-08-10 + +### Commits + +- [meta] avoid running `safe-publish-latest` when not publishing [`df44b27`](https://github.com/inspect-js/which-boxed-primitive/commit/df44b27875a8f5c3c596663ecb4a063f9fc7bde3) + +## v1.0.0 - 2019-08-10 + +### Commits + +- [Tests] add `.travis.yml` [`764b0cf`](https://github.com/inspect-js/which-boxed-primitive/commit/764b0cf75f8d2b3a0ad2056de5f4ad85d5d1b765) +- Initial commit [`da7d068`](https://github.com/inspect-js/which-boxed-primitive/commit/da7d068913d591294bf155db5d438f7804d71b9a) +- readme [`1395bb2`](https://github.com/inspect-js/which-boxed-primitive/commit/1395bb27b72137ac01e48ee398a0f54e93fd87f5) +- [Tests] add tests [`0ff580f`](https://github.com/inspect-js/which-boxed-primitive/commit/0ff580f99579cd4424af7b814bd76fcb69a2b04e) +- implementation [`8811c32`](https://github.com/inspect-js/which-boxed-primitive/commit/8811c3262a57963634cdc83ceb5bb2c5e9ae4e7e) +- npm init [`cffdea9`](https://github.com/inspect-js/which-boxed-primitive/commit/cffdea9755eabfa2f9ec62a6fcbce0c28f04495b) +- [Tests] add `npm run lint` [`a8be993`](https://github.com/inspect-js/which-boxed-primitive/commit/a8be9933fec1b21267acd847df77f6438e07e3b9) +- [meta] add FUNDING.yml [`941258c`](https://github.com/inspect-js/which-boxed-primitive/commit/941258c70c9a397466e05b614126cb8c7be77b99) +- Only apps should have lockfiles [`6857316`](https://github.com/inspect-js/which-boxed-primitive/commit/68573165d8ce842cdf15d94af82f8cccb961b8cf) +- [Tests] use `npx aud` in `posttest` [`ee48a91`](https://github.com/inspect-js/which-boxed-primitive/commit/ee48a9144bea23bde5cc47788a54d5aa7969d489) diff --git a/tools/ui/node_modules/which-boxed-primitive/LICENSE b/tools/ui/node_modules/which-boxed-primitive/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..3900dd7e2ffe6d5205fde1cd3f890aa51ea36234 --- /dev/null +++ b/tools/ui/node_modules/which-boxed-primitive/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Jordan Harband + +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/which-boxed-primitive/README.md b/tools/ui/node_modules/which-boxed-primitive/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e08f26af8faf6197d3a167738aa80f40174f924a --- /dev/null +++ b/tools/ui/node_modules/which-boxed-primitive/README.md @@ -0,0 +1,73 @@ +# which-boxed-primitive [![Version Badge][2]][1] + +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +Which kind of boxed JS primitive is this? This module works cross-realm/iframe, does not depend on `instanceof` or mutable properties, and works despite ES6 Symbol.toStringTag. + +## Example + +```js +var whichBoxedPrimitive = require('which-boxed-primitive'); +var assert = require('assert'); + +// unboxed primitives return `null` +// boxed primitives return the builtin constructor name + +assert.equal(whichBoxedPrimitive(undefined), null); +assert.equal(whichBoxedPrimitive(null), null); + +assert.equal(whichBoxedPrimitive(false), null); +assert.equal(whichBoxedPrimitive(true), null); +assert.equal(whichBoxedPrimitive(new Boolean(false)), 'Boolean'); +assert.equal(whichBoxedPrimitive(new Boolean(true)), 'Boolean'); + +assert.equal(whichBoxedPrimitive(42), null); +assert.equal(whichBoxedPrimitive(NaN), null); +assert.equal(whichBoxedPrimitive(Infinity), null); +assert.equal(whichBoxedPrimitive(new Number(42)), 'Number'); +assert.equal(whichBoxedPrimitive(new Number(NaN)), 'Number'); +assert.equal(whichBoxedPrimitive(new Number(Infinity)), 'Number'); + +assert.equal(whichBoxedPrimitive(''), null); +assert.equal(whichBoxedPrimitive('foo'), null); +assert.equal(whichBoxedPrimitive(new String('')), 'String'); +assert.equal(whichBoxedPrimitive(new String('foo')), 'String'); + +assert.equal(whichBoxedPrimitive(Symbol()), null); +assert.equal(whichBoxedPrimitive(Object(Symbol()), 'Symbol'); + +assert.equal(whichBoxedPrimitive(42n), null); +assert.equal(whichBoxedPrimitive(Object(42n), 'BigInt'); + +// non-boxed-primitive objects return `undefined` +assert.equal(whichBoxedPrimitive([]), undefined); +assert.equal(whichBoxedPrimitive({}), undefined); +assert.equal(whichBoxedPrimitive(/a/g), undefined); +assert.equal(whichBoxedPrimitive(new RegExp('a', 'g')), undefined); +assert.equal(whichBoxedPrimitive(new Date()), undefined); +assert.equal(whichBoxedPrimitive(function () {}), undefined); +assert.equal(whichBoxedPrimitive(function* () {}), undefined); +assert.equal(whichBoxedPrimitive(x => x * x), undefined); +assert.equal(whichBoxedPrimitive([]), undefined); + +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/which-boxed-primitive +[2]: https://versionbadg.es/inspect-js/which-boxed-primitive.svg +[5]: https://david-dm.org/inspect-js/which-boxed-primitive.svg +[6]: https://david-dm.org/inspect-js/which-boxed-primitive +[7]: https://david-dm.org/inspect-js/which-boxed-primitive/dev-status.svg +[8]: https://david-dm.org/inspect-js/which-boxed-primitive#info=devDependencies +[11]: https://nodei.co/npm/which-boxed-primitive.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/which-boxed-primitive.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/which-boxed-primitive.svg +[downloads-url]: https://npm-stat.com/charts.html?package=which-boxed-primitive diff --git a/tools/ui/node_modules/which-boxed-primitive/index.d.ts b/tools/ui/node_modules/which-boxed-primitive/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..96d9daf6bd6ee335d2d35712aec52df3336ac811 --- /dev/null +++ b/tools/ui/node_modules/which-boxed-primitive/index.d.ts @@ -0,0 +1,11 @@ +type primitive = string | number | bigint | boolean | symbol | null | undefined; + +declare function whichBoxedPrimitive(value: primitive): null; +declare function whichBoxedPrimitive(value: BigInt): 'BigInt'; +declare function whichBoxedPrimitive(value: Boolean): 'Boolean'; +declare function whichBoxedPrimitive(value: Number): 'Number'; +declare function whichBoxedPrimitive(value: String): 'String'; +declare function whichBoxedPrimitive(value: Symbol): 'Symbol'; +declare function whichBoxedPrimitive(value: unknown): undefined; + +export = whichBoxedPrimitive; diff --git a/tools/ui/node_modules/which-boxed-primitive/index.js b/tools/ui/node_modules/which-boxed-primitive/index.js new file mode 100644 index 0000000000000000000000000000000000000000..e8ca93390e97ce486e467fc236632a57dab16a7e --- /dev/null +++ b/tools/ui/node_modules/which-boxed-primitive/index.js @@ -0,0 +1,31 @@ +'use strict'; + +var isString = require('is-string'); +var isNumber = require('is-number-object'); +var isBoolean = require('is-boolean-object'); +var isSymbol = require('is-symbol'); +var isBigInt = require('is-bigint'); + +/** @type {import('.')} */ +// eslint-disable-next-line consistent-return +module.exports = function whichBoxedPrimitive(value) { + // eslint-disable-next-line eqeqeq + if (value == null || (typeof value !== 'object' && typeof value !== 'function')) { + return null; + } + if (isString(value)) { + return 'String'; + } + if (isNumber(value)) { + return 'Number'; + } + if (isBoolean(value)) { + return 'Boolean'; + } + if (isSymbol(value)) { + return 'Symbol'; + } + if (isBigInt(value)) { + return 'BigInt'; + } +}; diff --git a/tools/ui/node_modules/which-boxed-primitive/package.json b/tools/ui/node_modules/which-boxed-primitive/package.json new file mode 100644 index 0000000000000000000000000000000000000000..6540d89eeba6bd389e0358d48fe75aede5e1d5e8 --- /dev/null +++ b/tools/ui/node_modules/which-boxed-primitive/package.json @@ -0,0 +1,83 @@ +{ + "name": "which-boxed-primitive", + "version": "1.1.1", + "description": "Which kind of boxed JS primitive is this?", + "main": "index.js", + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -p . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/which-boxed-primitive.git" + }, + "keywords": [ + "boxed", + "primitive", + "object", + "ecmascript", + "javascript", + "which" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/which-boxed-primitive/issues" + }, + "homepage": "https://github.com/inspect-js/which-boxed-primitive#readme", + "dependencies": { + "is-bigint": "^1.1.0", + "is-boolean-object": "^1.2.1", + "is-number-object": "^1.1.1", + "is-string": "^1.1.1", + "is-symbol": "^1.1.1" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/for-each": "^0.3.3", + "@types/object-inspect": "^1.13.0", + "@types/tape": "^5.7.0", + "auto-changelog": "^2.5.0", + "encoding": "^0.1.13", + "es-value-fixtures": "^1.5.0", + "eslint": "=8.8.0", + "for-each": "^0.3.3", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.3", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/tools/ui/node_modules/which-boxed-primitive/test/index.js b/tools/ui/node_modules/which-boxed-primitive/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a2751578bf6f02584e63928d5328dc4cca049ba9 --- /dev/null +++ b/tools/ui/node_modules/which-boxed-primitive/test/index.js @@ -0,0 +1,46 @@ +'use strict'; + +var test = require('tape'); +var inspect = require('object-inspect'); +var forEach = require('for-each'); +var v = require('es-value-fixtures'); + +var whichBoxedPrimitive = require('../'); + +var objects = [ + /a/g, + new Date(), + function () {}, + [], + {} +].concat(v.objects); + +test('isBoxedPrimitive', function (t) { + t.test('unboxed primitives', function (st) { + forEach(v.primitives, function (primitive) { + st.equal(null, whichBoxedPrimitive(primitive), inspect(primitive) + ' is a primitive, but not a boxed primitive'); + }); + st.end(); + }); + + t.test('boxed primitives', function (st) { + forEach(v.primitives, function (primitive) { + if (primitive != null) { // eslint-disable-line eqeqeq + var boxed = Object(primitive); + var expected = boxed.constructor.name; + st.equal(typeof expected, 'string', 'expected is string'); + st.equal(whichBoxedPrimitive(boxed), expected, inspect(boxed) + ' is a boxed primitive: ' + expected); + } + }); + st.end(); + }); + + t.test('non-primitive objects', function (st) { + forEach(objects, function (object) { + st.equal(undefined, whichBoxedPrimitive(object), inspect(object) + ' is not a primitive, boxed or otherwise'); + }); + st.end(); + }); + + t.end(); +}); diff --git a/tools/ui/node_modules/which-boxed-primitive/tsconfig.json b/tools/ui/node_modules/which-boxed-primitive/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..707cf95103eea5754b0141455f421ec38d129dd9 --- /dev/null +++ b/tools/ui/node_modules/which-boxed-primitive/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "ES2021", + }, + "exclude": [ + "coverage" + ] +} diff --git a/tools/ui/node_modules/which-builtin-type/.eslintrc b/tools/ui/node_modules/which-builtin-type/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..f9c333a22a0326ead4615ae18fb6d6756af2a69d --- /dev/null +++ b/tools/ui/node_modules/which-builtin-type/.eslintrc @@ -0,0 +1,14 @@ +{ + "root": true, + + "extends": "@ljharb", + + "rules": { + "complexity": 0, + "eqeqeq": [2, "allow-null"], + "func-name-matching": 0, + "id-length": 0, + "max-lines-per-function": 0, + "max-statements": 0, + }, +} diff --git a/tools/ui/node_modules/which-builtin-type/.nycrc b/tools/ui/node_modules/which-builtin-type/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..bdd626ce91477abbdd489b79988baebadbd3c897 --- /dev/null +++ b/tools/ui/node_modules/which-builtin-type/.nycrc @@ -0,0 +1,9 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "exclude": [ + "coverage", + "test" + ] +} diff --git a/tools/ui/node_modules/which-builtin-type/CHANGELOG.md b/tools/ui/node_modules/which-builtin-type/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..fd64f01e7342a83add7d49b8181d65df877dac17 --- /dev/null +++ b/tools/ui/node_modules/which-builtin-type/CHANGELOG.md @@ -0,0 +1,113 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.2.1](https://github.com/inspect-js/which-builtin-type/compare/v1.2.0...v1.2.1) - 2024-12-12 + +### Commits + +- [meta] sort package.json [`8305bf9`](https://github.com/inspect-js/which-builtin-type/commit/8305bf9a47674564c84dde5856829444ac59e379) +- [actions] re-add finishers [`67140db`](https://github.com/inspect-js/which-builtin-type/commit/67140dba99e8f204c6f1abce315711fae4239032) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/function.prototype.name`, `@types/tape`, `has-symbols` [`5adff02`](https://github.com/inspect-js/which-builtin-type/commit/5adff02870f00eafe144250b0ea2181f59b0d337) +- [Deps] update `call-bind`, `is-date-object`, `is-regex`, `which-boxed-primitive` [`87922d3`](https://github.com/inspect-js/which-builtin-type/commit/87922d3a0a21ee2b0991d9f3832123f5ff149eed) +- [Refactor] use `call-bound` directly [`8f633bc`](https://github.com/inspect-js/which-builtin-type/commit/8f633bc7587f481877f3965fdf0c74885753d824) +- [Deps] update `is-regex`, `which-typed-array` [`a912742`](https://github.com/inspect-js/which-builtin-type/commit/a9127421b702943a57927bf3e4d867cdc5862419) + +## [v1.2.0](https://github.com/inspect-js/which-builtin-type/compare/v1.1.4...v1.2.0) - 2024-11-23 + +### Commits + +- [New] add types [`d4aa2db`](https://github.com/inspect-js/which-builtin-type/commit/d4aa2db289a8d97c6917c0edb1edcb32001488a8) +- [actions] split out node 10-20, and 20+ [`7b3d28b`](https://github.com/inspect-js/which-builtin-type/commit/7b3d28bcb1258cdfd5a7df5606622351596fb442) +- [Refactor] use `callBound` to cache Promise#then [`a000377`](https://github.com/inspect-js/which-builtin-type/commit/a0003772dabdd5fd4b84c2ed8e139df008a437e8) +- [Dev Deps] update `auto-changelog`, `object-inspect`, `tape` [`37062d2`](https://github.com/inspect-js/which-builtin-type/commit/37062d280a8c36c1bd96b6cfbe053f10cf8d71b6) +- [Tests] replace `aud` with `npm audit` [`337aac1`](https://github.com/inspect-js/which-builtin-type/commit/337aac1d88fc63d935bd15a97926e9b0b462a735) +- [Deps] update `is-finalizationregistry` [`4ef8763`](https://github.com/inspect-js/which-builtin-type/commit/4ef8763a19709df7ad50d790bd2b724f531a65d9) +- [Dev Deps] add missing peer dep [`1cb2842`](https://github.com/inspect-js/which-builtin-type/commit/1cb28421438eb4ee8f0f284b535f1cfc6b9c9757) + +## [v1.1.4](https://github.com/inspect-js/which-builtin-type/compare/v1.1.3...v1.1.4) - 2024-07-29 + +### Commits + +- [readme] fix URLs [`f26fc22`](https://github.com/inspect-js/which-builtin-type/commit/f26fc2243220277874e36ace85f48f87ec8ab502) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `available-typed-arrays`, `npmignore`, `object-inspect`, `object.assign`, `tape` [`f724135`](https://github.com/inspect-js/which-builtin-type/commit/f724135d44efd74ee067102c8c499566d73b849c) +- [Deps] update `function.prototype.name`, `has-tostringtag`, `which-collection`, `which-typed-array` [`831119b`](https://github.com/inspect-js/which-builtin-type/commit/831119b76ce79004c368deab141e8a9bd680950c) + +## [v1.1.3](https://github.com/inspect-js/which-builtin-type/compare/v1.1.2...v1.1.3) - 2022-11-02 + +### Commits + +- [meta] use `npmignore` to autogenerate an npmignore file [`0ccf168`](https://github.com/inspect-js/which-builtin-type/commit/0ccf168604ddaab1d40de8fde5140f5dca942c5b) +- [Dev Deps] update `aud`, `has-bigints`, `has-symbols`, `in-publish`, `object-inspect`, `object.assign`, `tape` [`2c87b2e`](https://github.com/inspect-js/which-builtin-type/commit/2c87b2ed58c397a26953dbe2cb2aae452e32ee21) +- [actions] update rebase action to use reusable workflow [`ab27caf`](https://github.com/inspect-js/which-builtin-type/commit/ab27caf0d6cd1fccc5738fda4cebee7bf47eca14) +- [meta] simplify `exports` [`680d056`](https://github.com/inspect-js/which-builtin-type/commit/680d05674f979c1a02ae7c6b9f885114e962324e) +- [Deps] update `which-typed-array` [`3ca0216`](https://github.com/inspect-js/which-builtin-type/commit/3ca02166585c6e7350fe0bc7518fccce269fc5ac) +- [meta] add `sideEffects` flag [`caa2221`](https://github.com/inspect-js/which-builtin-type/commit/caa22214c751674f1959944a0ece81b032141e3b) + +## [v1.1.2](https://github.com/inspect-js/which-builtin-type/compare/v1.1.1...v1.1.2) - 2022-04-12 + +### Commits + +- [actions] reuse common workflows [`b1b60aa`](https://github.com/inspect-js/which-builtin-type/commit/b1b60aa01b20f613a97b456c3062412f0aba67dd) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `@es-shims/api`, `safe-publish-latest`, `tape` [`8115a20`](https://github.com/inspect-js/which-builtin-type/commit/8115a20941ca702c1a927a0aea08ffa0b37821c0) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`86b3c3b`](https://github.com/inspect-js/which-builtin-type/commit/86b3c3ba155a2a292a69d507be85ede12896163d) +- [actions] update codecov uploader [`de30f4b`](https://github.com/inspect-js/which-builtin-type/commit/de30f4bdd613b36a11270085974013c1e0025b74) +- [Deps] update `function.prototype.name`, `is-finalizationregistry`, `which-typed-array` [`0ba20f5`](https://github.com/inspect-js/which-builtin-type/commit/0ba20f53824455b2fcdd90027a64bc34f09bec6b) +- [Refactor] use `is-async-function` [`6f36d89`](https://github.com/inspect-js/which-builtin-type/commit/6f36d8942a158cc41f486ba9e29d08f75a6d1406) +- [Deps] update `is-weakref` [`d775476`](https://github.com/inspect-js/which-builtin-type/commit/d775476f5f0dccab56b13c839ce6ada377b67ca0) + +## [v1.1.1](https://github.com/inspect-js/which-builtin-type/compare/v1.1.0...v1.1.1) - 2021-08-06 + +### Commits + +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `available-typed-arrays`, `object-inspect`, `tape` [`8adae7d`](https://github.com/inspect-js/which-builtin-type/commit/8adae7d7ba4a49309f87e990d9787589f8c978a1) +- [Deps] update `is-date-object`, `is-generator-function`, `is-regex`, `which-typed-array` [`805b158`](https://github.com/inspect-js/which-builtin-type/commit/805b158f86d258983868b45ceb4a3a9417fed08e) +- [Refactor] use `has-tostringtag` to behave correctly in the presence of symbol shams [`9ec250a`](https://github.com/inspect-js/which-builtin-type/commit/9ec250a652c6607053d63c3e662547cf36c8cb9b) +- [readme] add github actions/codecov badges [`75b51b4`](https://github.com/inspect-js/which-builtin-type/commit/75b51b4c96280a05014c97efba6b8291b18af5cb) + +## [v1.1.0](https://github.com/inspect-js/which-builtin-type/compare/v1.0.1...v1.1.0) - 2021-04-18 + +### Commits + +- [Fix] prevent constructor or Symbol.toStringTag from lying about builtins [`7638412`](https://github.com/inspect-js/which-builtin-type/commit/7638412d9b6cca9af3999b4bf45d3a630f84409e) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`6a06770`](https://github.com/inspect-js/which-builtin-type/commit/6a06770548aec6948ab0aaa28babc0423f0fe745) +- [New] recognize Promise [`0d79e3a`](https://github.com/inspect-js/which-builtin-type/commit/0d79e3a0916438e1c808f83d8928af29914de08a) +- [New] recognize WeakRef and FinalizationRegistry [`020de6a`](https://github.com/inspect-js/which-builtin-type/commit/020de6a84242e12a5cd956b74f4457a8d3cba6fb) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `has-symbols`, `object-inspect`, `tape` [`71e47f5`](https://github.com/inspect-js/which-builtin-type/commit/71e47f50c534e2e37ba654bdc2851f9fb8b9f435) +- [Deps] update `function.prototype.name`, `is-regex` [`f2d56b9`](https://github.com/inspect-js/which-builtin-type/commit/f2d56b9ba12962f6432d869e14a73c43b0bfaeb0) +- [meta] use `prepublishOnly` script for npm 7+ [`daae0a0`](https://github.com/inspect-js/which-builtin-type/commit/daae0a018594cef507a0d5bc3304ec950db15925) +- [Tests] increase coverage [`bd406f2`](https://github.com/inspect-js/which-builtin-type/commit/bd406f212ac79af48c0ca11fb36c770fe106bf5f) + +## [v1.0.1](https://github.com/inspect-js/which-builtin-type/compare/v1.0.0...v1.0.1) - 2020-12-14 + +### Commits + +- [Tests] migrate tests to Github Actions [`165a1b5`](https://github.com/inspect-js/which-builtin-type/commit/165a1b5924c242db86749e9691bb310fce3e2b05) +- [meta] do not publish github action workflow files [`851f508`](https://github.com/inspect-js/which-builtin-type/commit/851f508ad644248621ca2d465ba440913e865d4e) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `has-bigints`, `object-inspect`, `object.assign`, `tape` [`5b0906c`](https://github.com/inspect-js/which-builtin-type/commit/5b0906cf115aa7b77073262a3fb34134c214c444) +- [Tests] run `nyc` on all tests; use `tape` runner [`85924cd`](https://github.com/inspect-js/which-builtin-type/commit/85924cd70d665f79fd8f1a439706412d7e8e6455) +- [readme] fix repo URLs, remove defunct badges [`8fb4bb5`](https://github.com/inspect-js/which-builtin-type/commit/8fb4bb51219e956916583ba9a34a9a2d0228716e) +- [Dev Deps] update `@ljharb/eslint-config`, `available-typed-arrays`, `make-arrow-function`, `make-generator-function` [`9d65291`](https://github.com/inspect-js/which-builtin-type/commit/9d652910fc84589669f9bfe7accc0272df911a0f) +- [Deps] update `function.prototype.name`, `is-generator-function`, `is-regex`, `which-boxed-primitive`, `which-collection`, `which-typed-array` [`7900c10`](https://github.com/inspect-js/which-builtin-type/commit/7900c10e8113fb9b087103f313bda71f4204a935) +- [actions] add "Allow Edits" workflow [`f9f04f5`](https://github.com/inspect-js/which-builtin-type/commit/f9f04f5999f564b921b9678792a3db8ad4268709) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`4452dee`](https://github.com/inspect-js/which-builtin-type/commit/4452dee4fe2bc3cdb29470f25a184031b1c267ee) + +## v1.0.0 - 2020-01-24 + +### Commits + +- Tests [`d65924f`](https://github.com/inspect-js/which-builtin-type/commit/d65924fea79cd13609d3155b018f9db12f995b71) +- Initial commit [`a6208ff`](https://github.com/inspect-js/which-builtin-type/commit/a6208ff57dfbf9b6368adc5a22ca5d2db2c123e5) +- Implementation [`0d1c341`](https://github.com/inspect-js/which-builtin-type/commit/0d1c341b71de6b475db6f8cb430cace4be54c93b) +- readme [`23ecfb6`](https://github.com/inspect-js/which-builtin-type/commit/23ecfb6b5c5e30cbae73148f3d01adbb6229d064) +- npm init [`cce1b17`](https://github.com/inspect-js/which-builtin-type/commit/cce1b17caa4d56bae6980d898e8ad223da073fcc) +- [meta] add `auto-changelog` [`f903f62`](https://github.com/inspect-js/which-builtin-type/commit/f903f629cf70d725a2d0c1fd0e76112c39b88b70) +- [actions] add automatic rebasing / merge commit blocking [`71f9295`](https://github.com/inspect-js/which-builtin-type/commit/71f92950bdbcd1eb79d8ce8c3b7584bd4db45733) +- [Tests] use shared travis-ci configs [`2d7a1f4`](https://github.com/inspect-js/which-builtin-type/commit/2d7a1f4105de53def9b1652e53e900debb2a99a5) +- [Tests] add `npm run lint` [`a6372e2`](https://github.com/inspect-js/which-builtin-type/commit/a6372e203dbdb4ad42da15af7927cd21e0f94618) +- Only apps should have lockfiles [`d6bd083`](https://github.com/inspect-js/which-builtin-type/commit/d6bd083310cd713e6e1e3f16fcd35277194663e7) +- [meta] add `funding` field [`377f67a`](https://github.com/inspect-js/which-builtin-type/commit/377f67a24bef750dca957c8ccde62c3e8af6932b) +- [meta] add `safe-publish-latest` [`99295e9`](https://github.com/inspect-js/which-builtin-type/commit/99295e921f5cb898a62081b6719c30cf537f58f9) diff --git a/tools/ui/node_modules/which-builtin-type/LICENSE b/tools/ui/node_modules/which-builtin-type/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c5412d4aae7a8506854f4572097011489fcfdbec --- /dev/null +++ b/tools/ui/node_modules/which-builtin-type/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 ECMAScript Shims + +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/which-builtin-type/README.md b/tools/ui/node_modules/which-builtin-type/README.md new file mode 100644 index 0000000000000000000000000000000000000000..31a15b884e7fd1a4fbee719823e01fed7b8efaba --- /dev/null +++ b/tools/ui/node_modules/which-builtin-type/README.md @@ -0,0 +1,67 @@ +# which-builtin-type [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +What is the type of this builtin JavaScript value? Works cross-realm, without `instanceof`, and can not be fooled by a `constructor` property. + +## Example + +```js +var whichBuiltinType = require('which-builtin-type'); +var assert = require('assert'); + +assert.equal(undefined, whichBuiltinType(undefined)); +assert.equal(null, whichBuiltinType(null)); +assert.equal('Boolean', whichBuiltinType(false)); +assert.equal('Boolean', whichBuiltinType(true)); +assert.equal('Array', whichBuiltinType([])); +assert.equal('Object', whichBuiltinType({})); +assert.equal('RegExp', whichBuiltinType(/a/g)); +assert.equal('RegExp', whichBuiltinType(new RegExp('a', 'g'))); +assert.equal('Date', whichBuiltinType(new Date())); +assert.equal('Number', whichBuiltinType(42)); +assert.equal('Number', whichBuiltinType(NaN)); +assert.equal('Number', whichBuiltinType(Infinity)); +assert.equal('Number', whichBuiltinType(new Number(42))); +assert.equal('String', whichBuiltinType('foo')); +assert.equal('String', whichBuiltinType(Object('foo'))); +assert.equal('Function', whichBuiltinType(function () {})); +assert.equal('GeneratorFunction', whichBuiltinType(function* () {})); +assert.equal('Function', whichBuiltinType(x => x * x)); +assert.equal('Array', whichBuiltinType([])); +assert.equal('Int8Array', whichBuiltinType(new Int8Array())); +assert.equal('Uint8Array', whichBuiltinType(new Uint8Array())); +assert.equal('Uint8ClampedArray', whichBuiltinType(new Uint8ClampedArray())); +assert.equal('Int16Array', whichBuiltinType(new Int16Array())); +assert.equal('Uint16Array', whichBuiltinType(new Uint16Array())); +assert.equal('Int32Array', whichBuiltinType(new Int32Array())); +assert.equal('Uint32Array', whichBuiltinType(new Uint32Array())); +assert.equal('Float32Array', whichBuiltinType(new Float32Array())); +assert.equal('Float64Array', whichBuiltinType(new Float64Array())); +assert.equal('BigInt64Array', whichBuiltinType(new BigInt64Array())); +assert.equal('BigUint64Array', whichBuiltinType(new BigUint64Array())); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/which-builtin-type +[npm-version-svg]: https://versionbadg.es/inspect-js/which-builtin-type.svg +[deps-svg]: https://david-dm.org/inspect-js/which-builtin-type.svg +[deps-url]: https://david-dm.org/inspect-js/which-builtin-type +[dev-deps-svg]: https://david-dm.org/inspect-js/which-builtin-type/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/which-builtin-type#info=devDependencies +[npm-badge-png]: https://which-builtin-type/which-builtin-type.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/which-builtin-type.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/which-builtin-type.svg +[downloads-url]: https://npm-stat.com/charts.html?package=which-builtin-type +[codecov-image]: https://codecov.io/gh/inspect-js/which-builtin-type/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/which-builtin-type/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/which-builtin-type +[actions-url]: https://github.com/inspect-js/which-builtin-type/actions diff --git a/tools/ui/node_modules/which-builtin-type/index.d.ts b/tools/ui/node_modules/which-builtin-type/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6f194b34e2107b96da7ed3b8ed3a028561ea4675 --- /dev/null +++ b/tools/ui/node_modules/which-builtin-type/index.d.ts @@ -0,0 +1,21 @@ +import whichBoxedPrimitive from 'which-boxed-primitive'; +import whichCollection from 'which-collection'; +import whichTypedArray from 'which-typed-array'; + +type AsyncFunction = (...args: unknown[]) => Promise; + +declare function whichBuiltinType(value: Parameters[0]): ReturnType; +declare function whichBuiltinType(value: Parameters[0]): ReturnType; +declare function whichBuiltinType(value: ReadonlyArray): 'Array'; +declare function whichBuiltinType(value: Date): 'Date'; +declare function whichBuiltinType(value: RegExp): 'RegExp'; +declare function whichBuiltinType(value: T extends object ? WeakRef : never): 'WeakRef'; +declare function whichBuiltinType(value: FinalizationRegistry): 'FinalizationRegistry'; +declare function whichBuiltinType(value: GeneratorFunction): 'GeneratorFunction'; +declare function whichBuiltinType(value: AsyncFunction): 'AsyncFunction'; +declare function whichBuiltinType(value: Function): 'Function'; +declare function whichBuiltinType(value: Promise): 'Promise'; + +declare function whichBuiltinType(value: T): 'Object' | Exclude, null | undefined> | string; + +export = whichBuiltinType; diff --git a/tools/ui/node_modules/which-builtin-type/index.js b/tools/ui/node_modules/which-builtin-type/index.js new file mode 100644 index 0000000000000000000000000000000000000000..dd9da17d22538051149491519efd041e6bb38c1f --- /dev/null +++ b/tools/ui/node_modules/which-builtin-type/index.js @@ -0,0 +1,132 @@ +'use strict'; + +var whichBoxedPrimitive = require('which-boxed-primitive'); +var whichCollection = require('which-collection'); +var whichTypedArray = require('which-typed-array'); +var isArray = require('isarray'); +var isDate = require('is-date-object'); +var isRegex = require('is-regex'); +var isWeakRef = require('is-weakref'); +var isFinalizationRegistry = require('is-finalizationregistry'); +var name = require('function.prototype.name'); +var isGeneratorFunction = require('is-generator-function'); +var isAsyncFunction = require('is-async-function'); +var callBound = require('call-bound'); +var hasToStringTag = require('has-tostringtag/shams')(); +var toStringTag = hasToStringTag && Symbol.toStringTag; + +var $Object = Object; + +/** @type {undefined | ((value: ThisParameterType, ...args: Parameters) => ReturnType)} */ +var promiseThen = callBound('Promise.prototype.then', true); +/** @type {(value: unknown) => value is Promise} */ +var isPromise = function isPromise(value) { + if (!value || typeof value !== 'object' || !promiseThen) { + return false; + } + try { + promiseThen(value, null, function () {}); + return true; + } catch (e) {} + return false; +}; + +/** @type {(builtinName: unknown) => boolean} */ +var isKnownBuiltin = function isKnownBuiltin(builtinName) { + return !!builtinName + // primitives + && builtinName !== 'BigInt' + && builtinName !== 'Boolean' + && builtinName !== 'Null' + && builtinName !== 'Number' + && builtinName !== 'String' + && builtinName !== 'Symbol' + && builtinName !== 'Undefined' + // namespaces + && builtinName !== 'Math' + && builtinName !== 'JSON' + && builtinName !== 'Reflect' + && builtinName !== 'Atomics' + // collections + && builtinName !== 'Map' + && builtinName !== 'Set' + && builtinName !== 'WeakMap' + && builtinName !== 'WeakSet' + // typed arrays + && builtinName !== 'BigInt64Array' + && builtinName !== 'BigUint64Array' + && builtinName !== 'Float32Array' + && builtinName !== 'Float64Array' + && builtinName !== 'Int16Array' + && builtinName !== 'Int32Array' + && builtinName !== 'Int8Array' + && builtinName !== 'Uint16Array' + && builtinName !== 'Uint32Array' + && builtinName !== 'Uint8Array' + && builtinName !== 'Uint8ClampedArray' + // checked explicitly + && builtinName !== 'Array' + && builtinName !== 'Date' + && builtinName !== 'FinalizationRegistry' + && builtinName !== 'Promise' + && builtinName !== 'RegExp' + && builtinName !== 'WeakRef' + // functions + && builtinName !== 'Function' + && builtinName !== 'GeneratorFunction' + && builtinName !== 'AsyncFunction'; +}; + +/** @type {import('.')} */ +module.exports = function whichBuiltinType(value) { + if (value == null) { + return value; + } + // covers: primitives, {,Weak}Map/Set, typed arrays + var which = whichBoxedPrimitive($Object(value)) || whichCollection(value) || whichTypedArray(value); + if (which) { + return which; + } + if (isArray(value)) { + return 'Array'; + } + if (isDate(value)) { + return 'Date'; + } + if (isRegex(value)) { + return 'RegExp'; + } + if (isWeakRef(value)) { + return 'WeakRef'; + } + if (isFinalizationRegistry(value)) { + return 'FinalizationRegistry'; + } + if (typeof value === 'function') { + if (isGeneratorFunction(value)) { + return 'GeneratorFunction'; + } + if (isAsyncFunction(value)) { + return 'AsyncFunction'; + } + return 'Function'; + } + if (isPromise(value)) { + return 'Promise'; + } + // @ts-expect-error TS can't figure out that `value` is an `object` after the `which` check above + if (toStringTag && toStringTag in value) { + var tag = value[toStringTag]; + if (isKnownBuiltin(tag)) { + return tag; + } + } + if (typeof value.constructor === 'function') { + // eslint-disable-next-line no-extra-parens + var constructorName = name(/** @type {Parameters[0]} */ (value.constructor)); + if (isKnownBuiltin(constructorName)) { + return constructorName; + } + } + return 'Object'; +}; diff --git a/tools/ui/node_modules/which-builtin-type/package.json b/tools/ui/node_modules/which-builtin-type/package.json new file mode 100644 index 0000000000000000000000000000000000000000..b74ef473920cdb229e664951b81a57b418b9723e --- /dev/null +++ b/tools/ui/node_modules/which-builtin-type/package.json @@ -0,0 +1,111 @@ +{ + "name": "which-builtin-type", + "version": "1.2.1", + "description": "What is the type of this builtin JS value?", + "main": "index.js", + "types": "index.d.ts", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublish": "not-in-publish || npm run prepublishOnly", + "prepublishOnly": "safe-publish-latest", + "prelint": "evalmd README.md", + "lint": "eslint --ext=js,mjs .", + "postlint": "tsc -P . && attw -P", + "pretest": "npm run lint", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx npm@'>=10.2' audit --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/which-builtin-type.git" + }, + "keywords": [ + "type", + "builtin", + "ecmascript" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/which-builtin-type/issues" + }, + "homepage": "https://github.com/inspect-js/which-builtin-type#readme", + "dependencies": { + "call-bound": "^1.0.2", + "function.prototype.name": "^1.1.6", + "has-tostringtag": "^1.0.2", + "is-async-function": "^2.0.0", + "is-date-object": "^1.1.0", + "is-finalizationregistry": "^1.1.0", + "is-generator-function": "^1.0.10", + "is-regex": "^1.2.1", + "is-weakref": "^1.0.2", + "isarray": "^2.0.5", + "which-boxed-primitive": "^1.1.0", + "which-collection": "^1.0.2", + "which-typed-array": "^1.1.16" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.17.1", + "@ljharb/eslint-config": "^21.1.1", + "@ljharb/tsconfig": "^0.2.2", + "@types/for-each": "^0.3.3", + "@types/function.prototype.name": "^1.1.4", + "@types/is-async-function": "^2.0.3", + "@types/is-date-object": "^1.0.4", + "@types/is-generator-function": "^1.0.3", + "@types/is-weakref": "^1.0.0", + "@types/make-arrow-function": "^1.2.2", + "@types/make-async-function": "^1.0.2", + "@types/object-inspect": "^1.13.0", + "@types/object.assign": "^4.1.0", + "@types/tape": "^5.6.5", + "@types/which-boxed-primitive": "^1.0.3", + "auto-changelog": "^2.5.0", + "available-typed-arrays": "^1.0.7", + "encoding": "^0.1.13", + "eslint": "=8.8.0", + "evalmd": "^0.0.19", + "for-each": "^0.3.3", + "has-bigints": "^1.0.2", + "has-symbols": "^1.1.0", + "in-publish": "^2.0.1", + "make-arrow-function": "^1.2.0", + "make-async-function": "^1.0.0", + "make-generator-function": "^2.0.0", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.3", + "object.assign": "^4.1.5", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + } +} diff --git a/tools/ui/node_modules/which-builtin-type/test/index.js b/tools/ui/node_modules/which-builtin-type/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..bdb7c30f01aba47866fb15a4097b46671c845560 --- /dev/null +++ b/tools/ui/node_modules/which-builtin-type/test/index.js @@ -0,0 +1,184 @@ +'use strict'; + +var test = require('tape'); +var inspect = require('object-inspect'); +var assign = require('object.assign'); +var forEach = require('for-each'); +var arrows = require('make-arrow-function').list(); +var generators = require('make-generator-function')(); +var asyncs = require('make-async-function').list(); +var hasSymbols = require('has-symbols')(); +var hasToStringTag = require('has-tostringtag/shams')(); +var hasBigInts = require('has-bigints')(); +var availableTypedArrays = require('available-typed-arrays'); + +var which = require('../'); + +if (typeof process !== 'undefined') { + process.on('unhandledRejection', function () {}); +} + +test('nullish', function (t) { + t.equal(which(null), null, 'null is null'); + t.equal(which(undefined), undefined, 'undefined is undefined'); + // @ts-expect-error + t.equal(which(), undefined, 'absent is undefined'); + + t.end(); +}); + +test('non-nullish', function (t) { + /** @constructor */ + var F = function Foo() {}; + + var tests = { + Number: [ + 0, + -0, + 42, + Infinity, + -Infinity, + NaN, + 0.5 + ], + Boolean: [ + true, + false + ], + String: [ + '', + 'foo' + ], + Date: [ + new Date(), + new Date(NaN), + assign(new Date(), { constructor: Object }) + ], + RegExp: [ + /(?:)/, + /a/g, + assign(/constructor/, { constructor: Object }) + ], + Array: [ + [], + [42], + assign([], { constructor: Object }) + ], + Function: [ + function () {}, + function f() {}, + assign(function constructor() {}, { constructor: Object }) + ].concat(arrows), + GeneratorFunction: generators, + AsyncFunction: asyncs, + // eslint-disable-next-line no-extra-parens + Object: /** @type {object[]} */ ([ + {}, + { constructor: null }, + Math + ]), + Symbol: hasSymbols ? [ + Symbol.iterator, + Symbol(), + Symbol('foo'), + Symbol['for'] ? Symbol['for']('bar') : Symbol('no "for" support') // eslint-disable-line no-restricted-properties + ] : [], + BigInt: hasBigInts ? [ + BigInt(0), + BigInt(42) + ] : [], + Foo: [ + new F() + ], + Map: typeof Map === 'function' ? [ + new Map(), + new Map([[1, 2], [3, 4]]), + assign(new Map(), { constructor: Object }) + ] : [], + WeakMap: typeof WeakMap === 'function' ? [ + new WeakMap(), + assign(new WeakMap(), { constructor: Object }) + ] : [], + Set: typeof Set === 'function' ? [ + new Set(), + new Set([1, 2, 3, 4]), + assign(new Set(), { constructor: Object }) + ] : [], + WeakSet: typeof WeakSet === 'function' ? [ + new WeakSet(), + assign(new WeakSet(), { constructor: Object }) + ] : [], + WeakRef: typeof WeakRef === 'function' ? [ + new WeakRef({}), + assign(new WeakRef({}), { constructor: Object }) + ] : [], + FinalizationRegistry: typeof FinalizationRegistry === 'function' ? [ + new FinalizationRegistry(function () {}), + assign(new FinalizationRegistry(function () {}), { constructor: Object }) + ] : [], + Promise: typeof Promise === 'function' ? [ + Promise.resolve(42), + Promise.reject(NaN), + new Promise(function () {}) + ] : [] + }; + forEach(availableTypedArrays(), function (TypedArray) { + // @ts-expect-error not sure how to infer this as being spreaded into the above object literal + tests[TypedArray] = [ + new global[TypedArray](0), + new global[TypedArray](2) + ]; + }); + forEach(tests, function (values, expected) { + forEach(values, function (value) { + t.equal(which(value), expected, inspect(value) + ' is ' + inspect(expected)); + var obj = Object(value); + if (value !== obj) { + t.equal(which(obj), expected, inspect(obj) + ' is ' + inspect(expected)); + } + if ( + expected !== 'Object' // the fallback can't fall back + && expected !== 'Foo' // not a builtin + ) { + if (hasToStringTag) { + /** @type {{ [k in typeof Symbol.toStringTag]?: string }} */ + var fakerTag = {}; + fakerTag[Symbol.toStringTag] = expected; + t.equal( + which(fakerTag), + 'Object', + inspect(fakerTag) + ' lies and claims it is a ' + expected + ', but instead it is Object' + ); + } + + /** @typedef {Exclude} GlobalKey */ + + var fakerConstructor = { + // eslint-disable-next-line no-extra-parens + constructor: global[/** @type {GlobalKey} */ (expected)] || tests[expected] + }; + t.equal( + which(fakerConstructor), + 'Object', + inspect(fakerConstructor) + ' lies and claims it is a ' + expected + ', but instead it is Object' + ); + + if (hasToStringTag) { + /** @type {{ constructor: Function } & { [k in typeof Symbol.toStringTag]?: string }} */ + var fakerConstructorTag = { + // eslint-disable-next-line no-extra-parens + constructor: global[/** @type {GlobalKey} */ (expected)] || tests[expected] + }; + fakerConstructorTag[Symbol.toStringTag] = expected; + t.equal( + which(fakerConstructorTag), + 'Object', + inspect(fakerConstructorTag) + ' lies with a tag and claims it is a ' + expected + ', but instead it is Object' + ); + } + } + }); + }); + + t.end(); +}); diff --git a/tools/ui/node_modules/which-builtin-type/tsconfig.json b/tools/ui/node_modules/which-builtin-type/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..6716d81ce28cf3af2a23d2d9237c7a3d53114217 --- /dev/null +++ b/tools/ui/node_modules/which-builtin-type/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "ES2021", + }, + "exclude": [ + "coverage" + ] +} diff --git a/tools/ui/node_modules/which-collection/.eslintrc b/tools/ui/node_modules/which-collection/.eslintrc new file mode 100644 index 0000000000000000000000000000000000000000..3b5d9e90ec405f85dd7f9066656efccc51193697 --- /dev/null +++ b/tools/ui/node_modules/which-collection/.eslintrc @@ -0,0 +1,5 @@ +{ + "root": true, + + "extends": "@ljharb", +} diff --git a/tools/ui/node_modules/which-collection/.github/FUNDING.yml b/tools/ui/node_modules/which-collection/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..7570eaa7f1b7420f6063934d93ecf2d4037a76b9 --- /dev/null +++ b/tools/ui/node_modules/which-collection/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/which-collection +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/tools/ui/node_modules/which-collection/.nycrc b/tools/ui/node_modules/which-collection/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..1826526e091b89c896e7099ccd891db79165e329 --- /dev/null +++ b/tools/ui/node_modules/which-collection/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/tools/ui/node_modules/which-collection/CHANGELOG.md b/tools/ui/node_modules/which-collection/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..229184ff143029dafdbdadf5441faa36c5cc5a24 --- /dev/null +++ b/tools/ui/node_modules/which-collection/CHANGELOG.md @@ -0,0 +1,63 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.0.2](https://github.com/inspect-js/which-collection/compare/v1.0.1...v1.0.2) - 2024-03-08 + +### Commits + +- [actions] reuse common workflows [`a5b2949`](https://github.com/inspect-js/which-collection/commit/a5b294901933131cf753c260c0dccf15c1aeeadc) +- [Tests] migrate tests to Github Actions [`283ec03`](https://github.com/inspect-js/which-collection/commit/283ec03d70ad8fdc94b3d77c1b11de011617a04d) +- add types [`bf576db`](https://github.com/inspect-js/which-collection/commit/bf576db80dbc9bca1332622f0b6c4772706dca45) +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`24968a2`](https://github.com/inspect-js/which-collection/commit/24968a2aa55109520e2ec0532343224e11a6e311) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `object-inspect`, `safe-publish-latest`, `tape` [`f60b277`](https://github.com/inspect-js/which-collection/commit/f60b27727206261a0359adb5588cba645eb56cf8) +- [Tests] run `nyc` on all tests [`5700269`](https://github.com/inspect-js/which-collection/commit/57002694f9b5f40078bd2777ecc934ece544a556) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`eb1f1a4`](https://github.com/inspect-js/which-collection/commit/eb1f1a468f53bcbed6ddf7459f0811a0f5ea37a7) +- [actions] remove redundant finisher [`cd5b8fc`](https://github.com/inspect-js/which-collection/commit/cd5b8fcddb9d8ea9ea5132b88c50357e2409a277) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`f5786fa`](https://github.com/inspect-js/which-collection/commit/f5786fa3189c884debfa4f160a1733a738acccec) +- [actions] update rebase action to use reusable workflow [`7ac7b67`](https://github.com/inspect-js/which-collection/commit/7ac7b6777797230ca105f9c1560e7b5fc3ba901f) +- [actions] update codecov uploader [`b074105`](https://github.com/inspect-js/which-collection/commit/b074105e5001df42a8889cd8cadaabd2a2fc276c) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `object-inspect`, `tape` [`ec640d6`](https://github.com/inspect-js/which-collection/commit/ec640d667a48428aec41e19769ae9490da8301e1) +- [actions] add "Allow Edits" workflow [`65d842e`](https://github.com/inspect-js/which-collection/commit/65d842ee9c09ed60370cf14a721b94f9a5de43cd) +- [readme] remove travis badge [`f106289`](https://github.com/inspect-js/which-collection/commit/f10628946ad70286f503497850f6dd2350311577) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `npmignore`, `object-inspect`, `tape` [`e784a1f`](https://github.com/inspect-js/which-collection/commit/e784a1fe96f8bc3eb21350ec7a35c3cf24c66a35) +- [meta] use `npmignore` to autogenerate an npmignore file [`95b503f`](https://github.com/inspect-js/which-collection/commit/95b503fd95f30deca71415da97937a3620e24912) +- [readme] add actions and codecov badges [`121ba2d`](https://github.com/inspect-js/which-collection/commit/121ba2d320ecefd51e4af06cacae2f71dd51b59d) +- [Deps] update `is-map`, `is-set`, `is-weakmap`, `is-weakset` [`4aa150f`](https://github.com/inspect-js/which-collection/commit/4aa150fdad7b8c0728972d6b074cb43464681e97) +- [meta] simplify "exports" [`2afaed7`](https://github.com/inspect-js/which-collection/commit/2afaed7f8918aa87a380c333944db274670838ae) +- [Deps] update `is-map`, `is-set` [`ce44763`](https://github.com/inspect-js/which-collection/commit/ce447638a94303f0571b4c3d12389c20a61d7817) +- [actions] switch Automatic Rease workflow to `pull_request_target` event [`b16b664`](https://github.com/inspect-js/which-collection/commit/b16b6641301c3c9ef7df8000be13a69b8087474f) +- [Dev Deps] update `auto-changelog`, `tape` [`2b9c953`](https://github.com/inspect-js/which-collection/commit/2b9c953b469d7fd0e86d96b89f20ef0c424e4ba1) +- [meta] add missing `engines.node` [`dcdbfde`](https://github.com/inspect-js/which-collection/commit/dcdbfdecc9f77daf99735d1f5377d9f3894fead3) +- [Dev Deps] update `auto-changelog`; add `aud` [`8e7f28d`](https://github.com/inspect-js/which-collection/commit/8e7f28d82f6240b2eaf763c32a3ede53be6cdfe1) +- [meta] add `sideEffects` flag [`3e0376b`](https://github.com/inspect-js/which-collection/commit/3e0376b80d7a18b78fdc898a9a166e9ffc83eee3) +- [Deps] update `is-weakset` [`7b3e922`](https://github.com/inspect-js/which-collection/commit/7b3e922ca0f9f356c1cbf4701857d71b378eb7d7) +- [Tests] only audit prod deps [`3339fea`](https://github.com/inspect-js/which-collection/commit/3339fea827a7fdcf8db868bb52278a3186593d48) + +## [v1.0.1](https://github.com/inspect-js/which-collection/compare/v1.0.0...v1.0.1) - 2020-01-26 + +### Commits + +- [actions] add automatic rebasing / merge commit blocking [`c3820b2`](https://github.com/inspect-js/which-collection/commit/c3820b2e8c88548f2c7da4080b1d1b6b41be97a4) +- [patch] add "exports" [`10983b5`](https://github.com/inspect-js/which-collection/commit/10983b5fdcc453c64216c3d6aa3fb93340091818) +- [Deps] update `is-map`, `is-set`, `is-weakmap`, `is-weakset` [`1565925`](https://github.com/inspect-js/which-collection/commit/1565925705c4abfe88065b211d1d960791f7cd3c) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`92ef871`](https://github.com/inspect-js/which-collection/commit/92ef871338395352f1bafc3156088361a3fd917a) +- [Dev Deps] update `@ljharb/eslint-config` [`61e9cde`](https://github.com/inspect-js/which-collection/commit/61e9cde1830ccc2b551dd6a1a873ae2cf27a74c7) + +## v1.0.0 - 2019-11-13 + +### Commits + +- Initial commit [`a21fddf`](https://github.com/inspect-js/which-collection/commit/a21fddffef3b2f21923e4d056295dd63661d8155) +- Tests [`ec86bc1`](https://github.com/inspect-js/which-collection/commit/ec86bc12f0516bd662c6e2966b36de2e1128a431) +- readme [`ffe969c`](https://github.com/inspect-js/which-collection/commit/ffe969cf4388d18e12c664cc51498bbdef08e565) +- implementation [`9acb669`](https://github.com/inspect-js/which-collection/commit/9acb6695e6a5e60f4c0b6de59eaf8b1f681d78e5) +- npm init [`124a63e`](https://github.com/inspect-js/which-collection/commit/124a63ee68a0015b47cbcc08b0d5598e553e7c9a) +- [meta] add `auto-changelog`, `safe-publish-latest` [`df0d6d4`](https://github.com/inspect-js/which-collection/commit/df0d6d4f1efbc4d9b327471b9c659bd487b25b49) +- [meta] add `funding` field; create FUNDING.yml [`032c81c`](https://github.com/inspect-js/which-collection/commit/032c81c826d68acd6242fa87fd6348db70135506) +- [Tests] add `npm run lint` [`6ae406d`](https://github.com/inspect-js/which-collection/commit/6ae406d9e459779abbdd90f48559552f740b05c9) +- fixup [`a2cad36`](https://github.com/inspect-js/which-collection/commit/a2cad363f12e30afe7619597187c5d4dc840a2a7) +- Only apps should have lockfiles [`30b3aae`](https://github.com/inspect-js/which-collection/commit/30b3aae37155f0786e4582501369f738b3282cd7) diff --git a/tools/ui/node_modules/which-collection/LICENSE b/tools/ui/node_modules/which-collection/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c05eb206bdf4955213919987028657acd99ed92c --- /dev/null +++ b/tools/ui/node_modules/which-collection/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Inspect JS + +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/which-collection/README.md b/tools/ui/node_modules/which-collection/README.md new file mode 100644 index 0000000000000000000000000000000000000000..640b880db70a93bfef4c86ef61d4bdfb49f5c3c9 --- /dev/null +++ b/tools/ui/node_modules/which-collection/README.md @@ -0,0 +1,65 @@ +# which-collection [![Version Badge][2]][1] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][5]][6] +[![dev dependency status][7]][8] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][11]][1] + +Which kind of Collection (Map, Set, WeakMap, WeakSet) is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag. + +## Example + +```js +var whichCollection = require('which-collection'); +var assert = require('assert'); + +assert.equal(false, whichCollection(undefined)); +assert.equal(false, whichCollection(null)); +assert.equal(false, whichCollection(false)); +assert.equal(false, whichCollection(true)); +assert.equal(false, whichCollection([])); +assert.equal(false, whichCollection({})); +assert.equal(false, whichCollection(/a/g)); +assert.equal(false, whichCollection(new RegExp('a', 'g'))); +assert.equal(false, whichCollection(new Date())); +assert.equal(false, whichCollection(42)); +assert.equal(false, whichCollection(NaN)); +assert.equal(false, whichCollection(Infinity)); +assert.equal(false, whichCollection(new Number(42))); +assert.equal(false, whichCollection(42n)); +assert.equal(false, whichCollection(Object(42n))); +assert.equal(false, whichCollection('foo')); +assert.equal(false, whichCollection(Object('foo'))); +assert.equal(false, whichCollection(function () {})); +assert.equal(false, whichCollection(function* () {})); +assert.equal(false, whichCollection(x => x * x)); +assert.equal(false, whichCollection([])); + +assert.equal('Map', whichCollection(new Map())); +assert.equal('Set', whichCollection(new Set())); +assert.equal('WeakMap', whichCollection(new WeakMap())); +assert.equal('WeakSet', whichCollection(new WeakSet())); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[1]: https://npmjs.org/package/which-collection +[2]: https://versionbadg.es/inspect-js/which-collection.svg +[5]: https://david-dm.org/inspect-js/which-collection.svg +[6]: https://david-dm.org/inspect-js/which-collection +[7]: https://david-dm.org/inspect-js/which-collection/dev-status.svg +[8]: https://david-dm.org/inspect-js/which-collection#info=devDependencies +[11]: https://nodei.co/npm/which-collection.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/which-collection.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/which-collection.svg +[downloads-url]: https://npm-stat.com/charts.html?package=which-collection +[codecov-image]: https://codecov.io/gh/inspect-js/which-collection/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/which-collection/ +[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/which-collection +[actions-url]: https://github.com/inspect-js/which-collection/actions diff --git a/tools/ui/node_modules/which-collection/index.d.ts b/tools/ui/node_modules/which-collection/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..27005a892d8dd4341db2ff590b8f01429b565598 --- /dev/null +++ b/tools/ui/node_modules/which-collection/index.d.ts @@ -0,0 +1,13 @@ +/** + * Determines the type of the given collection, or returns false. + * + * @param {unknown} value The potential collection + * @returns {'Map' | 'Set' | 'WeakMap' | 'WeakSet' | false} 'Map' | 'Set' | 'WeakMap' | 'WeakSet' | false + */ +declare function whichCollection(value: Map): 'Map'; +declare function whichCollection(value: Set): 'Set'; +declare function whichCollection(value: WeakMap): 'WeakMap'; +declare function whichCollection(value: WeakSet): 'WeakSet'; +declare function whichCollection(value: null | undefined | boolean | number | bigint | symbol | unknown): false; + +export = whichCollection; diff --git a/tools/ui/node_modules/which-collection/index.js b/tools/ui/node_modules/which-collection/index.js new file mode 100644 index 0000000000000000000000000000000000000000..cc8d097bf980f73cf54c1186ec3d9982b23d6051 --- /dev/null +++ b/tools/ui/node_modules/which-collection/index.js @@ -0,0 +1,25 @@ +'use strict'; + +var isMap = require('is-map'); +var isSet = require('is-set'); +var isWeakMap = require('is-weakmap'); +var isWeakSet = require('is-weakset'); + +/** @type {import('.')} */ +module.exports = function whichCollection(/** @type {unknown} */ value) { + if (value && typeof value === 'object') { + if (isMap(value)) { + return 'Map'; + } + if (isSet(value)) { + return 'Set'; + } + if (isWeakMap(value)) { + return 'WeakMap'; + } + if (isWeakSet(value)) { + return 'WeakSet'; + } + } + return false; +}; diff --git a/tools/ui/node_modules/which-collection/package.json b/tools/ui/node_modules/which-collection/package.json new file mode 100644 index 0000000000000000000000000000000000000000..fc3cacc679c9373fd2f27958706df4d57e7b7ccf --- /dev/null +++ b/tools/ui/node_modules/which-collection/package.json @@ -0,0 +1,85 @@ +{ + "name": "which-collection", + "version": "1.0.2", + "description": "Which kind of Collection (Map, Set, WeakMap, WeakSet) is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag.", + "main": "index.js", + "exports": { + ".": "./index.js", + "./package.json": "./package.json" + }, + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "lint": "eslint --ext=js,mjs .", + "pretest": "npm run lint", + "postlint": "tsc -p . && attw -P", + "tests-only": "nyc tape 'test/**/*.js'", + "test": "npm run tests-only", + "posttest": "npx aud --production", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/inspect-js/which-collection.git" + }, + "keywords": [ + "map", + "set", + "weakmap", + "weakset", + "collection.es6", + "es2015" + ], + "author": "Jordan Harband ", + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/inspect-js/which-collection/issues" + }, + "homepage": "https://github.com/inspect-js/which-collection#readme", + "devDependencies": { + "@arethetypeswrong/cli": "^0.15.0", + "@ljharb/eslint-config": "^21.1.0", + "@types/for-each": "^0.3.3", + "@types/object-inspect": "^1.8.4", + "@types/tape": "^5.6.4", + "aud": "^2.0.4", + "auto-changelog": "^2.4.0", + "eslint": "=8.8.0", + "for-each": "^0.3.3", + "in-publish": "^2.0.1", + "npmignore": "^0.3.1", + "nyc": "^10.3.2", + "object-inspect": "^1.13.1", + "safe-publish-latest": "^2.0.0", + "tape": "^5.7.5", + "typescript": "next" + }, + "dependencies": { + "is-map": "^2.0.3", + "is-set": "^2.0.3", + "is-weakmap": "^2.0.2", + "is-weakset": "^2.0.3" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows" + ] + }, + "engines": { + "node": ">= 0.4" + } +} diff --git a/tools/ui/node_modules/which-collection/test/index.js b/tools/ui/node_modules/which-collection/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..3a5beccdd579200acfb654fc65725ffd8da776da --- /dev/null +++ b/tools/ui/node_modules/which-collection/test/index.js @@ -0,0 +1,59 @@ +'use strict'; + +var test = require('tape'); +var debug = require('object-inspect'); +var forEach = require('for-each'); + +var whichCollection = require('..'); + +test('non-collections', function (t) { + forEach([ + null, + undefined, + true, + false, + 42, + 0, + -0, + NaN, + Infinity, + '', + 'foo', + /a/g, + [], + {}, + function () {} + ], function (nonCollection) { + t.equal(whichCollection(nonCollection), false, debug(nonCollection) + ' is not a collection'); + }); + + t.end(); +}); + +test('Maps', { skip: typeof Map !== 'function' }, function (t) { + var m = new Map(); + t.equal(whichCollection(m), 'Map', debug(m) + ' is a Map'); + + t.end(); +}); + +test('Sets', { skip: typeof Set !== 'function' }, function (t) { + var s = new Set(); + t.equal(whichCollection(s), 'Set', debug(s) + ' is a Set'); + + t.end(); +}); + +test('WeakMaps', { skip: typeof WeakMap !== 'function' }, function (t) { + var wm = new WeakMap(); + t.equal(whichCollection(wm), 'WeakMap', debug(wm) + ' is a WeakMap'); + + t.end(); +}); + +test('WeakSets', { skip: typeof WeakSet !== 'function' }, function (t) { + var ws = new WeakSet(); + t.equal(whichCollection(ws), 'WeakSet', debug(ws) + ' is a WeakSet'); + + t.end(); +}); diff --git a/tools/ui/node_modules/which-collection/tsconfig.json b/tools/ui/node_modules/which-collection/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..2002ce5a53532769b9b5bc561dac11518c384d13 --- /dev/null +++ b/tools/ui/node_modules/which-collection/tsconfig.json @@ -0,0 +1,49 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + + /* Language and Environment */ + "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + "typeRoots": ["types"], /* Specify multiple folders that act like './node_modules/@types'. */ + "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + + /* JavaScript Support */ + "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + "maxNodeModuleJsDepth": 0, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declarationMap": true, /* Create sourcemaps for d.ts files. */ + "noEmit": true, /* Disable emitting files from a compilation. */ + + /* Interop Constraints */ + "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + + /* Completeness */ + //"skipLibCheck": true /* Skip type checking all .d.ts files. */ + }, + "exclude": [ + "coverage" + ] +} diff --git a/tools/ui/node_modules/which-typed-array/.editorconfig b/tools/ui/node_modules/which-typed-array/.editorconfig new file mode 100644 index 0000000000000000000000000000000000000000..bc228f8269443bf772b437890dde7756a3e8a894 --- /dev/null +++ b/tools/ui/node_modules/which-typed-array/.editorconfig @@ -0,0 +1,20 @@ +root = true + +[*] +indent_style = tab +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 150 + +[CHANGELOG.md] +indent_style = space +indent_size = 2 + +[*.json] +max_line_length = off + +[Makefile] +max_line_length = off diff --git a/tools/ui/node_modules/which-typed-array/.github/FUNDING.yml b/tools/ui/node_modules/which-typed-array/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..d6aa18036290de39a8905b2d9645bc77f3495f47 --- /dev/null +++ b/tools/ui/node_modules/which-typed-array/.github/FUNDING.yml @@ -0,0 +1,12 @@ +# These are supported funding model platforms + +github: [ljharb] +patreon: # Replace with a single Patreon username +open_collective: # Replace with a single Open Collective username +ko_fi: # Replace with a single Ko-fi username +tidelift: npm/which-typed-array +community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry +liberapay: # Replace with a single Liberapay username +issuehunt: # Replace with a single IssueHunt username +otechie: # Replace with a single Otechie username +custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] diff --git a/tools/ui/node_modules/which-typed-array/.nycrc b/tools/ui/node_modules/which-typed-array/.nycrc new file mode 100644 index 0000000000000000000000000000000000000000..1826526e091b89c896e7099ccd891db79165e329 --- /dev/null +++ b/tools/ui/node_modules/which-typed-array/.nycrc @@ -0,0 +1,13 @@ +{ + "all": true, + "check-coverage": false, + "reporter": ["text-summary", "text", "html", "json"], + "lines": 86, + "statements": 85.93, + "functions": 82.43, + "branches": 76.06, + "exclude": [ + "coverage", + "test" + ] +} diff --git a/tools/ui/node_modules/which-typed-array/CHANGELOG.md b/tools/ui/node_modules/which-typed-array/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..2cdfe3ef0480fb26cdadde150de2cb3c03b7994d --- /dev/null +++ b/tools/ui/node_modules/which-typed-array/CHANGELOG.md @@ -0,0 +1,280 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [v1.1.21](https://github.com/inspect-js/which-typed-array/compare/v1.1.20...v1.1.21) - 2026-05-26 + +### Commits + +- [types] add Float16Array [`b3dac9f`](https://github.com/inspect-js/which-typed-array/commit/b3dac9f6931f463d10b7e21b1b5e5369602642c4) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`; migrate to flat config [`2dd9b04`](https://github.com/inspect-js/which-typed-array/commit/2dd9b04cd3f461a0f4b19c607124e134e12df135) +- [Dev Deps] update `@ljharb/eslint-config`, `auto-changelog`, `eslint` [`b46f6a2`](https://github.com/inspect-js/which-typed-array/commit/b46f6a2f000e932f7b78c54b9dce0bf940379fea) +- [Tests] pin `fflate` to 0.8.2 [`06eb54e`](https://github.com/inspect-js/which-typed-array/commit/06eb54e4ee7369da3639a2291a1c6add642e53fb) +- [Dev Deps] update `eslint` [`2181d61`](https://github.com/inspect-js/which-typed-array/commit/2181d61990f20c82c84d06bcd4a91ba70b486bc1) +- [Deps] update `call-bind` [`ca58bca`](https://github.com/inspect-js/which-typed-array/commit/ca58bca5034adcbfc05797ffde7e9134c9df4a72) + +## [v1.1.20](https://github.com/inspect-js/which-typed-array/compare/v1.1.19...v1.1.20) - 2026-01-14 + +### Commits + +- [types] add Float16Array to TypedArray [`b04301f`](https://github.com/inspect-js/which-typed-array/commit/b04301f737aaa500ac2ee9a0578d6e3a52a65b94) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `eslint`, `make-generator-function`, `npmignore` [`215b3a1`](https://github.com/inspect-js/which-typed-array/commit/215b3a1a39300a3a305d9f9b6885d00d44387ef6) +- [readme] replace runkit CI badge with shields.io check-runs badge [`32def83`](https://github.com/inspect-js/which-typed-array/commit/32def83f46fdfe0d324ed32de2146554855ed140) + +## [v1.1.19](https://github.com/inspect-js/which-typed-array/compare/v1.1.18...v1.1.19) - 2025-03-08 + +### Commits + +- [Refactor] use `get-proto`, improve types [`e05d535`](https://github.com/inspect-js/which-typed-array/commit/e05d535fe4e4c4e674937718fe1cae90abff3606) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape` [`0dade9c`](https://github.com/inspect-js/which-typed-array/commit/0dade9c4c334f37ed14083a35724eea56a496991) +- [Deps] update `call-bound`, `for-each` [`490791a`](https://github.com/inspect-js/which-typed-array/commit/490791af49605390f9805660492976f86c64feb1) +- [Tests] skip `npm ls` in older nodes [`f83aaca`](https://github.com/inspect-js/which-typed-array/commit/f83aaca6b6634ce795f8caf9a1e14ab15d35161c) +- [Dev Deps] update `@ljharb/tsconfig` [`63c4795`](https://github.com/inspect-js/which-typed-array/commit/63c479564e5f3cb022c784ffe505673597341aab) + +## [v1.1.18](https://github.com/inspect-js/which-typed-array/compare/v1.1.17...v1.1.18) - 2024-12-18 + +### Commits + +- [types] improve types [`4b57173`](https://github.com/inspect-js/which-typed-array/commit/4b5717349976578c6b48966d581687df5dcc2e9b) +- [Dev Deps] update `@types/tape` [`81853b0`](https://github.com/inspect-js/which-typed-array/commit/81853b075c018538859a5533578be654fafecdae) + +## [v1.1.17](https://github.com/inspect-js/which-typed-array/compare/v1.1.16...v1.1.17) - 2024-12-18 + +### Commits + +- [types] improve types [`86bc612`](https://github.com/inspect-js/which-typed-array/commit/86bc61207e5970c2c7e13cdda4ccdeb0981ac40b) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/tsconfig`, `@types/tape` [`2e9bed6`](https://github.com/inspect-js/which-typed-array/commit/2e9bed67f1d623b176b1a7f06c5eab006c21cf96) +- [Deps] update `call-bind`, `gopd` [`34579df`](https://github.com/inspect-js/which-typed-array/commit/34579df639e35ceb3a7e54f8e680a4077a950b8b) +- [Refactor] use `call-bound` directly [`2a2d84e`](https://github.com/inspect-js/which-typed-array/commit/2a2d84e91045266841ddb47afe594899bae2f483) + +## [v1.1.16](https://github.com/inspect-js/which-typed-array/compare/v1.1.15...v1.1.16) - 2024-11-27 + +### Commits + +- [actions] split out node 10-20, and 20+ [`8e289a9`](https://github.com/inspect-js/which-typed-array/commit/8e289a9665a32f7ea267c3ffed7451b154adbe26) +- [Dev Deps] update `@arethetypeswrong/cli`, `@ljharb/eslint-config`, `@types/node`, `@types/tape`, `auto-changelog`, `tape` [`3d4a678`](https://github.com/inspect-js/which-typed-array/commit/3d4a67872d0dbecb755e63ba4101e9ec030a5e7e) +- [Tests] replace `aud` with `npm audit` [`6fbada9`](https://github.com/inspect-js/which-typed-array/commit/6fbada976743192db47000e47eefc07708713ea0) +- [types] add an additional overload [`db5a791`](https://github.com/inspect-js/which-typed-array/commit/db5a791642cd8b4d78fe4ed4da151c4543ee0840) +- [Dev Deps] remove an unused DT package [`6bfff4c`](https://github.com/inspect-js/which-typed-array/commit/6bfff4c3b0c415cb32cd12be6fab3cbbe9e10e13) +- [Dev Deps] add missing peer dep [`05fd582`](https://github.com/inspect-js/which-typed-array/commit/05fd582a703cd68ee7613af0ef2c45546ea5d2ba) + +## [v1.1.15](https://github.com/inspect-js/which-typed-array/compare/v1.1.14...v1.1.15) - 2024-03-10 + +### Commits + +- [types] use a namespace; improve type [`f42bec3`](https://github.com/inspect-js/which-typed-array/commit/f42bec34d5c47bd9e4ab1b48dcde60c09c666712) +- [types] use shared config [`464a9e3`](https://github.com/inspect-js/which-typed-array/commit/464a9e358c2597253c747970b12032406a19b8d2) +- [actions] remove redundant finisher; use reusable workflow [`d114ee8`](https://github.com/inspect-js/which-typed-array/commit/d114ee83ceb6c7898386f4b5935a3ed9e2ec61e4) +- [Dev Deps] update `@types/node`, `tape`, `typescript`; add `@arethetypeswrong/cli` [`9cc63d8`](https://github.com/inspect-js/which-typed-array/commit/9cc63d8635e80ce6dabcb352d23050111040d747) +- [types] add a helpful hover description [`29ccf8d`](https://github.com/inspect-js/which-typed-array/commit/29ccf8dab0f805cdac6ec56d7b9cc27476708273) +- [Deps] update `available-typed-arrays`, `call-bind`, `has-tostringtag` [`7ecfd8e`](https://github.com/inspect-js/which-typed-array/commit/7ecfd8e29d09f8708f7cab7cc41fea9ae5a20867) + +## [v1.1.14](https://github.com/inspect-js/which-typed-array/compare/v1.1.13...v1.1.14) - 2024-02-01 + +### Commits + +- [patch] add types [`49c4d4c`](https://github.com/inspect-js/which-typed-array/commit/49c4d4c5db9bebb8d6f8c18a01047e44eea15e17) +- [Dev Deps] update `aud`, `npmignore`, `tape` [`e5fab7b`](https://github.com/inspect-js/which-typed-array/commit/e5fab7b3dc9df2bceb88f15c3d0a2c0176cf2567) +- [Deps] update `available-typed-arrays`, `call-bind` [`97e2b44`](https://github.com/inspect-js/which-typed-array/commit/97e2b44bad85c9183f1219e28211b3abd167677c) +- [Deps] update `has-tostringtag` [`1efa8bf`](https://github.com/inspect-js/which-typed-array/commit/1efa8bf910c080c14f011aa7c645ac88bc7a7078) + +## [v1.1.13](https://github.com/inspect-js/which-typed-array/compare/v1.1.12...v1.1.13) - 2023-10-19 + +### Commits + +- [Refactor] avoid call-binding entirely when there is no method to bind [`9ff452b`](https://github.com/inspect-js/which-typed-array/commit/9ff452b88fbd8e4419bd768d86d0ea9a87d7e310) + +## [v1.1.12](https://github.com/inspect-js/which-typed-array/compare/v1.1.11...v1.1.12) - 2023-10-19 + +### Commits + +- [Fix] somehow node 0.12 - 3 can hit here, and they lack slice but have set [`c28e9b8`](https://github.com/inspect-js/which-typed-array/commit/c28e9b84d6d68ad5f52236ba59c26b06cde6300b) +- [Deps] update `call-bind` [`a648554`](https://github.com/inspect-js/which-typed-array/commit/a64855495106235352ebb3550a860d3bfd4a1ce1) +- [Dev Deps] update `tape` [`7a094d6`](https://github.com/inspect-js/which-typed-array/commit/7a094d6f9219b903c9a9e13c559e68f0e9672b59) + +## [v1.1.11](https://github.com/inspect-js/which-typed-array/compare/v1.1.10...v1.1.11) - 2023-07-17 + +### Commits + +- [Fix] `node < v0.6` lacks proper Object toString behavior [`b8fd654`](https://github.com/inspect-js/which-typed-array/commit/b8fd65479c0bd18385378cfae79750ebf7cb6ee7) +- [Dev Deps] update `tape` [`e1734c9`](https://github.com/inspect-js/which-typed-array/commit/e1734c99d79880ab11efa55220498a7a1e887834) + +## [v1.1.10](https://github.com/inspect-js/which-typed-array/compare/v1.1.9...v1.1.10) - 2023-07-10 + +### Commits + +- [actions] update rebase action to use reusable workflow [`2c10582`](https://github.com/inspect-js/which-typed-array/commit/2c105820d77274c079cb6d040cb348396e516ef5) +- [Robustness] use `call-bind` [`b2335fd`](https://github.com/inspect-js/which-typed-array/commit/b2335fdfca80840995eea5e6fcfffc6d712279a1) +- [Dev Deps] update `@ljharb/eslint-config`, `aud`, `tape` [`ad5e41b`](https://github.com/inspect-js/which-typed-array/commit/ad5e41ba18e7d23af1f9b211215c43a64bf75d70) + +## [v1.1.9](https://github.com/inspect-js/which-typed-array/compare/v1.1.8...v1.1.9) - 2022-11-02 + +### Commits + +- [Dev Deps] update `aud`, `is-callable`, `tape` [`9a20b3c`](https://github.com/inspect-js/which-typed-array/commit/9a20b3cb8f5d087789a8160395517bffe27b4339) +- [Refactor] use `gopd` instead of `es-abstract` helper [`00157af`](https://github.com/inspect-js/which-typed-array/commit/00157af909842b8b5affa5485d3574ec92d94065) +- [Deps] update `is-typed-array` [`6714240`](https://github.com/inspect-js/which-typed-array/commit/6714240e748cbbb634cb1e405ad762bc52acde66) +- [meta] add `sideEffects` flag [`89b96cc`](https://github.com/inspect-js/which-typed-array/commit/89b96cc3decc78d9621598e94fa1c2bb87eabf2e) + +## [v1.1.8](https://github.com/inspect-js/which-typed-array/compare/v1.1.7...v1.1.8) - 2022-05-14 + +### Commits + +- [actions] reuse common workflows [`95ea6c0`](https://github.com/inspect-js/which-typed-array/commit/95ea6c02dc5ec4ed0ee1b9c4692bb060108c8637) +- [meta] use `npmignore` to autogenerate an npmignore file [`d08436a`](https://github.com/inspect-js/which-typed-array/commit/d08436a19cdd76219732f5040a01cdb92ef2820e) +- [readme] add github actions/codecov badges [`35ae3af`](https://github.com/inspect-js/which-typed-array/commit/35ae3af6a0bb328c9d9b9bbb53e47122f269d81a) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `safe-publish-latest`, `tape` [`86e6e3a`](https://github.com/inspect-js/which-typed-array/commit/86e6e3af60b2436f0ff34968d9d6240a23f40528) +- [actions] update codecov uploader [`0aa6e30`](https://github.com/inspect-js/which-typed-array/commit/0aa6e3026ab4198c4364737ed4f0315a2ecc432a) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `tape` [`a881a78`](https://github.com/inspect-js/which-typed-array/commit/a881a785f094e823e1cefe2ae9e4ebe31a8e996e) +- [Refactor] use `for-each` instead of `foreach` [`9dafa03`](https://github.com/inspect-js/which-typed-array/commit/9dafa0377fc5c690059a9d454f1dd4d365c5c902) +- [Deps] update `es-abstract`, `is-typed-array` [`0684022`](https://github.com/inspect-js/which-typed-array/commit/068402297608f321a4ec99ebce741b3eb38fcfdd) +- [Deps] update `es-abstract`, `is-typed-array` [`633a529`](https://github.com/inspect-js/which-typed-array/commit/633a529081b5c48d9675abb8aea425e6e33d528e) + +## [v1.1.7](https://github.com/inspect-js/which-typed-array/compare/v1.1.6...v1.1.7) - 2021-08-30 + +### Commits + +- [Refactor] use `globalThis` if available [`2a16d1f`](https://github.com/inspect-js/which-typed-array/commit/2a16d1fd520871ce6b23c60f0bd2113cf33b2533) +- [meta] changelog cleanup [`ba99f56`](https://github.com/inspect-js/which-typed-array/commit/ba99f56b45e6acde7aef4a1f34bb00e44088ccee) +- [Dev Deps] update `@ljharb/eslint-config` [`19a6e04`](https://github.com/inspect-js/which-typed-array/commit/19a6e04ce0094fb3fd6d0d2cbc58d320556ddf50) +- [Deps] update `available-typed-arrays` [`50dbc58`](https://github.com/inspect-js/which-typed-array/commit/50dbc5810a24c468b49409e1f0a79d03501e3dd6) +- [Deps] update `is-typed-array` [`c1b83ea`](https://github.com/inspect-js/which-typed-array/commit/c1b83eae65f042e46b6ae941ac4e814b7965a0f7) + +## [v1.1.6](https://github.com/inspect-js/which-typed-array/compare/v1.1.5...v1.1.6) - 2021-08-06 + +### Fixed + +- [Fix] if Symbol.toStringTag exists but is not present, use Object.prototype.toString [`#51`](https://github.com/inspect-js/which-typed-array/issues/51) [`#49`](https://github.com/inspect-js/which-typed-array/issues/49) + +### Commits + +- [Dev Deps] update `is-callable`, `tape` [`63eb1e3`](https://github.com/inspect-js/which-typed-array/commit/63eb1e3faede3f328bbbb4a5fcffc2e4769cf4ec) +- [Deps] update `is-typed-array` [`c5056f0`](https://github.com/inspect-js/which-typed-array/commit/c5056f0007d4c9434f1fa69eff183109468b4769) + +## [v1.1.5](https://github.com/inspect-js/which-typed-array/compare/v1.1.4...v1.1.5) - 2021-08-05 + +### Commits + +- [actions] use `node/install` instead of `node/run`; use `codecov` action [`63fa8dd`](https://github.com/inspect-js/which-typed-array/commit/63fa8dd1dc9c0f0dbbaa16d1de0eb89797324c5d) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `is-callable`, `tape` [`1107c74`](https://github.com/inspect-js/which-typed-array/commit/1107c74c52ed6eb4a719faec88e16c4343976d73) +- [Deps] update `available-typed-arrays`, `call-bind`, `es-abstract`, `is-typed-array` [`f953454`](https://github.com/inspect-js/which-typed-array/commit/f953454b2c6f589f09573ddc961431f970c2e1b6) +- [Fix] use `has-tostringtag` to behave correctly in the presence of symbol shams [`8aee720`](https://github.com/inspect-js/which-typed-array/commit/8aee7207abcd72c799ac324b214fbb6ca7ae4a28) +- [meta] use `prepublishOnly` script for npm 7+ [`6c5167b`](https://github.com/inspect-js/which-typed-array/commit/6c5167b4cd06cb62a5487a2e797d8e41cc2970b1) + +## [v1.1.4](https://github.com/inspect-js/which-typed-array/compare/v1.1.3...v1.1.4) - 2020-12-05 + +### Commits + +- [meta] npmignore github action workflows [`aa427e7`](https://github.com/inspect-js/which-typed-array/commit/aa427e79a230a985953695a8129ceb6bb7d42527) + +## [v1.1.3](https://github.com/inspect-js/which-typed-array/compare/v1.1.2...v1.1.3) - 2020-12-05 + +### Commits + +- [Tests] migrate tests to Github Actions [`803d4dd`](https://github.com/inspect-js/which-typed-array/commit/803d4ddb601ff03e587be792bd452de0e2783d03) +- [Tests] run `nyc` on all tests [`205a13f`](https://github.com/inspect-js/which-typed-array/commit/205a13f7aa172e014ddc2079c84af6ba575581c8) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `aud`, `auto-changelog`, `is-callable`, `tape` [`97ceb07`](https://github.com/inspect-js/which-typed-array/commit/97ceb070d5aea1c3a696c6f695800ae468bafc0b) +- [actions] add "Allow Edits" workflow [`b140492`](https://github.com/inspect-js/which-typed-array/commit/b14049211eff32bd4149767def4f939483810051) +- [Deps] update `es-abstract`; use `call-bind` where applicable [`2abdb87`](https://github.com/inspect-js/which-typed-array/commit/2abdb871961b4e1b58925115a7d56a9cc5966a02) +- [actions] switch Automatic Rebase workflow to `pull_request_target` event [`256d34b`](https://github.com/inspect-js/which-typed-array/commit/256d34b8bdb67b8af0e9f83c9a318e54f3340e3b) +- [Dev Deps] update `auto-changelog`; add `aud` [`ddea96f`](https://github.com/inspect-js/which-typed-array/commit/ddea96fe320dbdd0c7d7569812399a7f64d43e04) +- [meta] gitignore nyc output [`8a812bd`](https://github.com/inspect-js/which-typed-array/commit/8a812bd1ce7c5609988fb4fe2e9af2089eccd07d) + +## [v1.1.2](https://github.com/inspect-js/which-typed-array/compare/v1.1.1...v1.1.2) - 2020-04-07 + +### Commits + +- [Dev Deps] update `make-arrow-function`, `make-generator-function` [`28c61ef`](https://github.com/inspect-js/which-typed-array/commit/28c61eff4903ff6509f65c2f500858b9cb4636f1) +- [Dev Deps] update `@ljharb/eslint-config` [`a233879`](https://github.com/inspect-js/which-typed-array/commit/a2338798d3a4a3169cda54e322b2f2eb0e976ad0) +- [Dev Deps] update `auto-changelog` [`df0134c`](https://github.com/inspect-js/which-typed-array/commit/df0134c0e20ec6d94993988ad670e1b3cf350bea) +- [Fix] move `foreach` to dependencies [`6ef29c0`](https://github.com/inspect-js/which-typed-array/commit/6ef29c0dbb91a7ec21df7ce8736f99f41efea39e) +- [Tests] only audit prod deps [`eb21044`](https://github.com/inspect-js/which-typed-array/commit/eb210446bd7a433657204d2314ef56fe264c21ad) +- [Deps] update `es-abstract` [`5ef0236`](https://github.com/inspect-js/which-typed-array/commit/5ef02368d9876a1074123aa7725d6759b4f3e358) +- [Dev Deps] update `tape` [`7456037`](https://github.com/inspect-js/which-typed-array/commit/745603728c6c3da8bdddee321e8a9196f4827aa3) +- [Deps] update `available-typed-arrays` [`8a856c9`](https://github.com/inspect-js/which-typed-array/commit/8a856c9aa707c1e6f7a52e834485356b31395ea6) + +## [v1.1.1](https://github.com/inspect-js/which-typed-array/compare/v1.1.0...v1.1.1) - 2020-01-24 + +### Commits + +- [Tests] use shared travis-ci configs [`0a627d9`](https://github.com/inspect-js/which-typed-array/commit/0a627d9694d0eabdaee63b19e605584166995a79) +- [meta] add `auto-changelog` [`2a14c58`](https://github.com/inspect-js/which-typed-array/commit/2a14c58b79f72e32ef2078efb40d31a4bf8c197a) +- [meta] remove unused Makefile and associated utilities [`75f7f22`](https://github.com/inspect-js/which-typed-array/commit/75f7f222199f42618c290de363c542b11f5a5632) +- [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16`, `v6.17` [`4162327`](https://github.com/inspect-js/which-typed-array/commit/416232725e7d127cbd886af0f8988dae612a342f) +- [Refactor] use `es-abstract`’s `callBound`, `available-typed-arrays`, `has-symbols` [`9b04a2a`](https://github.com/inspect-js/which-typed-array/commit/9b04a2a14c758600cffcf59485b7b3c85839c266) +- [readme] fix repo URLs, remove testling [`03ed52f`](https://github.com/inspect-js/which-typed-array/commit/03ed52f3ae4fcd35614bcda7e947b14e62009c71) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `replace`, `semver`, `tape` [`bfbcf3e`](https://github.com/inspect-js/which-typed-array/commit/bfbcf3ec9c449bd0089ed805c01a32ba4e7e5938) +- [actions] add automatic rebasing / merge commit blocking [`cc88ac5`](https://github.com/inspect-js/which-typed-array/commit/cc88ac56bcfb71cb26c656ebde4c560a22fadd85) +- [meta] create FUNDING.yml [`acbc723`](https://github.com/inspect-js/which-typed-array/commit/acbc7230929b1256c83df28be4a456eed3e147e9) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `is-callable`, `tape` [`f1ab63e`](https://github.com/inspect-js/which-typed-array/commit/f1ab63e9366027eae2e29398c035181dac164132) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`; add `safe-publish-latest` [`ac9f50b`](https://github.com/inspect-js/which-typed-array/commit/ac9f50b59558933292dff993df2e68eaa44b07e2) +- [Tests] use `npx aud` instead of `nsp` or `npm audit` with hoops [`aaaa15d`](https://github.com/inspect-js/which-typed-array/commit/aaaa15dfb5bd8228c0cfb8f2aba267efb405b0a1) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `tape` [`602fc9a`](https://github.com/inspect-js/which-typed-array/commit/602fc9a0a7d708236f90c76f592e6a980ecde940) +- [Deps] update `available-typed-arrays`, `is-typed-array` [`b2d69b6`](https://github.com/inspect-js/which-typed-array/commit/b2d69b639bf14344d09f8512dbc060cd4f533161) +- [meta] add `funding` field [`156f613`](https://github.com/inspect-js/which-typed-array/commit/156f613d0ce547c4b15e1ae279198b66e3cef55e) + +## [v1.1.0](https://github.com/inspect-js/which-typed-array/compare/v1.0.1...v1.1.0) - 2019-02-16 + +### Commits + +- [Tests] remove `jscs` [`381c9b4`](https://github.com/inspect-js/which-typed-array/commit/381c9b4bd858da1adedf23d8555af3a3ed901a83) +- [Tests] up to `node` `v8.2`, `v7.10`, `v6.11`, `v5.8`; improve matrix; newer npm breaks on older node [`7015c19`](https://github.com/inspect-js/which-typed-array/commit/7015c196ba86540b04d18d9b1d2c368909492023) +- [Tests] up to `node` `v10.0`, `v9.11`, `v8.11`, `v6.14`, `v4.9`; use `nvm install-latest-npm` [`ad67885`](https://github.com/inspect-js/which-typed-array/commit/ad678853e245986720d7650be1c974a9ff3ac814) +- [Tests] up to `node` `v11.6`, `v10.15`, `v8.15`, `v6.16` [`dd94bfb`](https://github.com/inspect-js/which-typed-array/commit/dd94bfb6309a92d1537352f2d1100f9e913ebc01) +- [Refactor] use an array instead of an object for storing Typed Array names [`de98bc1`](https://github.com/inspect-js/which-typed-array/commit/de98bc1d44af92909a34212e276deb5d79ac428a) +- [meta] ignore `test.html` [`06cfb1b`](https://github.com/inspect-js/which-typed-array/commit/06cfb1bc0ca7881d1bd1621fa946a16366cd6afc) +- [Tests] up to `node` `v7.0`, `v6.9`, `v4.6`; improve test matrix [`df76eaa`](https://github.com/inspect-js/which-typed-array/commit/df76eaa39b94b28147e81a89bb587e8aa3e3dba3) +- [New] add `BigInt64Array` and `BigUint64Array` [`d6bca3a`](https://github.com/inspect-js/which-typed-array/commit/d6bca3a68ccfe33f6659a24b770068e89dab1592) +- [Dev Deps] update `jscs`, `nsp`, `eslint` [`f23b45b`](https://github.com/inspect-js/which-typed-array/commit/f23b45b2796bd1f63ddddf28b4b80b9709478cb3) +- [Dev Deps] update `@ljharb/eslint-config`, `eslint`, `semver`, `tape` [`ddb4484`](https://github.com/inspect-js/which-typed-array/commit/ddb4484adc3b45c4396632611556055f3b2f5990) +- [Dev Deps] update `eslint`, `@ljharb/eslint-config`, `covert`, `is-callable`, `replace`, `semver`, `tape` [`4524e59`](https://github.com/inspect-js/which-typed-array/commit/4524e593e9387c185d5632696c62c1600c0b380f) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` [`1ec7056`](https://github.com/inspect-js/which-typed-array/commit/1ec70568565c479a6168b03e0a5aec6ec9ac5a21) +- [Dev Deps] update `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config` [`799487d`](https://github.com/inspect-js/which-typed-array/commit/799487d666b32d1ae0d27cfededf2f5480c5faea) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver` [`8092598`](https://github.com/inspect-js/which-typed-array/commit/8092598998a1f9f8005b4e3d299eb09c96fa2e21) +- [Tests] up to `node` `v11.10` [`a5aabb1`](https://github.com/inspect-js/which-typed-array/commit/a5aabb1910e8408f857a791253487824c7c758d3) +- [Dev Deps] update `@ljharb/eslint-config`, `eslint`, `nsp`, `semver`, `tape` [`277be33`](https://github.com/inspect-js/which-typed-array/commit/277be331d9f05ff95644d6bcd896547ca620cd8e) +- [Tests] use `npm audit` instead of `nsp` [`ee97dc7`](https://github.com/inspect-js/which-typed-array/commit/ee97dc7c5d384d68f60ce6cb5a85d9509e75f72b) +- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config` [`262ffb0`](https://github.com/inspect-js/which-typed-array/commit/262ffb025facb0795b33fbd5131183bdbc0a40f6) +- [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` [`d6bbcfc`](https://github.com/inspect-js/which-typed-array/commit/d6bbcfc3eea427f0156fbdcf9ae11dbf3745a755) +- [Tests] up to `node` `v6.2` [`2ff89eb`](https://github.com/inspect-js/which-typed-array/commit/2ff89eb91754146c0bc1ae689f37458d84f6e690) +- Only apps should have lockfiles [`e2bc271`](https://github.com/inspect-js/which-typed-array/commit/e2bc271e1e9a6481a2836f892177825a808c331c) +- [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config` [`b79e93b`](https://github.com/inspect-js/which-typed-array/commit/b79e93bf15c871ce0ff24fa3ad61001707eea463) +- [Dev Deps] update `nsp`, `eslint`, `@ljharb/eslint-config` [`016dbff`](https://github.com/inspect-js/which-typed-array/commit/016dbff8c49c32cda7ec80d86006c8a7c43bc40c) +- [Dev Deps] update `eslint`, `tape` [`6ce4bbc`](https://github.com/inspect-js/which-typed-array/commit/6ce4bbc5f6caf632cbcf9ababbfe36e1bf4093d7) +- [Tests] on `node` `v10.1` [`f0683a0`](https://github.com/inspect-js/which-typed-array/commit/f0683a0c17e039e926ecaad4c4c341cd8e5878f1) +- [Tests] up to `node` `v7.2` [`2f29cef`](https://github.com/inspect-js/which-typed-array/commit/2f29cef42d30f87259cd6687c25a79ae4651d0c9) +- [Dev Deps] update `replace` [`73b5ba6`](https://github.com/inspect-js/which-typed-array/commit/73b5ba6e87638d13553985977cab9d1bad33e242) +- [Deps] update `function-bind` [`c8a18c2`](https://github.com/inspect-js/which-typed-array/commit/c8a18c2982e6b126ecc1d4655ec2e53b05535b20) +- [Tests] on `node` `v5.12` [`812102b`](https://github.com/inspect-js/which-typed-array/commit/812102bf223422da8f7a89e5a1308214dd158571) +- [Tests] on `node` `v5.10` [`271584f`](https://github.com/inspect-js/which-typed-array/commit/271584f3a8b10ef68a7d419ac0062b444e63d07c) + +## [v1.0.1](https://github.com/inspect-js/which-typed-array/compare/v1.0.0...v1.0.1) - 2016-03-19 + +### Commits + +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `semver`, `is-callable` [`4a628c5`](https://github.com/inspect-js/which-typed-array/commit/4a628c520d8e080a9fa7e8218947d3b2ceedca72) +- [Dev Deps] update `tape`, `jscs`, `nsp`, `eslint`, `@ljharb/eslint-config`, `is-callable` [`8e09372`](https://github.com/inspect-js/which-typed-array/commit/8e09372ded877a191cbf777060483227d5071e84) +- [Tests] up to `node` `v5.6`, `v4.3` [`3a35bf9`](https://github.com/inspect-js/which-typed-array/commit/3a35bf9fb9c7f8e6ac1b579ed2754087351ad1a5) +- [Dev Deps] update `jscs`, `eslint`, `@ljharb/eslint-config` [`9410d5e`](https://github.com/inspect-js/which-typed-array/commit/9410d5e35db4b834827b31ea1723bbeebbcde5ba) +- [Fix] `Symbol.toStringTag` is on the super-[[Prototype]] of Float32Array, not the [[Prototype]]. [`7c40a3a`](https://github.com/inspect-js/which-typed-array/commit/7c40a3a05046bbbd188340fb19471ad913e4af05) +- [Tests] up to `node` `v5.9`, `v4.4` [`07878e7`](https://github.com/inspect-js/which-typed-array/commit/07878e7cd23d586ddb9e85a03f675e0a574db246) +- Use the object form of "author" in package.json [`65caa56`](https://github.com/inspect-js/which-typed-array/commit/65caa560d1c0c15c1080b25a9df55c7373c73f08) +- [Tests] use pretest/posttest for linting/security [`c170f7e`](https://github.com/inspect-js/which-typed-array/commit/c170f7ebcf07475d6420f2d2d2d08b1646280cd4) +- [Deps] update `is-typed-array` [`9ab324e`](https://github.com/inspect-js/which-typed-array/commit/9ab324e746a7552b2d9363777fc5c9f5c2e31ce7) +- [Deps] update `function-bind` [`a723142`](https://github.com/inspect-js/which-typed-array/commit/a723142c70a5b6a4f8f5feecc9705619590f4eeb) +- [Deps] update `is-typed-array` [`ed82ce4`](https://github.com/inspect-js/which-typed-array/commit/ed82ce4e8ecc657fc6e839d23ef6347497bc93be) +- [Tests] on `node` `v4.2` [`f581c20`](https://github.com/inspect-js/which-typed-array/commit/f581c2031990668894a8e5a08eaf01a2548e822c) + +## v1.0.0 - 2015-10-05 + +### Commits + +- Dotfiles / Makefile [`667f89a`](https://github.com/inspect-js/which-typed-array/commit/667f89a9046502594e2559dbf5568e062af3b770) +- Tests. [`a14d05e`](https://github.com/inspect-js/which-typed-array/commit/a14d05ef443d2ac678cb0567befc0abf8cf21709) +- package.json [`560b1aa`](https://github.com/inspect-js/which-typed-array/commit/560b1aa4f8bbc5d41d9cee96c93faf08c25be0e5) +- Read me [`a22096e`](https://github.com/inspect-js/which-typed-array/commit/a22096e05773f93b34e672d3f743ec6f1963bc24) +- Implementation [`0b1ae28`](https://github.com/inspect-js/which-typed-array/commit/0b1ae2848372f6256cf075d687e3722878e67aca) +- Initial commit [`4b32f0a`](https://github.com/inspect-js/which-typed-array/commit/4b32f0a9d32165d6ab91797d6971ea83cf4ce9da) diff --git a/tools/ui/node_modules/which-typed-array/LICENSE b/tools/ui/node_modules/which-typed-array/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..b43df444e518288ceef6eaa9badd33388191b1d3 --- /dev/null +++ b/tools/ui/node_modules/which-typed-array/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Jordan Harband + +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/which-typed-array/README.md b/tools/ui/node_modules/which-typed-array/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6427427ae0e09f654476591eca9157ff2d0b6978 --- /dev/null +++ b/tools/ui/node_modules/which-typed-array/README.md @@ -0,0 +1,70 @@ +# which-typed-array [![Version Badge][npm-version-svg]][package-url] + +[![github actions][actions-image]][actions-url] +[![coverage][codecov-image]][codecov-url] +[![dependency status][deps-svg]][deps-url] +[![dev dependency status][dev-deps-svg]][dev-deps-url] +[![License][license-image]][license-url] +[![Downloads][downloads-image]][downloads-url] + +[![npm badge][npm-badge-png]][package-url] + +Which kind of Typed Array is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag. + +## Example + +```js +var whichTypedArray = require('which-typed-array'); +var assert = require('assert'); + +assert.equal(false, whichTypedArray(undefined)); +assert.equal(false, whichTypedArray(null)); +assert.equal(false, whichTypedArray(false)); +assert.equal(false, whichTypedArray(true)); +assert.equal(false, whichTypedArray([])); +assert.equal(false, whichTypedArray({})); +assert.equal(false, whichTypedArray(/a/g)); +assert.equal(false, whichTypedArray(new RegExp('a', 'g'))); +assert.equal(false, whichTypedArray(new Date())); +assert.equal(false, whichTypedArray(42)); +assert.equal(false, whichTypedArray(NaN)); +assert.equal(false, whichTypedArray(Infinity)); +assert.equal(false, whichTypedArray(new Number(42))); +assert.equal(false, whichTypedArray('foo')); +assert.equal(false, whichTypedArray(Object('foo'))); +assert.equal(false, whichTypedArray(function () {})); +assert.equal(false, whichTypedArray(function* () {})); +assert.equal(false, whichTypedArray(x => x * x)); +assert.equal(false, whichTypedArray([])); + +assert.equal('Int8Array', whichTypedArray(new Int8Array())); +assert.equal('Uint8Array', whichTypedArray(new Uint8Array())); +assert.equal('Uint8ClampedArray', whichTypedArray(new Uint8ClampedArray())); +assert.equal('Int16Array', whichTypedArray(new Int16Array())); +assert.equal('Uint16Array', whichTypedArray(new Uint16Array())); +assert.equal('Int32Array', whichTypedArray(new Int32Array())); +assert.equal('Uint32Array', whichTypedArray(new Uint32Array())); +assert.equal('Float32Array', whichTypedArray(new Float32Array())); +assert.equal('Float64Array', whichTypedArray(new Float64Array())); +assert.equal('BigInt64Array', whichTypedArray(new BigInt64Array())); +assert.equal('BigUint64Array', whichTypedArray(new BigUint64Array())); +``` + +## Tests +Simply clone the repo, `npm install`, and run `npm test` + +[package-url]: https://npmjs.org/package/which-typed-array +[npm-version-svg]: https://versionbadg.es/inspect-js/which-typed-array.svg +[deps-svg]: https://david-dm.org/inspect-js/which-typed-array.svg +[deps-url]: https://david-dm.org/inspect-js/which-typed-array +[dev-deps-svg]: https://david-dm.org/inspect-js/which-typed-array/dev-status.svg +[dev-deps-url]: https://david-dm.org/inspect-js/which-typed-array#info=devDependencies +[npm-badge-png]: https://nodei.co/npm/which-typed-array.png?downloads=true&stars=true +[license-image]: https://img.shields.io/npm/l/which-typed-array.svg +[license-url]: LICENSE +[downloads-image]: https://img.shields.io/npm/dm/which-typed-array.svg +[downloads-url]: https://npm-stat.com/charts.html?package=which-typed-array +[codecov-image]: https://codecov.io/gh/inspect-js/which-typed-array/branch/main/graphs/badge.svg +[codecov-url]: https://app.codecov.io/gh/inspect-js/which-typed-array/ +[actions-image]: https://img.shields.io/github/check-runs/inspect-js/which-typed-array/main +[actions-url]: https://github.com/inspect-js/which-typed-array/actions diff --git a/tools/ui/node_modules/which-typed-array/eslint.config.mjs b/tools/ui/node_modules/which-typed-array/eslint.config.mjs new file mode 100644 index 0000000000000000000000000000000000000000..24006f27cfe22be80bd5826e7fec3d738ff4427a --- /dev/null +++ b/tools/ui/node_modules/which-typed-array/eslint.config.mjs @@ -0,0 +1,11 @@ +import ljharbConfig from '@ljharb/eslint-config/flat'; + +export default [ + ...ljharbConfig, + { + rules: { + 'max-statements-per-line': ['error', { max: 2 }], + 'no-extra-parens': 'off', + }, + }, +]; diff --git a/tools/ui/node_modules/which-typed-array/index.d.ts b/tools/ui/node_modules/which-typed-array/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..b1c190a1c66005e8acf2741644c827c10969a1d7 --- /dev/null +++ b/tools/ui/node_modules/which-typed-array/index.d.ts @@ -0,0 +1,44 @@ +/** + * Determines the type of the given collection, or returns false. + * + * @param {unknown} value The potential collection + * @returns {TypedArrayName | false | null} 'Int8Array' | 'Uint8Array' | 'Uint8ClampedArray' | 'Int16Array' | 'Uint16Array' | 'Int32Array' | 'Uint32Array' | 'Float32Array' | 'Float64Array' | 'BigInt64Array' | 'BigUint64Array' | false | null + */ +declare function whichTypedArray(value: Int8Array): 'Int8Array'; +declare function whichTypedArray(value: Uint8Array): 'Uint8Array'; +declare function whichTypedArray(value: Uint8ClampedArray): 'Uint8ClampedArray'; +declare function whichTypedArray(value: Int16Array): 'Int16Array'; +declare function whichTypedArray(value: Uint16Array): 'Uint16Array'; +declare function whichTypedArray(value: Int32Array): 'Int32Array'; +declare function whichTypedArray(value: Uint32Array): 'Uint32Array'; +declare function whichTypedArray(value: Float16Array): 'Float16Array'; +declare function whichTypedArray(value: Float32Array): 'Float32Array'; +declare function whichTypedArray(value: Float64Array): 'Float64Array'; +declare function whichTypedArray(value: Float16Array): 'Float16Array'; +declare function whichTypedArray(value: BigInt64Array): 'BigInt64Array'; +declare function whichTypedArray(value: BigUint64Array): 'BigUint64Array'; +declare function whichTypedArray(value: whichTypedArray.TypedArray): whichTypedArray.TypedArrayName; +declare function whichTypedArray(value: unknown): false | null; + +declare namespace whichTypedArray { + export type TypedArrayName = ReturnType[number]; + + export type TypedArray = + | Int8Array + | Uint8Array + | Uint8ClampedArray + | Int16Array + | Uint16Array + | Int32Array + | Uint32Array + | Float16Array + | Float32Array + | Float64Array + | Float16Array + | BigInt64Array + | BigUint64Array; + + export type TypedArrayConstructor = typeof globalThis[TypedArrayName]; +} + +export = whichTypedArray; diff --git a/tools/ui/node_modules/which-typed-array/index.js b/tools/ui/node_modules/which-typed-array/index.js new file mode 100644 index 0000000000000000000000000000000000000000..62245844e6b647ea2028a052dbdc9254bd00a0d1 --- /dev/null +++ b/tools/ui/node_modules/which-typed-array/index.js @@ -0,0 +1,122 @@ +'use strict'; + +var forEach = require('for-each'); +var availableTypedArrays = require('available-typed-arrays'); +var callBind = require('call-bind'); +var callBound = require('call-bound'); +var gOPD = require('gopd'); +var getProto = require('get-proto'); + +var $toString = callBound('Object.prototype.toString'); +var hasToStringTag = require('has-tostringtag/shams')(); + +var g = typeof globalThis === 'undefined' ? global : globalThis; +var typedArrays = availableTypedArrays(); + +var $slice = callBound('String.prototype.slice'); + +/** @type {(array: readonly T[], value: unknown) => number} */ +var $indexOf = callBound('Array.prototype.indexOf', true) || function indexOf(array, value) { + for (var i = 0; i < array.length; i += 1) { + if (array[i] === value) { + return i; + } + } + return -1; +}; + +/** @typedef {import('./types').Getter} Getter */ +/** @type {import('./types').Cache} */ +var cache = { __proto__: null }; +if (hasToStringTag && gOPD && getProto) { + forEach(typedArrays, function (typedArray) { + var arr = new g[typedArray](); + if (Symbol.toStringTag in arr && getProto) { + var proto = getProto(arr); + // @ts-expect-error TS won't narrow inside a closure + var descriptor = gOPD(proto, Symbol.toStringTag); + if (!descriptor && proto) { + var superProto = getProto(proto); + // @ts-expect-error TS won't narrow inside a closure + descriptor = gOPD(superProto, Symbol.toStringTag); + } + if (descriptor && descriptor.get) { + var bound = callBind(descriptor.get); + cache[ + /** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray) + ] = bound; + } + } + }); +} else { + forEach(typedArrays, function (typedArray) { + var arr = new g[typedArray](); + var fn = arr.slice || arr.set; + if (fn) { + var bound = /** @type {import('./types').BoundSlice | import('./types').BoundSet} */ ( + // @ts-expect-error TODO FIXME + callBind(fn) + ); + cache[ + /** @type {`$${import('.').TypedArrayName}`} */ ('$' + typedArray) + ] = bound; + } + }); +} + +/** @type {(value: object) => false | import('.').TypedArrayName} */ +var tryTypedArrays = function tryAllTypedArrays(value) { + /** @type {ReturnType} */ var found = false; + forEach( + /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */ (cache), + /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ + function (getter, typedArray) { + if (!found) { + try { + // @ts-expect-error a throw is fine here + if ('$' + getter(value) === typedArray) { + found = /** @type {import('.').TypedArrayName} */ ($slice(typedArray, 1)); + } + } catch (e) { /**/ } + } + } + ); + return found; +}; + +/** @type {(value: object) => false | import('.').TypedArrayName} */ +var trySlices = function tryAllSlices(value) { + /** @type {ReturnType} */ var found = false; + forEach( + /** @type {Record<`\$${import('.').TypedArrayName}`, Getter>} */(cache), + /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */ function (getter, name) { + if (!found) { + try { + // @ts-expect-error a throw is fine here + getter(value); + found = /** @type {import('.').TypedArrayName} */ ($slice(name, 1)); + } catch (e) { /**/ } + } + } + ); + return found; +}; + +/** @type {import('.')} */ +module.exports = function whichTypedArray(value) { + if (!value || typeof value !== 'object') { return false; } + if (!hasToStringTag) { + /** @type {string} */ + var tag = $slice($toString(value), 8, -1); + if ($indexOf(typedArrays, tag) > -1) { + return tag; + } + if (tag !== 'Object') { + return false; + } + // node < 0.6 hits here on real Typed Arrays + return trySlices(value); + } + if (!gOPD) { return null; } // unknown engine + return tryTypedArrays(value); +}; diff --git a/tools/ui/node_modules/which-typed-array/package.json b/tools/ui/node_modules/which-typed-array/package.json new file mode 100644 index 0000000000000000000000000000000000000000..ef7062433866fa0fc6fbee19b63062206ffe6d2e --- /dev/null +++ b/tools/ui/node_modules/which-typed-array/package.json @@ -0,0 +1,133 @@ +{ + "name": "which-typed-array", + "version": "1.1.21", + "author": { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + }, + "contributors": [ + { + "name": "Jordan Harband", + "email": "ljharb@gmail.com", + "url": "http://ljharb.codes" + } + ], + "description": "Which kind of Typed Array is this JavaScript value? Works cross-realm, without `instanceof`, and despite Symbol.toStringTag.", + "license": "MIT", + "main": "index.js", + "types": "./index.d.ts", + "sideEffects": false, + "scripts": { + "prepack": "npmignore --auto --commentLines=autogenerated", + "prepublishOnly": "safe-publish-latest", + "prepublish": "not-in-publish || npm run prepublishOnly", + "pretest": "npm run --silent lint", + "test": "npm run tests-only && npm run test:harmony", + "tests-only": "nyc tape test", + "test:harmony": "nyc node --harmony --es-staging test", + "posttest": "npx npm@'>=10.2' audit --production", + "lint": "eslint .", + "postlint": "tsc -p . && attw -P", + "version": "auto-changelog && git add CHANGELOG.md", + "postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\"" + }, + "repository": { + "type": "git", + "url": "git://github.com/inspect-js/which-typed-array.git" + }, + "keywords": [ + "array", + "TypedArray", + "typed array", + "which", + "typed", + "Int8Array", + "Uint8Array", + "Uint8ClampedArray", + "Int16Array", + "Uint16Array", + "Int32Array", + "Uint32Array", + "Float32Array", + "Float64Array", + "ES6", + "toStringTag", + "Symbol.toStringTag", + "@@toStringTag" + ], + "dependencies": { + "available-typed-arrays": "^1.0.7", + "call-bind": "^1.0.9", + "call-bound": "^1.0.4", + "for-each": "^0.3.5", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-tostringtag": "^1.0.2" + }, + "devDependencies": { + "@arethetypeswrong/cli": "^0.18.2", + "@ljharb/eslint-config": "^22.2.3", + "@ljharb/tsconfig": "^0.3.2", + "@types/call-bind": "^1.0.5", + "@types/for-each": "^0.3.3", + "@types/gopd": "^1.0.3", + "@types/is-callable": "^1.1.2", + "@types/make-arrow-function": "^1.2.2", + "@types/make-generator-function": "^2.0.3", + "@types/tape": "^5.8.1", + "auto-changelog": "^2.5.1", + "eslint": "^10.4.0", + "in-publish": "^2.0.1", + "is-callable": "^1.2.7", + "jiti": "^0.0.0", + "make-arrow-function": "^1.2.0", + "make-generator-function": "^2.1.0", + "npmignore": "^0.3.5", + "nyc": "^10.3.2", + "safe-publish-latest": "^2.0.0", + "tape": "^5.9.0", + "typescript": "next" + }, + "testling": { + "files": "test/index.js", + "browsers": [ + "iexplore/6.0..latest", + "firefox/3.0..6.0", + "firefox/15.0..latest", + "firefox/nightly", + "chrome/4.0..10.0", + "chrome/20.0..latest", + "chrome/canary", + "opera/10.0..latest", + "opera/next", + "safari/4.0..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2" + ] + }, + "engines": { + "node": ">= 0.4" + }, + "auto-changelog": { + "output": "CHANGELOG.md", + "template": "keepachangelog", + "unreleased": false, + "commitLimit": false, + "backfillLimit": false, + "hideCredit": true + }, + "publishConfig": { + "ignore": [ + ".github/workflows", + "types.d.ts" + ] + }, + "overrides": { + "fflate": "=0.8.2" + } +} diff --git a/tools/ui/node_modules/which-typed-array/test/index.js b/tools/ui/node_modules/which-typed-array/test/index.js new file mode 100644 index 0000000000000000000000000000000000000000..d79453ada7fe789cbeb3394721c2d60e019a6921 --- /dev/null +++ b/tools/ui/node_modules/which-typed-array/test/index.js @@ -0,0 +1,105 @@ +'use strict'; + +var test = require('tape'); +var whichTypedArray = require('../'); +var isCallable = require('is-callable'); +var hasToStringTag = require('has-tostringtag/shams')(); +var generators = require('make-generator-function')(); +var arrows = require('make-arrow-function').list(); +var forEach = require('for-each'); + +var typedArrayNames = [ + 'Int8Array', + 'Uint8Array', + 'Uint8ClampedArray', + 'Int16Array', + 'Uint16Array', + 'Int32Array', + 'Uint32Array', + 'Float32Array', + 'Float64Array', + 'BigInt64Array', + 'BigUint64Array' +]; + +test('not arrays', function (t) { + t.test('non-number/string primitives', function (st) { + // @ts-expect-error + st.equal(false, whichTypedArray(), 'undefined is not typed array'); + st.equal(false, whichTypedArray(null), 'null is not typed array'); + st.equal(false, whichTypedArray(false), 'false is not typed array'); + st.equal(false, whichTypedArray(true), 'true is not typed array'); + st.end(); + }); + + t.equal(false, whichTypedArray({}), 'object is not typed array'); + t.equal(false, whichTypedArray(/a/g), 'regex literal is not typed array'); + t.equal(false, whichTypedArray(new RegExp('a', 'g')), 'regex object is not typed array'); + t.equal(false, whichTypedArray(new Date()), 'new Date() is not typed array'); + + t.test('numbers', function (st) { + st.equal(false, whichTypedArray(42), 'number is not typed array'); + st.equal(false, whichTypedArray(Object(42)), 'number object is not typed array'); + st.equal(false, whichTypedArray(NaN), 'NaN is not typed array'); + st.equal(false, whichTypedArray(Infinity), 'Infinity is not typed array'); + st.end(); + }); + + t.test('strings', function (st) { + st.equal(false, whichTypedArray('foo'), 'string primitive is not typed array'); + st.equal(false, whichTypedArray(Object('foo')), 'string object is not typed array'); + st.end(); + }); + + t.end(); +}); + +test('Functions', function (t) { + t.equal(false, whichTypedArray(function () {}), 'function is not typed array'); + t.end(); +}); + +test('Generators', { skip: generators.length === 0 }, function (t) { + forEach(generators, function (genFn) { + t.equal(false, whichTypedArray(genFn), 'generator function ' + genFn + ' is not typed array'); + }); + t.end(); +}); + +test('Arrow functions', { skip: arrows.length === 0 }, function (t) { + forEach(arrows, function (arrowFn) { + t.equal(false, whichTypedArray(arrowFn), 'arrow function ' + arrowFn + ' is not typed array'); + }); + t.end(); +}); + +test('@@toStringTag', { skip: !hasToStringTag }, function (t) { + forEach(typedArrayNames, function (typedArray) { + // @ts-expect-error TODO: fix + if (typeof global[typedArray] === 'function') { + // @ts-expect-error TODO: fix + var fakeTypedArray = []; + // @ts-expect-error TODO: fix + fakeTypedArray[Symbol.toStringTag] = typedArray; + // @ts-expect-error TODO: fix + t.equal(false, whichTypedArray(fakeTypedArray), 'faked ' + typedArray + ' is not typed array'); + } else { + t.comment('# SKIP ' + typedArray + ' is not supported'); + } + }); + t.end(); +}); + +test('Typed Arrays', function (t) { + forEach(typedArrayNames, function (typedArray) { + // @ts-expect-error TODO: fix + /** @type {import('../').TypedArrayConstructor} */ var TypedArray = global[typedArray]; + if (isCallable(TypedArray)) { + var arr = new TypedArray(10); + t.equal(whichTypedArray(arr), typedArray, 'new ' + typedArray + '(10) is typed array of type ' + typedArray); + } else { + t.comment('# SKIP ' + typedArray + ' is not supported'); + } + }); + t.end(); +}); diff --git a/tools/ui/node_modules/which-typed-array/tsconfig.json b/tools/ui/node_modules/which-typed-array/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..dcdc3b08a0641833b97c9edd0cde68b791dae3b5 --- /dev/null +++ b/tools/ui/node_modules/which-typed-array/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "@ljharb/tsconfig", + "compilerOptions": { + "target": "ESNext", + }, + "exclude": [ + "coverage" + ] +} diff --git a/tools/ui/node_modules/which/CHANGELOG.md b/tools/ui/node_modules/which/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..7fb1f2033c8dcf5d7ac89ee1f77ef0be979cfb26 --- /dev/null +++ b/tools/ui/node_modules/which/CHANGELOG.md @@ -0,0 +1,166 @@ +# Changes + + +## 2.0.2 + +* Rename bin to `node-which` + +## 2.0.1 + +* generate changelog and publish on version bump +* enforce 100% test coverage +* Promise interface + +## 2.0.0 + +* Parallel tests, modern JavaScript, and drop support for node < 8 + +## 1.3.1 + +* update deps +* update travis + +## v1.3.0 + +* Add nothrow option to which.sync +* update tap + +## v1.2.14 + +* appveyor: drop node 5 and 0.x +* travis-ci: add node 6, drop 0.x + +## v1.2.13 + +* test: Pass missing option to pass on windows +* update tap +* update isexe to 2.0.0 +* neveragain.tech pledge request + +## v1.2.12 + +* Removed unused require + +## v1.2.11 + +* Prevent changelog script from being included in package + +## v1.2.10 + +* Use env.PATH only, not env.Path + +## v1.2.9 + +* fix for paths starting with ../ +* Remove unused `is-absolute` module + +## v1.2.8 + +* bullet items in changelog that contain (but don't start with) # + +## v1.2.7 + +* strip 'update changelog' changelog entries out of changelog + +## v1.2.6 + +* make the changelog bulleted + +## v1.2.5 + +* make a changelog, and keep it up to date +* don't include tests in package +* Properly handle relative-path executables +* appveyor +* Attach error code to Not Found error +* Make tests pass on Windows + +## v1.2.4 + +* Fix typo + +## v1.2.3 + +* update isexe, fix regression in pathExt handling + +## v1.2.2 + +* update deps, use isexe module, test windows + +## v1.2.1 + +* Sometimes windows PATH entries are quoted +* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode. +* doc cli + +## v1.2.0 + +* Add support for opt.all and -as cli flags +* test the bin +* update travis +* Allow checking for multiple programs in bin/which +* tap 2 + +## v1.1.2 + +* travis +* Refactored and fixed undefined error on Windows +* Support strict mode + +## v1.1.1 + +* test +g exes against secondary groups, if available +* Use windows exe semantics on cygwin & msys +* cwd should be first in path on win32, not last +* Handle lower-case 'env.Path' on Windows +* Update docs +* use single-quotes + +## v1.1.0 + +* Add tests, depend on is-absolute + +## v1.0.9 + +* which.js: root is allowed to execute files owned by anyone + +## v1.0.8 + +* don't use graceful-fs + +## v1.0.7 + +* add license to package.json + +## v1.0.6 + +* isc license + +## 1.0.5 + +* Awful typo + +## 1.0.4 + +* Test for path absoluteness properly +* win: Allow '' as a pathext if cmd has a . in it + +## 1.0.3 + +* Remove references to execPath +* Make `which.sync()` work on Windows by honoring the PATHEXT variable. +* Make `isExe()` always return true on Windows. +* MIT + +## 1.0.2 + +* Only files can be exes + +## 1.0.1 + +* Respect the PATHEXT env for win32 support +* should 0755 the bin +* binary +* guts +* package +* 1st diff --git a/tools/ui/node_modules/which/LICENSE b/tools/ui/node_modules/which/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..19129e315fe593965a2fdd50ec0d1253bcbd2ece --- /dev/null +++ b/tools/ui/node_modules/which/LICENSE @@ -0,0 +1,15 @@ +The ISC License + +Copyright (c) Isaac Z. Schlueter and Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/tools/ui/node_modules/which/README.md b/tools/ui/node_modules/which/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cd833509f3bcc971ef2e4ddcdfdd9a26d5accfb8 --- /dev/null +++ b/tools/ui/node_modules/which/README.md @@ -0,0 +1,54 @@ +# which + +Like the unix `which` utility. + +Finds the first instance of a specified executable in the PATH +environment variable. Does not cache the results, so `hash -r` is not +needed when the PATH changes. + +## USAGE + +```javascript +var which = require('which') + +// async usage +which('node', function (er, resolvedPath) { + // er is returned if no "node" is found on the PATH + // if it is found, then the absolute path to the exec is returned +}) + +// or promise +which('node').then(resolvedPath => { ... }).catch(er => { ... not found ... }) + +// sync usage +// throws if not found +var resolved = which.sync('node') + +// if nothrow option is used, returns null if not found +resolved = which.sync('node', {nothrow: true}) + +// Pass options to override the PATH and PATHEXT environment vars. +which('node', { path: someOtherPath }, function (er, resolved) { + if (er) + throw er + console.log('found at %j', resolved) +}) +``` + +## CLI USAGE + +Same as the BSD `which(1)` binary. + +``` +usage: which [-as] program ... +``` + +## OPTIONS + +You may pass an options object as the second argument. + +- `path`: Use instead of the `PATH` environment variable. +- `pathExt`: Use instead of the `PATHEXT` environment variable. +- `all`: Return all matches, instead of just the first one. Note that + this means the function returns an array of strings instead of a + single string. diff --git a/tools/ui/node_modules/which/bin/node-which b/tools/ui/node_modules/which/bin/node-which new file mode 100644 index 0000000000000000000000000000000000000000..7cee3729eebdd09e39bd891aa4d17483ea4a757a --- /dev/null +++ b/tools/ui/node_modules/which/bin/node-which @@ -0,0 +1,52 @@ +#!/usr/bin/env node +var which = require("../") +if (process.argv.length < 3) + usage() + +function usage () { + console.error('usage: which [-as] program ...') + process.exit(1) +} + +var all = false +var silent = false +var dashdash = false +var args = process.argv.slice(2).filter(function (arg) { + if (dashdash || !/^-/.test(arg)) + return true + + if (arg === '--') { + dashdash = true + return false + } + + var flags = arg.substr(1).split('') + for (var f = 0; f < flags.length; f++) { + var flag = flags[f] + switch (flag) { + case 's': + silent = true + break + case 'a': + all = true + break + default: + console.error('which: illegal option -- ' + flag) + usage() + } + } + return false +}) + +process.exit(args.reduce(function (pv, current) { + try { + var f = which.sync(current, { all: all }) + if (all) + f = f.join('\n') + if (!silent) + console.log(f) + return pv; + } catch (e) { + return 1; + } +}, 0)) diff --git a/tools/ui/node_modules/which/package.json b/tools/ui/node_modules/which/package.json new file mode 100644 index 0000000000000000000000000000000000000000..97ad7fbabc52b54b1d9c4c50236c3a81d78218a7 --- /dev/null +++ b/tools/ui/node_modules/which/package.json @@ -0,0 +1,43 @@ +{ + "author": "Isaac Z. Schlueter (http://blog.izs.me)", + "name": "which", + "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.", + "version": "2.0.2", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/node-which.git" + }, + "main": "which.js", + "bin": { + "node-which": "./bin/node-which" + }, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "devDependencies": { + "mkdirp": "^0.5.0", + "rimraf": "^2.6.2", + "tap": "^14.6.9" + }, + "scripts": { + "test": "tap", + "preversion": "npm test", + "postversion": "npm publish", + "prepublish": "npm run changelog", + "prechangelog": "bash gen-changelog.sh", + "changelog": "git add CHANGELOG.md", + "postchangelog": "git commit -m 'update changelog - '${npm_package_version}", + "postpublish": "git push origin --follow-tags" + }, + "files": [ + "which.js", + "bin/node-which" + ], + "tap": { + "check-coverage": true + }, + "engines": { + "node": ">= 8" + } +} diff --git a/tools/ui/node_modules/which/which.js b/tools/ui/node_modules/which/which.js new file mode 100644 index 0000000000000000000000000000000000000000..82afffd21437498a02aaaa1c03be7ea9178b2c48 --- /dev/null +++ b/tools/ui/node_modules/which/which.js @@ -0,0 +1,125 @@ +const isWindows = process.platform === 'win32' || + process.env.OSTYPE === 'cygwin' || + process.env.OSTYPE === 'msys' + +const path = require('path') +const COLON = isWindows ? ';' : ':' +const isexe = require('isexe') + +const getNotFoundError = (cmd) => + Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' }) + +const getPathInfo = (cmd, opt) => { + const colon = opt.colon || COLON + + // If it has a slash, then we don't bother searching the pathenv. + // just check the file itself, and that's it. + const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? [''] + : ( + [ + // windows always checks the cwd first + ...(isWindows ? [process.cwd()] : []), + ...(opt.path || process.env.PATH || + /* istanbul ignore next: very unusual */ '').split(colon), + ] + ) + const pathExtExe = isWindows + ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM' + : '' + const pathExt = isWindows ? pathExtExe.split(colon) : [''] + + if (isWindows) { + if (cmd.indexOf('.') !== -1 && pathExt[0] !== '') + pathExt.unshift('') + } + + return { + pathEnv, + pathExt, + pathExtExe, + } +} + +const which = (cmd, opt, cb) => { + if (typeof opt === 'function') { + cb = opt + opt = {} + } + if (!opt) + opt = {} + + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + const step = i => new Promise((resolve, reject) => { + if (i === pathEnv.length) + return opt.all && found.length ? resolve(found) + : reject(getNotFoundError(cmd)) + + const ppRaw = pathEnv[i] + const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw + + const pCmd = path.join(pathPart, cmd) + const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd + : pCmd + + resolve(subStep(p, i, 0)) + }) + + const subStep = (p, i, ii) => new Promise((resolve, reject) => { + if (ii === pathExt.length) + return resolve(step(i + 1)) + const ext = pathExt[ii] + isexe(p + ext, { pathExt: pathExtExe }, (er, is) => { + if (!er && is) { + if (opt.all) + found.push(p + ext) + else + return resolve(p + ext) + } + return resolve(subStep(p, i, ii + 1)) + }) + }) + + return cb ? step(0).then(res => cb(null, res), cb) : step(0) +} + +const whichSync = (cmd, opt) => { + opt = opt || {} + + const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt) + const found = [] + + for (let i = 0; i < pathEnv.length; i ++) { + const ppRaw = pathEnv[i] + const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw + + const pCmd = path.join(pathPart, cmd) + const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd + : pCmd + + for (let j = 0; j < pathExt.length; j ++) { + const cur = p + pathExt[j] + try { + const is = isexe.sync(cur, { pathExt: pathExtExe }) + if (is) { + if (opt.all) + found.push(cur) + else + return cur + } + } catch (ex) {} + } + } + + if (opt.all && found.length) + return found + + if (opt.nothrow) + return null + + throw getNotFoundError(cmd) +} + +module.exports = which +which.sync = whichSync diff --git a/tools/ui/node_modules/why-is-node-running/.github/FUNDING.yml b/tools/ui/node_modules/why-is-node-running/.github/FUNDING.yml new file mode 100644 index 0000000000000000000000000000000000000000..90f7f20b1ac27ec9cbe89779fd8d6ec40e2f2ce3 --- /dev/null +++ b/tools/ui/node_modules/why-is-node-running/.github/FUNDING.yml @@ -0,0 +1 @@ +github: mafintosh diff --git a/tools/ui/node_modules/why-is-node-running/LICENSE b/tools/ui/node_modules/why-is-node-running/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..bae9da7bfae2b5e22cfb0945b362b23ca822c8bb --- /dev/null +++ b/tools/ui/node_modules/why-is-node-running/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Mathias Buus + +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/why-is-node-running/README.md b/tools/ui/node_modules/why-is-node-running/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d5e4c5457400d4993ae18835f1ab57edcd86ba22 --- /dev/null +++ b/tools/ui/node_modules/why-is-node-running/README.md @@ -0,0 +1,104 @@ +# why-is-node-running + +Node is running but you don't know why? `why-is-node-running` is here to help you. + +## Installation + +Node 8 and above: + +```bash +npm i why-is-node-running -g +``` + +Earlier Node versions (no longer supported): + +```bash +npm i why-is-node-running@v1.x -g +``` + +## Usage + +```js +const log = require('why-is-node-running') // should be your first require +const net = require('net') + +function createServer () { + const server = net.createServer() + setInterval(function () {}, 1000) + server.listen(0) +} + +createServer() +createServer() + +setTimeout(function () { + log() // logs out active handles that are keeping node running +}, 100) +``` + +Save the file as `example.js`, then execute: + +```bash +node ./example.js +``` + +Here's the output: + +``` +There are 5 handle(s) keeping the process running + +# Timeout +/home/maf/dev/node_modules/why-is-node-running/example.js:6 - setInterval(function () {}, 1000) +/home/maf/dev/node_modules/why-is-node-running/example.js:10 - createServer() + +# TCPSERVERWRAP +/home/maf/dev/node_modules/why-is-node-running/example.js:7 - server.listen(0) +/home/maf/dev/node_modules/why-is-node-running/example.js:10 - createServer() + +# Timeout +/home/maf/dev/node_modules/why-is-node-running/example.js:6 - setInterval(function () {}, 1000) +/home/maf/dev/node_modules/why-is-node-running/example.js:11 - createServer() + +# TCPSERVERWRAP +/home/maf/dev/node_modules/why-is-node-running/example.js:7 - server.listen(0) +/home/maf/dev/node_modules/why-is-node-running/example.js:11 - createServer() + +# Timeout +/home/maf/dev/node_modules/why-is-node-running/example.js:13 - setTimeout(function () { +``` + +**Important Note!** +`unref`ed timers do not prevent the Node process from exiting. If you are running with Node v11.0.0 and above, `unref`ed timers will not be listed in the above list. Unfortunately, this is not supported in node versions below v11.0.0. + +## CLI + +You can also run `why-is-node-running` as a standalone if you don't want to include it inside your code. Sending `SIGUSR1`/`SIGINFO` signal to the process will produce the log. (`Ctrl + T` on macOS and BSD systems) + +```bash +why-is-node-running /path/to/some/file.js +``` + +``` +probing module /path/to/some/file.js +kill -SIGUSR1 31115 for logging +``` + +To trigger the log: + +``` +kill -SIGUSR1 31115 +``` + +## Require CLI Option + +You can also use the node `-r` option to include `why-is-node-running`: + +```bash +node -r why-is-node-running/include /path/to/some/file.js +``` + +The steps are otherwise the same as the above CLI section + +## License + +MIT diff --git a/tools/ui/node_modules/why-is-node-running/cli.js b/tools/ui/node_modules/why-is-node-running/cli.js new file mode 100644 index 0000000000000000000000000000000000000000..15cf2b9147ab2cb4c36afdc1ff50604e32cd593a --- /dev/null +++ b/tools/ui/node_modules/why-is-node-running/cli.js @@ -0,0 +1,18 @@ +#!/usr/bin/env node + +var spawn = require('child_process').spawn +var path = require('path') + +var prog = path.resolve(process.argv[2]) +var progArgs = process.argv.slice(3) + +console.log('probing program', prog) + +var nodeArgs = [ + '-r', + path.join(__dirname, 'include.js') +] +var nodeOpts = { stdio: 'inherit' } +var child = spawn('node', nodeArgs.concat(prog).concat(progArgs), nodeOpts) + +console.log('kill -SIGUSR1', child.pid, 'for logging') diff --git a/tools/ui/node_modules/why-is-node-running/example.js b/tools/ui/node_modules/why-is-node-running/example.js new file mode 100644 index 0000000000000000000000000000000000000000..4584d4b778a1c6be4fcf8ab8cc7877f3aa4b1d30 --- /dev/null +++ b/tools/ui/node_modules/why-is-node-running/example.js @@ -0,0 +1,15 @@ +var log = require('./') +var net = require('net') + +function createServer () { + var server = net.createServer() + setInterval(function () {}, 1000) + server.listen(0) +} + +createServer() +createServer() + +setTimeout(function () { + log() +}, 100) diff --git a/tools/ui/node_modules/why-is-node-running/include.js b/tools/ui/node_modules/why-is-node-running/include.js new file mode 100644 index 0000000000000000000000000000000000000000..c7ffe28cb6df140083f47c54abe6ad99dc9f3b4e --- /dev/null +++ b/tools/ui/node_modules/why-is-node-running/include.js @@ -0,0 +1,3 @@ +var why = require('./') + +require('siginfo')(why, true) diff --git a/tools/ui/node_modules/why-is-node-running/index.js b/tools/ui/node_modules/why-is-node-running/index.js new file mode 100644 index 0000000000000000000000000000000000000000..70842c5609e949492271e3cbd27aacf4991f3561 --- /dev/null +++ b/tools/ui/node_modules/why-is-node-running/index.js @@ -0,0 +1,67 @@ +var asyncHooks = require('async_hooks') +var stackback = require('stackback') +var path = require('path') +var fs = require('fs') +var sep = path.sep + +var active = new Map() +var hook = asyncHooks.createHook({ + init (asyncId, type, triggerAsyncId, resource) { + if (type === 'TIMERWRAP' || type === 'PROMISE') return + if (type === 'PerformanceObserver' || type === 'RANDOMBYTESREQUEST') return + var err = new Error('whatevs') + var stacks = stackback(err) + active.set(asyncId, {type, stacks, resource}) + }, + destroy (asyncId) { + active.delete(asyncId) + } +}) + +hook.enable() +module.exports = whyIsNodeRunning + +function whyIsNodeRunning (logger) { + if (!logger) logger = console + + hook.disable() + var activeResources = [...active.values()].filter(function(r) { + if ( + typeof r.resource.hasRef === 'function' + && !r.resource.hasRef() + ) return false + return true + }) + + logger.error('There are %d handle(s) keeping the process running', activeResources.length) + for (const o of activeResources) printStacks(o) + + function printStacks (o) { + var stacks = o.stacks.slice(1).filter(function (s) { + var filename = s.getFileName() + return filename && filename.indexOf(sep) > -1 && filename.indexOf('internal' + sep) !== 0 && filename.indexOf('node:internal' + sep) !== 0 + }) + + logger.error('') + logger.error('# %s', o.type) + + if (!stacks[0]) { + logger.error('(unknown stack trace)') + } else { + var padding = '' + stacks.forEach(function (s) { + var pad = (s.getFileName() + ':' + s.getLineNumber()).replace(/./g, ' ') + if (pad.length > padding.length) padding = pad + }) + stacks.forEach(function (s) { + var prefix = s.getFileName() + ':' + s.getLineNumber() + try { + var src = fs.readFileSync(s.getFileName(), 'utf-8').split(/\n|\r\n/) + logger.error(prefix + padding.slice(prefix.length) + ' - ' + src[s.getLineNumber() - 1].trim()) + } catch (e) { + logger.error(prefix + padding.slice(prefix.length)) + } + }) + } + } +} diff --git a/tools/ui/node_modules/why-is-node-running/package.json b/tools/ui/node_modules/why-is-node-running/package.json new file mode 100644 index 0000000000000000000000000000000000000000..9bf6a6d651e47b7f3d843f306ebb3aa1deb9c712 --- /dev/null +++ b/tools/ui/node_modules/why-is-node-running/package.json @@ -0,0 +1,39 @@ +{ + "name": "why-is-node-running", + "version": "2.3.0", + "description": "Node is running but you don't know why? why-is-node-running is here to help you.", + "main": "index.js", + "dependencies": { + "siginfo": "^2.0.0", + "stackback": "0.0.2" + }, + "bin": { + "why-is-node-running": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "repository": { + "type": "git", + "url": "https://github.com/mafintosh/why-is-node-running.git" + }, + "keywords": [ + "debug", + "devops", + "test", + "events", + "handles" + ], + "author": "Mathias Buus (@mafintosh)", + "contributors": [ + { + "name": "Jon Peck", + "email": "jpeck@fluxsauce.com" + } + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/mafintosh/why-is-node-running/issues" + }, + "homepage": "https://github.com/mafintosh/why-is-node-running" +} diff --git a/tools/ui/node_modules/word-wrap/LICENSE b/tools/ui/node_modules/word-wrap/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..842218cf09a20282e926305e01162174ab371a52 --- /dev/null +++ b/tools/ui/node_modules/word-wrap/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2016, Jon Schlinkert + +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/word-wrap/README.md b/tools/ui/node_modules/word-wrap/README.md new file mode 100644 index 0000000000000000000000000000000000000000..330595383205a5fe404b6501baf8761835c45a09 --- /dev/null +++ b/tools/ui/node_modules/word-wrap/README.md @@ -0,0 +1,201 @@ +# word-wrap [![NPM version](https://img.shields.io/npm/v/word-wrap.svg?style=flat)](https://www.npmjs.com/package/word-wrap) [![NPM monthly downloads](https://img.shields.io/npm/dm/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![NPM total downloads](https://img.shields.io/npm/dt/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/word-wrap.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/word-wrap) + +> Wrap words to a specified length. + +Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support. + +## Install + +Install with [npm](https://www.npmjs.com/): + +```sh +$ npm install --save word-wrap +``` + +## Usage + +```js +var wrap = require('word-wrap'); + +wrap('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.'); +``` + +Results in: + +``` + Lorem ipsum dolor sit amet, consectetur adipiscing + elit, sed do eiusmod tempor incididunt ut labore + et dolore magna aliqua. Ut enim ad minim veniam, + quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. +``` + +## Options + +![image](https://cloud.githubusercontent.com/assets/383994/6543728/7a381c08-c4f6-11e4-8b7d-b6ba197569c9.png) + +### options.width + +Type: `Number` + +Default: `50` + +The width of the text before wrapping to a new line. + +**Example:** + +```js +wrap(str, {width: 60}); +``` + +### options.indent + +Type: `String` + +Default: `` (two spaces) + +The string to use at the beginning of each line. + +**Example:** + +```js +wrap(str, {indent: ' '}); +``` + +### options.newline + +Type: `String` + +Default: `\n` + +The string to use at the end of each line. + +**Example:** + +```js +wrap(str, {newline: '\n\n'}); +``` + +### options.escape + +Type: `function` + +Default: `function(str){return str;}` + +An escape function to run on each line after splitting them. + +**Example:** + +```js +var xmlescape = require('xml-escape'); +wrap(str, { + escape: function(string){ + return xmlescape(string); + } +}); +``` + +### options.trim + +Type: `Boolean` + +Default: `false` + +Trim trailing whitespace from the returned string. This option is included since `.trim()` would also strip the leading indentation from the first line. + +**Example:** + +```js +wrap(str, {trim: true}); +``` + +### options.cut + +Type: `Boolean` + +Default: `false` + +Break a word between any two letters when the word is longer than the specified width. + +**Example:** + +```js +wrap(str, {cut: true}); +``` + +## About + +
+Contributing + +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). + +
+ +
+Running Tests + +Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command: + +```sh +$ npm install && npm test +``` + +
+ +
+Building docs + +_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_ + +To generate the readme, run the following command: + +```sh +$ npm install -g verbose/verb#dev verb-generate-readme && verb +``` + +
+ +### Related projects + +You might also be interested in these projects: + +* [common-words](https://www.npmjs.com/package/common-words): Updated list (JSON) of the 100 most common words in the English language. Useful for… [more](https://github.com/jonschlinkert/common-words) | [homepage](https://github.com/jonschlinkert/common-words "Updated list (JSON) of the 100 most common words in the English language. Useful for excluding these words from arrays.") +* [shuffle-words](https://www.npmjs.com/package/shuffle-words): Shuffle the words in a string and optionally the letters in each word using the… [more](https://github.com/jonschlinkert/shuffle-words) | [homepage](https://github.com/jonschlinkert/shuffle-words "Shuffle the words in a string and optionally the letters in each word using the Fisher-Yates algorithm. Useful for creating test fixtures, benchmarking samples, etc.") +* [unique-words](https://www.npmjs.com/package/unique-words): Returns an array of unique words, or the number of occurrences of each word in… [more](https://github.com/jonschlinkert/unique-words) | [homepage](https://github.com/jonschlinkert/unique-words "Returns an array of unique words, or the number of occurrences of each word in a string or list.") +* [wordcount](https://www.npmjs.com/package/wordcount): Count the words in a string. Support for english, CJK and Cyrillic. | [homepage](https://github.com/jonschlinkert/wordcount "Count the words in a string. Support for english, CJK and Cyrillic.") + +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 47 | [jonschlinkert](https://github.com/jonschlinkert) | +| 7 | [OlafConijn](https://github.com/OlafConijn) | +| 3 | [doowb](https://github.com/doowb) | +| 2 | [aashutoshrathi](https://github.com/aashutoshrathi) | +| 2 | [lordvlad](https://github.com/lordvlad) | +| 2 | [hildjj](https://github.com/hildjj) | +| 1 | [danilosampaio](https://github.com/danilosampaio) | +| 1 | [2fd](https://github.com/2fd) | +| 1 | [leonard-thieu](https://github.com/leonard-thieu) | +| 1 | [mohd-akram](https://github.com/mohd-akram) | +| 1 | [toddself](https://github.com/toddself) | +| 1 | [wolfgang42](https://github.com/wolfgang42) | +| 1 | [zachhale](https://github.com/zachhale) | + +### Author + +**Jon Schlinkert** + +* [GitHub Profile](https://github.com/jonschlinkert) +* [Twitter Profile](https://twitter.com/jonschlinkert) +* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert) + +### License + +Copyright © 2023, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). + +*** + +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 22, 2023._ \ No newline at end of file diff --git a/tools/ui/node_modules/word-wrap/index.d.ts b/tools/ui/node_modules/word-wrap/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..07e06f81672c4db9070a71ffb211d69af5459951 --- /dev/null +++ b/tools/ui/node_modules/word-wrap/index.d.ts @@ -0,0 +1,50 @@ +/** + * Wrap words to a specified length. + */ +export = wrap; + +declare function wrap(str: string, options?: wrap.IOptions): string; + +declare namespace wrap { + export interface IOptions { + + /** + * The width of the text before wrapping to a new line. + * @default ´50´ + */ + width?: number; + + /** + * The string to use at the beginning of each line. + * @default ´ ´ (two spaces) + */ + indent?: string; + + /** + * The string to use at the end of each line. + * @default ´\n´ + */ + newline?: string; + + /** + * An escape function to run on each line after splitting them. + * @default (str: string) => string; + */ + escape?: (str: string) => string; + + /** + * Trim trailing whitespace from the returned string. + * This option is included since .trim() would also strip + * the leading indentation from the first line. + * @default true + */ + trim?: boolean; + + /** + * Break a word between any two letters when the word is longer + * than the specified width. + * @default false + */ + cut?: boolean; + } +} diff --git a/tools/ui/node_modules/word-wrap/index.js b/tools/ui/node_modules/word-wrap/index.js new file mode 100644 index 0000000000000000000000000000000000000000..08f1e41d779f6c9173a3aa6a01101baaff3dc8dd --- /dev/null +++ b/tools/ui/node_modules/word-wrap/index.js @@ -0,0 +1,61 @@ +/*! + * word-wrap + * + * Copyright (c) 2014-2023, Jon Schlinkert. + * Released under the MIT License. + */ + +function trimEnd(str) { + let lastCharPos = str.length - 1; + let lastChar = str[lastCharPos]; + while(lastChar === ' ' || lastChar === '\t') { + lastChar = str[--lastCharPos]; + } + return str.substring(0, lastCharPos + 1); +} + +function trimTabAndSpaces(str) { + const lines = str.split('\n'); + const trimmedLines = lines.map((line) => trimEnd(line)); + return trimmedLines.join('\n'); +} + +module.exports = function(str, options) { + options = options || {}; + if (str == null) { + return str; + } + + var width = options.width || 50; + var indent = (typeof options.indent === 'string') + ? options.indent + : ' '; + + var newline = options.newline || '\n' + indent; + var escape = typeof options.escape === 'function' + ? options.escape + : identity; + + var regexString = '.{1,' + width + '}'; + if (options.cut !== true) { + regexString += '([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)'; + } + + var re = new RegExp(regexString, 'g'); + var lines = str.match(re) || []; + var result = indent + lines.map(function(line) { + if (line.slice(-1) === '\n') { + line = line.slice(0, line.length - 1); + } + return escape(line); + }).join(newline); + + if (options.trim === true) { + result = trimTabAndSpaces(result); + } + return result; +}; + +function identity(str) { + return str; +} diff --git a/tools/ui/node_modules/word-wrap/package.json b/tools/ui/node_modules/word-wrap/package.json new file mode 100644 index 0000000000000000000000000000000000000000..459246d5447a1ebc745d12ddbe6d2932ac0e017d --- /dev/null +++ b/tools/ui/node_modules/word-wrap/package.json @@ -0,0 +1,77 @@ +{ + "name": "word-wrap", + "description": "Wrap words to a specified length.", + "version": "1.2.5", + "homepage": "https://github.com/jonschlinkert/word-wrap", + "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Danilo Sampaio (localhost:8080)", + "Fede Ramirez (https://2fd.github.io)", + "Joe Hildebrand (https://twitter.com/hildjj)", + "Jon Schlinkert (http://twitter.com/jonschlinkert)", + "Todd Kennedy (https://tck.io)", + "Waldemar Reusch (https://github.com/lordvlad)", + "Wolfgang Faust (http://www.linestarve.com)", + "Zach Hale (http://zachhale.com)" + ], + "repository": "jonschlinkert/word-wrap", + "bugs": { + "url": "https://github.com/jonschlinkert/word-wrap/issues" + }, + "license": "MIT", + "files": [ + "index.js", + "index.d.ts" + ], + "main": "index.js", + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "devDependencies": { + "gulp-format-md": "^0.1.11", + "mocha": "^3.2.0" + }, + "keywords": [ + "break", + "carriage", + "line", + "new-line", + "newline", + "return", + "soft", + "text", + "word", + "word-wrap", + "words", + "wrap" + ], + "typings": "index.d.ts", + "verb": { + "toc": false, + "layout": "default", + "tasks": [ + "readme" + ], + "plugins": [ + "gulp-format-md" + ], + "lint": { + "reflinks": true + }, + "related": { + "list": [ + "common-words", + "shuffle-words", + "unique-words", + "wordcount" + ] + }, + "reflinks": [ + "verb", + "verb-generate-readme" + ] + } +} diff --git a/tools/ui/node_modules/workbox-background-sync/BackgroundSyncPlugin.d.ts b/tools/ui/node_modules/workbox-background-sync/BackgroundSyncPlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..8594ccd1ab32b7f6f564be42eb86fbe7eed0e34d --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/BackgroundSyncPlugin.d.ts @@ -0,0 +1,27 @@ +import { WorkboxPlugin } from 'workbox-core/types.js'; +import { QueueOptions } from './Queue.js'; +import './_version.js'; +/** + * A class implementing the `fetchDidFail` lifecycle callback. This makes it + * easier to add failed requests to a background sync Queue. + * + * @memberof workbox-background-sync + */ +declare class BackgroundSyncPlugin implements WorkboxPlugin { + private readonly _queue; + /** + * @param {string} name See the {@link workbox-background-sync.Queue} + * documentation for parameter details. + * @param {Object} [options] See the + * {@link workbox-background-sync.Queue} documentation for + * parameter details. + */ + constructor(name: string, options?: QueueOptions); + /** + * @param {Object} options + * @param {Request} options.request + * @private + */ + fetchDidFail: WorkboxPlugin['fetchDidFail']; +} +export { BackgroundSyncPlugin }; diff --git a/tools/ui/node_modules/workbox-background-sync/BackgroundSyncPlugin.js b/tools/ui/node_modules/workbox-background-sync/BackgroundSyncPlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..52f2d236edec9016e00f68ec1df7320518349988 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/BackgroundSyncPlugin.js @@ -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 { Queue } from './Queue.js'; +import './_version.js'; +/** + * A class implementing the `fetchDidFail` lifecycle callback. This makes it + * easier to add failed requests to a background sync Queue. + * + * @memberof workbox-background-sync + */ +class BackgroundSyncPlugin { + /** + * @param {string} name See the {@link workbox-background-sync.Queue} + * documentation for parameter details. + * @param {Object} [options] See the + * {@link workbox-background-sync.Queue} documentation for + * parameter details. + */ + constructor(name, options) { + /** + * @param {Object} options + * @param {Request} options.request + * @private + */ + this.fetchDidFail = async ({ request }) => { + await this._queue.pushRequest({ request }); + }; + this._queue = new Queue(name, options); + } +} +export { BackgroundSyncPlugin }; diff --git a/tools/ui/node_modules/workbox-background-sync/BackgroundSyncPlugin.mjs b/tools/ui/node_modules/workbox-background-sync/BackgroundSyncPlugin.mjs new file mode 100644 index 0000000000000000000000000000000000000000..69e2171403b0a65ecbd3c45a88404817a28c04ed --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/BackgroundSyncPlugin.mjs @@ -0,0 +1 @@ +export * from './BackgroundSyncPlugin.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-background-sync/LICENSE b/tools/ui/node_modules/workbox-background-sync/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/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-background-sync/Queue.d.ts b/tools/ui/node_modules/workbox-background-sync/Queue.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..46c999e25b5a7c646201f413df64e7737cae5b7f --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/Queue.d.ts @@ -0,0 +1,175 @@ +import './_version.js'; +interface OnSyncCallbackOptions { + queue: Queue; +} +interface OnSyncCallback { + (options: OnSyncCallbackOptions): void | Promise; +} +export interface QueueOptions { + forceSyncFallback?: boolean; + maxRetentionTime?: number; + onSync?: OnSyncCallback; +} +interface QueueEntry { + request: Request; + timestamp?: number; + metadata?: object; +} +/** + * A class to manage storing failed requests in IndexedDB and retrying them + * later. All parts of the storing and replaying process are observable via + * callbacks. + * + * @memberof workbox-background-sync + */ +declare class Queue { + private readonly _name; + private readonly _onSync; + private readonly _maxRetentionTime; + private readonly _queueStore; + private readonly _forceSyncFallback; + private _syncInProgress; + private _requestsAddedDuringSync; + /** + * Creates an instance of Queue with the given options + * + * @param {string} name The unique name for this queue. This name must be + * unique as it's used to register sync events and store requests + * in IndexedDB specific to this instance. An error will be thrown if + * a duplicate name is detected. + * @param {Object} [options] + * @param {Function} [options.onSync] A function that gets invoked whenever + * the 'sync' event fires. The function is invoked with an object + * containing the `queue` property (referencing this instance), and you + * can use the callback to customize the replay behavior of the queue. + * When not set the `replayRequests()` method is called. + * Note: if the replay fails after a sync event, make sure you throw an + * error, so the browser knows to retry the sync event later. + * @param {number} [options.maxRetentionTime=7 days] The amount of time (in + * minutes) a request may be retried. After this amount of time has + * passed, the request will be deleted from the queue. + * @param {boolean} [options.forceSyncFallback=false] If `true`, instead + * of attempting to use background sync events, always attempt to replay + * queued request at service worker startup. Most folks will not need + * this, unless you explicitly target a runtime like Electron that + * exposes the interfaces for background sync, but does not have a working + * implementation. + */ + constructor(name: string, { forceSyncFallback, onSync, maxRetentionTime }?: QueueOptions); + /** + * @return {string} + */ + get name(): string; + /** + * Stores the passed request in IndexedDB (with its timestamp and any + * metadata) at the end of the queue. + * + * @param {QueueEntry} entry + * @param {Request} entry.request The request to store in the queue. + * @param {Object} [entry.metadata] Any metadata you want associated with the + * stored request. When requests are replayed you'll have access to this + * metadata object in case you need to modify the request beforehand. + * @param {number} [entry.timestamp] The timestamp (Epoch time in + * milliseconds) when the request was first added to the queue. This is + * used along with `maxRetentionTime` to remove outdated requests. In + * general you don't need to set this value, as it's automatically set + * for you (defaulting to `Date.now()`), but you can update it if you + * don't want particular requests to expire. + */ + pushRequest(entry: QueueEntry): Promise; + /** + * Stores the passed request in IndexedDB (with its timestamp and any + * metadata) at the beginning of the queue. + * + * @param {QueueEntry} entry + * @param {Request} entry.request The request to store in the queue. + * @param {Object} [entry.metadata] Any metadata you want associated with the + * stored request. When requests are replayed you'll have access to this + * metadata object in case you need to modify the request beforehand. + * @param {number} [entry.timestamp] The timestamp (Epoch time in + * milliseconds) when the request was first added to the queue. This is + * used along with `maxRetentionTime` to remove outdated requests. In + * general you don't need to set this value, as it's automatically set + * for you (defaulting to `Date.now()`), but you can update it if you + * don't want particular requests to expire. + */ + unshiftRequest(entry: QueueEntry): Promise; + /** + * Removes and returns the last request in the queue (along with its + * timestamp and any metadata). The returned object takes the form: + * `{request, timestamp, metadata}`. + * + * @return {Promise} + */ + popRequest(): Promise; + /** + * Removes and returns the first request in the queue (along with its + * timestamp and any metadata). The returned object takes the form: + * `{request, timestamp, metadata}`. + * + * @return {Promise} + */ + shiftRequest(): Promise; + /** + * Returns all the entries that have not expired (per `maxRetentionTime`). + * Any expired entries are removed from the queue. + * + * @return {Promise>} + */ + getAll(): Promise>; + /** + * Returns the number of entries present in the queue. + * Note that expired entries (per `maxRetentionTime`) are also included in this count. + * + * @return {Promise} + */ + size(): Promise; + /** + * Adds the entry to the QueueStore and registers for a sync event. + * + * @param {Object} entry + * @param {Request} entry.request + * @param {Object} [entry.metadata] + * @param {number} [entry.timestamp=Date.now()] + * @param {string} operation ('push' or 'unshift') + * @private + */ + _addRequest({ request, metadata, timestamp }: QueueEntry, operation: 'push' | 'unshift'): Promise; + /** + * Removes and returns the first or last (depending on `operation`) entry + * from the QueueStore that's not older than the `maxRetentionTime`. + * + * @param {string} operation ('pop' or 'shift') + * @return {Object|undefined} + * @private + */ + _removeRequest(operation: 'pop' | 'shift'): Promise; + /** + * Loops through each request in the queue and attempts to re-fetch it. + * If any request fails to re-fetch, it's put back in the same position in + * the queue (which registers a retry for the next sync event). + */ + replayRequests(): Promise; + /** + * Registers a sync event with a tag unique to this instance. + */ + registerSync(): Promise; + /** + * In sync-supporting browsers, this adds a listener for the sync event. + * In non-sync-supporting browsers, or if _forceSyncFallback is true, this + * will retry the queue on service worker startup. + * + * @private + */ + private _addSyncListener; + /** + * Returns the set of queue names. This is primarily used to reset the list + * of queue names in tests. + * + * @return {Set} + * + * @private + */ + static get _queueNames(): Set; +} +export { Queue }; diff --git a/tools/ui/node_modules/workbox-background-sync/Queue.js b/tools/ui/node_modules/workbox-background-sync/Queue.js new file mode 100644 index 0000000000000000000000000000000000000000..7ae3e6934cb0f51cbcfcb0ea779586203afa138a --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/Queue.js @@ -0,0 +1,401 @@ +/* + 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 { logger } from 'workbox-core/_private/logger.js'; +import { assert } from 'workbox-core/_private/assert.js'; +import { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js'; +import { QueueStore } from './lib/QueueStore.js'; +import { StorableRequest } from './lib/StorableRequest.js'; +import './_version.js'; +const TAG_PREFIX = 'workbox-background-sync'; +const MAX_RETENTION_TIME = 60 * 24 * 7; // 7 days in minutes +const queueNames = new Set(); +/** + * Converts a QueueStore entry into the format exposed by Queue. This entails + * converting the request data into a real request and omitting the `id` and + * `queueName` properties. + * + * @param {UnidentifiedQueueStoreEntry} queueStoreEntry + * @return {Queue} + * @private + */ +const convertEntry = (queueStoreEntry) => { + const queueEntry = { + request: new StorableRequest(queueStoreEntry.requestData).toRequest(), + timestamp: queueStoreEntry.timestamp, + }; + if (queueStoreEntry.metadata) { + queueEntry.metadata = queueStoreEntry.metadata; + } + return queueEntry; +}; +/** + * A class to manage storing failed requests in IndexedDB and retrying them + * later. All parts of the storing and replaying process are observable via + * callbacks. + * + * @memberof workbox-background-sync + */ +class Queue { + /** + * Creates an instance of Queue with the given options + * + * @param {string} name The unique name for this queue. This name must be + * unique as it's used to register sync events and store requests + * in IndexedDB specific to this instance. An error will be thrown if + * a duplicate name is detected. + * @param {Object} [options] + * @param {Function} [options.onSync] A function that gets invoked whenever + * the 'sync' event fires. The function is invoked with an object + * containing the `queue` property (referencing this instance), and you + * can use the callback to customize the replay behavior of the queue. + * When not set the `replayRequests()` method is called. + * Note: if the replay fails after a sync event, make sure you throw an + * error, so the browser knows to retry the sync event later. + * @param {number} [options.maxRetentionTime=7 days] The amount of time (in + * minutes) a request may be retried. After this amount of time has + * passed, the request will be deleted from the queue. + * @param {boolean} [options.forceSyncFallback=false] If `true`, instead + * of attempting to use background sync events, always attempt to replay + * queued request at service worker startup. Most folks will not need + * this, unless you explicitly target a runtime like Electron that + * exposes the interfaces for background sync, but does not have a working + * implementation. + */ + constructor(name, { forceSyncFallback, onSync, maxRetentionTime } = {}) { + this._syncInProgress = false; + this._requestsAddedDuringSync = false; + // Ensure the store name is not already being used + if (queueNames.has(name)) { + throw new WorkboxError('duplicate-queue-name', { name }); + } + else { + queueNames.add(name); + } + this._name = name; + this._onSync = onSync || this.replayRequests; + this._maxRetentionTime = maxRetentionTime || MAX_RETENTION_TIME; + this._forceSyncFallback = Boolean(forceSyncFallback); + this._queueStore = new QueueStore(this._name); + this._addSyncListener(); + } + /** + * @return {string} + */ + get name() { + return this._name; + } + /** + * Stores the passed request in IndexedDB (with its timestamp and any + * metadata) at the end of the queue. + * + * @param {QueueEntry} entry + * @param {Request} entry.request The request to store in the queue. + * @param {Object} [entry.metadata] Any metadata you want associated with the + * stored request. When requests are replayed you'll have access to this + * metadata object in case you need to modify the request beforehand. + * @param {number} [entry.timestamp] The timestamp (Epoch time in + * milliseconds) when the request was first added to the queue. This is + * used along with `maxRetentionTime` to remove outdated requests. In + * general you don't need to set this value, as it's automatically set + * for you (defaulting to `Date.now()`), but you can update it if you + * don't want particular requests to expire. + */ + async pushRequest(entry) { + if (process.env.NODE_ENV !== 'production') { + assert.isType(entry, 'object', { + moduleName: 'workbox-background-sync', + className: 'Queue', + funcName: 'pushRequest', + paramName: 'entry', + }); + assert.isInstance(entry.request, Request, { + moduleName: 'workbox-background-sync', + className: 'Queue', + funcName: 'pushRequest', + paramName: 'entry.request', + }); + } + await this._addRequest(entry, 'push'); + } + /** + * Stores the passed request in IndexedDB (with its timestamp and any + * metadata) at the beginning of the queue. + * + * @param {QueueEntry} entry + * @param {Request} entry.request The request to store in the queue. + * @param {Object} [entry.metadata] Any metadata you want associated with the + * stored request. When requests are replayed you'll have access to this + * metadata object in case you need to modify the request beforehand. + * @param {number} [entry.timestamp] The timestamp (Epoch time in + * milliseconds) when the request was first added to the queue. This is + * used along with `maxRetentionTime` to remove outdated requests. In + * general you don't need to set this value, as it's automatically set + * for you (defaulting to `Date.now()`), but you can update it if you + * don't want particular requests to expire. + */ + async unshiftRequest(entry) { + if (process.env.NODE_ENV !== 'production') { + assert.isType(entry, 'object', { + moduleName: 'workbox-background-sync', + className: 'Queue', + funcName: 'unshiftRequest', + paramName: 'entry', + }); + assert.isInstance(entry.request, Request, { + moduleName: 'workbox-background-sync', + className: 'Queue', + funcName: 'unshiftRequest', + paramName: 'entry.request', + }); + } + await this._addRequest(entry, 'unshift'); + } + /** + * Removes and returns the last request in the queue (along with its + * timestamp and any metadata). The returned object takes the form: + * `{request, timestamp, metadata}`. + * + * @return {Promise} + */ + async popRequest() { + return this._removeRequest('pop'); + } + /** + * Removes and returns the first request in the queue (along with its + * timestamp and any metadata). The returned object takes the form: + * `{request, timestamp, metadata}`. + * + * @return {Promise} + */ + async shiftRequest() { + return this._removeRequest('shift'); + } + /** + * Returns all the entries that have not expired (per `maxRetentionTime`). + * Any expired entries are removed from the queue. + * + * @return {Promise>} + */ + async getAll() { + const allEntries = await this._queueStore.getAll(); + const now = Date.now(); + const unexpiredEntries = []; + for (const entry of allEntries) { + // Ignore requests older than maxRetentionTime. Call this function + // recursively until an unexpired request is found. + const maxRetentionTimeInMs = this._maxRetentionTime * 60 * 1000; + if (now - entry.timestamp > maxRetentionTimeInMs) { + await this._queueStore.deleteEntry(entry.id); + } + else { + unexpiredEntries.push(convertEntry(entry)); + } + } + return unexpiredEntries; + } + /** + * Returns the number of entries present in the queue. + * Note that expired entries (per `maxRetentionTime`) are also included in this count. + * + * @return {Promise} + */ + async size() { + return await this._queueStore.size(); + } + /** + * Adds the entry to the QueueStore and registers for a sync event. + * + * @param {Object} entry + * @param {Request} entry.request + * @param {Object} [entry.metadata] + * @param {number} [entry.timestamp=Date.now()] + * @param {string} operation ('push' or 'unshift') + * @private + */ + async _addRequest({ request, metadata, timestamp = Date.now() }, operation) { + const storableRequest = await StorableRequest.fromRequest(request.clone()); + const entry = { + requestData: storableRequest.toObject(), + timestamp, + }; + // Only include metadata if it's present. + if (metadata) { + entry.metadata = metadata; + } + switch (operation) { + case 'push': + await this._queueStore.pushEntry(entry); + break; + case 'unshift': + await this._queueStore.unshiftEntry(entry); + break; + } + if (process.env.NODE_ENV !== 'production') { + logger.log(`Request for '${getFriendlyURL(request.url)}' has ` + + `been added to background sync queue '${this._name}'.`); + } + // Don't register for a sync if we're in the middle of a sync. Instead, + // we wait until the sync is complete and call register if + // `this._requestsAddedDuringSync` is true. + if (this._syncInProgress) { + this._requestsAddedDuringSync = true; + } + else { + await this.registerSync(); + } + } + /** + * Removes and returns the first or last (depending on `operation`) entry + * from the QueueStore that's not older than the `maxRetentionTime`. + * + * @param {string} operation ('pop' or 'shift') + * @return {Object|undefined} + * @private + */ + async _removeRequest(operation) { + const now = Date.now(); + let entry; + switch (operation) { + case 'pop': + entry = await this._queueStore.popEntry(); + break; + case 'shift': + entry = await this._queueStore.shiftEntry(); + break; + } + if (entry) { + // Ignore requests older than maxRetentionTime. Call this function + // recursively until an unexpired request is found. + const maxRetentionTimeInMs = this._maxRetentionTime * 60 * 1000; + if (now - entry.timestamp > maxRetentionTimeInMs) { + return this._removeRequest(operation); + } + return convertEntry(entry); + } + else { + return undefined; + } + } + /** + * Loops through each request in the queue and attempts to re-fetch it. + * If any request fails to re-fetch, it's put back in the same position in + * the queue (which registers a retry for the next sync event). + */ + async replayRequests() { + let entry; + while ((entry = await this.shiftRequest())) { + try { + await fetch(entry.request.clone()); + if (process.env.NODE_ENV !== 'production') { + logger.log(`Request for '${getFriendlyURL(entry.request.url)}' ` + + `has been replayed in queue '${this._name}'`); + } + } + catch (error) { + await this.unshiftRequest(entry); + if (process.env.NODE_ENV !== 'production') { + logger.log(`Request for '${getFriendlyURL(entry.request.url)}' ` + + `failed to replay, putting it back in queue '${this._name}'`); + } + throw new WorkboxError('queue-replay-failed', { name: this._name }); + } + } + if (process.env.NODE_ENV !== 'production') { + logger.log(`All requests in queue '${this.name}' have successfully ` + + `replayed; the queue is now empty!`); + } + } + /** + * Registers a sync event with a tag unique to this instance. + */ + async registerSync() { + // See https://github.com/GoogleChrome/workbox/issues/2393 + if ('sync' in self.registration && !this._forceSyncFallback) { + try { + await self.registration.sync.register(`${TAG_PREFIX}:${this._name}`); + } + catch (err) { + // This means the registration failed for some reason, possibly due to + // the user disabling it. + if (process.env.NODE_ENV !== 'production') { + logger.warn(`Unable to register sync event for '${this._name}'.`, err); + } + } + } + } + /** + * In sync-supporting browsers, this adds a listener for the sync event. + * In non-sync-supporting browsers, or if _forceSyncFallback is true, this + * will retry the queue on service worker startup. + * + * @private + */ + _addSyncListener() { + // See https://github.com/GoogleChrome/workbox/issues/2393 + if ('sync' in self.registration && !this._forceSyncFallback) { + self.addEventListener('sync', (event) => { + if (event.tag === `${TAG_PREFIX}:${this._name}`) { + if (process.env.NODE_ENV !== 'production') { + logger.log(`Background sync for tag '${event.tag}' ` + `has been received`); + } + const syncComplete = async () => { + this._syncInProgress = true; + let syncError; + try { + await this._onSync({ queue: this }); + } + catch (error) { + if (error instanceof Error) { + syncError = error; + // Rethrow the error. Note: the logic in the finally clause + // will run before this gets rethrown. + throw syncError; + } + } + finally { + // New items may have been added to the queue during the sync, + // so we need to register for a new sync if that's happened... + // Unless there was an error during the sync, in which + // case the browser will automatically retry later, as long + // as `event.lastChance` is not true. + if (this._requestsAddedDuringSync && + !(syncError && !event.lastChance)) { + await this.registerSync(); + } + this._syncInProgress = false; + this._requestsAddedDuringSync = false; + } + }; + event.waitUntil(syncComplete()); + } + }); + } + else { + if (process.env.NODE_ENV !== 'production') { + logger.log(`Background sync replaying without background sync event`); + } + // If the browser doesn't support background sync, or the developer has + // opted-in to not using it, retry every time the service worker starts up + // as a fallback. + void this._onSync({ queue: this }); + } + } + /** + * Returns the set of queue names. This is primarily used to reset the list + * of queue names in tests. + * + * @return {Set} + * + * @private + */ + static get _queueNames() { + return queueNames; + } +} +export { Queue }; diff --git a/tools/ui/node_modules/workbox-background-sync/Queue.mjs b/tools/ui/node_modules/workbox-background-sync/Queue.mjs new file mode 100644 index 0000000000000000000000000000000000000000..0d9d8785b3c1fa8d989b36a8b2faee2da00b2553 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/Queue.mjs @@ -0,0 +1 @@ +export * from './Queue.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-background-sync/QueueStore.d.ts b/tools/ui/node_modules/workbox-background-sync/QueueStore.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c14e58629255700294b5979cdabe60c897f790bb --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/QueueStore.d.ts @@ -0,0 +1,2 @@ +import './_version.js'; +export { QueueStore } from './lib/QueueStore'; diff --git a/tools/ui/node_modules/workbox-background-sync/QueueStore.js b/tools/ui/node_modules/workbox-background-sync/QueueStore.js new file mode 100644 index 0000000000000000000000000000000000000000..1a256c05efe88c7c7a074e95541e0ee2fc34bca3 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/QueueStore.js @@ -0,0 +1,12 @@ +/* + 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 './_version.js'; +// This is a temporary workaround to expose something from ./lib/ via our +// top-level public API. +// TODO: In Workbox v7, move the actual code from ./lib/ to this file. +export { QueueStore } from './lib/QueueStore'; diff --git a/tools/ui/node_modules/workbox-background-sync/QueueStore.mjs b/tools/ui/node_modules/workbox-background-sync/QueueStore.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f46524b41f6b2df72f0cae0a4c7413140a0c04b8 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/QueueStore.mjs @@ -0,0 +1 @@ +export * from './QueueStore.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-background-sync/README.md b/tools/ui/node_modules/workbox-background-sync/README.md new file mode 100644 index 0000000000000000000000000000000000000000..af63198d6d4bbaef1ad12340475e12985afe1c8e --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/README.md @@ -0,0 +1 @@ +This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-background-sync diff --git a/tools/ui/node_modules/workbox-background-sync/StorableRequest.d.ts b/tools/ui/node_modules/workbox-background-sync/StorableRequest.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..059ed36af6441b9abff14d35c760380cc9efdced --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/StorableRequest.d.ts @@ -0,0 +1,2 @@ +import './_version.js'; +export { StorableRequest } from './lib/StorableRequest'; diff --git a/tools/ui/node_modules/workbox-background-sync/StorableRequest.js b/tools/ui/node_modules/workbox-background-sync/StorableRequest.js new file mode 100644 index 0000000000000000000000000000000000000000..d711f3d74a2b30f8c5c540bcc7b61565ff8cbc6f --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/StorableRequest.js @@ -0,0 +1,12 @@ +/* + 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 './_version.js'; +// This is a temporary workaround to expose something from ./lib/ via our +// top-level public API. +// TODO: In Workbox v7, move the actual code from ./lib/ to this file. +export { StorableRequest } from './lib/StorableRequest'; diff --git a/tools/ui/node_modules/workbox-background-sync/StorableRequest.mjs b/tools/ui/node_modules/workbox-background-sync/StorableRequest.mjs new file mode 100644 index 0000000000000000000000000000000000000000..fb7122edc779b247778968c40bffa6c6b84b4f87 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/StorableRequest.mjs @@ -0,0 +1 @@ +export * from './StorableRequest.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-background-sync/_version.d.ts b/tools/ui/node_modules/workbox-background-sync/_version.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/workbox-background-sync/_version.js b/tools/ui/node_modules/workbox-background-sync/_version.js new file mode 100644 index 0000000000000000000000000000000000000000..63e50a394de1817854deb6ceae98289306a1547f --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/_version.js @@ -0,0 +1,6 @@ +"use strict"; +// @ts-ignore +try { + self['workbox:background-sync:7.4.0'] && _(); +} +catch (e) { } diff --git a/tools/ui/node_modules/workbox-background-sync/_version.mjs b/tools/ui/node_modules/workbox-background-sync/_version.mjs new file mode 100644 index 0000000000000000000000000000000000000000..262596d31e08b13e874d28fc68589ca60348f023 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/_version.mjs @@ -0,0 +1 @@ +try{self['workbox:background-sync:7.4.1']&&_()}catch(e){}// eslint-disable-line \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-background-sync/build/workbox-background-sync.dev.js b/tools/ui/node_modules/workbox-background-sync/build/workbox-background-sync.dev.js new file mode 100644 index 0000000000000000000000000000000000000000..00c1ff03020eba8059b3110ea27f9391760ed07c --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/build/workbox-background-sync.dev.js @@ -0,0 +1,1082 @@ +this.workbox = this.workbox || {}; +this.workbox.backgroundSync = (function (exports, WorkboxError_js, logger_js, assert_js, getFriendlyURL_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; + } + 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:background-sync:7.4.0'] && _(); + } catch (e) {} + + /* + 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. + */ + const DB_VERSION = 3; + const DB_NAME = 'workbox-background-sync'; + const REQUEST_OBJECT_STORE_NAME = 'requests'; + const QUEUE_NAME_INDEX = 'queueName'; + /** + * A class to interact directly an IndexedDB created specifically to save and + * retrieve QueueStoreEntries. This class encapsulates all the schema details + * to store the representation of a Queue. + * + * @private + */ + class QueueDb { + constructor() { + this._db = null; + } + /** + * Add QueueStoreEntry to underlying db. + * + * @param {UnidentifiedQueueStoreEntry} entry + */ + async addEntry(entry) { + const db = await this.getDb(); + const tx = db.transaction(REQUEST_OBJECT_STORE_NAME, 'readwrite', { + durability: 'relaxed' + }); + await tx.store.add(entry); + await tx.done; + } + /** + * Returns the first entry id in the ObjectStore. + * + * @return {number | undefined} + */ + async getFirstEntryId() { + const db = await this.getDb(); + const cursor = await db.transaction(REQUEST_OBJECT_STORE_NAME).store.openCursor(); + return cursor === null || cursor === void 0 ? void 0 : cursor.value.id; + } + /** + * Get all the entries filtered by index + * + * @param queueName + * @return {Promise} + */ + async getAllEntriesByQueueName(queueName) { + const db = await this.getDb(); + const results = await db.getAllFromIndex(REQUEST_OBJECT_STORE_NAME, QUEUE_NAME_INDEX, IDBKeyRange.only(queueName)); + return results ? results : new Array(); + } + /** + * Returns the number of entries filtered by index + * + * @param queueName + * @return {Promise} + */ + async getEntryCountByQueueName(queueName) { + const db = await this.getDb(); + return db.countFromIndex(REQUEST_OBJECT_STORE_NAME, QUEUE_NAME_INDEX, IDBKeyRange.only(queueName)); + } + /** + * Deletes a single entry by id. + * + * @param {number} id the id of the entry to be deleted + */ + async deleteEntry(id) { + const db = await this.getDb(); + await db.delete(REQUEST_OBJECT_STORE_NAME, id); + } + /** + * + * @param queueName + * @returns {Promise} + */ + async getFirstEntryByQueueName(queueName) { + return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'next'); + } + /** + * + * @param queueName + * @returns {Promise} + */ + async getLastEntryByQueueName(queueName) { + return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'prev'); + } + /** + * Returns either the first or the last entries, depending on direction. + * Filtered by index. + * + * @param {IDBCursorDirection} direction + * @param {IDBKeyRange} query + * @return {Promise} + * @private + */ + async getEndEntryFromIndex(query, direction) { + const db = await this.getDb(); + const cursor = await db.transaction(REQUEST_OBJECT_STORE_NAME).store.index(QUEUE_NAME_INDEX).openCursor(query, direction); + return cursor === null || cursor === void 0 ? void 0 : cursor.value; + } + /** + * Returns an open connection to the database. + * + * @private + */ + async getDb() { + if (!this._db) { + this._db = await openDB(DB_NAME, DB_VERSION, { + upgrade: this._upgradeDb + }); + } + return this._db; + } + /** + * Upgrades QueueDB + * + * @param {IDBPDatabase} db + * @param {number} oldVersion + * @private + */ + _upgradeDb(db, oldVersion) { + if (oldVersion > 0 && oldVersion < DB_VERSION) { + if (db.objectStoreNames.contains(REQUEST_OBJECT_STORE_NAME)) { + db.deleteObjectStore(REQUEST_OBJECT_STORE_NAME); + } + } + const objStore = db.createObjectStore(REQUEST_OBJECT_STORE_NAME, { + autoIncrement: true, + keyPath: 'id' + }); + objStore.createIndex(QUEUE_NAME_INDEX, QUEUE_NAME_INDEX, { + unique: 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. + */ + /** + * A class to manage storing requests from a Queue in IndexedDB, + * indexed by their queue name for easier access. + * + * Most developers will not need to access this class directly; + * it is exposed for advanced use cases. + */ + class QueueStore { + /** + * Associates this instance with a Queue instance, so entries added can be + * identified by their queue name. + * + * @param {string} queueName + */ + constructor(queueName) { + this._queueName = queueName; + this._queueDb = new QueueDb(); + } + /** + * Append an entry last in the queue. + * + * @param {Object} entry + * @param {Object} entry.requestData + * @param {number} [entry.timestamp] + * @param {Object} [entry.metadata] + */ + async pushEntry(entry) { + { + assert_js.assert.isType(entry, 'object', { + moduleName: 'workbox-background-sync', + className: 'QueueStore', + funcName: 'pushEntry', + paramName: 'entry' + }); + assert_js.assert.isType(entry.requestData, 'object', { + moduleName: 'workbox-background-sync', + className: 'QueueStore', + funcName: 'pushEntry', + paramName: 'entry.requestData' + }); + } + // Don't specify an ID since one is automatically generated. + delete entry.id; + entry.queueName = this._queueName; + await this._queueDb.addEntry(entry); + } + /** + * Prepend an entry first in the queue. + * + * @param {Object} entry + * @param {Object} entry.requestData + * @param {number} [entry.timestamp] + * @param {Object} [entry.metadata] + */ + async unshiftEntry(entry) { + { + assert_js.assert.isType(entry, 'object', { + moduleName: 'workbox-background-sync', + className: 'QueueStore', + funcName: 'unshiftEntry', + paramName: 'entry' + }); + assert_js.assert.isType(entry.requestData, 'object', { + moduleName: 'workbox-background-sync', + className: 'QueueStore', + funcName: 'unshiftEntry', + paramName: 'entry.requestData' + }); + } + const firstId = await this._queueDb.getFirstEntryId(); + if (firstId) { + // Pick an ID one less than the lowest ID in the object store. + entry.id = firstId - 1; + } else { + // Otherwise let the auto-incrementor assign the ID. + delete entry.id; + } + entry.queueName = this._queueName; + await this._queueDb.addEntry(entry); + } + /** + * Removes and returns the last entry in the queue matching the `queueName`. + * + * @return {Promise} + */ + async popEntry() { + return this._removeEntry(await this._queueDb.getLastEntryByQueueName(this._queueName)); + } + /** + * Removes and returns the first entry in the queue matching the `queueName`. + * + * @return {Promise} + */ + async shiftEntry() { + return this._removeEntry(await this._queueDb.getFirstEntryByQueueName(this._queueName)); + } + /** + * Returns all entries in the store matching the `queueName`. + * + * @param {Object} options See {@link workbox-background-sync.Queue~getAll} + * @return {Promise>} + */ + async getAll() { + return await this._queueDb.getAllEntriesByQueueName(this._queueName); + } + /** + * Returns the number of entries in the store matching the `queueName`. + * + * @param {Object} options See {@link workbox-background-sync.Queue~size} + * @return {Promise} + */ + async size() { + return await this._queueDb.getEntryCountByQueueName(this._queueName); + } + /** + * Deletes the entry for the given ID. + * + * WARNING: this method does not ensure the deleted entry belongs to this + * queue (i.e. matches the `queueName`). But this limitation is acceptable + * as this class is not publicly exposed. An additional check would make + * this method slower than it needs to be. + * + * @param {number} id + */ + async deleteEntry(id) { + await this._queueDb.deleteEntry(id); + } + /** + * Removes and returns the first or last entry in the queue (based on the + * `direction` argument) matching the `queueName`. + * + * @return {Promise} + * @private + */ + async _removeEntry(entry) { + if (entry) { + await this.deleteEntry(entry.id); + } + return entry; + } + } + + /* + 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 serializableProperties = ['method', 'referrer', 'referrerPolicy', 'mode', 'credentials', 'cache', 'redirect', 'integrity', 'keepalive']; + /** + * A class to make it easier to serialize and de-serialize requests so they + * can be stored in IndexedDB. + * + * Most developers will not need to access this class directly; + * it is exposed for advanced use cases. + */ + class StorableRequest { + /** + * Converts a Request object to a plain object that can be structured + * cloned or JSON-stringified. + * + * @param {Request} request + * @return {Promise} + */ + static async fromRequest(request) { + const requestData = { + url: request.url, + headers: {} + }; + // Set the body if present. + if (request.method !== 'GET') { + // Use ArrayBuffer to support non-text request bodies. + // NOTE: we can't use Blobs becuse Safari doesn't support storing + // Blobs in IndexedDB in some cases: + // https://github.com/dfahlander/Dexie.js/issues/618#issuecomment-398348457 + requestData.body = await request.clone().arrayBuffer(); + } + // Convert the headers from an iterable to an object. + for (const [key, value] of request.headers.entries()) { + requestData.headers[key] = value; + } + // Add all other serializable request properties + for (const prop of serializableProperties) { + if (request[prop] !== undefined) { + requestData[prop] = request[prop]; + } + } + return new StorableRequest(requestData); + } + /** + * Accepts an object of request data that can be used to construct a + * `Request` but can also be stored in IndexedDB. + * + * @param {Object} requestData An object of request data that includes the + * `url` plus any relevant properties of + * [requestInit]{@link https://fetch.spec.whatwg.org/#requestinit}. + */ + constructor(requestData) { + { + assert_js.assert.isType(requestData, 'object', { + moduleName: 'workbox-background-sync', + className: 'StorableRequest', + funcName: 'constructor', + paramName: 'requestData' + }); + assert_js.assert.isType(requestData.url, 'string', { + moduleName: 'workbox-background-sync', + className: 'StorableRequest', + funcName: 'constructor', + paramName: 'requestData.url' + }); + } + // If the request's mode is `navigate`, convert it to `same-origin` since + // navigation requests can't be constructed via script. + if (requestData['mode'] === 'navigate') { + requestData['mode'] = 'same-origin'; + } + this._requestData = requestData; + } + /** + * Returns a deep clone of the instances `_requestData` object. + * + * @return {Object} + */ + toObject() { + const requestData = Object.assign({}, this._requestData); + requestData.headers = Object.assign({}, this._requestData.headers); + if (requestData.body) { + requestData.body = requestData.body.slice(0); + } + return requestData; + } + /** + * Converts this instance to a Request. + * + * @return {Request} + */ + toRequest() { + return new Request(this._requestData.url, this._requestData); + } + /** + * Creates and returns a deep clone of the instance. + * + * @return {StorableRequest} + */ + clone() { + return new StorableRequest(this.toObject()); + } + } + + /* + 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 TAG_PREFIX = 'workbox-background-sync'; + const MAX_RETENTION_TIME = 60 * 24 * 7; // 7 days in minutes + const queueNames = new Set(); + /** + * Converts a QueueStore entry into the format exposed by Queue. This entails + * converting the request data into a real request and omitting the `id` and + * `queueName` properties. + * + * @param {UnidentifiedQueueStoreEntry} queueStoreEntry + * @return {Queue} + * @private + */ + const convertEntry = queueStoreEntry => { + const queueEntry = { + request: new StorableRequest(queueStoreEntry.requestData).toRequest(), + timestamp: queueStoreEntry.timestamp + }; + if (queueStoreEntry.metadata) { + queueEntry.metadata = queueStoreEntry.metadata; + } + return queueEntry; + }; + /** + * A class to manage storing failed requests in IndexedDB and retrying them + * later. All parts of the storing and replaying process are observable via + * callbacks. + * + * @memberof workbox-background-sync + */ + class Queue { + /** + * Creates an instance of Queue with the given options + * + * @param {string} name The unique name for this queue. This name must be + * unique as it's used to register sync events and store requests + * in IndexedDB specific to this instance. An error will be thrown if + * a duplicate name is detected. + * @param {Object} [options] + * @param {Function} [options.onSync] A function that gets invoked whenever + * the 'sync' event fires. The function is invoked with an object + * containing the `queue` property (referencing this instance), and you + * can use the callback to customize the replay behavior of the queue. + * When not set the `replayRequests()` method is called. + * Note: if the replay fails after a sync event, make sure you throw an + * error, so the browser knows to retry the sync event later. + * @param {number} [options.maxRetentionTime=7 days] The amount of time (in + * minutes) a request may be retried. After this amount of time has + * passed, the request will be deleted from the queue. + * @param {boolean} [options.forceSyncFallback=false] If `true`, instead + * of attempting to use background sync events, always attempt to replay + * queued request at service worker startup. Most folks will not need + * this, unless you explicitly target a runtime like Electron that + * exposes the interfaces for background sync, but does not have a working + * implementation. + */ + constructor(name, { + forceSyncFallback, + onSync, + maxRetentionTime + } = {}) { + this._syncInProgress = false; + this._requestsAddedDuringSync = false; + // Ensure the store name is not already being used + if (queueNames.has(name)) { + throw new WorkboxError_js.WorkboxError('duplicate-queue-name', { + name + }); + } else { + queueNames.add(name); + } + this._name = name; + this._onSync = onSync || this.replayRequests; + this._maxRetentionTime = maxRetentionTime || MAX_RETENTION_TIME; + this._forceSyncFallback = Boolean(forceSyncFallback); + this._queueStore = new QueueStore(this._name); + this._addSyncListener(); + } + /** + * @return {string} + */ + get name() { + return this._name; + } + /** + * Stores the passed request in IndexedDB (with its timestamp and any + * metadata) at the end of the queue. + * + * @param {QueueEntry} entry + * @param {Request} entry.request The request to store in the queue. + * @param {Object} [entry.metadata] Any metadata you want associated with the + * stored request. When requests are replayed you'll have access to this + * metadata object in case you need to modify the request beforehand. + * @param {number} [entry.timestamp] The timestamp (Epoch time in + * milliseconds) when the request was first added to the queue. This is + * used along with `maxRetentionTime` to remove outdated requests. In + * general you don't need to set this value, as it's automatically set + * for you (defaulting to `Date.now()`), but you can update it if you + * don't want particular requests to expire. + */ + async pushRequest(entry) { + { + assert_js.assert.isType(entry, 'object', { + moduleName: 'workbox-background-sync', + className: 'Queue', + funcName: 'pushRequest', + paramName: 'entry' + }); + assert_js.assert.isInstance(entry.request, Request, { + moduleName: 'workbox-background-sync', + className: 'Queue', + funcName: 'pushRequest', + paramName: 'entry.request' + }); + } + await this._addRequest(entry, 'push'); + } + /** + * Stores the passed request in IndexedDB (with its timestamp and any + * metadata) at the beginning of the queue. + * + * @param {QueueEntry} entry + * @param {Request} entry.request The request to store in the queue. + * @param {Object} [entry.metadata] Any metadata you want associated with the + * stored request. When requests are replayed you'll have access to this + * metadata object in case you need to modify the request beforehand. + * @param {number} [entry.timestamp] The timestamp (Epoch time in + * milliseconds) when the request was first added to the queue. This is + * used along with `maxRetentionTime` to remove outdated requests. In + * general you don't need to set this value, as it's automatically set + * for you (defaulting to `Date.now()`), but you can update it if you + * don't want particular requests to expire. + */ + async unshiftRequest(entry) { + { + assert_js.assert.isType(entry, 'object', { + moduleName: 'workbox-background-sync', + className: 'Queue', + funcName: 'unshiftRequest', + paramName: 'entry' + }); + assert_js.assert.isInstance(entry.request, Request, { + moduleName: 'workbox-background-sync', + className: 'Queue', + funcName: 'unshiftRequest', + paramName: 'entry.request' + }); + } + await this._addRequest(entry, 'unshift'); + } + /** + * Removes and returns the last request in the queue (along with its + * timestamp and any metadata). The returned object takes the form: + * `{request, timestamp, metadata}`. + * + * @return {Promise} + */ + async popRequest() { + return this._removeRequest('pop'); + } + /** + * Removes and returns the first request in the queue (along with its + * timestamp and any metadata). The returned object takes the form: + * `{request, timestamp, metadata}`. + * + * @return {Promise} + */ + async shiftRequest() { + return this._removeRequest('shift'); + } + /** + * Returns all the entries that have not expired (per `maxRetentionTime`). + * Any expired entries are removed from the queue. + * + * @return {Promise>} + */ + async getAll() { + const allEntries = await this._queueStore.getAll(); + const now = Date.now(); + const unexpiredEntries = []; + for (const entry of allEntries) { + // Ignore requests older than maxRetentionTime. Call this function + // recursively until an unexpired request is found. + const maxRetentionTimeInMs = this._maxRetentionTime * 60 * 1000; + if (now - entry.timestamp > maxRetentionTimeInMs) { + await this._queueStore.deleteEntry(entry.id); + } else { + unexpiredEntries.push(convertEntry(entry)); + } + } + return unexpiredEntries; + } + /** + * Returns the number of entries present in the queue. + * Note that expired entries (per `maxRetentionTime`) are also included in this count. + * + * @return {Promise} + */ + async size() { + return await this._queueStore.size(); + } + /** + * Adds the entry to the QueueStore and registers for a sync event. + * + * @param {Object} entry + * @param {Request} entry.request + * @param {Object} [entry.metadata] + * @param {number} [entry.timestamp=Date.now()] + * @param {string} operation ('push' or 'unshift') + * @private + */ + async _addRequest({ + request, + metadata, + timestamp = Date.now() + }, operation) { + const storableRequest = await StorableRequest.fromRequest(request.clone()); + const entry = { + requestData: storableRequest.toObject(), + timestamp + }; + // Only include metadata if it's present. + if (metadata) { + entry.metadata = metadata; + } + switch (operation) { + case 'push': + await this._queueStore.pushEntry(entry); + break; + case 'unshift': + await this._queueStore.unshiftEntry(entry); + break; + } + { + logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(request.url)}' has ` + `been added to background sync queue '${this._name}'.`); + } + // Don't register for a sync if we're in the middle of a sync. Instead, + // we wait until the sync is complete and call register if + // `this._requestsAddedDuringSync` is true. + if (this._syncInProgress) { + this._requestsAddedDuringSync = true; + } else { + await this.registerSync(); + } + } + /** + * Removes and returns the first or last (depending on `operation`) entry + * from the QueueStore that's not older than the `maxRetentionTime`. + * + * @param {string} operation ('pop' or 'shift') + * @return {Object|undefined} + * @private + */ + async _removeRequest(operation) { + const now = Date.now(); + let entry; + switch (operation) { + case 'pop': + entry = await this._queueStore.popEntry(); + break; + case 'shift': + entry = await this._queueStore.shiftEntry(); + break; + } + if (entry) { + // Ignore requests older than maxRetentionTime. Call this function + // recursively until an unexpired request is found. + const maxRetentionTimeInMs = this._maxRetentionTime * 60 * 1000; + if (now - entry.timestamp > maxRetentionTimeInMs) { + return this._removeRequest(operation); + } + return convertEntry(entry); + } else { + return undefined; + } + } + /** + * Loops through each request in the queue and attempts to re-fetch it. + * If any request fails to re-fetch, it's put back in the same position in + * the queue (which registers a retry for the next sync event). + */ + async replayRequests() { + let entry; + while (entry = await this.shiftRequest()) { + try { + await fetch(entry.request.clone()); + if ("dev" !== 'production') { + logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(entry.request.url)}' ` + `has been replayed in queue '${this._name}'`); + } + } catch (error) { + await this.unshiftRequest(entry); + { + logger_js.logger.log(`Request for '${getFriendlyURL_js.getFriendlyURL(entry.request.url)}' ` + `failed to replay, putting it back in queue '${this._name}'`); + } + throw new WorkboxError_js.WorkboxError('queue-replay-failed', { + name: this._name + }); + } + } + { + logger_js.logger.log(`All requests in queue '${this.name}' have successfully ` + `replayed; the queue is now empty!`); + } + } + /** + * Registers a sync event with a tag unique to this instance. + */ + async registerSync() { + // See https://github.com/GoogleChrome/workbox/issues/2393 + if ('sync' in self.registration && !this._forceSyncFallback) { + try { + await self.registration.sync.register(`${TAG_PREFIX}:${this._name}`); + } catch (err) { + // This means the registration failed for some reason, possibly due to + // the user disabling it. + { + logger_js.logger.warn(`Unable to register sync event for '${this._name}'.`, err); + } + } + } + } + /** + * In sync-supporting browsers, this adds a listener for the sync event. + * In non-sync-supporting browsers, or if _forceSyncFallback is true, this + * will retry the queue on service worker startup. + * + * @private + */ + _addSyncListener() { + // See https://github.com/GoogleChrome/workbox/issues/2393 + if ('sync' in self.registration && !this._forceSyncFallback) { + self.addEventListener('sync', event => { + if (event.tag === `${TAG_PREFIX}:${this._name}`) { + { + logger_js.logger.log(`Background sync for tag '${event.tag}' ` + `has been received`); + } + const syncComplete = async () => { + this._syncInProgress = true; + let syncError; + try { + await this._onSync({ + queue: this + }); + } catch (error) { + if (error instanceof Error) { + syncError = error; + // Rethrow the error. Note: the logic in the finally clause + // will run before this gets rethrown. + throw syncError; + } + } finally { + // New items may have been added to the queue during the sync, + // so we need to register for a new sync if that's happened... + // Unless there was an error during the sync, in which + // case the browser will automatically retry later, as long + // as `event.lastChance` is not true. + if (this._requestsAddedDuringSync && !(syncError && !event.lastChance)) { + await this.registerSync(); + } + this._syncInProgress = false; + this._requestsAddedDuringSync = false; + } + }; + event.waitUntil(syncComplete()); + } + }); + } else { + { + logger_js.logger.log(`Background sync replaying without background sync event`); + } + // If the browser doesn't support background sync, or the developer has + // opted-in to not using it, retry every time the service worker starts up + // as a fallback. + void this._onSync({ + queue: this + }); + } + } + /** + * Returns the set of queue names. This is primarily used to reset the list + * of queue names in tests. + * + * @return {Set} + * + * @private + */ + static get _queueNames() { + return queueNames; + } + } + + /* + 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 `fetchDidFail` lifecycle callback. This makes it + * easier to add failed requests to a background sync Queue. + * + * @memberof workbox-background-sync + */ + class BackgroundSyncPlugin { + /** + * @param {string} name See the {@link workbox-background-sync.Queue} + * documentation for parameter details. + * @param {Object} [options] See the + * {@link workbox-background-sync.Queue} documentation for + * parameter details. + */ + constructor(name, options) { + /** + * @param {Object} options + * @param {Request} options.request + * @private + */ + this.fetchDidFail = async ({ + request + }) => { + await this._queue.pushRequest({ + request + }); + }; + this._queue = new Queue(name, options); + } + } + + exports.BackgroundSyncPlugin = BackgroundSyncPlugin; + exports.Queue = Queue; + exports.QueueStore = QueueStore; + exports.StorableRequest = StorableRequest; + + return exports; + +})({}, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private); +//# sourceMappingURL=workbox-background-sync.dev.js.map diff --git a/tools/ui/node_modules/workbox-background-sync/build/workbox-background-sync.dev.js.map b/tools/ui/node_modules/workbox-background-sync/build/workbox-background-sync.dev.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f05b35c413514940c6aae6a2f35e434f405d346c --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/build/workbox-background-sync.dev.js.map @@ -0,0 +1 @@ +{"version":3,"file":"workbox-background-sync.dev.js","sources":["../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.js","../_version.js","../lib/QueueDb.js","../lib/QueueStore.js","../lib/StorableRequest.js","../Queue.js","../BackgroundSyncPlugin.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:background-sync:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2021 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 } from 'idb';\nimport '../_version.js';\nconst DB_VERSION = 3;\nconst DB_NAME = 'workbox-background-sync';\nconst REQUEST_OBJECT_STORE_NAME = 'requests';\nconst QUEUE_NAME_INDEX = 'queueName';\n/**\n * A class to interact directly an IndexedDB created specifically to save and\n * retrieve QueueStoreEntries. This class encapsulates all the schema details\n * to store the representation of a Queue.\n *\n * @private\n */\nexport class QueueDb {\n constructor() {\n this._db = null;\n }\n /**\n * Add QueueStoreEntry to underlying db.\n *\n * @param {UnidentifiedQueueStoreEntry} entry\n */\n async addEntry(entry) {\n const db = await this.getDb();\n const tx = db.transaction(REQUEST_OBJECT_STORE_NAME, 'readwrite', {\n durability: 'relaxed',\n });\n await tx.store.add(entry);\n await tx.done;\n }\n /**\n * Returns the first entry id in the ObjectStore.\n *\n * @return {number | undefined}\n */\n async getFirstEntryId() {\n const db = await this.getDb();\n const cursor = await db\n .transaction(REQUEST_OBJECT_STORE_NAME)\n .store.openCursor();\n return cursor === null || cursor === void 0 ? void 0 : cursor.value.id;\n }\n /**\n * Get all the entries filtered by index\n *\n * @param queueName\n * @return {Promise}\n */\n async getAllEntriesByQueueName(queueName) {\n const db = await this.getDb();\n const results = await db.getAllFromIndex(REQUEST_OBJECT_STORE_NAME, QUEUE_NAME_INDEX, IDBKeyRange.only(queueName));\n return results ? results : new Array();\n }\n /**\n * Returns the number of entries filtered by index\n *\n * @param queueName\n * @return {Promise}\n */\n async getEntryCountByQueueName(queueName) {\n const db = await this.getDb();\n return db.countFromIndex(REQUEST_OBJECT_STORE_NAME, QUEUE_NAME_INDEX, IDBKeyRange.only(queueName));\n }\n /**\n * Deletes a single entry by id.\n *\n * @param {number} id the id of the entry to be deleted\n */\n async deleteEntry(id) {\n const db = await this.getDb();\n await db.delete(REQUEST_OBJECT_STORE_NAME, id);\n }\n /**\n *\n * @param queueName\n * @returns {Promise}\n */\n async getFirstEntryByQueueName(queueName) {\n return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'next');\n }\n /**\n *\n * @param queueName\n * @returns {Promise}\n */\n async getLastEntryByQueueName(queueName) {\n return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'prev');\n }\n /**\n * Returns either the first or the last entries, depending on direction.\n * Filtered by index.\n *\n * @param {IDBCursorDirection} direction\n * @param {IDBKeyRange} query\n * @return {Promise}\n * @private\n */\n async getEndEntryFromIndex(query, direction) {\n const db = await this.getDb();\n const cursor = await db\n .transaction(REQUEST_OBJECT_STORE_NAME)\n .store.index(QUEUE_NAME_INDEX)\n .openCursor(query, direction);\n return cursor === null || cursor === void 0 ? void 0 : cursor.value;\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, DB_VERSION, {\n upgrade: this._upgradeDb,\n });\n }\n return this._db;\n }\n /**\n * Upgrades QueueDB\n *\n * @param {IDBPDatabase} db\n * @param {number} oldVersion\n * @private\n */\n _upgradeDb(db, oldVersion) {\n if (oldVersion > 0 && oldVersion < DB_VERSION) {\n if (db.objectStoreNames.contains(REQUEST_OBJECT_STORE_NAME)) {\n db.deleteObjectStore(REQUEST_OBJECT_STORE_NAME);\n }\n }\n const objStore = db.createObjectStore(REQUEST_OBJECT_STORE_NAME, {\n autoIncrement: true,\n keyPath: 'id',\n });\n objStore.createIndex(QUEUE_NAME_INDEX, QUEUE_NAME_INDEX, { unique: false });\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 { QueueDb, } from './QueueDb.js';\nimport '../_version.js';\n/**\n * A class to manage storing requests from a Queue in IndexedDB,\n * indexed by their queue name for easier access.\n *\n * Most developers will not need to access this class directly;\n * it is exposed for advanced use cases.\n */\nexport class QueueStore {\n /**\n * Associates this instance with a Queue instance, so entries added can be\n * identified by their queue name.\n *\n * @param {string} queueName\n */\n constructor(queueName) {\n this._queueName = queueName;\n this._queueDb = new QueueDb();\n }\n /**\n * Append an entry last in the queue.\n *\n * @param {Object} entry\n * @param {Object} entry.requestData\n * @param {number} [entry.timestamp]\n * @param {Object} [entry.metadata]\n */\n async pushEntry(entry) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(entry, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'QueueStore',\n funcName: 'pushEntry',\n paramName: 'entry',\n });\n assert.isType(entry.requestData, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'QueueStore',\n funcName: 'pushEntry',\n paramName: 'entry.requestData',\n });\n }\n // Don't specify an ID since one is automatically generated.\n delete entry.id;\n entry.queueName = this._queueName;\n await this._queueDb.addEntry(entry);\n }\n /**\n * Prepend an entry first in the queue.\n *\n * @param {Object} entry\n * @param {Object} entry.requestData\n * @param {number} [entry.timestamp]\n * @param {Object} [entry.metadata]\n */\n async unshiftEntry(entry) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(entry, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'QueueStore',\n funcName: 'unshiftEntry',\n paramName: 'entry',\n });\n assert.isType(entry.requestData, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'QueueStore',\n funcName: 'unshiftEntry',\n paramName: 'entry.requestData',\n });\n }\n const firstId = await this._queueDb.getFirstEntryId();\n if (firstId) {\n // Pick an ID one less than the lowest ID in the object store.\n entry.id = firstId - 1;\n }\n else {\n // Otherwise let the auto-incrementor assign the ID.\n delete entry.id;\n }\n entry.queueName = this._queueName;\n await this._queueDb.addEntry(entry);\n }\n /**\n * Removes and returns the last entry in the queue matching the `queueName`.\n *\n * @return {Promise}\n */\n async popEntry() {\n return this._removeEntry(await this._queueDb.getLastEntryByQueueName(this._queueName));\n }\n /**\n * Removes and returns the first entry in the queue matching the `queueName`.\n *\n * @return {Promise}\n */\n async shiftEntry() {\n return this._removeEntry(await this._queueDb.getFirstEntryByQueueName(this._queueName));\n }\n /**\n * Returns all entries in the store matching the `queueName`.\n *\n * @param {Object} options See {@link workbox-background-sync.Queue~getAll}\n * @return {Promise>}\n */\n async getAll() {\n return await this._queueDb.getAllEntriesByQueueName(this._queueName);\n }\n /**\n * Returns the number of entries in the store matching the `queueName`.\n *\n * @param {Object} options See {@link workbox-background-sync.Queue~size}\n * @return {Promise}\n */\n async size() {\n return await this._queueDb.getEntryCountByQueueName(this._queueName);\n }\n /**\n * Deletes the entry for the given ID.\n *\n * WARNING: this method does not ensure the deleted entry belongs to this\n * queue (i.e. matches the `queueName`). But this limitation is acceptable\n * as this class is not publicly exposed. An additional check would make\n * this method slower than it needs to be.\n *\n * @param {number} id\n */\n async deleteEntry(id) {\n await this._queueDb.deleteEntry(id);\n }\n /**\n * Removes and returns the first or last entry in the queue (based on the\n * `direction` argument) matching the `queueName`.\n *\n * @return {Promise}\n * @private\n */\n async _removeEntry(entry) {\n if (entry) {\n await this.deleteEntry(entry.id);\n }\n return entry;\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 '../_version.js';\nconst serializableProperties = [\n 'method',\n 'referrer',\n 'referrerPolicy',\n 'mode',\n 'credentials',\n 'cache',\n 'redirect',\n 'integrity',\n 'keepalive',\n];\n/**\n * A class to make it easier to serialize and de-serialize requests so they\n * can be stored in IndexedDB.\n *\n * Most developers will not need to access this class directly;\n * it is exposed for advanced use cases.\n */\nclass StorableRequest {\n /**\n * Converts a Request object to a plain object that can be structured\n * cloned or JSON-stringified.\n *\n * @param {Request} request\n * @return {Promise}\n */\n static async fromRequest(request) {\n const requestData = {\n url: request.url,\n headers: {},\n };\n // Set the body if present.\n if (request.method !== 'GET') {\n // Use ArrayBuffer to support non-text request bodies.\n // NOTE: we can't use Blobs becuse Safari doesn't support storing\n // Blobs in IndexedDB in some cases:\n // https://github.com/dfahlander/Dexie.js/issues/618#issuecomment-398348457\n requestData.body = await request.clone().arrayBuffer();\n }\n // Convert the headers from an iterable to an object.\n for (const [key, value] of request.headers.entries()) {\n requestData.headers[key] = value;\n }\n // Add all other serializable request properties\n for (const prop of serializableProperties) {\n if (request[prop] !== undefined) {\n requestData[prop] = request[prop];\n }\n }\n return new StorableRequest(requestData);\n }\n /**\n * Accepts an object of request data that can be used to construct a\n * `Request` but can also be stored in IndexedDB.\n *\n * @param {Object} requestData An object of request data that includes the\n * `url` plus any relevant properties of\n * [requestInit]{@link https://fetch.spec.whatwg.org/#requestinit}.\n */\n constructor(requestData) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(requestData, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'StorableRequest',\n funcName: 'constructor',\n paramName: 'requestData',\n });\n assert.isType(requestData.url, 'string', {\n moduleName: 'workbox-background-sync',\n className: 'StorableRequest',\n funcName: 'constructor',\n paramName: 'requestData.url',\n });\n }\n // If the request's mode is `navigate`, convert it to `same-origin` since\n // navigation requests can't be constructed via script.\n if (requestData['mode'] === 'navigate') {\n requestData['mode'] = 'same-origin';\n }\n this._requestData = requestData;\n }\n /**\n * Returns a deep clone of the instances `_requestData` object.\n *\n * @return {Object}\n */\n toObject() {\n const requestData = Object.assign({}, this._requestData);\n requestData.headers = Object.assign({}, this._requestData.headers);\n if (requestData.body) {\n requestData.body = requestData.body.slice(0);\n }\n return requestData;\n }\n /**\n * Converts this instance to a Request.\n *\n * @return {Request}\n */\n toRequest() {\n return new Request(this._requestData.url, this._requestData);\n }\n /**\n * Creates and returns a deep clone of the instance.\n *\n * @return {StorableRequest}\n */\n clone() {\n return new StorableRequest(this.toObject());\n }\n}\nexport { StorableRequest };\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 { logger } from 'workbox-core/_private/logger.js';\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { QueueStore } from './lib/QueueStore.js';\nimport { StorableRequest } from './lib/StorableRequest.js';\nimport './_version.js';\nconst TAG_PREFIX = 'workbox-background-sync';\nconst MAX_RETENTION_TIME = 60 * 24 * 7; // 7 days in minutes\nconst queueNames = new Set();\n/**\n * Converts a QueueStore entry into the format exposed by Queue. This entails\n * converting the request data into a real request and omitting the `id` and\n * `queueName` properties.\n *\n * @param {UnidentifiedQueueStoreEntry} queueStoreEntry\n * @return {Queue}\n * @private\n */\nconst convertEntry = (queueStoreEntry) => {\n const queueEntry = {\n request: new StorableRequest(queueStoreEntry.requestData).toRequest(),\n timestamp: queueStoreEntry.timestamp,\n };\n if (queueStoreEntry.metadata) {\n queueEntry.metadata = queueStoreEntry.metadata;\n }\n return queueEntry;\n};\n/**\n * A class to manage storing failed requests in IndexedDB and retrying them\n * later. All parts of the storing and replaying process are observable via\n * callbacks.\n *\n * @memberof workbox-background-sync\n */\nclass Queue {\n /**\n * Creates an instance of Queue with the given options\n *\n * @param {string} name The unique name for this queue. This name must be\n * unique as it's used to register sync events and store requests\n * in IndexedDB specific to this instance. An error will be thrown if\n * a duplicate name is detected.\n * @param {Object} [options]\n * @param {Function} [options.onSync] A function that gets invoked whenever\n * the 'sync' event fires. The function is invoked with an object\n * containing the `queue` property (referencing this instance), and you\n * can use the callback to customize the replay behavior of the queue.\n * When not set the `replayRequests()` method is called.\n * Note: if the replay fails after a sync event, make sure you throw an\n * error, so the browser knows to retry the sync event later.\n * @param {number} [options.maxRetentionTime=7 days] The amount of time (in\n * minutes) a request may be retried. After this amount of time has\n * passed, the request will be deleted from the queue.\n * @param {boolean} [options.forceSyncFallback=false] If `true`, instead\n * of attempting to use background sync events, always attempt to replay\n * queued request at service worker startup. Most folks will not need\n * this, unless you explicitly target a runtime like Electron that\n * exposes the interfaces for background sync, but does not have a working\n * implementation.\n */\n constructor(name, { forceSyncFallback, onSync, maxRetentionTime } = {}) {\n this._syncInProgress = false;\n this._requestsAddedDuringSync = false;\n // Ensure the store name is not already being used\n if (queueNames.has(name)) {\n throw new WorkboxError('duplicate-queue-name', { name });\n }\n else {\n queueNames.add(name);\n }\n this._name = name;\n this._onSync = onSync || this.replayRequests;\n this._maxRetentionTime = maxRetentionTime || MAX_RETENTION_TIME;\n this._forceSyncFallback = Boolean(forceSyncFallback);\n this._queueStore = new QueueStore(this._name);\n this._addSyncListener();\n }\n /**\n * @return {string}\n */\n get name() {\n return this._name;\n }\n /**\n * Stores the passed request in IndexedDB (with its timestamp and any\n * metadata) at the end of the queue.\n *\n * @param {QueueEntry} entry\n * @param {Request} entry.request The request to store in the queue.\n * @param {Object} [entry.metadata] Any metadata you want associated with the\n * stored request. When requests are replayed you'll have access to this\n * metadata object in case you need to modify the request beforehand.\n * @param {number} [entry.timestamp] The timestamp (Epoch time in\n * milliseconds) when the request was first added to the queue. This is\n * used along with `maxRetentionTime` to remove outdated requests. In\n * general you don't need to set this value, as it's automatically set\n * for you (defaulting to `Date.now()`), but you can update it if you\n * don't want particular requests to expire.\n */\n async pushRequest(entry) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(entry, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'Queue',\n funcName: 'pushRequest',\n paramName: 'entry',\n });\n assert.isInstance(entry.request, Request, {\n moduleName: 'workbox-background-sync',\n className: 'Queue',\n funcName: 'pushRequest',\n paramName: 'entry.request',\n });\n }\n await this._addRequest(entry, 'push');\n }\n /**\n * Stores the passed request in IndexedDB (with its timestamp and any\n * metadata) at the beginning of the queue.\n *\n * @param {QueueEntry} entry\n * @param {Request} entry.request The request to store in the queue.\n * @param {Object} [entry.metadata] Any metadata you want associated with the\n * stored request. When requests are replayed you'll have access to this\n * metadata object in case you need to modify the request beforehand.\n * @param {number} [entry.timestamp] The timestamp (Epoch time in\n * milliseconds) when the request was first added to the queue. This is\n * used along with `maxRetentionTime` to remove outdated requests. In\n * general you don't need to set this value, as it's automatically set\n * for you (defaulting to `Date.now()`), but you can update it if you\n * don't want particular requests to expire.\n */\n async unshiftRequest(entry) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(entry, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'Queue',\n funcName: 'unshiftRequest',\n paramName: 'entry',\n });\n assert.isInstance(entry.request, Request, {\n moduleName: 'workbox-background-sync',\n className: 'Queue',\n funcName: 'unshiftRequest',\n paramName: 'entry.request',\n });\n }\n await this._addRequest(entry, 'unshift');\n }\n /**\n * Removes and returns the last request in the queue (along with its\n * timestamp and any metadata). The returned object takes the form:\n * `{request, timestamp, metadata}`.\n *\n * @return {Promise}\n */\n async popRequest() {\n return this._removeRequest('pop');\n }\n /**\n * Removes and returns the first request in the queue (along with its\n * timestamp and any metadata). The returned object takes the form:\n * `{request, timestamp, metadata}`.\n *\n * @return {Promise}\n */\n async shiftRequest() {\n return this._removeRequest('shift');\n }\n /**\n * Returns all the entries that have not expired (per `maxRetentionTime`).\n * Any expired entries are removed from the queue.\n *\n * @return {Promise>}\n */\n async getAll() {\n const allEntries = await this._queueStore.getAll();\n const now = Date.now();\n const unexpiredEntries = [];\n for (const entry of allEntries) {\n // Ignore requests older than maxRetentionTime. Call this function\n // recursively until an unexpired request is found.\n const maxRetentionTimeInMs = this._maxRetentionTime * 60 * 1000;\n if (now - entry.timestamp > maxRetentionTimeInMs) {\n await this._queueStore.deleteEntry(entry.id);\n }\n else {\n unexpiredEntries.push(convertEntry(entry));\n }\n }\n return unexpiredEntries;\n }\n /**\n * Returns the number of entries present in the queue.\n * Note that expired entries (per `maxRetentionTime`) are also included in this count.\n *\n * @return {Promise}\n */\n async size() {\n return await this._queueStore.size();\n }\n /**\n * Adds the entry to the QueueStore and registers for a sync event.\n *\n * @param {Object} entry\n * @param {Request} entry.request\n * @param {Object} [entry.metadata]\n * @param {number} [entry.timestamp=Date.now()]\n * @param {string} operation ('push' or 'unshift')\n * @private\n */\n async _addRequest({ request, metadata, timestamp = Date.now() }, operation) {\n const storableRequest = await StorableRequest.fromRequest(request.clone());\n const entry = {\n requestData: storableRequest.toObject(),\n timestamp,\n };\n // Only include metadata if it's present.\n if (metadata) {\n entry.metadata = metadata;\n }\n switch (operation) {\n case 'push':\n await this._queueStore.pushEntry(entry);\n break;\n case 'unshift':\n await this._queueStore.unshiftEntry(entry);\n break;\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Request for '${getFriendlyURL(request.url)}' has ` +\n `been added to background sync queue '${this._name}'.`);\n }\n // Don't register for a sync if we're in the middle of a sync. Instead,\n // we wait until the sync is complete and call register if\n // `this._requestsAddedDuringSync` is true.\n if (this._syncInProgress) {\n this._requestsAddedDuringSync = true;\n }\n else {\n await this.registerSync();\n }\n }\n /**\n * Removes and returns the first or last (depending on `operation`) entry\n * from the QueueStore that's not older than the `maxRetentionTime`.\n *\n * @param {string} operation ('pop' or 'shift')\n * @return {Object|undefined}\n * @private\n */\n async _removeRequest(operation) {\n const now = Date.now();\n let entry;\n switch (operation) {\n case 'pop':\n entry = await this._queueStore.popEntry();\n break;\n case 'shift':\n entry = await this._queueStore.shiftEntry();\n break;\n }\n if (entry) {\n // Ignore requests older than maxRetentionTime. Call this function\n // recursively until an unexpired request is found.\n const maxRetentionTimeInMs = this._maxRetentionTime * 60 * 1000;\n if (now - entry.timestamp > maxRetentionTimeInMs) {\n return this._removeRequest(operation);\n }\n return convertEntry(entry);\n }\n else {\n return undefined;\n }\n }\n /**\n * Loops through each request in the queue and attempts to re-fetch it.\n * If any request fails to re-fetch, it's put back in the same position in\n * the queue (which registers a retry for the next sync event).\n */\n async replayRequests() {\n let entry;\n while ((entry = await this.shiftRequest())) {\n try {\n await fetch(entry.request.clone());\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Request for '${getFriendlyURL(entry.request.url)}' ` +\n `has been replayed in queue '${this._name}'`);\n }\n }\n catch (error) {\n await this.unshiftRequest(entry);\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Request for '${getFriendlyURL(entry.request.url)}' ` +\n `failed to replay, putting it back in queue '${this._name}'`);\n }\n throw new WorkboxError('queue-replay-failed', { name: this._name });\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`All requests in queue '${this.name}' have successfully ` +\n `replayed; the queue is now empty!`);\n }\n }\n /**\n * Registers a sync event with a tag unique to this instance.\n */\n async registerSync() {\n // See https://github.com/GoogleChrome/workbox/issues/2393\n if ('sync' in self.registration && !this._forceSyncFallback) {\n try {\n await self.registration.sync.register(`${TAG_PREFIX}:${this._name}`);\n }\n catch (err) {\n // This means the registration failed for some reason, possibly due to\n // the user disabling it.\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`Unable to register sync event for '${this._name}'.`, err);\n }\n }\n }\n }\n /**\n * In sync-supporting browsers, this adds a listener for the sync event.\n * In non-sync-supporting browsers, or if _forceSyncFallback is true, this\n * will retry the queue on service worker startup.\n *\n * @private\n */\n _addSyncListener() {\n // See https://github.com/GoogleChrome/workbox/issues/2393\n if ('sync' in self.registration && !this._forceSyncFallback) {\n self.addEventListener('sync', (event) => {\n if (event.tag === `${TAG_PREFIX}:${this._name}`) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Background sync for tag '${event.tag}' ` + `has been received`);\n }\n const syncComplete = async () => {\n this._syncInProgress = true;\n let syncError;\n try {\n await this._onSync({ queue: this });\n }\n catch (error) {\n if (error instanceof Error) {\n syncError = error;\n // Rethrow the error. Note: the logic in the finally clause\n // will run before this gets rethrown.\n throw syncError;\n }\n }\n finally {\n // New items may have been added to the queue during the sync,\n // so we need to register for a new sync if that's happened...\n // Unless there was an error during the sync, in which\n // case the browser will automatically retry later, as long\n // as `event.lastChance` is not true.\n if (this._requestsAddedDuringSync &&\n !(syncError && !event.lastChance)) {\n await this.registerSync();\n }\n this._syncInProgress = false;\n this._requestsAddedDuringSync = false;\n }\n };\n event.waitUntil(syncComplete());\n }\n });\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Background sync replaying without background sync event`);\n }\n // If the browser doesn't support background sync, or the developer has\n // opted-in to not using it, retry every time the service worker starts up\n // as a fallback.\n void this._onSync({ queue: this });\n }\n }\n /**\n * Returns the set of queue names. This is primarily used to reset the list\n * of queue names in tests.\n *\n * @return {Set}\n *\n * @private\n */\n static get _queueNames() {\n return queueNames;\n }\n}\nexport { Queue };\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 { Queue } from './Queue.js';\nimport './_version.js';\n/**\n * A class implementing the `fetchDidFail` lifecycle callback. This makes it\n * easier to add failed requests to a background sync Queue.\n *\n * @memberof workbox-background-sync\n */\nclass BackgroundSyncPlugin {\n /**\n * @param {string} name See the {@link workbox-background-sync.Queue}\n * documentation for parameter details.\n * @param {Object} [options] See the\n * {@link workbox-background-sync.Queue} documentation for\n * parameter details.\n */\n constructor(name, options) {\n /**\n * @param {Object} options\n * @param {Request} options.request\n * @private\n */\n this.fetchDidFail = async ({ request }) => {\n await this._queue.pushRequest({ request });\n };\n this._queue = new Queue(name, options);\n }\n}\nexport { BackgroundSyncPlugin };\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","readMethods","writeMethods","cachedMethods","Map","getMethod","targetFuncName","replace","useIndex","isWrite","method","storeName","store","index","shift","all","oldTraps","_extends","self","_","e","DB_VERSION","DB_NAME","REQUEST_OBJECT_STORE_NAME","QUEUE_NAME_INDEX","QueueDb","constructor","_db","addEntry","entry","getDb","durability","add","getFirstEntryId","cursor","openCursor","id","getAllEntriesByQueueName","queueName","results","getAllFromIndex","IDBKeyRange","only","Array","getEntryCountByQueueName","countFromIndex","deleteEntry","delete","getFirstEntryByQueueName","getEndEntryFromIndex","getLastEntryByQueueName","query","direction","_upgradeDb","contains","deleteObjectStore","objStore","createObjectStore","autoIncrement","keyPath","createIndex","unique","QueueStore","_queueName","_queueDb","pushEntry","assert","isType","moduleName","className","funcName","paramName","requestData","unshiftEntry","firstId","popEntry","_removeEntry","shiftEntry","getAll","size","serializableProperties","StorableRequest","fromRequest","url","headers","body","clone","arrayBuffer","key","entries","_requestData","toObject","Object","assign","slice","toRequest","Request","TAG_PREFIX","MAX_RETENTION_TIME","queueNames","Set","convertEntry","queueStoreEntry","queueEntry","timestamp","metadata","Queue","forceSyncFallback","onSync","maxRetentionTime","_syncInProgress","_requestsAddedDuringSync","WorkboxError","_name","_onSync","replayRequests","_maxRetentionTime","_forceSyncFallback","Boolean","_queueStore","_addSyncListener","pushRequest","isInstance","_addRequest","unshiftRequest","popRequest","_removeRequest","shiftRequest","allEntries","now","Date","unexpiredEntries","maxRetentionTimeInMs","push","operation","storableRequest","logger","log","getFriendlyURL","registerSync","fetch","process","registration","sync","register","err","warn","tag","syncComplete","syncError","queue","Error","lastChance","waitUntil","_queueNames","BackgroundSyncPlugin","options","fetchDidFail","_queue"],"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,iBAAiB,GAAG,CACjBG,WAAW,EACXC,cAAc,EACdC,QAAQ,EACRC,SAAS,EACTC,cAAc,CACjB,CAAC;EACV;EACA;EACA,SAASC,uBAAuBA,GAAG;IAC/B,OAAQP,oBAAoB,KACvBA,oBAAoB,GAAG,CACpBK,SAAS,CAACG,SAAS,CAACC,OAAO,EAC3BJ,SAAS,CAACG,SAAS,CAACE,QAAQ,EAC5BL,SAAS,CAACG,SAAS,CAACG,kBAAkB,CACzC,CAAC;EACV;EACA,MAAMC,gBAAgB,GAAG,IAAIC,OAAO,EAAE;EACtC,MAAMC,kBAAkB,GAAG,IAAID,OAAO,EAAE;EACxC,MAAME,wBAAwB,GAAG,IAAIF,OAAO,EAAE;EAC9C,MAAMG,cAAc,GAAG,IAAIH,OAAO,EAAE;EACpC,MAAMI,qBAAqB,GAAG,IAAIJ,OAAO,EAAE;EAC3C,SAASK,gBAAgBA,CAACC,OAAO,EAAE;IAC/B,MAAMC,OAAO,GAAG,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;MAC7C,MAAMC,QAAQ,GAAGA,MAAM;EACnBL,MAAAA,OAAO,CAACM,mBAAmB,CAAC,SAAS,EAAEC,OAAO,CAAC;EAC/CP,MAAAA,OAAO,CAACM,mBAAmB,CAAC,OAAO,EAAEE,KAAK,CAAC;MAC/C,CAAC;MACD,MAAMD,OAAO,GAAGA,MAAM;EAClBJ,MAAAA,OAAO,CAACM,IAAI,CAACT,OAAO,CAACU,MAAM,CAAC,CAAC;EAC7BL,MAAAA,QAAQ,EAAE;MACd,CAAC;MACD,MAAMG,KAAK,GAAGA,MAAM;EAChBJ,MAAAA,MAAM,CAACJ,OAAO,CAACQ,KAAK,CAAC;EACrBH,MAAAA,QAAQ,EAAE;MACd,CAAC;EACDL,IAAAA,OAAO,CAACW,gBAAgB,CAAC,SAAS,EAAEJ,OAAO,CAAC;EAC5CP,IAAAA,OAAO,CAACW,gBAAgB,CAAC,OAAO,EAAEH,KAAK,CAAC;EAC5C,EAAA,CAAC,CAAC;EACFP,EAAAA,OAAO,CACFW,IAAI,CAAEC,KAAK,IAAK;EACjB;EACA;MACA,IAAIA,KAAK,YAAY3B,SAAS,EAAE;EAC5BO,MAAAA,gBAAgB,CAACqB,GAAG,CAACD,KAAK,EAAEb,OAAO,CAAC;EACxC,IAAA;EACA;EACJ,EAAA,CAAC,CAAC,CACGe,KAAK,CAAC,MAAM,CAAE,CAAC,CAAC;EACrB;EACA;EACAjB,EAAAA,qBAAqB,CAACgB,GAAG,CAACb,OAAO,EAAED,OAAO,CAAC;EAC3C,EAAA,OAAOC,OAAO;EAClB;EACA,SAASe,8BAA8BA,CAACC,EAAE,EAAE;EACxC;EACA,EAAA,IAAItB,kBAAkB,CAACuB,GAAG,CAACD,EAAE,CAAC,EAC1B;IACJ,MAAME,IAAI,GAAG,IAAIjB,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;MAC1C,MAAMC,QAAQ,GAAGA,MAAM;EACnBY,MAAAA,EAAE,CAACX,mBAAmB,CAAC,UAAU,EAAEc,QAAQ,CAAC;EAC5CH,MAAAA,EAAE,CAACX,mBAAmB,CAAC,OAAO,EAAEE,KAAK,CAAC;EACtCS,MAAAA,EAAE,CAACX,mBAAmB,CAAC,OAAO,EAAEE,KAAK,CAAC;MAC1C,CAAC;MACD,MAAMY,QAAQ,GAAGA,MAAM;EACnBjB,MAAAA,OAAO,EAAE;EACTE,MAAAA,QAAQ,EAAE;MACd,CAAC;MACD,MAAMG,KAAK,GAAGA,MAAM;EAChBJ,MAAAA,MAAM,CAACa,EAAE,CAACT,KAAK,IAAI,IAAIa,YAAY,CAAC,YAAY,EAAE,YAAY,CAAC,CAAC;EAChEhB,MAAAA,QAAQ,EAAE;MACd,CAAC;EACDY,IAAAA,EAAE,CAACN,gBAAgB,CAAC,UAAU,EAAES,QAAQ,CAAC;EACzCH,IAAAA,EAAE,CAACN,gBAAgB,CAAC,OAAO,EAAEH,KAAK,CAAC;EACnCS,IAAAA,EAAE,CAACN,gBAAgB,CAAC,OAAO,EAAEH,KAAK,CAAC;EACvC,EAAA,CAAC,CAAC;EACF;EACAb,EAAAA,kBAAkB,CAACmB,GAAG,CAACG,EAAE,EAAEE,IAAI,CAAC;EACpC;EACA,IAAIG,aAAa,GAAG;EAChBC,EAAAA,GAAGA,CAACC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAE;MACxB,IAAIF,MAAM,YAAYrC,cAAc,EAAE;EAClC;QACA,IAAIsC,IAAI,KAAK,MAAM,EACf,OAAO9B,kBAAkB,CAAC4B,GAAG,CAACC,MAAM,CAAC;EACzC;QACA,IAAIC,IAAI,KAAK,kBAAkB,EAAE;UAC7B,OAAOD,MAAM,CAACG,gBAAgB,IAAI/B,wBAAwB,CAAC2B,GAAG,CAACC,MAAM,CAAC;EAC1E,MAAA;EACA;QACA,IAAIC,IAAI,KAAK,OAAO,EAAE;EAClB,QAAA,OAAOC,QAAQ,CAACC,gBAAgB,CAAC,CAAC,CAAC,GAC7BC,SAAS,GACTF,QAAQ,CAACG,WAAW,CAACH,QAAQ,CAACC,gBAAgB,CAAC,CAAC,CAAC,CAAC;EAC5D,MAAA;EACJ,IAAA;EACA;EACA,IAAA,OAAOlB,IAAI,CAACe,MAAM,CAACC,IAAI,CAAC,CAAC;IAC7B,CAAC;EACDX,EAAAA,GAAGA,CAACU,MAAM,EAAEC,IAAI,EAAEZ,KAAK,EAAE;EACrBW,IAAAA,MAAM,CAACC,IAAI,CAAC,GAAGZ,KAAK;EACpB,IAAA,OAAO,IAAI;IACf,CAAC;EACDK,EAAAA,GAAGA,CAACM,MAAM,EAAEC,IAAI,EAAE;EACd,IAAA,IAAID,MAAM,YAAYrC,cAAc,KAC/BsC,IAAI,KAAK,MAAM,IAAIA,IAAI,KAAK,OAAO,CAAC,EAAE;EACvC,MAAA,OAAO,IAAI;EACf,IAAA;MACA,OAAOA,IAAI,IAAID,MAAM;EACzB,EAAA;EACJ,CAAC;EACD,SAASM,YAAYA,CAACC,QAAQ,EAAE;EAC5BT,EAAAA,aAAa,GAAGS,QAAQ,CAACT,aAAa,CAAC;EAC3C;EACA,SAASU,YAAYA,CAACC,IAAI,EAAE;EACxB;EACA;EACA;EACA,EAAA,IAAIA,IAAI,KAAKlD,WAAW,CAACM,SAAS,CAAC6C,WAAW,IAC1C,EAAE,kBAAkB,IAAI/C,cAAc,CAACE,SAAS,CAAC,EAAE;EACnD,IAAA,OAAO,UAAU8C,UAAU,EAAE,GAAGC,IAAI,EAAE;EAClC,MAAA,MAAMnB,EAAE,GAAGgB,IAAI,CAACI,IAAI,CAACC,MAAM,CAAC,IAAI,CAAC,EAAEH,UAAU,EAAE,GAAGC,IAAI,CAAC;EACvDxC,MAAAA,wBAAwB,CAACkB,GAAG,CAACG,EAAE,EAAEkB,UAAU,CAACI,IAAI,GAAGJ,UAAU,CAACI,IAAI,EAAE,GAAG,CAACJ,UAAU,CAAC,CAAC;QACpF,OAAO1B,IAAI,CAACQ,EAAE,CAAC;MACnB,CAAC;EACL,EAAA;EACA;EACA;EACA;EACA;EACA;IACA,IAAI7B,uBAAuB,EAAE,CAACoD,QAAQ,CAACP,IAAI,CAAC,EAAE;MAC1C,OAAO,UAAU,GAAGG,IAAI,EAAE;EACtB;EACA;QACAH,IAAI,CAACQ,KAAK,CAACH,MAAM,CAAC,IAAI,CAAC,EAAEF,IAAI,CAAC;QAC9B,OAAO3B,IAAI,CAAChB,gBAAgB,CAAC8B,GAAG,CAAC,IAAI,CAAC,CAAC;MAC3C,CAAC;EACL,EAAA;IACA,OAAO,UAAU,GAAGa,IAAI,EAAE;EACtB;EACA;EACA,IAAA,OAAO3B,IAAI,CAACwB,IAAI,CAACQ,KAAK,CAACH,MAAM,CAAC,IAAI,CAAC,EAAEF,IAAI,CAAC,CAAC;IAC/C,CAAC;EACL;EACA,SAASM,sBAAsBA,CAAC7B,KAAK,EAAE;IACnC,IAAI,OAAOA,KAAK,KAAK,UAAU,EAC3B,OAAOmB,YAAY,CAACnB,KAAK,CAAC;EAC9B;EACA;EACA,EAAA,IAAIA,KAAK,YAAY1B,cAAc,EAC/B6B,8BAA8B,CAACH,KAAK,CAAC;EACzC,EAAA,IAAItC,aAAa,CAACsC,KAAK,EAAE/B,oBAAoB,EAAE,CAAC,EAC5C,OAAO,IAAI6D,KAAK,CAAC9B,KAAK,EAAES,aAAa,CAAC;EAC1C;EACA,EAAA,OAAOT,KAAK;EAChB;EACA,SAASJ,IAAIA,CAACI,KAAK,EAAE;EACjB;EACA;IACA,IAAIA,KAAK,YAAY+B,UAAU,EAC3B,OAAO7C,gBAAgB,CAACc,KAAK,CAAC;EAClC;EACA;EACA,EAAA,IAAIhB,cAAc,CAACqB,GAAG,CAACL,KAAK,CAAC,EACzB,OAAOhB,cAAc,CAAC0B,GAAG,CAACV,KAAK,CAAC;EACpC,EAAA,MAAMgC,QAAQ,GAAGH,sBAAsB,CAAC7B,KAAK,CAAC;EAC9C;EACA;IACA,IAAIgC,QAAQ,KAAKhC,KAAK,EAAE;EACpBhB,IAAAA,cAAc,CAACiB,GAAG,CAACD,KAAK,EAAEgC,QAAQ,CAAC;EACnC/C,IAAAA,qBAAqB,CAACgB,GAAG,CAAC+B,QAAQ,EAAEhC,KAAK,CAAC;EAC9C,EAAA;EACA,EAAA,OAAOgC,QAAQ;EACnB;EACA,MAAMP,MAAM,GAAIzB,KAAK,IAAKf,qBAAqB,CAACyB,GAAG,CAACV,KAAK,CAAC;;ECnL1D;EACA;EACA;EACA;EACA;EACA;EACA;EACA,SAASiC,MAAMA,CAACC,IAAI,EAAEC,OAAO,EAAE;IAAEC,OAAO;IAAEC,OAAO;IAAEC,QAAQ;EAAEC,EAAAA;EAAW,CAAC,GAAG,EAAE,EAAE;IAC5E,MAAMpD,OAAO,GAAGqD,SAAS,CAACC,IAAI,CAACP,IAAI,EAAEC,OAAO,CAAC;EAC7C,EAAA,MAAMO,WAAW,GAAG9C,IAAI,CAACT,OAAO,CAAC;EACjC,EAAA,IAAIkD,OAAO,EAAE;EACTlD,IAAAA,OAAO,CAACW,gBAAgB,CAAC,eAAe,EAAG6C,KAAK,IAAK;QACjDN,OAAO,CAACzC,IAAI,CAACT,OAAO,CAACU,MAAM,CAAC,EAAE8C,KAAK,CAACC,UAAU,EAAED,KAAK,CAACE,UAAU,EAAEjD,IAAI,CAACT,OAAO,CAACkC,WAAW,CAAC,CAAC;EAChG,IAAA,CAAC,CAAC;EACN,EAAA;EACA,EAAA,IAAIe,OAAO,EACPjD,OAAO,CAACW,gBAAgB,CAAC,SAAS,EAAE,MAAMsC,OAAO,EAAE,CAAC;EACxDM,EAAAA,WAAW,CACN3C,IAAI,CAAE+C,EAAE,IAAK;EACd,IAAA,IAAIP,UAAU,EACVO,EAAE,CAAChD,gBAAgB,CAAC,OAAO,EAAE,MAAMyC,UAAU,EAAE,CAAC;EACpD,IAAA,IAAID,QAAQ,EACRQ,EAAE,CAAChD,gBAAgB,CAAC,eAAe,EAAE,MAAMwC,QAAQ,EAAE,CAAC;EAC9D,EAAA,CAAC,CAAC,CACGpC,KAAK,CAAC,MAAM,CAAE,CAAC,CAAC;EACrB,EAAA,OAAOwC,WAAW;EACtB;EAaA,MAAMK,WAAW,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,OAAO,CAAC;EACtE,MAAMC,YAAY,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,CAAC;EACtD,MAAMC,aAAa,GAAG,IAAIC,GAAG,EAAE;EAC/B,SAASC,SAASA,CAACxC,MAAM,EAAEC,IAAI,EAAE;EAC7B,EAAA,IAAI,EAAED,MAAM,YAAYzC,WAAW,IAC/B,EAAE0C,IAAI,IAAID,MAAM,CAAC,IACjB,OAAOC,IAAI,KAAK,QAAQ,CAAC,EAAE;EAC3B,IAAA;EACJ,EAAA;EACA,EAAA,IAAIqC,aAAa,CAACvC,GAAG,CAACE,IAAI,CAAC,EACvB,OAAOqC,aAAa,CAACvC,GAAG,CAACE,IAAI,CAAC;IAClC,MAAMwC,cAAc,GAAGxC,IAAI,CAACyC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;EACrD,EAAA,MAAMC,QAAQ,GAAG1C,IAAI,KAAKwC,cAAc;EACxC,EAAA,MAAMG,OAAO,GAAGP,YAAY,CAACrB,QAAQ,CAACyB,cAAc,CAAC;EACrD,EAAA;EACA;IACA,EAAEA,cAAc,IAAI,CAACE,QAAQ,GAAGlF,QAAQ,GAAGD,cAAc,EAAEK,SAAS,CAAC,IACjE,EAAE+E,OAAO,IAAIR,WAAW,CAACpB,QAAQ,CAACyB,cAAc,CAAC,CAAC,EAAE;EACpD,IAAA;EACJ,EAAA;IACA,MAAMI,MAAM,GAAG,gBAAgBC,SAAS,EAAE,GAAGlC,IAAI,EAAE;EAC/C;EACA,IAAA,MAAMnB,EAAE,GAAG,IAAI,CAACiB,WAAW,CAACoC,SAAS,EAAEF,OAAO,GAAG,WAAW,GAAG,UAAU,CAAC;EAC1E,IAAA,IAAI5C,MAAM,GAAGP,EAAE,CAACsD,KAAK;EACrB,IAAA,IAAIJ,QAAQ,EACR3C,MAAM,GAAGA,MAAM,CAACgD,KAAK,CAACpC,IAAI,CAACqC,KAAK,EAAE,CAAC;EACvC;EACA;EACA;EACA;EACA;MACA,OAAO,CAAC,MAAMvE,OAAO,CAACwE,GAAG,CAAC,CACtBlD,MAAM,CAACyC,cAAc,CAAC,CAAC,GAAG7B,IAAI,CAAC,EAC/BgC,OAAO,IAAInD,EAAE,CAACE,IAAI,CACrB,CAAC,EAAE,CAAC,CAAC;IACV,CAAC;EACD2C,EAAAA,aAAa,CAAChD,GAAG,CAACW,IAAI,EAAE4C,MAAM,CAAC;EAC/B,EAAA,OAAOA,MAAM;EACjB;EACAvC,YAAY,CAAE6C,QAAQ,IAAAC,QAAA,KACfD,QAAQ,EAAA;IACXpD,GAAG,EAAEA,CAACC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,KAAKsC,SAAS,CAACxC,MAAM,EAAEC,IAAI,CAAC,IAAIkD,QAAQ,CAACpD,GAAG,CAACC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,CAAC;IAChGR,GAAG,EAAEA,CAACM,MAAM,EAAEC,IAAI,KAAK,CAAC,CAACuC,SAAS,CAACxC,MAAM,EAAEC,IAAI,CAAC,IAAIkD,QAAQ,CAACzD,GAAG,CAACM,MAAM,EAAEC,IAAI;EAAC,CAAA,CAChF,CAAC;;ECpFH;EACA,IAAI;EACAoD,EAAAA,IAAI,CAAC,+BAA+B,CAAC,IAAIC,CAAC,EAAE;EAChD,CAAC,CACD,OAAOC,CAAC,EAAE,CAAE;;ECLZ;EACA;;EAEA;EACA;EACA;EACA;EAGA,MAAMC,UAAU,GAAG,CAAC;EACpB,MAAMC,OAAO,GAAG,yBAAyB;EACzC,MAAMC,yBAAyB,GAAG,UAAU;EAC5C,MAAMC,gBAAgB,GAAG,WAAW;EACpC;EACA;EACA;EACA;EACA;EACA;EACA;EACO,MAAMC,OAAO,CAAC;EACjBC,EAAAA,WAAWA,GAAG;MACV,IAAI,CAACC,GAAG,GAAG,IAAI;EACnB,EAAA;EACA;EACJ;EACA;EACA;EACA;IACI,MAAMC,QAAQA,CAACC,KAAK,EAAE;EAClB,IAAA,MAAM7B,EAAE,GAAG,MAAM,IAAI,CAAC8B,KAAK,EAAE;MAC7B,MAAMxE,EAAE,GAAG0C,EAAE,CAACzB,WAAW,CAACgD,yBAAyB,EAAE,WAAW,EAAE;EAC9DQ,MAAAA,UAAU,EAAE;EAChB,KAAC,CAAC;EACF,IAAA,MAAMzE,EAAE,CAACsD,KAAK,CAACoB,GAAG,CAACH,KAAK,CAAC;MACzB,MAAMvE,EAAE,CAACE,IAAI;EACjB,EAAA;EACA;EACJ;EACA;EACA;EACA;IACI,MAAMyE,eAAeA,GAAG;EACpB,IAAA,MAAMjC,EAAE,GAAG,MAAM,IAAI,CAAC8B,KAAK,EAAE;EAC7B,IAAA,MAAMI,MAAM,GAAG,MAAMlC,EAAE,CAClBzB,WAAW,CAACgD,yBAAyB,CAAC,CACtCX,KAAK,CAACuB,UAAU,EAAE;EACvB,IAAA,OAAOD,MAAM,KAAK,IAAI,IAAIA,MAAM,KAAK,MAAM,GAAG,MAAM,GAAGA,MAAM,CAAChF,KAAK,CAACkF,EAAE;EAC1E,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;IACI,MAAMC,wBAAwBA,CAACC,SAAS,EAAE;EACtC,IAAA,MAAMtC,EAAE,GAAG,MAAM,IAAI,CAAC8B,KAAK,EAAE;EAC7B,IAAA,MAAMS,OAAO,GAAG,MAAMvC,EAAE,CAACwC,eAAe,CAACjB,yBAAyB,EAAEC,gBAAgB,EAAEiB,WAAW,CAACC,IAAI,CAACJ,SAAS,CAAC,CAAC;EAClH,IAAA,OAAOC,OAAO,GAAGA,OAAO,GAAG,IAAII,KAAK,EAAE;EAC1C,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;IACI,MAAMC,wBAAwBA,CAACN,SAAS,EAAE;EACtC,IAAA,MAAMtC,EAAE,GAAG,MAAM,IAAI,CAAC8B,KAAK,EAAE;EAC7B,IAAA,OAAO9B,EAAE,CAAC6C,cAAc,CAACtB,yBAAyB,EAAEC,gBAAgB,EAAEiB,WAAW,CAACC,IAAI,CAACJ,SAAS,CAAC,CAAC;EACtG,EAAA;EACA;EACJ;EACA;EACA;EACA;IACI,MAAMQ,WAAWA,CAACV,EAAE,EAAE;EAClB,IAAA,MAAMpC,EAAE,GAAG,MAAM,IAAI,CAAC8B,KAAK,EAAE;EAC7B,IAAA,MAAM9B,EAAE,CAAC+C,MAAM,CAACxB,yBAAyB,EAAEa,EAAE,CAAC;EAClD,EAAA;EACA;EACJ;EACA;EACA;EACA;IACI,MAAMY,wBAAwBA,CAACV,SAAS,EAAE;EACtC,IAAA,OAAO,MAAM,IAAI,CAACW,oBAAoB,CAACR,WAAW,CAACC,IAAI,CAACJ,SAAS,CAAC,EAAE,MAAM,CAAC;EAC/E,EAAA;EACA;EACJ;EACA;EACA;EACA;IACI,MAAMY,uBAAuBA,CAACZ,SAAS,EAAE;EACrC,IAAA,OAAO,MAAM,IAAI,CAACW,oBAAoB,CAACR,WAAW,CAACC,IAAI,CAACJ,SAAS,CAAC,EAAE,MAAM,CAAC;EAC/E,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACI,EAAA,MAAMW,oBAAoBA,CAACE,KAAK,EAAEC,SAAS,EAAE;EACzC,IAAA,MAAMpD,EAAE,GAAG,MAAM,IAAI,CAAC8B,KAAK,EAAE;MAC7B,MAAMI,MAAM,GAAG,MAAMlC,EAAE,CAClBzB,WAAW,CAACgD,yBAAyB,CAAC,CACtCX,KAAK,CAACC,KAAK,CAACW,gBAAgB,CAAC,CAC7BW,UAAU,CAACgB,KAAK,EAAEC,SAAS,CAAC;EACjC,IAAA,OAAOlB,MAAM,KAAK,IAAI,IAAIA,MAAM,KAAK,MAAM,GAAG,MAAM,GAAGA,MAAM,CAAChF,KAAK;EACvE,EAAA;EACA;EACJ;EACA;EACA;EACA;IACI,MAAM4E,KAAKA,GAAG;EACV,IAAA,IAAI,CAAC,IAAI,CAACH,GAAG,EAAE;QACX,IAAI,CAACA,GAAG,GAAG,MAAMxC,MAAM,CAACmC,OAAO,EAAED,UAAU,EAAE;UACzC9B,OAAO,EAAE,IAAI,CAAC8D;EAClB,OAAC,CAAC;EACN,IAAA;MACA,OAAO,IAAI,CAAC1B,GAAG;EACnB,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACI0B,EAAAA,UAAUA,CAACrD,EAAE,EAAEF,UAAU,EAAE;EACvB,IAAA,IAAIA,UAAU,GAAG,CAAC,IAAIA,UAAU,GAAGuB,UAAU,EAAE;QAC3C,IAAIrB,EAAE,CAAChC,gBAAgB,CAACsF,QAAQ,CAAC/B,yBAAyB,CAAC,EAAE;EACzDvB,QAAAA,EAAE,CAACuD,iBAAiB,CAAChC,yBAAyB,CAAC;EACnD,MAAA;EACJ,IAAA;EACA,IAAA,MAAMiC,QAAQ,GAAGxD,EAAE,CAACyD,iBAAiB,CAAClC,yBAAyB,EAAE;EAC7DmC,MAAAA,aAAa,EAAE,IAAI;EACnBC,MAAAA,OAAO,EAAE;EACb,KAAC,CAAC;EACFH,IAAAA,QAAQ,CAACI,WAAW,CAACpC,gBAAgB,EAAEA,gBAAgB,EAAE;EAAEqC,MAAAA,MAAM,EAAE;EAAM,KAAC,CAAC;EAC/E,EAAA;EACJ;;EChJA;EACA;;EAEA;EACA;EACA;EACA;EAIA;EACA;EACA;EACA;EACA;EACA;EACA;EACO,MAAMC,UAAU,CAAC;EACpB;EACJ;EACA;EACA;EACA;EACA;IACIpC,WAAWA,CAACY,SAAS,EAAE;MACnB,IAAI,CAACyB,UAAU,GAAGzB,SAAS;EAC3B,IAAA,IAAI,CAAC0B,QAAQ,GAAG,IAAIvC,OAAO,EAAE;EACjC,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;IACI,MAAMwC,SAASA,CAACpC,KAAK,EAAE;EACnB,IAA2C;EACvCqC,MAAAA,gBAAM,CAACC,MAAM,CAACtC,KAAK,EAAE,QAAQ,EAAE;EAC3BuC,QAAAA,UAAU,EAAE,yBAAyB;EACrCC,QAAAA,SAAS,EAAE,YAAY;EACvBC,QAAAA,QAAQ,EAAE,WAAW;EACrBC,QAAAA,SAAS,EAAE;EACf,OAAC,CAAC;QACFL,gBAAM,CAACC,MAAM,CAACtC,KAAK,CAAC2C,WAAW,EAAE,QAAQ,EAAE;EACvCJ,QAAAA,UAAU,EAAE,yBAAyB;EACrCC,QAAAA,SAAS,EAAE,YAAY;EACvBC,QAAAA,QAAQ,EAAE,WAAW;EACrBC,QAAAA,SAAS,EAAE;EACf,OAAC,CAAC;EACN,IAAA;EACA;MACA,OAAO1C,KAAK,CAACO,EAAE;EACfP,IAAAA,KAAK,CAACS,SAAS,GAAG,IAAI,CAACyB,UAAU;EACjC,IAAA,MAAM,IAAI,CAACC,QAAQ,CAACpC,QAAQ,CAACC,KAAK,CAAC;EACvC,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;IACI,MAAM4C,YAAYA,CAAC5C,KAAK,EAAE;EACtB,IAA2C;EACvCqC,MAAAA,gBAAM,CAACC,MAAM,CAACtC,KAAK,EAAE,QAAQ,EAAE;EAC3BuC,QAAAA,UAAU,EAAE,yBAAyB;EACrCC,QAAAA,SAAS,EAAE,YAAY;EACvBC,QAAAA,QAAQ,EAAE,cAAc;EACxBC,QAAAA,SAAS,EAAE;EACf,OAAC,CAAC;QACFL,gBAAM,CAACC,MAAM,CAACtC,KAAK,CAAC2C,WAAW,EAAE,QAAQ,EAAE;EACvCJ,QAAAA,UAAU,EAAE,yBAAyB;EACrCC,QAAAA,SAAS,EAAE,YAAY;EACvBC,QAAAA,QAAQ,EAAE,cAAc;EACxBC,QAAAA,SAAS,EAAE;EACf,OAAC,CAAC;EACN,IAAA;MACA,MAAMG,OAAO,GAAG,MAAM,IAAI,CAACV,QAAQ,CAAC/B,eAAe,EAAE;EACrD,IAAA,IAAIyC,OAAO,EAAE;EACT;EACA7C,MAAAA,KAAK,CAACO,EAAE,GAAGsC,OAAO,GAAG,CAAC;EAC1B,IAAA,CAAC,MACI;EACD;QACA,OAAO7C,KAAK,CAACO,EAAE;EACnB,IAAA;EACAP,IAAAA,KAAK,CAACS,SAAS,GAAG,IAAI,CAACyB,UAAU;EACjC,IAAA,MAAM,IAAI,CAACC,QAAQ,CAACpC,QAAQ,CAACC,KAAK,CAAC;EACvC,EAAA;EACA;EACJ;EACA;EACA;EACA;IACI,MAAM8C,QAAQA,GAAG;EACb,IAAA,OAAO,IAAI,CAACC,YAAY,CAAC,MAAM,IAAI,CAACZ,QAAQ,CAACd,uBAAuB,CAAC,IAAI,CAACa,UAAU,CAAC,CAAC;EAC1F,EAAA;EACA;EACJ;EACA;EACA;EACA;IACI,MAAMc,UAAUA,GAAG;EACf,IAAA,OAAO,IAAI,CAACD,YAAY,CAAC,MAAM,IAAI,CAACZ,QAAQ,CAAChB,wBAAwB,CAAC,IAAI,CAACe,UAAU,CAAC,CAAC;EAC3F,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;IACI,MAAMe,MAAMA,GAAG;MACX,OAAO,MAAM,IAAI,CAACd,QAAQ,CAAC3B,wBAAwB,CAAC,IAAI,CAAC0B,UAAU,CAAC;EACxE,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;IACI,MAAMgB,IAAIA,GAAG;MACT,OAAO,MAAM,IAAI,CAACf,QAAQ,CAACpB,wBAAwB,CAAC,IAAI,CAACmB,UAAU,CAAC;EACxE,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IACI,MAAMjB,WAAWA,CAACV,EAAE,EAAE;EAClB,IAAA,MAAM,IAAI,CAAC4B,QAAQ,CAAClB,WAAW,CAACV,EAAE,CAAC;EACvC,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;IACI,MAAMwC,YAAYA,CAAC/C,KAAK,EAAE;EACtB,IAAA,IAAIA,KAAK,EAAE;EACP,MAAA,MAAM,IAAI,CAACiB,WAAW,CAACjB,KAAK,CAACO,EAAE,CAAC;EACpC,IAAA;EACA,IAAA,OAAOP,KAAK;EAChB,EAAA;EACJ;;ECvJA;EACA;;EAEA;EACA;EACA;EACA;EAGA,MAAMmD,sBAAsB,GAAG,CAC3B,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,aAAa,EACb,OAAO,EACP,UAAU,EACV,WAAW,EACX,WAAW,CACd;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMC,eAAe,CAAC;EAClB;EACJ;EACA;EACA;EACA;EACA;EACA;IACI,aAAaC,WAAWA,CAAC7I,OAAO,EAAE;EAC9B,IAAA,MAAMmI,WAAW,GAAG;QAChBW,GAAG,EAAE9I,OAAO,CAAC8I,GAAG;EAChBC,MAAAA,OAAO,EAAE;OACZ;EACD;EACA,IAAA,IAAI/I,OAAO,CAACqE,MAAM,KAAK,KAAK,EAAE;EAC1B;EACA;EACA;EACA;EACA8D,MAAAA,WAAW,CAACa,IAAI,GAAG,MAAMhJ,OAAO,CAACiJ,KAAK,EAAE,CAACC,WAAW,EAAE;EAC1D,IAAA;EACA;EACA,IAAA,KAAK,MAAM,CAACC,GAAG,EAAEtI,KAAK,CAAC,IAAIb,OAAO,CAAC+I,OAAO,CAACK,OAAO,EAAE,EAAE;EAClDjB,MAAAA,WAAW,CAACY,OAAO,CAACI,GAAG,CAAC,GAAGtI,KAAK;EACpC,IAAA;EACA;EACA,IAAA,KAAK,MAAMY,IAAI,IAAIkH,sBAAsB,EAAE;EACvC,MAAA,IAAI3I,OAAO,CAACyB,IAAI,CAAC,KAAKG,SAAS,EAAE;EAC7BuG,QAAAA,WAAW,CAAC1G,IAAI,CAAC,GAAGzB,OAAO,CAACyB,IAAI,CAAC;EACrC,MAAA;EACJ,IAAA;EACA,IAAA,OAAO,IAAImH,eAAe,CAACT,WAAW,CAAC;EAC3C,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;IACI9C,WAAWA,CAAC8C,WAAW,EAAE;EACrB,IAA2C;EACvCN,MAAAA,gBAAM,CAACC,MAAM,CAACK,WAAW,EAAE,QAAQ,EAAE;EACjCJ,QAAAA,UAAU,EAAE,yBAAyB;EACrCC,QAAAA,SAAS,EAAE,iBAAiB;EAC5BC,QAAAA,QAAQ,EAAE,aAAa;EACvBC,QAAAA,SAAS,EAAE;EACf,OAAC,CAAC;QACFL,gBAAM,CAACC,MAAM,CAACK,WAAW,CAACW,GAAG,EAAE,QAAQ,EAAE;EACrCf,QAAAA,UAAU,EAAE,yBAAyB;EACrCC,QAAAA,SAAS,EAAE,iBAAiB;EAC5BC,QAAAA,QAAQ,EAAE,aAAa;EACvBC,QAAAA,SAAS,EAAE;EACf,OAAC,CAAC;EACN,IAAA;EACA;EACA;EACA,IAAA,IAAIC,WAAW,CAAC,MAAM,CAAC,KAAK,UAAU,EAAE;EACpCA,MAAAA,WAAW,CAAC,MAAM,CAAC,GAAG,aAAa;EACvC,IAAA;MACA,IAAI,CAACkB,YAAY,GAAGlB,WAAW;EACnC,EAAA;EACA;EACJ;EACA;EACA;EACA;EACImB,EAAAA,QAAQA,GAAG;EACP,IAAA,MAAMnB,WAAW,GAAGoB,MAAM,CAACC,MAAM,CAAC,EAAE,EAAE,IAAI,CAACH,YAAY,CAAC;EACxDlB,IAAAA,WAAW,CAACY,OAAO,GAAGQ,MAAM,CAACC,MAAM,CAAC,EAAE,EAAE,IAAI,CAACH,YAAY,CAACN,OAAO,CAAC;MAClE,IAAIZ,WAAW,CAACa,IAAI,EAAE;QAClBb,WAAW,CAACa,IAAI,GAAGb,WAAW,CAACa,IAAI,CAACS,KAAK,CAAC,CAAC,CAAC;EAChD,IAAA;EACA,IAAA,OAAOtB,WAAW;EACtB,EAAA;EACA;EACJ;EACA;EACA;EACA;EACIuB,EAAAA,SAASA,GAAG;EACR,IAAA,OAAO,IAAIC,OAAO,CAAC,IAAI,CAACN,YAAY,CAACP,GAAG,EAAE,IAAI,CAACO,YAAY,CAAC;EAChE,EAAA;EACA;EACJ;EACA;EACA;EACA;EACIJ,EAAAA,KAAKA,GAAG;MACJ,OAAO,IAAIL,eAAe,CAAC,IAAI,CAACU,QAAQ,EAAE,CAAC;EAC/C,EAAA;EACJ;;ECvHA;EACA;;EAEA;EACA;EACA;EACA;EAQA,MAAMM,UAAU,GAAG,yBAAyB;EAC5C,MAAMC,kBAAkB,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;EACvC,MAAMC,UAAU,GAAG,IAAIC,GAAG,EAAE;EAC5B;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMC,YAAY,GAAIC,eAAe,IAAK;EACtC,EAAA,MAAMC,UAAU,GAAG;MACflK,OAAO,EAAE,IAAI4I,eAAe,CAACqB,eAAe,CAAC9B,WAAW,CAAC,CAACuB,SAAS,EAAE;MACrES,SAAS,EAAEF,eAAe,CAACE;KAC9B;IACD,IAAIF,eAAe,CAACG,QAAQ,EAAE;EAC1BF,IAAAA,UAAU,CAACE,QAAQ,GAAGH,eAAe,CAACG,QAAQ;EAClD,EAAA;EACA,EAAA,OAAOF,UAAU;EACrB,CAAC;EACD;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMG,KAAK,CAAC;EACR;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IACIhF,WAAWA,CAACtC,IAAI,EAAE;MAAEuH,iBAAiB;MAAEC,MAAM;EAAEC,IAAAA;KAAkB,GAAG,EAAE,EAAE;MACpE,IAAI,CAACC,eAAe,GAAG,KAAK;MAC5B,IAAI,CAACC,wBAAwB,GAAG,KAAK;EACrC;EACA,IAAA,IAAIZ,UAAU,CAAC5I,GAAG,CAAC6B,IAAI,CAAC,EAAE;EACtB,MAAA,MAAM,IAAI4H,4BAAY,CAAC,sBAAsB,EAAE;EAAE5H,QAAAA;EAAK,OAAC,CAAC;EAC5D,IAAA,CAAC,MACI;EACD+G,MAAAA,UAAU,CAACnE,GAAG,CAAC5C,IAAI,CAAC;EACxB,IAAA;MACA,IAAI,CAAC6H,KAAK,GAAG7H,IAAI;EACjB,IAAA,IAAI,CAAC8H,OAAO,GAAGN,MAAM,IAAI,IAAI,CAACO,cAAc;EAC5C,IAAA,IAAI,CAACC,iBAAiB,GAAGP,gBAAgB,IAAIX,kBAAkB;EAC/D,IAAA,IAAI,CAACmB,kBAAkB,GAAGC,OAAO,CAACX,iBAAiB,CAAC;MACpD,IAAI,CAACY,WAAW,GAAG,IAAIzD,UAAU,CAAC,IAAI,CAACmD,KAAK,CAAC;MAC7C,IAAI,CAACO,gBAAgB,EAAE;EAC3B,EAAA;EACA;EACJ;EACA;IACI,IAAIpI,IAAIA,GAAG;MACP,OAAO,IAAI,CAAC6H,KAAK;EACrB,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IACI,MAAMQ,WAAWA,CAAC5F,KAAK,EAAE;EACrB,IAA2C;EACvCqC,MAAAA,gBAAM,CAACC,MAAM,CAACtC,KAAK,EAAE,QAAQ,EAAE;EAC3BuC,QAAAA,UAAU,EAAE,yBAAyB;EACrCC,QAAAA,SAAS,EAAE,OAAO;EAClBC,QAAAA,QAAQ,EAAE,aAAa;EACvBC,QAAAA,SAAS,EAAE;EACf,OAAC,CAAC;QACFL,gBAAM,CAACwD,UAAU,CAAC7F,KAAK,CAACxF,OAAO,EAAE2J,OAAO,EAAE;EACtC5B,QAAAA,UAAU,EAAE,yBAAyB;EACrCC,QAAAA,SAAS,EAAE,OAAO;EAClBC,QAAAA,QAAQ,EAAE,aAAa;EACvBC,QAAAA,SAAS,EAAE;EACf,OAAC,CAAC;EACN,IAAA;EACA,IAAA,MAAM,IAAI,CAACoD,WAAW,CAAC9F,KAAK,EAAE,MAAM,CAAC;EACzC,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;IACI,MAAM+F,cAAcA,CAAC/F,KAAK,EAAE;EACxB,IAA2C;EACvCqC,MAAAA,gBAAM,CAACC,MAAM,CAACtC,KAAK,EAAE,QAAQ,EAAE;EAC3BuC,QAAAA,UAAU,EAAE,yBAAyB;EACrCC,QAAAA,SAAS,EAAE,OAAO;EAClBC,QAAAA,QAAQ,EAAE,gBAAgB;EAC1BC,QAAAA,SAAS,EAAE;EACf,OAAC,CAAC;QACFL,gBAAM,CAACwD,UAAU,CAAC7F,KAAK,CAACxF,OAAO,EAAE2J,OAAO,EAAE;EACtC5B,QAAAA,UAAU,EAAE,yBAAyB;EACrCC,QAAAA,SAAS,EAAE,OAAO;EAClBC,QAAAA,QAAQ,EAAE,gBAAgB;EAC1BC,QAAAA,SAAS,EAAE;EACf,OAAC,CAAC;EACN,IAAA;EACA,IAAA,MAAM,IAAI,CAACoD,WAAW,CAAC9F,KAAK,EAAE,SAAS,CAAC;EAC5C,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;IACI,MAAMgG,UAAUA,GAAG;EACf,IAAA,OAAO,IAAI,CAACC,cAAc,CAAC,KAAK,CAAC;EACrC,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;IACI,MAAMC,YAAYA,GAAG;EACjB,IAAA,OAAO,IAAI,CAACD,cAAc,CAAC,OAAO,CAAC;EACvC,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;IACI,MAAMhD,MAAMA,GAAG;MACX,MAAMkD,UAAU,GAAG,MAAM,IAAI,CAACT,WAAW,CAACzC,MAAM,EAAE;EAClD,IAAA,MAAMmD,GAAG,GAAGC,IAAI,CAACD,GAAG,EAAE;MACtB,MAAME,gBAAgB,GAAG,EAAE;EAC3B,IAAA,KAAK,MAAMtG,KAAK,IAAImG,UAAU,EAAE;EAC5B;EACA;QACA,MAAMI,oBAAoB,GAAG,IAAI,CAAChB,iBAAiB,GAAG,EAAE,GAAG,IAAI;EAC/D,MAAA,IAAIa,GAAG,GAAGpG,KAAK,CAAC2E,SAAS,GAAG4B,oBAAoB,EAAE;UAC9C,MAAM,IAAI,CAACb,WAAW,CAACzE,WAAW,CAACjB,KAAK,CAACO,EAAE,CAAC;EAChD,MAAA,CAAC,MACI;EACD+F,QAAAA,gBAAgB,CAACE,IAAI,CAAChC,YAAY,CAACxE,KAAK,CAAC,CAAC;EAC9C,MAAA;EACJ,IAAA;EACA,IAAA,OAAOsG,gBAAgB;EAC3B,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;IACI,MAAMpD,IAAIA,GAAG;EACT,IAAA,OAAO,MAAM,IAAI,CAACwC,WAAW,CAACxC,IAAI,EAAE;EACxC,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACI,EAAA,MAAM4C,WAAWA,CAAC;MAAEtL,OAAO;MAAEoK,QAAQ;EAAED,IAAAA,SAAS,GAAG0B,IAAI,CAACD,GAAG;KAAI,EAAEK,SAAS,EAAE;EACxE,IAAA,MAAMC,eAAe,GAAG,MAAMtD,eAAe,CAACC,WAAW,CAAC7I,OAAO,CAACiJ,KAAK,EAAE,CAAC;EAC1E,IAAA,MAAMzD,KAAK,GAAG;EACV2C,MAAAA,WAAW,EAAE+D,eAAe,CAAC5C,QAAQ,EAAE;EACvCa,MAAAA;OACH;EACD;EACA,IAAA,IAAIC,QAAQ,EAAE;QACV5E,KAAK,CAAC4E,QAAQ,GAAGA,QAAQ;EAC7B,IAAA;EACA,IAAA,QAAQ6B,SAAS;EACb,MAAA,KAAK,MAAM;EACP,QAAA,MAAM,IAAI,CAACf,WAAW,CAACtD,SAAS,CAACpC,KAAK,CAAC;EACvC,QAAA;EACJ,MAAA,KAAK,SAAS;EACV,QAAA,MAAM,IAAI,CAAC0F,WAAW,CAAC9C,YAAY,CAAC5C,KAAK,CAAC;EAC1C,QAAA;EACR;EACA,IAA2C;EACvC2G,MAAAA,gBAAM,CAACC,GAAG,CAAE,CAAA,aAAA,EAAeC,gCAAc,CAACrM,OAAO,CAAC8I,GAAG,CAAE,QAAO,GACzD,CAAA,qCAAA,EAAuC,IAAI,CAAC8B,KAAM,IAAG,CAAC;EAC/D,IAAA;EACA;EACA;EACA;MACA,IAAI,IAAI,CAACH,eAAe,EAAE;QACtB,IAAI,CAACC,wBAAwB,GAAG,IAAI;EACxC,IAAA,CAAC,MACI;EACD,MAAA,MAAM,IAAI,CAAC4B,YAAY,EAAE;EAC7B,IAAA;EACJ,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;IACI,MAAMb,cAAcA,CAACQ,SAAS,EAAE;EAC5B,IAAA,MAAML,GAAG,GAAGC,IAAI,CAACD,GAAG,EAAE;EACtB,IAAA,IAAIpG,KAAK;EACT,IAAA,QAAQyG,SAAS;EACb,MAAA,KAAK,KAAK;UACNzG,KAAK,GAAG,MAAM,IAAI,CAAC0F,WAAW,CAAC5C,QAAQ,EAAE;EACzC,QAAA;EACJ,MAAA,KAAK,OAAO;UACR9C,KAAK,GAAG,MAAM,IAAI,CAAC0F,WAAW,CAAC1C,UAAU,EAAE;EAC3C,QAAA;EACR;EACA,IAAA,IAAIhD,KAAK,EAAE;EACP;EACA;QACA,MAAMuG,oBAAoB,GAAG,IAAI,CAAChB,iBAAiB,GAAG,EAAE,GAAG,IAAI;EAC/D,MAAA,IAAIa,GAAG,GAAGpG,KAAK,CAAC2E,SAAS,GAAG4B,oBAAoB,EAAE;EAC9C,QAAA,OAAO,IAAI,CAACN,cAAc,CAACQ,SAAS,CAAC;EACzC,MAAA;QACA,OAAOjC,YAAY,CAACxE,KAAK,CAAC;EAC9B,IAAA,CAAC,MACI;EACD,MAAA,OAAO5D,SAAS;EACpB,IAAA;EACJ,EAAA;EACA;EACJ;EACA;EACA;EACA;IACI,MAAMkJ,cAAcA,GAAG;EACnB,IAAA,IAAItF,KAAK;MACT,OAAQA,KAAK,GAAG,MAAM,IAAI,CAACkG,YAAY,EAAE,EAAG;QACxC,IAAI;UACA,MAAMa,KAAK,CAAC/G,KAAK,CAACxF,OAAO,CAACiJ,KAAK,EAAE,CAAC;EAClC,QAAA,IAAIuD,KAAoB,KAAK,YAAY,EAAE;EACvCL,UAAAA,gBAAM,CAACC,GAAG,CAAE,gBAAeC,gCAAc,CAAC7G,KAAK,CAACxF,OAAO,CAAC8I,GAAG,CAAE,IAAG,GAC3D,CAAA,4BAAA,EAA8B,IAAI,CAAC8B,KAAM,GAAE,CAAC;EACrD,QAAA;QACJ,CAAC,CACD,OAAOpK,KAAK,EAAE;EACV,QAAA,MAAM,IAAI,CAAC+K,cAAc,CAAC/F,KAAK,CAAC;EAChC,QAA2C;EACvC2G,UAAAA,gBAAM,CAACC,GAAG,CAAE,gBAAeC,gCAAc,CAAC7G,KAAK,CAACxF,OAAO,CAAC8I,GAAG,CAAE,IAAG,GAC3D,CAAA,4CAAA,EAA8C,IAAI,CAAC8B,KAAM,GAAE,CAAC;EACrE,QAAA;EACA,QAAA,MAAM,IAAID,4BAAY,CAAC,qBAAqB,EAAE;YAAE5H,IAAI,EAAE,IAAI,CAAC6H;EAAM,SAAC,CAAC;EACvE,MAAA;EACJ,IAAA;EACA,IAA2C;QACvCuB,gBAAM,CAACC,GAAG,CAAE,CAAA,uBAAA,EAAyB,IAAI,CAACrJ,IAAK,CAAA,oBAAA,CAAqB,GAC/D,CAAA,iCAAA,CAAkC,CAAC;EAC5C,IAAA;EACJ,EAAA;EACA;EACJ;EACA;IACI,MAAMuJ,YAAYA,GAAG;EACjB;MACA,IAAI,MAAM,IAAIzH,IAAI,CAAC4H,YAAY,IAAI,CAAC,IAAI,CAACzB,kBAAkB,EAAE;QACzD,IAAI;EACA,QAAA,MAAMnG,IAAI,CAAC4H,YAAY,CAACC,IAAI,CAACC,QAAQ,CAAE,CAAA,EAAE/C,UAAW,CAAA,CAAA,EAAG,IAAI,CAACgB,KAAM,EAAC,CAAC;QACxE,CAAC,CACD,OAAOgC,GAAG,EAAE;EACR;EACA;EACA,QAA2C;YACvCT,gBAAM,CAACU,IAAI,CAAE,CAAA,mCAAA,EAAqC,IAAI,CAACjC,KAAM,CAAA,EAAA,CAAG,EAAEgC,GAAG,CAAC;EAC1E,QAAA;EACJ,MAAA;EACJ,IAAA;EACJ,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACIzB,EAAAA,gBAAgBA,GAAG;EACf;MACA,IAAI,MAAM,IAAItG,IAAI,CAAC4H,YAAY,IAAI,CAAC,IAAI,CAACzB,kBAAkB,EAAE;EACzDnG,MAAAA,IAAI,CAAClE,gBAAgB,CAAC,MAAM,EAAG6C,KAAK,IAAK;UACrC,IAAIA,KAAK,CAACsJ,GAAG,KAAM,CAAA,EAAElD,UAAW,CAAA,CAAA,EAAG,IAAI,CAACgB,KAAM,CAAA,CAAC,EAAE;EAC7C,UAA2C;cACvCuB,gBAAM,CAACC,GAAG,CAAE,CAAA,yBAAA,EAA2B5I,KAAK,CAACsJ,GAAI,CAAA,EAAA,CAAG,GAAI,CAAA,iBAAA,CAAkB,CAAC;EAC/E,UAAA;EACA,UAAA,MAAMC,YAAY,GAAG,YAAY;cAC7B,IAAI,CAACtC,eAAe,GAAG,IAAI;EAC3B,YAAA,IAAIuC,SAAS;cACb,IAAI;gBACA,MAAM,IAAI,CAACnC,OAAO,CAAC;EAAEoC,gBAAAA,KAAK,EAAE;EAAK,eAAC,CAAC;cACvC,CAAC,CACD,OAAOzM,KAAK,EAAE;gBACV,IAAIA,KAAK,YAAY0M,KAAK,EAAE;EACxBF,gBAAAA,SAAS,GAAGxM,KAAK;EACjB;EACA;EACA,gBAAA,MAAMwM,SAAS;EACnB,cAAA;EACJ,YAAA,CAAC,SACO;EACJ;EACA;EACA;EACA;EACA;EACA,cAAA,IAAI,IAAI,CAACtC,wBAAwB,IAC7B,EAAEsC,SAAS,IAAI,CAACxJ,KAAK,CAAC2J,UAAU,CAAC,EAAE;EACnC,gBAAA,MAAM,IAAI,CAACb,YAAY,EAAE;EAC7B,cAAA;gBACA,IAAI,CAAC7B,eAAe,GAAG,KAAK;gBAC5B,IAAI,CAACC,wBAAwB,GAAG,KAAK;EACzC,YAAA;YACJ,CAAC;EACDlH,UAAAA,KAAK,CAAC4J,SAAS,CAACL,YAAY,EAAE,CAAC;EACnC,QAAA;EACJ,MAAA,CAAC,CAAC;EACN,IAAA,CAAC,MACI;EACD,MAA2C;EACvCZ,QAAAA,gBAAM,CAACC,GAAG,CAAE,CAAA,uDAAA,CAAwD,CAAC;EACzE,MAAA;EACA;EACA;EACA;QACA,KAAK,IAAI,CAACvB,OAAO,CAAC;EAAEoC,QAAAA,KAAK,EAAE;EAAK,OAAC,CAAC;EACtC,IAAA;EACJ,EAAA;EACA;EACJ;EACA;EACA;EACA;EACA;EACA;EACA;IACI,WAAWI,WAAWA,GAAG;EACrB,IAAA,OAAOvD,UAAU;EACrB,EAAA;EACJ;;EC/YA;EACA;;EAEA;EACA;EACA;EACA;EAGA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMwD,oBAAoB,CAAC;EACvB;EACJ;EACA;EACA;EACA;EACA;EACA;EACIjI,EAAAA,WAAWA,CAACtC,IAAI,EAAEwK,OAAO,EAAE;EACvB;EACR;EACA;EACA;EACA;MACQ,IAAI,CAACC,YAAY,GAAG,OAAO;EAAExN,MAAAA;EAAQ,KAAC,KAAK;EACvC,MAAA,MAAM,IAAI,CAACyN,MAAM,CAACrC,WAAW,CAAC;EAAEpL,QAAAA;EAAQ,OAAC,CAAC;MAC9C,CAAC;MACD,IAAI,CAACyN,MAAM,GAAG,IAAIpD,KAAK,CAACtH,IAAI,EAAEwK,OAAO,CAAC;EAC1C,EAAA;EACJ;;;;;;;;;;;;;","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-background-sync/build/workbox-background-sync.prod.js b/tools/ui/node_modules/workbox-background-sync/build/workbox-background-sync.prod.js new file mode 100644 index 0000000000000000000000000000000000000000..894723f1df15c337b8fe8e5751ab3b609bcd4b29 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/build/workbox-background-sync.prod.js @@ -0,0 +1,2 @@ +this.workbox=this.workbox||{},this.workbox.backgroundSync=function(t,e,s,n){"use strict";function r(){return r=Object.assign?Object.assign.bind():function(t){for(var e=1;ee.some((e=>t instanceof e));let i,c;const o=new WeakMap,u=new WeakMap,h=new WeakMap,y=new WeakMap,w=new WeakMap;let f={get(t,e,s){if(t instanceof IDBTransaction){if("done"===e)return u.get(t);if("objectStoreNames"===e)return t.objectStoreNames||h.get(t);if("store"===e)return s.objectStoreNames[1]?void 0:s.objectStore(s.objectStoreNames[0])}return m(t[e])},set:(t,e,s)=>(t[e]=s,!0),has:(t,e)=>t instanceof IDBTransaction&&("done"===e||"store"===e)||e in t};function l(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(p(this),e),m(o.get(this))}:function(...e){return m(t.apply(p(this),e))}:function(e,...s){const n=t.call(p(this),e,...s);return h.set(n,e.sort?e.sort():[e]),m(n)}}function d(t){return"function"==typeof t?l(t):(t instanceof IDBTransaction&&function(t){if(u.has(t))return;const e=new Promise(((e,s)=>{const n=()=>{t.removeEventListener("complete",r),t.removeEventListener("error",a),t.removeEventListener("abort",a)},r=()=>{e(),n()},a=()=>{s(t.error||new DOMException("AbortError","AbortError")),n()};t.addEventListener("complete",r),t.addEventListener("error",a),t.addEventListener("abort",a)}));u.set(t,e)}(t),a(t,i||(i=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction]))?new Proxy(t,f):t)}function m(t){if(t instanceof IDBRequest)return function(t){const e=new Promise(((e,s)=>{const n=()=>{t.removeEventListener("success",r),t.removeEventListener("error",a)},r=()=>{e(m(t.result)),n()},a=()=>{s(t.error),n()};t.addEventListener("success",r),t.addEventListener("error",a)}));return e.then((e=>{e instanceof IDBCursor&&o.set(e,t)})).catch((()=>{})),w.set(e,t),e}(t);if(y.has(t))return y.get(t);const e=d(t);return e!==t&&(y.set(t,e),w.set(e,t)),e}const p=t=>w.get(t);const g=["get","getKey","getAll","getAllKeys","count"],D=["put","add","delete","clear"],b=new Map;function B(t,e){if(!(t instanceof IDBDatabase)||e in t||"string"!=typeof e)return;if(b.get(e))return b.get(e);const s=e.replace(/FromIndex$/,""),n=e!==s,r=D.includes(s);if(!(s in(n?IDBIndex:IDBObjectStore).prototype)||!r&&!g.includes(s))return;const a=async function(t,...e){const a=this.transaction(t,r?"readwrite":"readonly");let i=a.store;return n&&(i=i.index(e.shift())),(await Promise.all([i[s](...e),r&&a.done]))[0]};return b.set(e,a),a}f=(t=>r({},t,{get:(e,s,n)=>B(e,s)||t.get(e,s,n),has:(e,s)=>!!B(e,s)||t.has(e,s)}))(f);try{self["workbox:background-sync:7.4.0"]&&_()}catch(t){}const I="requests",q="queueName";class k{constructor(){this.A=null}async addEntry(t){const e=(await this.getDb()).transaction(I,"readwrite",{durability:"relaxed"});await e.store.add(t),await e.done}async getFirstEntryId(){const t=await this.getDb(),e=await t.transaction(I).store.openCursor();return null==e?void 0:e.value.id}async getAllEntriesByQueueName(t){const e=await this.getDb(),s=await e.getAllFromIndex(I,q,IDBKeyRange.only(t));return s||new Array}async getEntryCountByQueueName(t){return(await this.getDb()).countFromIndex(I,q,IDBKeyRange.only(t))}async deleteEntry(t){const e=await this.getDb();await e.delete(I,t)}async getFirstEntryByQueueName(t){return await this.getEndEntryFromIndex(IDBKeyRange.only(t),"next")}async getLastEntryByQueueName(t){return await this.getEndEntryFromIndex(IDBKeyRange.only(t),"prev")}async getEndEntryFromIndex(t,e){const s=await this.getDb(),n=await s.transaction(I).store.index(q).openCursor(t,e);return null==n?void 0:n.value}async getDb(){return this.A||(this.A=await function(t,e,{blocked:s,upgrade:n,blocking:r,terminated:a}={}){const i=indexedDB.open(t,e),c=m(i);return n&&i.addEventListener("upgradeneeded",(t=>{n(m(i.result),t.oldVersion,t.newVersion,m(i.transaction))})),s&&i.addEventListener("blocked",(()=>s())),c.then((t=>{a&&t.addEventListener("close",(()=>a())),r&&t.addEventListener("versionchange",(()=>r()))})).catch((()=>{})),c}("workbox-background-sync",3,{upgrade:this.J})),this.A}J(t,e){e>0&&e<3&&t.objectStoreNames.contains(I)&&t.deleteObjectStore(I);t.createObjectStore(I,{autoIncrement:!0,keyPath:"id"}).createIndex(q,q,{unique:!1})}}class E{constructor(t){this.yt=t,this.wt=new k}async pushEntry(t){delete t.id,t.queueName=this.yt,await this.wt.addEntry(t)}async unshiftEntry(t){const e=await this.wt.getFirstEntryId();e?t.id=e-1:delete t.id,t.queueName=this.yt,await this.wt.addEntry(t)}async popEntry(){return this.gt(await this.wt.getLastEntryByQueueName(this.yt))}async shiftEntry(){return this.gt(await this.wt.getFirstEntryByQueueName(this.yt))}async getAll(){return await this.wt.getAllEntriesByQueueName(this.yt)}async size(){return await this.wt.getEntryCountByQueueName(this.yt)}async deleteEntry(t){await this.wt.deleteEntry(t)}async gt(t){return t&&await this.deleteEntry(t.id),t}}const R=["method","referrer","referrerPolicy","mode","credentials","cache","redirect","integrity","keepalive"];class x{static async fromRequest(t){const e={url:t.url,headers:{}};"GET"!==t.method&&(e.body=await t.clone().arrayBuffer());for(const[s,n]of t.headers.entries())e.headers[s]=n;for(const s of R)void 0!==t[s]&&(e[s]=t[s]);return new x(e)}constructor(t){"navigate"===t.mode&&(t.mode="same-origin"),this.Dt=t}toObject(){const t=Object.assign({},this.Dt);return t.headers=Object.assign({},this.Dt.headers),t.body&&(t.body=t.body.slice(0)),t}toRequest(){return new Request(this.Dt.url,this.Dt)}clone(){return new x(this.toObject())}}const v="workbox-background-sync",j=new Set,S=t=>{const e={request:new x(t.requestData).toRequest(),timestamp:t.timestamp};return t.metadata&&(e.metadata=t.metadata),e};class A{constructor(t,{forceSyncFallback:s,onSync:n,maxRetentionTime:r}={}){if(this.bt=!1,this.Bt=!1,j.has(t))throw new e.WorkboxError("duplicate-queue-name",{name:t});j.add(t),this.It=t,this.qt=n||this.replayRequests,this.kt=r||10080,this.Et=Boolean(s),this.Rt=new E(this.It),this.xt()}get name(){return this.It}async pushRequest(t){await this.vt(t,"push")}async unshiftRequest(t){await this.vt(t,"unshift")}async popRequest(){return this.jt("pop")}async shiftRequest(){return this.jt("shift")}async getAll(){const t=await this.Rt.getAll(),e=Date.now(),s=[];for(const n of t){const t=60*this.kt*1e3;e-n.timestamp>t?await this.Rt.deleteEntry(n.id):s.push(S(n))}return s}async size(){return await this.Rt.size()}async vt({request:t,metadata:e,timestamp:s=Date.now()},n){const r={requestData:(await x.fromRequest(t.clone())).toObject(),timestamp:s};switch(e&&(r.metadata=e),n){case"push":await this.Rt.pushEntry(r);break;case"unshift":await this.Rt.unshiftEntry(r)}this.bt?this.Bt=!0:await this.registerSync()}async jt(t){const e=Date.now();let s;switch(t){case"pop":s=await this.Rt.popEntry();break;case"shift":s=await this.Rt.shiftEntry()}if(s){const n=60*this.kt*1e3;return e-s.timestamp>n?this.jt(t):S(s)}}async replayRequests(){let t;for(;t=await this.shiftRequest();)try{await fetch(t.request.clone())}catch(s){throw await this.unshiftRequest(t),new e.WorkboxError("queue-replay-failed",{name:this.It})}}async registerSync(){if("sync"in self.registration&&!this.Et)try{await self.registration.sync.register(`${v}:${this.It}`)}catch(t){}}xt(){"sync"in self.registration&&!this.Et?self.addEventListener("sync",(t=>{if(t.tag===`${v}:${this.It}`){const e=async()=>{let e;this.bt=!0;try{await this.qt({queue:this})}catch(t){if(t instanceof Error)throw e=t,e}finally{!this.Bt||e&&!t.lastChance||await this.registerSync(),this.bt=!1,this.Bt=!1}};t.waitUntil(e())}})):this.qt({queue:this})}static get St(){return j}}return t.BackgroundSyncPlugin=class{constructor(t,e){this.fetchDidFail=async({request:t})=>{await this.At.pushRequest({request:t})},this.At=new A(t,e)}},t.Queue=A,t.QueueStore=E,t.StorableRequest=x,t}({},workbox.core._private,workbox.core._private,workbox.core._private); +//# sourceMappingURL=workbox-background-sync.prod.js.map diff --git a/tools/ui/node_modules/workbox-background-sync/build/workbox-background-sync.prod.js.map b/tools/ui/node_modules/workbox-background-sync/build/workbox-background-sync.prod.js.map new file mode 100644 index 0000000000000000000000000000000000000000..43492bd79cfd26f9508eee356cacfc2e7aa9058c --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/build/workbox-background-sync.prod.js.map @@ -0,0 +1 @@ +{"version":3,"file":"workbox-background-sync.prod.js","sources":["../node_modules/idb/build/wrap-idb-value.js","../node_modules/idb/build/index.js","../_version.js","../lib/QueueDb.js","../lib/QueueStore.js","../lib/StorableRequest.js","../Queue.js","../BackgroundSyncPlugin.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:background-sync:7.4.0'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2021 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 } from 'idb';\nimport '../_version.js';\nconst DB_VERSION = 3;\nconst DB_NAME = 'workbox-background-sync';\nconst REQUEST_OBJECT_STORE_NAME = 'requests';\nconst QUEUE_NAME_INDEX = 'queueName';\n/**\n * A class to interact directly an IndexedDB created specifically to save and\n * retrieve QueueStoreEntries. This class encapsulates all the schema details\n * to store the representation of a Queue.\n *\n * @private\n */\nexport class QueueDb {\n constructor() {\n this._db = null;\n }\n /**\n * Add QueueStoreEntry to underlying db.\n *\n * @param {UnidentifiedQueueStoreEntry} entry\n */\n async addEntry(entry) {\n const db = await this.getDb();\n const tx = db.transaction(REQUEST_OBJECT_STORE_NAME, 'readwrite', {\n durability: 'relaxed',\n });\n await tx.store.add(entry);\n await tx.done;\n }\n /**\n * Returns the first entry id in the ObjectStore.\n *\n * @return {number | undefined}\n */\n async getFirstEntryId() {\n const db = await this.getDb();\n const cursor = await db\n .transaction(REQUEST_OBJECT_STORE_NAME)\n .store.openCursor();\n return cursor === null || cursor === void 0 ? void 0 : cursor.value.id;\n }\n /**\n * Get all the entries filtered by index\n *\n * @param queueName\n * @return {Promise}\n */\n async getAllEntriesByQueueName(queueName) {\n const db = await this.getDb();\n const results = await db.getAllFromIndex(REQUEST_OBJECT_STORE_NAME, QUEUE_NAME_INDEX, IDBKeyRange.only(queueName));\n return results ? results : new Array();\n }\n /**\n * Returns the number of entries filtered by index\n *\n * @param queueName\n * @return {Promise}\n */\n async getEntryCountByQueueName(queueName) {\n const db = await this.getDb();\n return db.countFromIndex(REQUEST_OBJECT_STORE_NAME, QUEUE_NAME_INDEX, IDBKeyRange.only(queueName));\n }\n /**\n * Deletes a single entry by id.\n *\n * @param {number} id the id of the entry to be deleted\n */\n async deleteEntry(id) {\n const db = await this.getDb();\n await db.delete(REQUEST_OBJECT_STORE_NAME, id);\n }\n /**\n *\n * @param queueName\n * @returns {Promise}\n */\n async getFirstEntryByQueueName(queueName) {\n return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'next');\n }\n /**\n *\n * @param queueName\n * @returns {Promise}\n */\n async getLastEntryByQueueName(queueName) {\n return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'prev');\n }\n /**\n * Returns either the first or the last entries, depending on direction.\n * Filtered by index.\n *\n * @param {IDBCursorDirection} direction\n * @param {IDBKeyRange} query\n * @return {Promise}\n * @private\n */\n async getEndEntryFromIndex(query, direction) {\n const db = await this.getDb();\n const cursor = await db\n .transaction(REQUEST_OBJECT_STORE_NAME)\n .store.index(QUEUE_NAME_INDEX)\n .openCursor(query, direction);\n return cursor === null || cursor === void 0 ? void 0 : cursor.value;\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, DB_VERSION, {\n upgrade: this._upgradeDb,\n });\n }\n return this._db;\n }\n /**\n * Upgrades QueueDB\n *\n * @param {IDBPDatabase} db\n * @param {number} oldVersion\n * @private\n */\n _upgradeDb(db, oldVersion) {\n if (oldVersion > 0 && oldVersion < DB_VERSION) {\n if (db.objectStoreNames.contains(REQUEST_OBJECT_STORE_NAME)) {\n db.deleteObjectStore(REQUEST_OBJECT_STORE_NAME);\n }\n }\n const objStore = db.createObjectStore(REQUEST_OBJECT_STORE_NAME, {\n autoIncrement: true,\n keyPath: 'id',\n });\n objStore.createIndex(QUEUE_NAME_INDEX, QUEUE_NAME_INDEX, { unique: false });\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 { QueueDb, } from './QueueDb.js';\nimport '../_version.js';\n/**\n * A class to manage storing requests from a Queue in IndexedDB,\n * indexed by their queue name for easier access.\n *\n * Most developers will not need to access this class directly;\n * it is exposed for advanced use cases.\n */\nexport class QueueStore {\n /**\n * Associates this instance with a Queue instance, so entries added can be\n * identified by their queue name.\n *\n * @param {string} queueName\n */\n constructor(queueName) {\n this._queueName = queueName;\n this._queueDb = new QueueDb();\n }\n /**\n * Append an entry last in the queue.\n *\n * @param {Object} entry\n * @param {Object} entry.requestData\n * @param {number} [entry.timestamp]\n * @param {Object} [entry.metadata]\n */\n async pushEntry(entry) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(entry, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'QueueStore',\n funcName: 'pushEntry',\n paramName: 'entry',\n });\n assert.isType(entry.requestData, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'QueueStore',\n funcName: 'pushEntry',\n paramName: 'entry.requestData',\n });\n }\n // Don't specify an ID since one is automatically generated.\n delete entry.id;\n entry.queueName = this._queueName;\n await this._queueDb.addEntry(entry);\n }\n /**\n * Prepend an entry first in the queue.\n *\n * @param {Object} entry\n * @param {Object} entry.requestData\n * @param {number} [entry.timestamp]\n * @param {Object} [entry.metadata]\n */\n async unshiftEntry(entry) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(entry, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'QueueStore',\n funcName: 'unshiftEntry',\n paramName: 'entry',\n });\n assert.isType(entry.requestData, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'QueueStore',\n funcName: 'unshiftEntry',\n paramName: 'entry.requestData',\n });\n }\n const firstId = await this._queueDb.getFirstEntryId();\n if (firstId) {\n // Pick an ID one less than the lowest ID in the object store.\n entry.id = firstId - 1;\n }\n else {\n // Otherwise let the auto-incrementor assign the ID.\n delete entry.id;\n }\n entry.queueName = this._queueName;\n await this._queueDb.addEntry(entry);\n }\n /**\n * Removes and returns the last entry in the queue matching the `queueName`.\n *\n * @return {Promise}\n */\n async popEntry() {\n return this._removeEntry(await this._queueDb.getLastEntryByQueueName(this._queueName));\n }\n /**\n * Removes and returns the first entry in the queue matching the `queueName`.\n *\n * @return {Promise}\n */\n async shiftEntry() {\n return this._removeEntry(await this._queueDb.getFirstEntryByQueueName(this._queueName));\n }\n /**\n * Returns all entries in the store matching the `queueName`.\n *\n * @param {Object} options See {@link workbox-background-sync.Queue~getAll}\n * @return {Promise>}\n */\n async getAll() {\n return await this._queueDb.getAllEntriesByQueueName(this._queueName);\n }\n /**\n * Returns the number of entries in the store matching the `queueName`.\n *\n * @param {Object} options See {@link workbox-background-sync.Queue~size}\n * @return {Promise}\n */\n async size() {\n return await this._queueDb.getEntryCountByQueueName(this._queueName);\n }\n /**\n * Deletes the entry for the given ID.\n *\n * WARNING: this method does not ensure the deleted entry belongs to this\n * queue (i.e. matches the `queueName`). But this limitation is acceptable\n * as this class is not publicly exposed. An additional check would make\n * this method slower than it needs to be.\n *\n * @param {number} id\n */\n async deleteEntry(id) {\n await this._queueDb.deleteEntry(id);\n }\n /**\n * Removes and returns the first or last entry in the queue (based on the\n * `direction` argument) matching the `queueName`.\n *\n * @return {Promise}\n * @private\n */\n async _removeEntry(entry) {\n if (entry) {\n await this.deleteEntry(entry.id);\n }\n return entry;\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 '../_version.js';\nconst serializableProperties = [\n 'method',\n 'referrer',\n 'referrerPolicy',\n 'mode',\n 'credentials',\n 'cache',\n 'redirect',\n 'integrity',\n 'keepalive',\n];\n/**\n * A class to make it easier to serialize and de-serialize requests so they\n * can be stored in IndexedDB.\n *\n * Most developers will not need to access this class directly;\n * it is exposed for advanced use cases.\n */\nclass StorableRequest {\n /**\n * Converts a Request object to a plain object that can be structured\n * cloned or JSON-stringified.\n *\n * @param {Request} request\n * @return {Promise}\n */\n static async fromRequest(request) {\n const requestData = {\n url: request.url,\n headers: {},\n };\n // Set the body if present.\n if (request.method !== 'GET') {\n // Use ArrayBuffer to support non-text request bodies.\n // NOTE: we can't use Blobs becuse Safari doesn't support storing\n // Blobs in IndexedDB in some cases:\n // https://github.com/dfahlander/Dexie.js/issues/618#issuecomment-398348457\n requestData.body = await request.clone().arrayBuffer();\n }\n // Convert the headers from an iterable to an object.\n for (const [key, value] of request.headers.entries()) {\n requestData.headers[key] = value;\n }\n // Add all other serializable request properties\n for (const prop of serializableProperties) {\n if (request[prop] !== undefined) {\n requestData[prop] = request[prop];\n }\n }\n return new StorableRequest(requestData);\n }\n /**\n * Accepts an object of request data that can be used to construct a\n * `Request` but can also be stored in IndexedDB.\n *\n * @param {Object} requestData An object of request data that includes the\n * `url` plus any relevant properties of\n * [requestInit]{@link https://fetch.spec.whatwg.org/#requestinit}.\n */\n constructor(requestData) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(requestData, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'StorableRequest',\n funcName: 'constructor',\n paramName: 'requestData',\n });\n assert.isType(requestData.url, 'string', {\n moduleName: 'workbox-background-sync',\n className: 'StorableRequest',\n funcName: 'constructor',\n paramName: 'requestData.url',\n });\n }\n // If the request's mode is `navigate`, convert it to `same-origin` since\n // navigation requests can't be constructed via script.\n if (requestData['mode'] === 'navigate') {\n requestData['mode'] = 'same-origin';\n }\n this._requestData = requestData;\n }\n /**\n * Returns a deep clone of the instances `_requestData` object.\n *\n * @return {Object}\n */\n toObject() {\n const requestData = Object.assign({}, this._requestData);\n requestData.headers = Object.assign({}, this._requestData.headers);\n if (requestData.body) {\n requestData.body = requestData.body.slice(0);\n }\n return requestData;\n }\n /**\n * Converts this instance to a Request.\n *\n * @return {Request}\n */\n toRequest() {\n return new Request(this._requestData.url, this._requestData);\n }\n /**\n * Creates and returns a deep clone of the instance.\n *\n * @return {StorableRequest}\n */\n clone() {\n return new StorableRequest(this.toObject());\n }\n}\nexport { StorableRequest };\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 { logger } from 'workbox-core/_private/logger.js';\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { QueueStore } from './lib/QueueStore.js';\nimport { StorableRequest } from './lib/StorableRequest.js';\nimport './_version.js';\nconst TAG_PREFIX = 'workbox-background-sync';\nconst MAX_RETENTION_TIME = 60 * 24 * 7; // 7 days in minutes\nconst queueNames = new Set();\n/**\n * Converts a QueueStore entry into the format exposed by Queue. This entails\n * converting the request data into a real request and omitting the `id` and\n * `queueName` properties.\n *\n * @param {UnidentifiedQueueStoreEntry} queueStoreEntry\n * @return {Queue}\n * @private\n */\nconst convertEntry = (queueStoreEntry) => {\n const queueEntry = {\n request: new StorableRequest(queueStoreEntry.requestData).toRequest(),\n timestamp: queueStoreEntry.timestamp,\n };\n if (queueStoreEntry.metadata) {\n queueEntry.metadata = queueStoreEntry.metadata;\n }\n return queueEntry;\n};\n/**\n * A class to manage storing failed requests in IndexedDB and retrying them\n * later. All parts of the storing and replaying process are observable via\n * callbacks.\n *\n * @memberof workbox-background-sync\n */\nclass Queue {\n /**\n * Creates an instance of Queue with the given options\n *\n * @param {string} name The unique name for this queue. This name must be\n * unique as it's used to register sync events and store requests\n * in IndexedDB specific to this instance. An error will be thrown if\n * a duplicate name is detected.\n * @param {Object} [options]\n * @param {Function} [options.onSync] A function that gets invoked whenever\n * the 'sync' event fires. The function is invoked with an object\n * containing the `queue` property (referencing this instance), and you\n * can use the callback to customize the replay behavior of the queue.\n * When not set the `replayRequests()` method is called.\n * Note: if the replay fails after a sync event, make sure you throw an\n * error, so the browser knows to retry the sync event later.\n * @param {number} [options.maxRetentionTime=7 days] The amount of time (in\n * minutes) a request may be retried. After this amount of time has\n * passed, the request will be deleted from the queue.\n * @param {boolean} [options.forceSyncFallback=false] If `true`, instead\n * of attempting to use background sync events, always attempt to replay\n * queued request at service worker startup. Most folks will not need\n * this, unless you explicitly target a runtime like Electron that\n * exposes the interfaces for background sync, but does not have a working\n * implementation.\n */\n constructor(name, { forceSyncFallback, onSync, maxRetentionTime } = {}) {\n this._syncInProgress = false;\n this._requestsAddedDuringSync = false;\n // Ensure the store name is not already being used\n if (queueNames.has(name)) {\n throw new WorkboxError('duplicate-queue-name', { name });\n }\n else {\n queueNames.add(name);\n }\n this._name = name;\n this._onSync = onSync || this.replayRequests;\n this._maxRetentionTime = maxRetentionTime || MAX_RETENTION_TIME;\n this._forceSyncFallback = Boolean(forceSyncFallback);\n this._queueStore = new QueueStore(this._name);\n this._addSyncListener();\n }\n /**\n * @return {string}\n */\n get name() {\n return this._name;\n }\n /**\n * Stores the passed request in IndexedDB (with its timestamp and any\n * metadata) at the end of the queue.\n *\n * @param {QueueEntry} entry\n * @param {Request} entry.request The request to store in the queue.\n * @param {Object} [entry.metadata] Any metadata you want associated with the\n * stored request. When requests are replayed you'll have access to this\n * metadata object in case you need to modify the request beforehand.\n * @param {number} [entry.timestamp] The timestamp (Epoch time in\n * milliseconds) when the request was first added to the queue. This is\n * used along with `maxRetentionTime` to remove outdated requests. In\n * general you don't need to set this value, as it's automatically set\n * for you (defaulting to `Date.now()`), but you can update it if you\n * don't want particular requests to expire.\n */\n async pushRequest(entry) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(entry, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'Queue',\n funcName: 'pushRequest',\n paramName: 'entry',\n });\n assert.isInstance(entry.request, Request, {\n moduleName: 'workbox-background-sync',\n className: 'Queue',\n funcName: 'pushRequest',\n paramName: 'entry.request',\n });\n }\n await this._addRequest(entry, 'push');\n }\n /**\n * Stores the passed request in IndexedDB (with its timestamp and any\n * metadata) at the beginning of the queue.\n *\n * @param {QueueEntry} entry\n * @param {Request} entry.request The request to store in the queue.\n * @param {Object} [entry.metadata] Any metadata you want associated with the\n * stored request. When requests are replayed you'll have access to this\n * metadata object in case you need to modify the request beforehand.\n * @param {number} [entry.timestamp] The timestamp (Epoch time in\n * milliseconds) when the request was first added to the queue. This is\n * used along with `maxRetentionTime` to remove outdated requests. In\n * general you don't need to set this value, as it's automatically set\n * for you (defaulting to `Date.now()`), but you can update it if you\n * don't want particular requests to expire.\n */\n async unshiftRequest(entry) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(entry, 'object', {\n moduleName: 'workbox-background-sync',\n className: 'Queue',\n funcName: 'unshiftRequest',\n paramName: 'entry',\n });\n assert.isInstance(entry.request, Request, {\n moduleName: 'workbox-background-sync',\n className: 'Queue',\n funcName: 'unshiftRequest',\n paramName: 'entry.request',\n });\n }\n await this._addRequest(entry, 'unshift');\n }\n /**\n * Removes and returns the last request in the queue (along with its\n * timestamp and any metadata). The returned object takes the form:\n * `{request, timestamp, metadata}`.\n *\n * @return {Promise}\n */\n async popRequest() {\n return this._removeRequest('pop');\n }\n /**\n * Removes and returns the first request in the queue (along with its\n * timestamp and any metadata). The returned object takes the form:\n * `{request, timestamp, metadata}`.\n *\n * @return {Promise}\n */\n async shiftRequest() {\n return this._removeRequest('shift');\n }\n /**\n * Returns all the entries that have not expired (per `maxRetentionTime`).\n * Any expired entries are removed from the queue.\n *\n * @return {Promise>}\n */\n async getAll() {\n const allEntries = await this._queueStore.getAll();\n const now = Date.now();\n const unexpiredEntries = [];\n for (const entry of allEntries) {\n // Ignore requests older than maxRetentionTime. Call this function\n // recursively until an unexpired request is found.\n const maxRetentionTimeInMs = this._maxRetentionTime * 60 * 1000;\n if (now - entry.timestamp > maxRetentionTimeInMs) {\n await this._queueStore.deleteEntry(entry.id);\n }\n else {\n unexpiredEntries.push(convertEntry(entry));\n }\n }\n return unexpiredEntries;\n }\n /**\n * Returns the number of entries present in the queue.\n * Note that expired entries (per `maxRetentionTime`) are also included in this count.\n *\n * @return {Promise}\n */\n async size() {\n return await this._queueStore.size();\n }\n /**\n * Adds the entry to the QueueStore and registers for a sync event.\n *\n * @param {Object} entry\n * @param {Request} entry.request\n * @param {Object} [entry.metadata]\n * @param {number} [entry.timestamp=Date.now()]\n * @param {string} operation ('push' or 'unshift')\n * @private\n */\n async _addRequest({ request, metadata, timestamp = Date.now() }, operation) {\n const storableRequest = await StorableRequest.fromRequest(request.clone());\n const entry = {\n requestData: storableRequest.toObject(),\n timestamp,\n };\n // Only include metadata if it's present.\n if (metadata) {\n entry.metadata = metadata;\n }\n switch (operation) {\n case 'push':\n await this._queueStore.pushEntry(entry);\n break;\n case 'unshift':\n await this._queueStore.unshiftEntry(entry);\n break;\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Request for '${getFriendlyURL(request.url)}' has ` +\n `been added to background sync queue '${this._name}'.`);\n }\n // Don't register for a sync if we're in the middle of a sync. Instead,\n // we wait until the sync is complete and call register if\n // `this._requestsAddedDuringSync` is true.\n if (this._syncInProgress) {\n this._requestsAddedDuringSync = true;\n }\n else {\n await this.registerSync();\n }\n }\n /**\n * Removes and returns the first or last (depending on `operation`) entry\n * from the QueueStore that's not older than the `maxRetentionTime`.\n *\n * @param {string} operation ('pop' or 'shift')\n * @return {Object|undefined}\n * @private\n */\n async _removeRequest(operation) {\n const now = Date.now();\n let entry;\n switch (operation) {\n case 'pop':\n entry = await this._queueStore.popEntry();\n break;\n case 'shift':\n entry = await this._queueStore.shiftEntry();\n break;\n }\n if (entry) {\n // Ignore requests older than maxRetentionTime. Call this function\n // recursively until an unexpired request is found.\n const maxRetentionTimeInMs = this._maxRetentionTime * 60 * 1000;\n if (now - entry.timestamp > maxRetentionTimeInMs) {\n return this._removeRequest(operation);\n }\n return convertEntry(entry);\n }\n else {\n return undefined;\n }\n }\n /**\n * Loops through each request in the queue and attempts to re-fetch it.\n * If any request fails to re-fetch, it's put back in the same position in\n * the queue (which registers a retry for the next sync event).\n */\n async replayRequests() {\n let entry;\n while ((entry = await this.shiftRequest())) {\n try {\n await fetch(entry.request.clone());\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Request for '${getFriendlyURL(entry.request.url)}' ` +\n `has been replayed in queue '${this._name}'`);\n }\n }\n catch (error) {\n await this.unshiftRequest(entry);\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Request for '${getFriendlyURL(entry.request.url)}' ` +\n `failed to replay, putting it back in queue '${this._name}'`);\n }\n throw new WorkboxError('queue-replay-failed', { name: this._name });\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`All requests in queue '${this.name}' have successfully ` +\n `replayed; the queue is now empty!`);\n }\n }\n /**\n * Registers a sync event with a tag unique to this instance.\n */\n async registerSync() {\n // See https://github.com/GoogleChrome/workbox/issues/2393\n if ('sync' in self.registration && !this._forceSyncFallback) {\n try {\n await self.registration.sync.register(`${TAG_PREFIX}:${this._name}`);\n }\n catch (err) {\n // This means the registration failed for some reason, possibly due to\n // the user disabling it.\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`Unable to register sync event for '${this._name}'.`, err);\n }\n }\n }\n }\n /**\n * In sync-supporting browsers, this adds a listener for the sync event.\n * In non-sync-supporting browsers, or if _forceSyncFallback is true, this\n * will retry the queue on service worker startup.\n *\n * @private\n */\n _addSyncListener() {\n // See https://github.com/GoogleChrome/workbox/issues/2393\n if ('sync' in self.registration && !this._forceSyncFallback) {\n self.addEventListener('sync', (event) => {\n if (event.tag === `${TAG_PREFIX}:${this._name}`) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Background sync for tag '${event.tag}' ` + `has been received`);\n }\n const syncComplete = async () => {\n this._syncInProgress = true;\n let syncError;\n try {\n await this._onSync({ queue: this });\n }\n catch (error) {\n if (error instanceof Error) {\n syncError = error;\n // Rethrow the error. Note: the logic in the finally clause\n // will run before this gets rethrown.\n throw syncError;\n }\n }\n finally {\n // New items may have been added to the queue during the sync,\n // so we need to register for a new sync if that's happened...\n // Unless there was an error during the sync, in which\n // case the browser will automatically retry later, as long\n // as `event.lastChance` is not true.\n if (this._requestsAddedDuringSync &&\n !(syncError && !event.lastChance)) {\n await this.registerSync();\n }\n this._syncInProgress = false;\n this._requestsAddedDuringSync = false;\n }\n };\n event.waitUntil(syncComplete());\n }\n });\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Background sync replaying without background sync event`);\n }\n // If the browser doesn't support background sync, or the developer has\n // opted-in to not using it, retry every time the service worker starts up\n // as a fallback.\n void this._onSync({ queue: this });\n }\n }\n /**\n * Returns the set of queue names. This is primarily used to reset the list\n * of queue names in tests.\n *\n * @return {Set}\n *\n * @private\n */\n static get _queueNames() {\n return queueNames;\n }\n}\nexport { Queue };\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 { Queue } from './Queue.js';\nimport './_version.js';\n/**\n * A class implementing the `fetchDidFail` lifecycle callback. This makes it\n * easier to add failed requests to a background sync Queue.\n *\n * @memberof workbox-background-sync\n */\nclass BackgroundSyncPlugin {\n /**\n * @param {string} name See the {@link workbox-background-sync.Queue}\n * documentation for parameter details.\n * @param {Object} [options] See the\n * {@link workbox-background-sync.Queue} documentation for\n * parameter details.\n */\n constructor(name, options) {\n /**\n * @param {Object} options\n * @param {Request} options.request\n * @private\n */\n this.fetchDidFail = async ({ request }) => {\n await this._queue.pushRequest({ request });\n };\n this._queue = new Queue(name, options);\n }\n}\nexport { BackgroundSyncPlugin };\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","REQUEST_OBJECT_STORE_NAME","QUEUE_NAME_INDEX","QueueDb","constructor","_db","entry","getDb","durability","add","db","cursor","openCursor","id","queueName","results","getAllFromIndex","IDBKeyRange","only","Array","countFromIndex","delete","getEndEntryFromIndex","query","direction","name","version","blocked","upgrade","blocking","terminated","indexedDB","open","openPromise","event","oldVersion","newVersion","openDB","_upgradeDb","contains","deleteObjectStore","createObjectStore","autoIncrement","keyPath","createIndex","unique","QueueStore","_queueName","_queueDb","addEntry","firstId","getFirstEntryId","_removeEntry","getLastEntryByQueueName","getFirstEntryByQueueName","getAllEntriesByQueueName","getEntryCountByQueueName","deleteEntry","serializableProperties","StorableRequest","static","requestData","url","headers","body","clone","arrayBuffer","key","entries","_requestData","toObject","Object","assign","slice","toRequest","Request","TAG_PREFIX","queueNames","Set","convertEntry","queueStoreEntry","queueEntry","timestamp","metadata","Queue","forceSyncFallback","onSync","maxRetentionTime","_syncInProgress","_requestsAddedDuringSync","WorkboxError","_name","_onSync","replayRequests","_maxRetentionTime","_forceSyncFallback","Boolean","_queueStore","_addSyncListener","_addRequest","_removeRequest","allEntries","getAll","now","Date","unexpiredEntries","maxRetentionTimeInMs","push","size","operation","fromRequest","pushEntry","unshiftEntry","registerSync","popEntry","shiftEntry","shiftRequest","fetch","unshiftRequest","registration","sync","register","err","tag","syncComplete","syncError","queue","Error","lastChance","waitUntil","_queueNames","options","fetchDidFail","_queue","pushRequest"],"mappings":"iTAAA,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,GACvB,EACAO,IAAGA,CAACR,EAAQC,EAAMQ,KACdT,EAAOC,GAAQQ,GACR,GAEXC,IAAGA,CAACV,EAAQC,IACJD,aAAkBG,iBACR,SAATF,GAA4B,UAATA,IAGjBA,KAAQD,GAMvB,SAASW,EAAaC,GAIlB,OAAIA,IAASC,YAAYC,UAAUC,aAC7B,qBAAsBZ,eAAeW,WA7GnCvB,IACHA,EAAuB,CACpByB,UAAUF,UAAUG,QACpBD,UAAUF,UAAUI,SACpBF,UAAUF,UAAUK,sBAqHEC,SAASR,GAC5B,YAAaS,GAIhB,OADAT,EAAKU,MAAMC,EAAOC,MAAOH,GAClBd,EAAKf,EAAiBO,IAAIyB,MACrC,EAEG,YAAaH,GAGhB,OAAOd,EAAKK,EAAKU,MAAMC,EAAOC,MAAOH,GACzC,EAvBW,SAAUI,KAAeJ,GAC5B,MAAMK,EAAKd,EAAKe,KAAKJ,EAAOC,MAAOC,KAAeJ,GAElD,OADA1B,EAAyBa,IAAIkB,EAAID,EAAWG,KAAOH,EAAWG,OAAS,CAACH,IACjElB,EAAKmB,EAChB,CAoBR,CACA,SAASG,EAAuBpB,GAC5B,MAAqB,mBAAVA,EACAE,EAAaF,IAGpBA,aAAiBN,gBAhGzB,SAAwCuB,GAEpC,GAAIhC,EAAmBgB,IAAIgB,GACvB,OACJ,MAAMI,EAAO,IAAIC,SAAQ,CAACC,EAASC,KAC/B,MAAMC,EAAWA,KACbR,EAAGS,oBAAoB,WAAYC,GACnCV,EAAGS,oBAAoB,QAASE,GAChCX,EAAGS,oBAAoB,QAASE,EAAM,EAEpCD,EAAWA,KACbJ,IACAE,GAAU,EAERG,EAAQA,KACVJ,EAAOP,EAAGW,OAAS,IAAIC,aAAa,aAAc,eAClDJ,GAAU,EAEdR,EAAGa,iBAAiB,WAAYH,GAChCV,EAAGa,iBAAiB,QAASF,GAC7BX,EAAGa,iBAAiB,QAASF,EAAM,IAGvC3C,EAAmBc,IAAIkB,EAAII,EAC/B,CAyEQU,CAA+B/B,GAC/BxB,EAAcwB,EAzJVnB,IACHA,EAAoB,CACjBuB,YACA4B,eACAC,SACA1B,UACAb,kBAoJG,IAAIwC,MAAMlC,EAAOX,GAErBW,EACX,CACA,SAASF,EAAKE,GAGV,GAAIA,aAAiBmC,WACjB,OA3IR,SAA0BC,GACtB,MAAMC,EAAU,IAAIf,SAAQ,CAACC,EAASC,KAClC,MAAMC,EAAWA,KACbW,EAAQV,oBAAoB,UAAWY,GACvCF,EAAQV,oBAAoB,QAASE,EAAM,EAEzCU,EAAUA,KACZf,EAAQzB,EAAKsC,EAAQG,SACrBd,GAAU,EAERG,EAAQA,KACVJ,EAAOY,EAAQR,OACfH,GAAU,EAEdW,EAAQN,iBAAiB,UAAWQ,GACpCF,EAAQN,iBAAiB,QAASF,EAAM,IAe5C,OAbAS,EACKG,MAAMxC,IAGHA,aAAiBO,WACjBxB,EAAiBgB,IAAIC,EAAOoC,EAChC,IAGCK,OAAM,SAGXrD,EAAsBW,IAAIsC,EAASD,GAC5BC,CACX,CA4GeK,CAAiB1C,GAG5B,GAAIb,EAAec,IAAID,GACnB,OAAOb,EAAeG,IAAIU,GAC9B,MAAM2C,EAAWvB,EAAuBpB,GAOxC,OAJI2C,IAAa3C,IACbb,EAAeY,IAAIC,EAAO2C,GAC1BvD,EAAsBW,IAAI4C,EAAU3C,IAEjC2C,CACX,CACA,MAAM7B,EAAUd,GAAUZ,EAAsBE,IAAIU,GC5IpD,MAAM4C,EAAc,CAAC,MAAO,SAAU,SAAU,aAAc,SACxDC,EAAe,CAAC,MAAO,MAAO,SAAU,SACxCC,EAAgB,IAAIC,IAC1B,SAASC,EAAUzD,EAAQC,GACvB,KAAMD,aAAkBa,cAClBZ,KAAQD,GACM,iBAATC,EACP,OAEJ,GAAIsD,EAAcxD,IAAIE,GAClB,OAAOsD,EAAcxD,IAAIE,GAC7B,MAAMyD,EAAiBzD,EAAK0D,QAAQ,aAAc,IAC5CC,EAAW3D,IAASyD,EACpBG,EAAUP,EAAalC,SAASsC,GACtC,KAEEA,KAAmBE,EAAWlB,SAAWD,gBAAgB3B,aACrD+C,IAAWR,EAAYjC,SAASsC,GAClC,OAEJ,MAAMI,EAASC,eAAgBC,KAAc3C,GAEzC,MAAMK,EAAKF,KAAKT,YAAYiD,EAAWH,EAAU,YAAc,YAC/D,IAAI7D,EAAS0B,EAAGuC,MAQhB,OAPIL,IACA5D,EAASA,EAAOkE,MAAM7C,EAAK8C,iBAMjBpC,QAAQqC,IAAI,CACtBpE,EAAO0D,MAAmBrC,GAC1BwC,GAAWnC,EAAGI,QACd,EACR,EAEA,OADAyB,EAAc/C,IAAIP,EAAM6D,GACjBA,CACX,CDuCIhE,ECtCUuE,IAAQC,KACfD,EAAQ,CACXtE,IAAKA,CAACC,EAAQC,EAAMC,IAAauD,EAAUzD,EAAQC,IAASoE,EAAStE,IAAIC,EAAQC,EAAMC,GACvFQ,IAAKA,CAACV,EAAQC,MAAWwD,EAAUzD,EAAQC,IAASoE,EAAS3D,IAAIV,EAAQC,KDmCzDsE,CAASzE,GErH7B,IACI0E,KAAK,kCAAoCC,GAC7C,CACA,MAAOC,GAAK,CCIZ,MAEMC,EAA4B,WAC5BC,EAAmB,YAQlB,MAAMC,EACTC,cACItD,KAAKuD,EAAM,IACf,CAMAhB,eAAeiB,GACX,MACMtD,SADWF,KAAKyD,SACRlE,YAAY4D,EAA2B,YAAa,CAC9DO,WAAY,kBAEVxD,EAAGuC,MAAMkB,IAAIH,SACbtD,EAAGI,IACb,CAMAiC,wBACI,MAAMqB,QAAW5D,KAAKyD,QAChBI,QAAeD,EAChBrE,YAAY4D,GACZV,MAAMqB,aACX,OAAOD,aAAuC,EAASA,EAAO5E,MAAM8E,EACxE,CAOAxB,+BAA+ByB,GAC3B,MAAMJ,QAAW5D,KAAKyD,QAChBQ,QAAgBL,EAAGM,gBAAgBf,EAA2BC,EAAkBe,YAAYC,KAAKJ,IACvG,OAAOC,GAAoB,IAAII,KACnC,CAOA9B,+BAA+ByB,GAE3B,aADiBhE,KAAKyD,SACZa,eAAenB,EAA2BC,EAAkBe,YAAYC,KAAKJ,GAC3F,CAMAzB,kBAAkBwB,GACd,MAAMH,QAAW5D,KAAKyD,cAChBG,EAAGW,OAAOpB,EAA2BY,EAC/C,CAMAxB,+BAA+ByB,GAC3B,aAAahE,KAAKwE,qBAAqBL,YAAYC,KAAKJ,GAAY,OACxE,CAMAzB,8BAA8ByB,GAC1B,aAAahE,KAAKwE,qBAAqBL,YAAYC,KAAKJ,GAAY,OACxE,CAUAzB,2BAA2BkC,EAAOC,GAC9B,MAAMd,QAAW5D,KAAKyD,QAChBI,QAAeD,EAChBrE,YAAY4D,GACZV,MAAMC,MAAMU,GACZU,WAAWW,EAAOC,GACvB,OAAOb,aAAuC,EAASA,EAAO5E,KAClE,CAMAsD,cAMI,OALKvC,KAAKuD,IACNvD,KAAKuD,QF7GjB,SAAgBoB,EAAMC,GAASC,QAAEA,EAAOC,QAAEA,EAAOC,SAAEA,EAAQC,WAAEA,GAAe,IACxE,MAAM3D,EAAU4D,UAAUC,KAAKP,EAAMC,GAC/BO,EAAcpG,EAAKsC,GAgBzB,OAfIyD,GACAzD,EAAQN,iBAAiB,iBAAkBqE,IACvCN,EAAQ/F,EAAKsC,EAAQG,QAAS4D,EAAMC,WAAYD,EAAME,WAAYvG,EAAKsC,EAAQ9B,aAAa,IAGhGsF,GACAxD,EAAQN,iBAAiB,WAAW,IAAM8D,MAC9CM,EACK1D,MAAMmC,IACHoB,GACApB,EAAG7C,iBAAiB,SAAS,IAAMiE,MACnCD,GACAnB,EAAG7C,iBAAiB,iBAAiB,IAAMgE,KAAW,IAEzDrD,OAAM,SACJyD,CACX,CE0F6BI,CA7Gb,0BADG,EA8GsC,CACzCT,QAAS9E,KAAKwF,KAGfxF,KAAKuD,CAChB,CAQAiC,EAAW5B,EAAIyB,GACPA,EAAa,GAAKA,EA5HX,GA6HHzB,EAAGhF,iBAAiB6G,SAAStC,IAC7BS,EAAG8B,kBAAkBvC,GAGZS,EAAG+B,kBAAkBxC,EAA2B,CAC7DyC,eAAe,EACfC,QAAS,OAEJC,YAAY1C,EAAkBA,EAAkB,CAAE2C,QAAQ,GACvE,EC9HG,MAAMC,EAOT1C,YAAYU,GACRhE,KAAKiG,GAAajC,EAClBhE,KAAKkG,GAAW,IAAI7C,CACxB,CASAd,gBAAgBiB,UAgBLA,EAAMO,GACbP,EAAMQ,UAAYhE,KAAKiG,SACjBjG,KAAKkG,GAASC,SAAS3C,EACjC,CASAjB,mBAAmBiB,GAef,MAAM4C,QAAgBpG,KAAKkG,GAASG,kBAChCD,EAEA5C,EAAMO,GAAKqC,EAAU,SAId5C,EAAMO,GAEjBP,EAAMQ,UAAYhE,KAAKiG,SACjBjG,KAAKkG,GAASC,SAAS3C,EACjC,CAMAjB,iBACI,OAAOvC,KAAKsG,SAAmBtG,KAAKkG,GAASK,wBAAwBvG,KAAKiG,IAC9E,CAMA1D,mBACI,OAAOvC,KAAKsG,SAAmBtG,KAAKkG,GAASM,yBAAyBxG,KAAKiG,IAC/E,CAOA1D,eACI,aAAavC,KAAKkG,GAASO,yBAAyBzG,KAAKiG,GAC7D,CAOA1D,aACI,aAAavC,KAAKkG,GAASQ,yBAAyB1G,KAAKiG,GAC7D,CAWA1D,kBAAkBwB,SACR/D,KAAKkG,GAASS,YAAY5C,EACpC,CAQAxB,SAAmBiB,GAIf,OAHIA,SACMxD,KAAK2G,YAAYnD,EAAMO,IAE1BP,CACX,EC7IJ,MAAMoD,EAAyB,CAC3B,SACA,WACA,iBACA,OACA,cACA,QACA,WACA,YACA,aASJ,MAAMC,EAQFC,yBAAyBzF,GACrB,MAAM0F,EAAc,CAChBC,IAAK3F,EAAQ2F,IACbC,QAAS,CAAA,GAGU,QAAnB5F,EAAQiB,SAKRyE,EAAYG,WAAa7F,EAAQ8F,QAAQC,eAG7C,IAAK,MAAOC,EAAKpI,KAAUoC,EAAQ4F,QAAQK,UACvCP,EAAYE,QAAQI,GAAOpI,EAG/B,IAAK,MAAMR,KAAQmI,OACO/H,IAAlBwC,EAAQ5C,KACRsI,EAAYtI,GAAQ4C,EAAQ5C,IAGpC,OAAO,IAAIoI,EAAgBE,EAC/B,CASAzD,YAAYyD,GAiBoB,aAAxBA,EAAkB,OAClBA,EAAkB,KAAI,eAE1B/G,KAAKuH,GAAeR,CACxB,CAMAS,WACI,MAAMT,EAAcU,OAAOC,OAAO,CAAA,EAAI1H,KAAKuH,IAK3C,OAJAR,EAAYE,QAAUQ,OAAOC,OAAO,CAAA,EAAI1H,KAAKuH,GAAaN,SACtDF,EAAYG,OACZH,EAAYG,KAAOH,EAAYG,KAAKS,MAAM,IAEvCZ,CACX,CAMAa,YACI,OAAO,IAAIC,QAAQ7H,KAAKuH,GAAaP,IAAKhH,KAAKuH,GACnD,CAMAJ,QACI,OAAO,IAAIN,EAAgB7G,KAAKwH,WACpC,ECxGJ,MAAMM,EAAa,0BAEbC,EAAa,IAAIC,IAUjBC,EAAgBC,IAClB,MAAMC,EAAa,CACf9G,QAAS,IAAIwF,EAAgBqB,EAAgBnB,aAAaa,YAC1DQ,UAAWF,EAAgBE,WAK/B,OAHIF,EAAgBG,WAChBF,EAAWE,SAAWH,EAAgBG,UAEnCF,CAAU,EASrB,MAAMG,EA0BFhF,YAAYqB,GAAM4D,kBAAEA,EAAiBC,OAAEA,EAAMC,iBAAEA,GAAqB,IAIhE,GAHAzI,KAAK0I,IAAkB,EACvB1I,KAAK2I,IAA2B,EAE5BZ,EAAW7I,IAAIyF,GACf,MAAM,IAAIiE,EAAAA,aAAa,uBAAwB,CAAEjE,SAGjDoD,EAAWpE,IAAIgB,GAEnB3E,KAAK6I,GAAQlE,EACb3E,KAAK8I,GAAUN,GAAUxI,KAAK+I,eAC9B/I,KAAKgJ,GAAoBP,GAlEN,MAmEnBzI,KAAKiJ,GAAqBC,QAAQX,GAClCvI,KAAKmJ,GAAc,IAAInD,EAAWhG,KAAK6I,IACvC7I,KAAKoJ,IACT,CAIIzE,WACA,OAAO3E,KAAK6I,EAChB,CAiBAtG,kBAAkBiB,SAeRxD,KAAKqJ,GAAY7F,EAAO,OAClC,CAiBAjB,qBAAqBiB,SAeXxD,KAAKqJ,GAAY7F,EAAO,UAClC,CAQAjB,mBACI,OAAOvC,KAAKsJ,GAAe,MAC/B,CAQA/G,qBACI,OAAOvC,KAAKsJ,GAAe,QAC/B,CAOA/G,eACI,MAAMgH,QAAmBvJ,KAAKmJ,GAAYK,SACpCC,EAAMC,KAAKD,MACXE,EAAmB,GACzB,IAAK,MAAMnG,KAAS+F,EAAY,CAG5B,MAAMK,EAAgD,GAAzB5J,KAAKgJ,GAAyB,IACvDS,EAAMjG,EAAM4E,UAAYwB,QAClB5J,KAAKmJ,GAAYxC,YAAYnD,EAAMO,IAGzC4F,EAAiBE,KAAK5B,EAAazE,GAE3C,CACA,OAAOmG,CACX,CAOApH,aACI,aAAavC,KAAKmJ,GAAYW,MAClC,CAWAvH,UAAkBlB,QAAEA,EAAOgH,SAAEA,EAAQD,UAAEA,EAAYsB,KAAKD,OAASM,GAC7D,MACMvG,EAAQ,CACVuD,mBAF0BF,EAAgBmD,YAAY3I,EAAQ8F,UAEjCK,WAC7BY,aAMJ,OAHIC,IACA7E,EAAM6E,SAAWA,GAEb0B,GACJ,IAAK,aACK/J,KAAKmJ,GAAYc,UAAUzG,GACjC,MACJ,IAAK,gBACKxD,KAAKmJ,GAAYe,aAAa1G,GAUxCxD,KAAK0I,GACL1I,KAAK2I,IAA2B,QAG1B3I,KAAKmK,cAEnB,CASA5H,SAAqBwH,GACjB,MAAMN,EAAMC,KAAKD,MACjB,IAAIjG,EACJ,OAAQuG,GACJ,IAAK,MACDvG,QAAcxD,KAAKmJ,GAAYiB,WAC/B,MACJ,IAAK,QACD5G,QAAcxD,KAAKmJ,GAAYkB,aAGvC,GAAI7G,EAAO,CAGP,MAAMoG,EAAgD,GAAzB5J,KAAKgJ,GAAyB,IAC3D,OAAIS,EAAMjG,EAAM4E,UAAYwB,EACjB5J,KAAKsJ,GAAeS,GAExB9B,EAAazE,EACxB,CAIJ,CAMAjB,uBACI,IAAIiB,EACJ,KAAQA,QAAcxD,KAAKsK,gBACvB,UACUC,MAAM/G,EAAMnC,QAAQ8F,QAK9B,CACA,MAAOtG,GAMH,YALMb,KAAKwK,eAAehH,GAKpB,IAAIoF,EAAAA,aAAa,sBAAuB,CAAEjE,KAAM3E,KAAK6I,IAC/D,CAMR,CAIAtG,qBAEI,GAAI,SAAUS,KAAKyH,eAAiBzK,KAAKiJ,GACrC,UACUjG,KAAKyH,aAAaC,KAAKC,SAAU,GAAE7C,KAAc9H,KAAK6I,KAChE,CACA,MAAO+B,GAMP,CAER,CAQAxB,KAEQ,SAAUpG,KAAKyH,eAAiBzK,KAAKiJ,GACrCjG,KAAKjC,iBAAiB,QAASqE,IAC3B,GAAIA,EAAMyF,MAAS,GAAE/C,KAAc9H,KAAK6I,KAAS,CAI7C,MAAMiC,EAAevI,UAEjB,IAAIwI,EADJ/K,KAAK0I,IAAkB,EAEvB,UACU1I,KAAK8I,GAAQ,CAAEkC,MAAOhL,MAChC,CACA,MAAOa,GACH,GAAIA,aAAiBoK,MAIjB,MAHAF,EAAYlK,EAGNkK,CAEd,CAAC,SAOO/K,KAAK2I,IACHoC,IAAc3F,EAAM8F,kBAChBlL,KAAKmK,eAEfnK,KAAK0I,IAAkB,EACvB1I,KAAK2I,IAA2B,CACpC,GAEJvD,EAAM+F,UAAUL,IACpB,KAUC9K,KAAK8I,GAAQ,CAAEkC,MAAOhL,MAEnC,CASWoL,gBACP,OAAOrD,CACX,gCC/XJ,MAQIzE,YAAYqB,EAAM0G,GAMdrL,KAAKsL,aAAe/I,OAASlB,oBACnBrB,KAAKuL,GAAOC,YAAY,CAAEnK,WAAU,EAE9CrB,KAAKuL,GAAS,IAAIjD,EAAM3D,EAAM0G,EAClC","x_google_ignoreList":[0,1]} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-background-sync/index.d.ts b/tools/ui/node_modules/workbox-background-sync/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c494d7b3e6d67910419354fa0eb5a7484fa8a9c8 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/index.d.ts @@ -0,0 +1,25 @@ +import { BackgroundSyncPlugin } from './BackgroundSyncPlugin.js'; +import { Queue, QueueOptions } from './Queue.js'; +import { QueueStore } from './QueueStore.js'; +import { StorableRequest } from './StorableRequest.js'; +import './_version.js'; +interface SyncManager { + getTags(): Promise; + register(tag: string): Promise; +} +declare global { + interface ServiceWorkerRegistration { + readonly sync: SyncManager; + } + interface SyncEvent extends ExtendableEvent { + readonly lastChance: boolean; + readonly tag: string; + } + interface ServiceWorkerGlobalScopeEventMap { + sync: SyncEvent; + } +} +/** + * @module workbox-background-sync + */ +export { BackgroundSyncPlugin, Queue, QueueOptions, QueueStore, StorableRequest }; diff --git a/tools/ui/node_modules/workbox-background-sync/index.js b/tools/ui/node_modules/workbox-background-sync/index.js new file mode 100644 index 0000000000000000000000000000000000000000..022e0ac972555b219248addec55d0692ca7d968a --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/index.js @@ -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 { BackgroundSyncPlugin } from './BackgroundSyncPlugin.js'; +import { Queue } from './Queue.js'; +import { QueueStore } from './QueueStore.js'; +import { StorableRequest } from './StorableRequest.js'; +import './_version.js'; +/** + * @module workbox-background-sync + */ +export { BackgroundSyncPlugin, Queue, QueueStore, StorableRequest }; diff --git a/tools/ui/node_modules/workbox-background-sync/index.mjs b/tools/ui/node_modules/workbox-background-sync/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..833b6a2f3226fec78490a3b7a622dc5146f94b53 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/index.mjs @@ -0,0 +1 @@ +export * from './index.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-background-sync/lib/QueueDb.d.ts b/tools/ui/node_modules/workbox-background-sync/lib/QueueDb.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..2df55333cce6f8a39a0f0fdc58033e72dc1a7c76 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/lib/QueueDb.d.ts @@ -0,0 +1,90 @@ +import { RequestData } from './StorableRequest.js'; +import '../_version.js'; +export interface UnidentifiedQueueStoreEntry { + requestData: RequestData; + timestamp: number; + id?: number; + queueName?: string; + metadata?: object; +} +export interface QueueStoreEntry extends UnidentifiedQueueStoreEntry { + id: number; +} +/** + * A class to interact directly an IndexedDB created specifically to save and + * retrieve QueueStoreEntries. This class encapsulates all the schema details + * to store the representation of a Queue. + * + * @private + */ +export declare class QueueDb { + private _db; + /** + * Add QueueStoreEntry to underlying db. + * + * @param {UnidentifiedQueueStoreEntry} entry + */ + addEntry(entry: UnidentifiedQueueStoreEntry): Promise; + /** + * Returns the first entry id in the ObjectStore. + * + * @return {number | undefined} + */ + getFirstEntryId(): Promise; + /** + * Get all the entries filtered by index + * + * @param queueName + * @return {Promise} + */ + getAllEntriesByQueueName(queueName: string): Promise; + /** + * Returns the number of entries filtered by index + * + * @param queueName + * @return {Promise} + */ + getEntryCountByQueueName(queueName: string): Promise; + /** + * Deletes a single entry by id. + * + * @param {number} id the id of the entry to be deleted + */ + deleteEntry(id: number): Promise; + /** + * + * @param queueName + * @returns {Promise} + */ + getFirstEntryByQueueName(queueName: string): Promise; + /** + * + * @param queueName + * @returns {Promise} + */ + getLastEntryByQueueName(queueName: string): Promise; + /** + * Returns either the first or the last entries, depending on direction. + * Filtered by index. + * + * @param {IDBCursorDirection} direction + * @param {IDBKeyRange} query + * @return {Promise} + * @private + */ + getEndEntryFromIndex(query: IDBKeyRange, direction: IDBCursorDirection): Promise; + /** + * Returns an open connection to the database. + * + * @private + */ + private getDb; + /** + * Upgrades QueueDB + * + * @param {IDBPDatabase} db + * @param {number} oldVersion + * @private + */ + private _upgradeDb; +} diff --git a/tools/ui/node_modules/workbox-background-sync/lib/QueueDb.js b/tools/ui/node_modules/workbox-background-sync/lib/QueueDb.js new file mode 100644 index 0000000000000000000000000000000000000000..cbdbcfd40483530bffbe9b58c7aea27e575ed6d8 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/lib/QueueDb.js @@ -0,0 +1,145 @@ +/* + 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 { openDB } from 'idb'; +import '../_version.js'; +const DB_VERSION = 3; +const DB_NAME = 'workbox-background-sync'; +const REQUEST_OBJECT_STORE_NAME = 'requests'; +const QUEUE_NAME_INDEX = 'queueName'; +/** + * A class to interact directly an IndexedDB created specifically to save and + * retrieve QueueStoreEntries. This class encapsulates all the schema details + * to store the representation of a Queue. + * + * @private + */ +export class QueueDb { + constructor() { + this._db = null; + } + /** + * Add QueueStoreEntry to underlying db. + * + * @param {UnidentifiedQueueStoreEntry} entry + */ + async addEntry(entry) { + const db = await this.getDb(); + const tx = db.transaction(REQUEST_OBJECT_STORE_NAME, 'readwrite', { + durability: 'relaxed', + }); + await tx.store.add(entry); + await tx.done; + } + /** + * Returns the first entry id in the ObjectStore. + * + * @return {number | undefined} + */ + async getFirstEntryId() { + const db = await this.getDb(); + const cursor = await db + .transaction(REQUEST_OBJECT_STORE_NAME) + .store.openCursor(); + return cursor === null || cursor === void 0 ? void 0 : cursor.value.id; + } + /** + * Get all the entries filtered by index + * + * @param queueName + * @return {Promise} + */ + async getAllEntriesByQueueName(queueName) { + const db = await this.getDb(); + const results = await db.getAllFromIndex(REQUEST_OBJECT_STORE_NAME, QUEUE_NAME_INDEX, IDBKeyRange.only(queueName)); + return results ? results : new Array(); + } + /** + * Returns the number of entries filtered by index + * + * @param queueName + * @return {Promise} + */ + async getEntryCountByQueueName(queueName) { + const db = await this.getDb(); + return db.countFromIndex(REQUEST_OBJECT_STORE_NAME, QUEUE_NAME_INDEX, IDBKeyRange.only(queueName)); + } + /** + * Deletes a single entry by id. + * + * @param {number} id the id of the entry to be deleted + */ + async deleteEntry(id) { + const db = await this.getDb(); + await db.delete(REQUEST_OBJECT_STORE_NAME, id); + } + /** + * + * @param queueName + * @returns {Promise} + */ + async getFirstEntryByQueueName(queueName) { + return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'next'); + } + /** + * + * @param queueName + * @returns {Promise} + */ + async getLastEntryByQueueName(queueName) { + return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'prev'); + } + /** + * Returns either the first or the last entries, depending on direction. + * Filtered by index. + * + * @param {IDBCursorDirection} direction + * @param {IDBKeyRange} query + * @return {Promise} + * @private + */ + async getEndEntryFromIndex(query, direction) { + const db = await this.getDb(); + const cursor = await db + .transaction(REQUEST_OBJECT_STORE_NAME) + .store.index(QUEUE_NAME_INDEX) + .openCursor(query, direction); + return cursor === null || cursor === void 0 ? void 0 : cursor.value; + } + /** + * Returns an open connection to the database. + * + * @private + */ + async getDb() { + if (!this._db) { + this._db = await openDB(DB_NAME, DB_VERSION, { + upgrade: this._upgradeDb, + }); + } + return this._db; + } + /** + * Upgrades QueueDB + * + * @param {IDBPDatabase} db + * @param {number} oldVersion + * @private + */ + _upgradeDb(db, oldVersion) { + if (oldVersion > 0 && oldVersion < DB_VERSION) { + if (db.objectStoreNames.contains(REQUEST_OBJECT_STORE_NAME)) { + db.deleteObjectStore(REQUEST_OBJECT_STORE_NAME); + } + } + const objStore = db.createObjectStore(REQUEST_OBJECT_STORE_NAME, { + autoIncrement: true, + keyPath: 'id', + }); + objStore.createIndex(QUEUE_NAME_INDEX, QUEUE_NAME_INDEX, { unique: false }); + } +} diff --git a/tools/ui/node_modules/workbox-background-sync/lib/QueueDb.mjs b/tools/ui/node_modules/workbox-background-sync/lib/QueueDb.mjs new file mode 100644 index 0000000000000000000000000000000000000000..6e2f3b94e60a80c705f439149d29fa4a9cacfd68 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/lib/QueueDb.mjs @@ -0,0 +1 @@ +export * from './QueueDb.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-background-sync/lib/QueueStore.d.ts b/tools/ui/node_modules/workbox-background-sync/lib/QueueStore.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..6cca5e3dd1535c82fdbe61ac55a70f89f4120feb --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/lib/QueueStore.d.ts @@ -0,0 +1,83 @@ +import { UnidentifiedQueueStoreEntry, QueueStoreEntry } from './QueueDb.js'; +import '../_version.js'; +/** + * A class to manage storing requests from a Queue in IndexedDB, + * indexed by their queue name for easier access. + * + * Most developers will not need to access this class directly; + * it is exposed for advanced use cases. + */ +export declare class QueueStore { + private readonly _queueName; + private readonly _queueDb; + /** + * Associates this instance with a Queue instance, so entries added can be + * identified by their queue name. + * + * @param {string} queueName + */ + constructor(queueName: string); + /** + * Append an entry last in the queue. + * + * @param {Object} entry + * @param {Object} entry.requestData + * @param {number} [entry.timestamp] + * @param {Object} [entry.metadata] + */ + pushEntry(entry: UnidentifiedQueueStoreEntry): Promise; + /** + * Prepend an entry first in the queue. + * + * @param {Object} entry + * @param {Object} entry.requestData + * @param {number} [entry.timestamp] + * @param {Object} [entry.metadata] + */ + unshiftEntry(entry: UnidentifiedQueueStoreEntry): Promise; + /** + * Removes and returns the last entry in the queue matching the `queueName`. + * + * @return {Promise} + */ + popEntry(): Promise; + /** + * Removes and returns the first entry in the queue matching the `queueName`. + * + * @return {Promise} + */ + shiftEntry(): Promise; + /** + * Returns all entries in the store matching the `queueName`. + * + * @param {Object} options See {@link workbox-background-sync.Queue~getAll} + * @return {Promise>} + */ + getAll(): Promise; + /** + * Returns the number of entries in the store matching the `queueName`. + * + * @param {Object} options See {@link workbox-background-sync.Queue~size} + * @return {Promise} + */ + size(): Promise; + /** + * Deletes the entry for the given ID. + * + * WARNING: this method does not ensure the deleted entry belongs to this + * queue (i.e. matches the `queueName`). But this limitation is acceptable + * as this class is not publicly exposed. An additional check would make + * this method slower than it needs to be. + * + * @param {number} id + */ + deleteEntry(id: number): Promise; + /** + * Removes and returns the first or last entry in the queue (based on the + * `direction` argument) matching the `queueName`. + * + * @return {Promise} + * @private + */ + _removeEntry(entry?: QueueStoreEntry): Promise; +} diff --git a/tools/ui/node_modules/workbox-background-sync/lib/QueueStore.js b/tools/ui/node_modules/workbox-background-sync/lib/QueueStore.js new file mode 100644 index 0000000000000000000000000000000000000000..411a36f042fafbcb68b6e2c89800d85ec60a90c0 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/lib/QueueStore.js @@ -0,0 +1,152 @@ +/* + 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 { QueueDb, } from './QueueDb.js'; +import '../_version.js'; +/** + * A class to manage storing requests from a Queue in IndexedDB, + * indexed by their queue name for easier access. + * + * Most developers will not need to access this class directly; + * it is exposed for advanced use cases. + */ +export class QueueStore { + /** + * Associates this instance with a Queue instance, so entries added can be + * identified by their queue name. + * + * @param {string} queueName + */ + constructor(queueName) { + this._queueName = queueName; + this._queueDb = new QueueDb(); + } + /** + * Append an entry last in the queue. + * + * @param {Object} entry + * @param {Object} entry.requestData + * @param {number} [entry.timestamp] + * @param {Object} [entry.metadata] + */ + async pushEntry(entry) { + if (process.env.NODE_ENV !== 'production') { + assert.isType(entry, 'object', { + moduleName: 'workbox-background-sync', + className: 'QueueStore', + funcName: 'pushEntry', + paramName: 'entry', + }); + assert.isType(entry.requestData, 'object', { + moduleName: 'workbox-background-sync', + className: 'QueueStore', + funcName: 'pushEntry', + paramName: 'entry.requestData', + }); + } + // Don't specify an ID since one is automatically generated. + delete entry.id; + entry.queueName = this._queueName; + await this._queueDb.addEntry(entry); + } + /** + * Prepend an entry first in the queue. + * + * @param {Object} entry + * @param {Object} entry.requestData + * @param {number} [entry.timestamp] + * @param {Object} [entry.metadata] + */ + async unshiftEntry(entry) { + if (process.env.NODE_ENV !== 'production') { + assert.isType(entry, 'object', { + moduleName: 'workbox-background-sync', + className: 'QueueStore', + funcName: 'unshiftEntry', + paramName: 'entry', + }); + assert.isType(entry.requestData, 'object', { + moduleName: 'workbox-background-sync', + className: 'QueueStore', + funcName: 'unshiftEntry', + paramName: 'entry.requestData', + }); + } + const firstId = await this._queueDb.getFirstEntryId(); + if (firstId) { + // Pick an ID one less than the lowest ID in the object store. + entry.id = firstId - 1; + } + else { + // Otherwise let the auto-incrementor assign the ID. + delete entry.id; + } + entry.queueName = this._queueName; + await this._queueDb.addEntry(entry); + } + /** + * Removes and returns the last entry in the queue matching the `queueName`. + * + * @return {Promise} + */ + async popEntry() { + return this._removeEntry(await this._queueDb.getLastEntryByQueueName(this._queueName)); + } + /** + * Removes and returns the first entry in the queue matching the `queueName`. + * + * @return {Promise} + */ + async shiftEntry() { + return this._removeEntry(await this._queueDb.getFirstEntryByQueueName(this._queueName)); + } + /** + * Returns all entries in the store matching the `queueName`. + * + * @param {Object} options See {@link workbox-background-sync.Queue~getAll} + * @return {Promise>} + */ + async getAll() { + return await this._queueDb.getAllEntriesByQueueName(this._queueName); + } + /** + * Returns the number of entries in the store matching the `queueName`. + * + * @param {Object} options See {@link workbox-background-sync.Queue~size} + * @return {Promise} + */ + async size() { + return await this._queueDb.getEntryCountByQueueName(this._queueName); + } + /** + * Deletes the entry for the given ID. + * + * WARNING: this method does not ensure the deleted entry belongs to this + * queue (i.e. matches the `queueName`). But this limitation is acceptable + * as this class is not publicly exposed. An additional check would make + * this method slower than it needs to be. + * + * @param {number} id + */ + async deleteEntry(id) { + await this._queueDb.deleteEntry(id); + } + /** + * Removes and returns the first or last entry in the queue (based on the + * `direction` argument) matching the `queueName`. + * + * @return {Promise} + * @private + */ + async _removeEntry(entry) { + if (entry) { + await this.deleteEntry(entry.id); + } + return entry; + } +} diff --git a/tools/ui/node_modules/workbox-background-sync/lib/QueueStore.mjs b/tools/ui/node_modules/workbox-background-sync/lib/QueueStore.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f46524b41f6b2df72f0cae0a4c7413140a0c04b8 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/lib/QueueStore.mjs @@ -0,0 +1 @@ +export * from './QueueStore.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-background-sync/lib/StorableRequest.d.ts b/tools/ui/node_modules/workbox-background-sync/lib/StorableRequest.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d204585569b68f43f8d3f796cd9adb115a3834cb --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/lib/StorableRequest.d.ts @@ -0,0 +1,53 @@ +import { MapLikeObject } from 'workbox-core/types.js'; +import '../_version.js'; +export interface RequestData extends MapLikeObject { + url: string; + headers: MapLikeObject; + body?: ArrayBuffer; +} +/** + * A class to make it easier to serialize and de-serialize requests so they + * can be stored in IndexedDB. + * + * Most developers will not need to access this class directly; + * it is exposed for advanced use cases. + */ +declare class StorableRequest { + private readonly _requestData; + /** + * Converts a Request object to a plain object that can be structured + * cloned or JSON-stringified. + * + * @param {Request} request + * @return {Promise} + */ + static fromRequest(request: Request): Promise; + /** + * Accepts an object of request data that can be used to construct a + * `Request` but can also be stored in IndexedDB. + * + * @param {Object} requestData An object of request data that includes the + * `url` plus any relevant properties of + * [requestInit]{@link https://fetch.spec.whatwg.org/#requestinit}. + */ + constructor(requestData: RequestData); + /** + * Returns a deep clone of the instances `_requestData` object. + * + * @return {Object} + */ + toObject(): RequestData; + /** + * Converts this instance to a Request. + * + * @return {Request} + */ + toRequest(): Request; + /** + * Creates and returns a deep clone of the instance. + * + * @return {StorableRequest} + */ + clone(): StorableRequest; +} +export { StorableRequest }; diff --git a/tools/ui/node_modules/workbox-background-sync/lib/StorableRequest.js b/tools/ui/node_modules/workbox-background-sync/lib/StorableRequest.js new file mode 100644 index 0000000000000000000000000000000000000000..4334db69d48b0c585201909cfa5e514facd75e0b --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/lib/StorableRequest.js @@ -0,0 +1,121 @@ +/* + 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'; +const serializableProperties = [ + 'method', + 'referrer', + 'referrerPolicy', + 'mode', + 'credentials', + 'cache', + 'redirect', + 'integrity', + 'keepalive', +]; +/** + * A class to make it easier to serialize and de-serialize requests so they + * can be stored in IndexedDB. + * + * Most developers will not need to access this class directly; + * it is exposed for advanced use cases. + */ +class StorableRequest { + /** + * Converts a Request object to a plain object that can be structured + * cloned or JSON-stringified. + * + * @param {Request} request + * @return {Promise} + */ + static async fromRequest(request) { + const requestData = { + url: request.url, + headers: {}, + }; + // Set the body if present. + if (request.method !== 'GET') { + // Use ArrayBuffer to support non-text request bodies. + // NOTE: we can't use Blobs becuse Safari doesn't support storing + // Blobs in IndexedDB in some cases: + // https://github.com/dfahlander/Dexie.js/issues/618#issuecomment-398348457 + requestData.body = await request.clone().arrayBuffer(); + } + // Convert the headers from an iterable to an object. + for (const [key, value] of request.headers.entries()) { + requestData.headers[key] = value; + } + // Add all other serializable request properties + for (const prop of serializableProperties) { + if (request[prop] !== undefined) { + requestData[prop] = request[prop]; + } + } + return new StorableRequest(requestData); + } + /** + * Accepts an object of request data that can be used to construct a + * `Request` but can also be stored in IndexedDB. + * + * @param {Object} requestData An object of request data that includes the + * `url` plus any relevant properties of + * [requestInit]{@link https://fetch.spec.whatwg.org/#requestinit}. + */ + constructor(requestData) { + if (process.env.NODE_ENV !== 'production') { + assert.isType(requestData, 'object', { + moduleName: 'workbox-background-sync', + className: 'StorableRequest', + funcName: 'constructor', + paramName: 'requestData', + }); + assert.isType(requestData.url, 'string', { + moduleName: 'workbox-background-sync', + className: 'StorableRequest', + funcName: 'constructor', + paramName: 'requestData.url', + }); + } + // If the request's mode is `navigate`, convert it to `same-origin` since + // navigation requests can't be constructed via script. + if (requestData['mode'] === 'navigate') { + requestData['mode'] = 'same-origin'; + } + this._requestData = requestData; + } + /** + * Returns a deep clone of the instances `_requestData` object. + * + * @return {Object} + */ + toObject() { + const requestData = Object.assign({}, this._requestData); + requestData.headers = Object.assign({}, this._requestData.headers); + if (requestData.body) { + requestData.body = requestData.body.slice(0); + } + return requestData; + } + /** + * Converts this instance to a Request. + * + * @return {Request} + */ + toRequest() { + return new Request(this._requestData.url, this._requestData); + } + /** + * Creates and returns a deep clone of the instance. + * + * @return {StorableRequest} + */ + clone() { + return new StorableRequest(this.toObject()); + } +} +export { StorableRequest }; diff --git a/tools/ui/node_modules/workbox-background-sync/lib/StorableRequest.mjs b/tools/ui/node_modules/workbox-background-sync/lib/StorableRequest.mjs new file mode 100644 index 0000000000000000000000000000000000000000..fb7122edc779b247778968c40bffa6c6b84b4f87 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/lib/StorableRequest.mjs @@ -0,0 +1 @@ +export * from './StorableRequest.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-background-sync/package.json b/tools/ui/node_modules/workbox-background-sync/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1467e0d9946fa0ebff9767a4d21434446e9c31c0 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/package.json @@ -0,0 +1,34 @@ +{ + "name": "workbox-background-sync", + "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", + "background", + "sync", + "workbox-plugin" + ], + "workbox": { + "browserNamespace": "workbox.backgroundSync", + "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-background-sync/src/BackgroundSyncPlugin.ts b/tools/ui/node_modules/workbox-background-sync/src/BackgroundSyncPlugin.ts new file mode 100644 index 0000000000000000000000000000000000000000..acb682c4ef9f86d27843779d87e89216b50fbb68 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/src/BackgroundSyncPlugin.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 {WorkboxPlugin} from 'workbox-core/types.js'; +import {Queue, QueueOptions} from './Queue.js'; +import './_version.js'; + +/** + * A class implementing the `fetchDidFail` lifecycle callback. This makes it + * easier to add failed requests to a background sync Queue. + * + * @memberof workbox-background-sync + */ +class BackgroundSyncPlugin implements WorkboxPlugin { + private readonly _queue: Queue; + + /** + * @param {string} name See the {@link workbox-background-sync.Queue} + * documentation for parameter details. + * @param {Object} [options] See the + * {@link workbox-background-sync.Queue} documentation for + * parameter details. + */ + constructor(name: string, options?: QueueOptions) { + this._queue = new Queue(name, options); + } + + /** + * @param {Object} options + * @param {Request} options.request + * @private + */ + fetchDidFail: WorkboxPlugin['fetchDidFail'] = async ({request}) => { + await this._queue.pushRequest({request}); + }; +} + +export {BackgroundSyncPlugin}; diff --git a/tools/ui/node_modules/workbox-background-sync/src/Queue.ts b/tools/ui/node_modules/workbox-background-sync/src/Queue.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e05183964897d5d84e5159323c19c51c2d8e2a7 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/src/Queue.ts @@ -0,0 +1,487 @@ +/* + 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 {logger} from 'workbox-core/_private/logger.js'; +import {assert} from 'workbox-core/_private/assert.js'; +import {getFriendlyURL} from 'workbox-core/_private/getFriendlyURL.js'; +import {QueueStore} from './lib/QueueStore.js'; +import {QueueStoreEntry, UnidentifiedQueueStoreEntry} from './lib/QueueDb.js'; +import {StorableRequest} from './lib/StorableRequest.js'; +import './_version.js'; + +// Give TypeScript the correct global. +declare let self: ServiceWorkerGlobalScope; + +interface OnSyncCallbackOptions { + queue: Queue; +} + +interface OnSyncCallback { + (options: OnSyncCallbackOptions): void | Promise; +} + +export interface QueueOptions { + forceSyncFallback?: boolean; + maxRetentionTime?: number; + onSync?: OnSyncCallback; +} + +interface QueueEntry { + request: Request; + timestamp?: number; + // We could use Record as a type but that would be a breaking + // change, better do it in next major release. + // eslint-disable-next-line @typescript-eslint/ban-types + metadata?: object; +} + +const TAG_PREFIX = 'workbox-background-sync'; +const MAX_RETENTION_TIME = 60 * 24 * 7; // 7 days in minutes + +const queueNames = new Set(); + +/** + * Converts a QueueStore entry into the format exposed by Queue. This entails + * converting the request data into a real request and omitting the `id` and + * `queueName` properties. + * + * @param {UnidentifiedQueueStoreEntry} queueStoreEntry + * @return {Queue} + * @private + */ +const convertEntry = ( + queueStoreEntry: UnidentifiedQueueStoreEntry, +): QueueEntry => { + const queueEntry: QueueEntry = { + request: new StorableRequest(queueStoreEntry.requestData).toRequest(), + timestamp: queueStoreEntry.timestamp, + }; + if (queueStoreEntry.metadata) { + queueEntry.metadata = queueStoreEntry.metadata; + } + return queueEntry; +}; + +/** + * A class to manage storing failed requests in IndexedDB and retrying them + * later. All parts of the storing and replaying process are observable via + * callbacks. + * + * @memberof workbox-background-sync + */ +class Queue { + private readonly _name: string; + private readonly _onSync: OnSyncCallback; + private readonly _maxRetentionTime: number; + private readonly _queueStore: QueueStore; + private readonly _forceSyncFallback: boolean; + private _syncInProgress = false; + private _requestsAddedDuringSync = false; + + /** + * Creates an instance of Queue with the given options + * + * @param {string} name The unique name for this queue. This name must be + * unique as it's used to register sync events and store requests + * in IndexedDB specific to this instance. An error will be thrown if + * a duplicate name is detected. + * @param {Object} [options] + * @param {Function} [options.onSync] A function that gets invoked whenever + * the 'sync' event fires. The function is invoked with an object + * containing the `queue` property (referencing this instance), and you + * can use the callback to customize the replay behavior of the queue. + * When not set the `replayRequests()` method is called. + * Note: if the replay fails after a sync event, make sure you throw an + * error, so the browser knows to retry the sync event later. + * @param {number} [options.maxRetentionTime=7 days] The amount of time (in + * minutes) a request may be retried. After this amount of time has + * passed, the request will be deleted from the queue. + * @param {boolean} [options.forceSyncFallback=false] If `true`, instead + * of attempting to use background sync events, always attempt to replay + * queued request at service worker startup. Most folks will not need + * this, unless you explicitly target a runtime like Electron that + * exposes the interfaces for background sync, but does not have a working + * implementation. + */ + constructor( + name: string, + {forceSyncFallback, onSync, maxRetentionTime}: QueueOptions = {}, + ) { + // Ensure the store name is not already being used + if (queueNames.has(name)) { + throw new WorkboxError('duplicate-queue-name', {name}); + } else { + queueNames.add(name); + } + + this._name = name; + this._onSync = onSync || this.replayRequests; + this._maxRetentionTime = maxRetentionTime || MAX_RETENTION_TIME; + this._forceSyncFallback = Boolean(forceSyncFallback); + this._queueStore = new QueueStore(this._name); + + this._addSyncListener(); + } + + /** + * @return {string} + */ + get name(): string { + return this._name; + } + + /** + * Stores the passed request in IndexedDB (with its timestamp and any + * metadata) at the end of the queue. + * + * @param {QueueEntry} entry + * @param {Request} entry.request The request to store in the queue. + * @param {Object} [entry.metadata] Any metadata you want associated with the + * stored request. When requests are replayed you'll have access to this + * metadata object in case you need to modify the request beforehand. + * @param {number} [entry.timestamp] The timestamp (Epoch time in + * milliseconds) when the request was first added to the queue. This is + * used along with `maxRetentionTime` to remove outdated requests. In + * general you don't need to set this value, as it's automatically set + * for you (defaulting to `Date.now()`), but you can update it if you + * don't want particular requests to expire. + */ + async pushRequest(entry: QueueEntry): Promise { + if (process.env.NODE_ENV !== 'production') { + assert!.isType(entry, 'object', { + moduleName: 'workbox-background-sync', + className: 'Queue', + funcName: 'pushRequest', + paramName: 'entry', + }); + assert!.isInstance(entry.request, Request, { + moduleName: 'workbox-background-sync', + className: 'Queue', + funcName: 'pushRequest', + paramName: 'entry.request', + }); + } + + await this._addRequest(entry, 'push'); + } + + /** + * Stores the passed request in IndexedDB (with its timestamp and any + * metadata) at the beginning of the queue. + * + * @param {QueueEntry} entry + * @param {Request} entry.request The request to store in the queue. + * @param {Object} [entry.metadata] Any metadata you want associated with the + * stored request. When requests are replayed you'll have access to this + * metadata object in case you need to modify the request beforehand. + * @param {number} [entry.timestamp] The timestamp (Epoch time in + * milliseconds) when the request was first added to the queue. This is + * used along with `maxRetentionTime` to remove outdated requests. In + * general you don't need to set this value, as it's automatically set + * for you (defaulting to `Date.now()`), but you can update it if you + * don't want particular requests to expire. + */ + async unshiftRequest(entry: QueueEntry): Promise { + if (process.env.NODE_ENV !== 'production') { + assert!.isType(entry, 'object', { + moduleName: 'workbox-background-sync', + className: 'Queue', + funcName: 'unshiftRequest', + paramName: 'entry', + }); + assert!.isInstance(entry.request, Request, { + moduleName: 'workbox-background-sync', + className: 'Queue', + funcName: 'unshiftRequest', + paramName: 'entry.request', + }); + } + + await this._addRequest(entry, 'unshift'); + } + + /** + * Removes and returns the last request in the queue (along with its + * timestamp and any metadata). The returned object takes the form: + * `{request, timestamp, metadata}`. + * + * @return {Promise} + */ + async popRequest(): Promise { + return this._removeRequest('pop'); + } + + /** + * Removes and returns the first request in the queue (along with its + * timestamp and any metadata). The returned object takes the form: + * `{request, timestamp, metadata}`. + * + * @return {Promise} + */ + async shiftRequest(): Promise { + return this._removeRequest('shift'); + } + + /** + * Returns all the entries that have not expired (per `maxRetentionTime`). + * Any expired entries are removed from the queue. + * + * @return {Promise>} + */ + async getAll(): Promise> { + const allEntries = await this._queueStore.getAll(); + const now = Date.now(); + + const unexpiredEntries = []; + for (const entry of allEntries) { + // Ignore requests older than maxRetentionTime. Call this function + // recursively until an unexpired request is found. + const maxRetentionTimeInMs = this._maxRetentionTime * 60 * 1000; + if (now - entry.timestamp > maxRetentionTimeInMs) { + await this._queueStore.deleteEntry(entry.id); + } else { + unexpiredEntries.push(convertEntry(entry)); + } + } + + return unexpiredEntries; + } + + /** + * Returns the number of entries present in the queue. + * Note that expired entries (per `maxRetentionTime`) are also included in this count. + * + * @return {Promise} + */ + async size(): Promise { + return await this._queueStore.size(); + } + + /** + * Adds the entry to the QueueStore and registers for a sync event. + * + * @param {Object} entry + * @param {Request} entry.request + * @param {Object} [entry.metadata] + * @param {number} [entry.timestamp=Date.now()] + * @param {string} operation ('push' or 'unshift') + * @private + */ + async _addRequest( + {request, metadata, timestamp = Date.now()}: QueueEntry, + operation: 'push' | 'unshift', + ): Promise { + const storableRequest = await StorableRequest.fromRequest(request.clone()); + const entry: UnidentifiedQueueStoreEntry = { + requestData: storableRequest.toObject(), + timestamp, + }; + + // Only include metadata if it's present. + if (metadata) { + entry.metadata = metadata; + } + + switch (operation) { + case 'push': + await this._queueStore.pushEntry(entry); + break; + case 'unshift': + await this._queueStore.unshiftEntry(entry); + break; + } + + if (process.env.NODE_ENV !== 'production') { + logger.log( + `Request for '${getFriendlyURL(request.url)}' has ` + + `been added to background sync queue '${this._name}'.`, + ); + } + + // Don't register for a sync if we're in the middle of a sync. Instead, + // we wait until the sync is complete and call register if + // `this._requestsAddedDuringSync` is true. + if (this._syncInProgress) { + this._requestsAddedDuringSync = true; + } else { + await this.registerSync(); + } + } + + /** + * Removes and returns the first or last (depending on `operation`) entry + * from the QueueStore that's not older than the `maxRetentionTime`. + * + * @param {string} operation ('pop' or 'shift') + * @return {Object|undefined} + * @private + */ + async _removeRequest( + operation: 'pop' | 'shift', + ): Promise { + const now = Date.now(); + let entry: QueueStoreEntry | undefined; + switch (operation) { + case 'pop': + entry = await this._queueStore.popEntry(); + break; + case 'shift': + entry = await this._queueStore.shiftEntry(); + break; + } + + if (entry) { + // Ignore requests older than maxRetentionTime. Call this function + // recursively until an unexpired request is found. + const maxRetentionTimeInMs = this._maxRetentionTime * 60 * 1000; + if (now - entry.timestamp > maxRetentionTimeInMs) { + return this._removeRequest(operation); + } + + return convertEntry(entry); + } else { + return undefined; + } + } + + /** + * Loops through each request in the queue and attempts to re-fetch it. + * If any request fails to re-fetch, it's put back in the same position in + * the queue (which registers a retry for the next sync event). + */ + async replayRequests(): Promise { + let entry; + while ((entry = await this.shiftRequest())) { + try { + await fetch(entry.request.clone()); + + if (process.env.NODE_ENV !== 'production') { + logger.log( + `Request for '${getFriendlyURL(entry.request.url)}' ` + + `has been replayed in queue '${this._name}'`, + ); + } + } catch (error) { + await this.unshiftRequest(entry); + + if (process.env.NODE_ENV !== 'production') { + logger.log( + `Request for '${getFriendlyURL(entry.request.url)}' ` + + `failed to replay, putting it back in queue '${this._name}'`, + ); + } + throw new WorkboxError('queue-replay-failed', {name: this._name}); + } + } + if (process.env.NODE_ENV !== 'production') { + logger.log( + `All requests in queue '${this.name}' have successfully ` + + `replayed; the queue is now empty!`, + ); + } + } + + /** + * Registers a sync event with a tag unique to this instance. + */ + async registerSync(): Promise { + // See https://github.com/GoogleChrome/workbox/issues/2393 + if ('sync' in self.registration && !this._forceSyncFallback) { + try { + await self.registration.sync.register(`${TAG_PREFIX}:${this._name}`); + } catch (err) { + // This means the registration failed for some reason, possibly due to + // the user disabling it. + if (process.env.NODE_ENV !== 'production') { + logger.warn( + `Unable to register sync event for '${this._name}'.`, + err, + ); + } + } + } + } + + /** + * In sync-supporting browsers, this adds a listener for the sync event. + * In non-sync-supporting browsers, or if _forceSyncFallback is true, this + * will retry the queue on service worker startup. + * + * @private + */ + private _addSyncListener() { + // See https://github.com/GoogleChrome/workbox/issues/2393 + if ('sync' in self.registration && !this._forceSyncFallback) { + self.addEventListener('sync', (event: SyncEvent) => { + if (event.tag === `${TAG_PREFIX}:${this._name}`) { + if (process.env.NODE_ENV !== 'production') { + logger.log( + `Background sync for tag '${event.tag}' ` + `has been received`, + ); + } + + const syncComplete = async () => { + this._syncInProgress = true; + + let syncError; + try { + await this._onSync({queue: this}); + } catch (error) { + if (error instanceof Error) { + syncError = error; + + // Rethrow the error. Note: the logic in the finally clause + // will run before this gets rethrown. + throw syncError; + } + } finally { + // New items may have been added to the queue during the sync, + // so we need to register for a new sync if that's happened... + // Unless there was an error during the sync, in which + // case the browser will automatically retry later, as long + // as `event.lastChance` is not true. + if ( + this._requestsAddedDuringSync && + !(syncError && !event.lastChance) + ) { + await this.registerSync(); + } + + this._syncInProgress = false; + this._requestsAddedDuringSync = false; + } + }; + event.waitUntil(syncComplete()); + } + }); + } else { + if (process.env.NODE_ENV !== 'production') { + logger.log(`Background sync replaying without background sync event`); + } + // If the browser doesn't support background sync, or the developer has + // opted-in to not using it, retry every time the service worker starts up + // as a fallback. + void this._onSync({queue: this}); + } + } + + /** + * Returns the set of queue names. This is primarily used to reset the list + * of queue names in tests. + * + * @return {Set} + * + * @private + */ + static get _queueNames(): Set { + return queueNames; + } +} + +export {Queue}; diff --git a/tools/ui/node_modules/workbox-background-sync/src/QueueStore.ts b/tools/ui/node_modules/workbox-background-sync/src/QueueStore.ts new file mode 100644 index 0000000000000000000000000000000000000000..1d6fde58aafbecc6f425fd13748945daefdc3c93 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/src/QueueStore.ts @@ -0,0 +1,14 @@ +/* + 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 './_version.js'; + +// This is a temporary workaround to expose something from ./lib/ via our +// top-level public API. +// TODO: In Workbox v7, move the actual code from ./lib/ to this file. +export {QueueStore} from './lib/QueueStore'; diff --git a/tools/ui/node_modules/workbox-background-sync/src/StorableRequest.ts b/tools/ui/node_modules/workbox-background-sync/src/StorableRequest.ts new file mode 100644 index 0000000000000000000000000000000000000000..6b8d692799b4cfc63514e36acd6f7b3a927c1502 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/src/StorableRequest.ts @@ -0,0 +1,14 @@ +/* + 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 './_version.js'; + +// This is a temporary workaround to expose something from ./lib/ via our +// top-level public API. +// TODO: In Workbox v7, move the actual code from ./lib/ to this file. +export {StorableRequest} from './lib/StorableRequest'; diff --git a/tools/ui/node_modules/workbox-background-sync/src/_version.ts b/tools/ui/node_modules/workbox-background-sync/src/_version.ts new file mode 100644 index 0000000000000000000000000000000000000000..6bab02c74bbd7a8663764b727da0cb8894ad05af --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/src/_version.ts @@ -0,0 +1,2 @@ +// @ts-ignore +try{self['workbox:background-sync:7.4.1']&&_()}catch(e){} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-background-sync/src/index.ts b/tools/ui/node_modules/workbox-background-sync/src/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..6e40eebaa6ba3f17513cd827e87077bcefd7d112 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/src/index.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 {BackgroundSyncPlugin} from './BackgroundSyncPlugin.js'; +import {Queue, QueueOptions} from './Queue.js'; +import {QueueStore} from './QueueStore.js'; +import {StorableRequest} from './StorableRequest.js'; + +import './_version.js'; + +// See https://github.com/GoogleChrome/workbox/issues/2946 +interface SyncManager { + getTags(): Promise; + register(tag: string): Promise; +} + +declare global { + interface ServiceWorkerRegistration { + readonly sync: SyncManager; + } + + interface SyncEvent extends ExtendableEvent { + readonly lastChance: boolean; + readonly tag: string; + } + + interface ServiceWorkerGlobalScopeEventMap { + sync: SyncEvent; + } +} + +/** + * @module workbox-background-sync + */ +export {BackgroundSyncPlugin, Queue, QueueOptions, QueueStore, StorableRequest}; diff --git a/tools/ui/node_modules/workbox-background-sync/src/lib/QueueDb.ts b/tools/ui/node_modules/workbox-background-sync/src/lib/QueueDb.ts new file mode 100644 index 0000000000000000000000000000000000000000..a017f9db4863c10f8b55b6eb5f3dde90af73251f --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/src/lib/QueueDb.ts @@ -0,0 +1,200 @@ +/* + 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 {openDB, DBSchema, IDBPDatabase} from 'idb'; +import {RequestData} from './StorableRequest.js'; +import '../_version.js'; + +interface QueueDBSchema extends DBSchema { + requests: { + key: number; + value: QueueStoreEntry; + indexes: {queueName: string}; + }; +} + +const DB_VERSION = 3; +const DB_NAME = 'workbox-background-sync'; +const REQUEST_OBJECT_STORE_NAME = 'requests'; +const QUEUE_NAME_INDEX = 'queueName'; + +export interface UnidentifiedQueueStoreEntry { + requestData: RequestData; + timestamp: number; + id?: number; + queueName?: string; + // We could use Record as a type but that would be a breaking + // change, better do it in next major release. + // eslint-disable-next-line @typescript-eslint/ban-types + metadata?: object; +} + +export interface QueueStoreEntry extends UnidentifiedQueueStoreEntry { + id: number; +} + +/** + * A class to interact directly an IndexedDB created specifically to save and + * retrieve QueueStoreEntries. This class encapsulates all the schema details + * to store the representation of a Queue. + * + * @private + */ + +export class QueueDb { + private _db: IDBPDatabase | null = null; + + /** + * Add QueueStoreEntry to underlying db. + * + * @param {UnidentifiedQueueStoreEntry} entry + */ + async addEntry(entry: UnidentifiedQueueStoreEntry): Promise { + const db = await this.getDb(); + const tx = db.transaction(REQUEST_OBJECT_STORE_NAME, 'readwrite', { + durability: 'relaxed', + }); + await tx.store.add(entry as QueueStoreEntry); + await tx.done; + } + + /** + * Returns the first entry id in the ObjectStore. + * + * @return {number | undefined} + */ + async getFirstEntryId(): Promise { + const db = await this.getDb(); + const cursor = await db + .transaction(REQUEST_OBJECT_STORE_NAME) + .store.openCursor(); + return cursor?.value.id; + } + + /** + * Get all the entries filtered by index + * + * @param queueName + * @return {Promise} + */ + async getAllEntriesByQueueName( + queueName: string, + ): Promise { + const db = await this.getDb(); + const results = await db.getAllFromIndex( + REQUEST_OBJECT_STORE_NAME, + QUEUE_NAME_INDEX, + IDBKeyRange.only(queueName), + ); + return results ? results : new Array(); + } + + /** + * Returns the number of entries filtered by index + * + * @param queueName + * @return {Promise} + */ + async getEntryCountByQueueName(queueName: string): Promise { + const db = await this.getDb(); + return db.countFromIndex( + REQUEST_OBJECT_STORE_NAME, + QUEUE_NAME_INDEX, + IDBKeyRange.only(queueName), + ); + } + + /** + * Deletes a single entry by id. + * + * @param {number} id the id of the entry to be deleted + */ + async deleteEntry(id: number): Promise { + const db = await this.getDb(); + await db.delete(REQUEST_OBJECT_STORE_NAME, id); + } + + /** + * + * @param queueName + * @returns {Promise} + */ + async getFirstEntryByQueueName( + queueName: string, + ): Promise { + return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'next'); + } + + /** + * + * @param queueName + * @returns {Promise} + */ + async getLastEntryByQueueName( + queueName: string, + ): Promise { + return await this.getEndEntryFromIndex(IDBKeyRange.only(queueName), 'prev'); + } + + /** + * Returns either the first or the last entries, depending on direction. + * Filtered by index. + * + * @param {IDBCursorDirection} direction + * @param {IDBKeyRange} query + * @return {Promise} + * @private + */ + async getEndEntryFromIndex( + query: IDBKeyRange, + direction: IDBCursorDirection, + ): Promise { + const db = await this.getDb(); + + const cursor = await db + .transaction(REQUEST_OBJECT_STORE_NAME) + .store.index(QUEUE_NAME_INDEX) + .openCursor(query, direction); + return cursor?.value; + } + + /** + * Returns an open connection to the database. + * + * @private + */ + private async getDb() { + if (!this._db) { + this._db = await openDB(DB_NAME, DB_VERSION, { + upgrade: this._upgradeDb, + }); + } + return this._db; + } + + /** + * Upgrades QueueDB + * + * @param {IDBPDatabase} db + * @param {number} oldVersion + * @private + */ + private _upgradeDb(db: IDBPDatabase, oldVersion: number) { + if (oldVersion > 0 && oldVersion < DB_VERSION) { + if (db.objectStoreNames.contains(REQUEST_OBJECT_STORE_NAME)) { + db.deleteObjectStore(REQUEST_OBJECT_STORE_NAME); + } + } + + const objStore = db.createObjectStore(REQUEST_OBJECT_STORE_NAME, { + autoIncrement: true, + keyPath: 'id', + }); + objStore.createIndex(QUEUE_NAME_INDEX, QUEUE_NAME_INDEX, {unique: false}); + } +} diff --git a/tools/ui/node_modules/workbox-background-sync/src/lib/QueueStore.ts b/tools/ui/node_modules/workbox-background-sync/src/lib/QueueStore.ts new file mode 100644 index 0000000000000000000000000000000000000000..67461e3ee253a7ae6c142ffae4dd3494bd50405c --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/src/lib/QueueStore.ts @@ -0,0 +1,179 @@ +/* + 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 { + UnidentifiedQueueStoreEntry, + QueueStoreEntry, + QueueDb, +} from './QueueDb.js'; +import '../_version.js'; + +/** + * A class to manage storing requests from a Queue in IndexedDB, + * indexed by their queue name for easier access. + * + * Most developers will not need to access this class directly; + * it is exposed for advanced use cases. + */ +export class QueueStore { + private readonly _queueName: string; + private readonly _queueDb: QueueDb; + + /** + * Associates this instance with a Queue instance, so entries added can be + * identified by their queue name. + * + * @param {string} queueName + */ + constructor(queueName: string) { + this._queueName = queueName; + this._queueDb = new QueueDb(); + } + + /** + * Append an entry last in the queue. + * + * @param {Object} entry + * @param {Object} entry.requestData + * @param {number} [entry.timestamp] + * @param {Object} [entry.metadata] + */ + async pushEntry(entry: UnidentifiedQueueStoreEntry): Promise { + if (process.env.NODE_ENV !== 'production') { + assert!.isType(entry, 'object', { + moduleName: 'workbox-background-sync', + className: 'QueueStore', + funcName: 'pushEntry', + paramName: 'entry', + }); + assert!.isType(entry.requestData, 'object', { + moduleName: 'workbox-background-sync', + className: 'QueueStore', + funcName: 'pushEntry', + paramName: 'entry.requestData', + }); + } + + // Don't specify an ID since one is automatically generated. + delete entry.id; + entry.queueName = this._queueName; + + await this._queueDb.addEntry(entry); + } + + /** + * Prepend an entry first in the queue. + * + * @param {Object} entry + * @param {Object} entry.requestData + * @param {number} [entry.timestamp] + * @param {Object} [entry.metadata] + */ + async unshiftEntry(entry: UnidentifiedQueueStoreEntry): Promise { + if (process.env.NODE_ENV !== 'production') { + assert!.isType(entry, 'object', { + moduleName: 'workbox-background-sync', + className: 'QueueStore', + funcName: 'unshiftEntry', + paramName: 'entry', + }); + assert!.isType(entry.requestData, 'object', { + moduleName: 'workbox-background-sync', + className: 'QueueStore', + funcName: 'unshiftEntry', + paramName: 'entry.requestData', + }); + } + + const firstId = await this._queueDb.getFirstEntryId(); + + if (firstId) { + // Pick an ID one less than the lowest ID in the object store. + entry.id = firstId - 1; + } else { + // Otherwise let the auto-incrementor assign the ID. + delete entry.id; + } + entry.queueName = this._queueName; + + await this._queueDb.addEntry(entry); + } + + /** + * Removes and returns the last entry in the queue matching the `queueName`. + * + * @return {Promise} + */ + async popEntry(): Promise { + return this._removeEntry( + await this._queueDb.getLastEntryByQueueName(this._queueName), + ); + } + + /** + * Removes and returns the first entry in the queue matching the `queueName`. + * + * @return {Promise} + */ + async shiftEntry(): Promise { + return this._removeEntry( + await this._queueDb.getFirstEntryByQueueName(this._queueName), + ); + } + + /** + * Returns all entries in the store matching the `queueName`. + * + * @param {Object} options See {@link workbox-background-sync.Queue~getAll} + * @return {Promise>} + */ + async getAll(): Promise { + return await this._queueDb.getAllEntriesByQueueName(this._queueName); + } + + /** + * Returns the number of entries in the store matching the `queueName`. + * + * @param {Object} options See {@link workbox-background-sync.Queue~size} + * @return {Promise} + */ + async size(): Promise { + return await this._queueDb.getEntryCountByQueueName(this._queueName); + } + + /** + * Deletes the entry for the given ID. + * + * WARNING: this method does not ensure the deleted entry belongs to this + * queue (i.e. matches the `queueName`). But this limitation is acceptable + * as this class is not publicly exposed. An additional check would make + * this method slower than it needs to be. + * + * @param {number} id + */ + async deleteEntry(id: number): Promise { + await this._queueDb.deleteEntry(id); + } + + /** + * Removes and returns the first or last entry in the queue (based on the + * `direction` argument) matching the `queueName`. + * + * @return {Promise} + * @private + */ + async _removeEntry( + entry?: QueueStoreEntry, + ): Promise { + if (entry) { + await this.deleteEntry(entry.id); + } + return entry; + } +} diff --git a/tools/ui/node_modules/workbox-background-sync/src/lib/StorableRequest.ts b/tools/ui/node_modules/workbox-background-sync/src/lib/StorableRequest.ts new file mode 100644 index 0000000000000000000000000000000000000000..f28d6aef62f241ad3f2846dff6d5436d6fb77744 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/src/lib/StorableRequest.ts @@ -0,0 +1,156 @@ +/* + 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 {MapLikeObject} from 'workbox-core/types.js'; +import '../_version.js'; + +type SerializableProperties = + | 'method' + | 'referrer' + | 'referrerPolicy' + | 'mode' + | 'credentials' + | 'cache' + | 'redirect' + | 'integrity' + | 'keepalive'; + +const serializableProperties: SerializableProperties[] = [ + 'method', + 'referrer', + 'referrerPolicy', + 'mode', + 'credentials', + 'cache', + 'redirect', + 'integrity', + 'keepalive', +]; + +export interface RequestData extends MapLikeObject { + url: string; + headers: MapLikeObject; + body?: ArrayBuffer; +} + +/** + * A class to make it easier to serialize and de-serialize requests so they + * can be stored in IndexedDB. + * + * Most developers will not need to access this class directly; + * it is exposed for advanced use cases. + */ +class StorableRequest { + private readonly _requestData: RequestData; + + /** + * Converts a Request object to a plain object that can be structured + * cloned or JSON-stringified. + * + * @param {Request} request + * @return {Promise} + */ + static async fromRequest(request: Request): Promise { + const requestData: RequestData = { + url: request.url, + headers: {}, + }; + + // Set the body if present. + if (request.method !== 'GET') { + // Use ArrayBuffer to support non-text request bodies. + // NOTE: we can't use Blobs becuse Safari doesn't support storing + // Blobs in IndexedDB in some cases: + // https://github.com/dfahlander/Dexie.js/issues/618#issuecomment-398348457 + requestData.body = await request.clone().arrayBuffer(); + } + + // Convert the headers from an iterable to an object. + for (const [key, value] of request.headers.entries()) { + requestData.headers[key] = value; + } + + // Add all other serializable request properties + for (const prop of serializableProperties) { + if (request[prop] !== undefined) { + requestData[prop] = request[prop]; + } + } + + return new StorableRequest(requestData); + } + + /** + * Accepts an object of request data that can be used to construct a + * `Request` but can also be stored in IndexedDB. + * + * @param {Object} requestData An object of request data that includes the + * `url` plus any relevant properties of + * [requestInit]{@link https://fetch.spec.whatwg.org/#requestinit}. + */ + constructor(requestData: RequestData) { + if (process.env.NODE_ENV !== 'production') { + assert!.isType(requestData, 'object', { + moduleName: 'workbox-background-sync', + className: 'StorableRequest', + funcName: 'constructor', + paramName: 'requestData', + }); + assert!.isType(requestData.url, 'string', { + moduleName: 'workbox-background-sync', + className: 'StorableRequest', + funcName: 'constructor', + paramName: 'requestData.url', + }); + } + + // If the request's mode is `navigate`, convert it to `same-origin` since + // navigation requests can't be constructed via script. + if (requestData['mode'] === 'navigate') { + requestData['mode'] = 'same-origin'; + } + + this._requestData = requestData; + } + + /** + * Returns a deep clone of the instances `_requestData` object. + * + * @return {Object} + */ + toObject(): RequestData { + const requestData = Object.assign({}, this._requestData); + requestData.headers = Object.assign({}, this._requestData.headers); + if (requestData.body) { + requestData.body = requestData.body.slice(0); + } + + return requestData; + } + + /** + * Converts this instance to a Request. + * + * @return {Request} + */ + toRequest(): Request { + return new Request(this._requestData.url, this._requestData); + } + + /** + * Creates and returns a deep clone of the instance. + * + * @return {StorableRequest} + */ + clone(): StorableRequest { + return new StorableRequest(this.toObject()); + } +} + +export {StorableRequest}; diff --git a/tools/ui/node_modules/workbox-background-sync/tsconfig.json b/tools/ui/node_modules/workbox-background-sync/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..3bb2772b586c4d0ceee3d014e64dba7aafbdd570 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/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-background-sync/tsconfig.tsbuildinfo b/tools/ui/node_modules/workbox-background-sync/tsconfig.tsbuildinfo new file mode 100644 index 0000000000000000000000000000000000000000..e5738556dd36956f5991a709c5e5126d1035c127 --- /dev/null +++ b/tools/ui/node_modules/workbox-background-sync/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/logger.d.ts","../workbox-core/_private/assert.d.ts","../workbox-core/_private/getfriendlyurl.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/lib/storablerequest.ts","./src/lib/queuedb.ts","./src/lib/queuestore.ts","./src/queue.ts","./src/backgroundsyncplugin.ts","./src/queuestore.ts","./src/storablerequest.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",{"version":"d763b9ef68a16f3896187af5b51b5a959b479218cc65c2930bcb440cbbf10728","affectsGlobalScope":true},"7f5bced3f1bd3647585b59564e0b0fda67e1c2930325507ee922698fe8366aca","9fd40388bab591ded1f8c05b64fbfe3e342c6cd70d594d5238f42dd2186980ff","0a891b4678e2705451b79b6587efa5911288492815e1a2b46da880c06979f4ed","c488c9ba0e79f3d0f7af33ab64c9d3e736b842ce3e8ee23991830ae836397947","8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881","976b7d4fa6b154ae080c22f5249da4fa5c5bfb7584abf0c06279e2814bf4660a",{"version":"8a9aea00d2bffc349f17a55667503b25e4972add474557b43ce5c7e24afaa0c2","signature":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","affectsGlobalScope":true},{"version":"fd8523b384b49eabcd2dce9d5c6d76f86fa8eddd2889078d970d5a572cbaf751","signature":"bbbc8b1e87deaedfbd78cbbcd538a52430bf3386d18ba58cbe0eb96f2e2a6d83"},{"version":"9044f4a7916d8750e84c6bb6cc0536c6906906545e1539042fd1b875ffb32a15","signature":"12cf56bf7dbb9a2d161dd61d4adf20347f1c90a406cf62f40b34251a40378f38"},{"version":"15d415f26ccb87b1e3c24e6fb846a3d142d7cd7c4b0c3a03d7822dcdb9d41fb3","signature":"442ae514433af7f208d6ff63f49cac04cae9bbcf4872efd98bd14f1ef64a0f49"},{"version":"70cdec5c4b526b70b5e2430631a14df75f2d9f51371cfa97842778c62a7492af","signature":"72c62b406af19eca8080ea63f90f4c907ee5b8348152b75ba106395cd7514f54"},{"version":"6b6b2d887a077904ae2d7e5bfeecdcec0a8de7d15eeeccde04a53ea1310cd766","signature":"3d3f0a288ad84c93fa07551ef1471447bec5357f1e23d4c113dc960a4a088f65"},{"version":"0793214b49d56eedbb371acbebacec68f09b58f5061413e7246819d6a927e3dd","signature":"a11e0f0a8864c8423ac7d9b0e4f10ff6bdfc1293496e9ba41ab134728e6f8901"},{"version":"1b39355b5db7aafcc849e3f777eb842be92c797c20e748c44cbf0177357fe935","signature":"af599cf0f7d08f1f265f458a9d5406eb8e955d0d34aeb5a99e75ed8ee0ffde7e"},{"version":"51dc9c8377a4ba60f16e5ea1b02a2715e8b7c0a74126ab7680ca675afce01375","signature":"5bd7129bf71f782c4619ca7a344208f0f774ca66be3d85ee35e6cd10dfb7f6c3","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":[[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],[49,80,122],[50,51,80,122],[50,80,122],[44,57,80,122],[57,58,59,60,80,122],[52,54,80,122],[47,55,80,122],[44,47,80,122],[45,46,47,48,54,55,56,80,122],[56,80,122],[54,80,122],[44,80,122],[44,57],[57,58,59,60],[54],[55],[44],[56]],"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],[51,1],[50,115],[52,116],[49,117],[53,1],[58,118],[61,119],[55,120],[56,121],[54,122],[57,123],[59,124],[60,125],[47,126],[48,1],[46,1],[45,126],[43,1],[44,1]],"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],[51,1],[50,115],[52,116],[49,117],[58,127],[61,128],[55,129],[56,130],[54,131],[59,132],[60,129],[47,126],[48,1],[46,1],[45,126],[43,1],[44,1]],"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,51,50,52,49,53,58,61,55,56,54,57,59,60,47,48,46,45,43,44],"latestChangedDtsFile":"./index.d.ts"},"version":"4.9.5"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-broadcast-update/BroadcastCacheUpdate.d.ts b/tools/ui/node_modules/workbox-broadcast-update/BroadcastCacheUpdate.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7f356b34d1dc3cd22d80d73ebada155e62b4d89b --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/BroadcastCacheUpdate.d.ts @@ -0,0 +1,70 @@ +import { CacheDidUpdateCallbackParam } from 'workbox-core/types.js'; +import './_version.js'; +export interface BroadcastCacheUpdateOptions { + headersToCheck?: string[]; + generatePayload?: (options: CacheDidUpdateCallbackParam) => Record; + notifyAllClients?: boolean; +} +/** + * Uses the `postMessage()` API to inform any open windows/tabs when a cached + * response has been updated. + * + * For efficiency's sake, the underlying response bodies are not compared; + * only specific response headers are checked. + * + * @memberof workbox-broadcast-update + */ +declare class BroadcastCacheUpdate { + private readonly _headersToCheck; + private readonly _generatePayload; + private readonly _notifyAllClients; + /** + * Construct a BroadcastCacheUpdate instance with a specific `channelName` to + * broadcast messages on + * + * @param {Object} [options] + * @param {Array} [options.headersToCheck=['content-length', 'etag', 'last-modified']] + * A list of headers that will be used to determine whether the responses + * differ. + * @param {string} [options.generatePayload] A function whose return value + * will be used as the `payload` field in any cache update messages sent + * to the window clients. + * @param {boolean} [options.notifyAllClients=true] If true (the default) then + * all open clients will receive a message. If false, then only the client + * that make the original request will be notified of the update. + */ + constructor({ generatePayload, headersToCheck, notifyAllClients, }?: BroadcastCacheUpdateOptions); + /** + * Compares two [Responses](https://developer.mozilla.org/en-US/docs/Web/API/Response) + * and sends a message (via `postMessage()`) to all window clients if the + * responses differ. Neither of the Responses can be + * [opaque](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses). + * + * The message that's posted has the following format (where `payload` can + * be customized via the `generatePayload` option the instance is created + * with): + * + * ``` + * { + * type: 'CACHE_UPDATED', + * meta: 'workbox-broadcast-update', + * payload: { + * cacheName: 'the-cache-name', + * updatedURL: 'https://example.com/' + * } + * } + * ``` + * + * @param {Object} options + * @param {Response} [options.oldResponse] Cached response to compare. + * @param {Response} options.newResponse Possibly updated response to compare. + * @param {Request} options.request The request. + * @param {string} options.cacheName Name of the cache the responses belong + * to. This is included in the broadcast message. + * @param {Event} options.event event The event that triggered + * this possible cache update. + * @return {Promise} Resolves once the update is sent. + */ + notifyIfUpdated(options: CacheDidUpdateCallbackParam): Promise; +} +export { BroadcastCacheUpdate }; diff --git a/tools/ui/node_modules/workbox-broadcast-update/BroadcastCacheUpdate.js b/tools/ui/node_modules/workbox-broadcast-update/BroadcastCacheUpdate.js new file mode 100644 index 0000000000000000000000000000000000000000..fe96ede69207f6becb58df307c75af66af57ff0b --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/BroadcastCacheUpdate.js @@ -0,0 +1,164 @@ +/* + 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 { timeout } from 'workbox-core/_private/timeout.js'; +import { resultingClientExists } from 'workbox-core/_private/resultingClientExists.js'; +import { logger } from 'workbox-core/_private/logger.js'; +import { responsesAreSame } from './responsesAreSame.js'; +import { CACHE_UPDATED_MESSAGE_META, CACHE_UPDATED_MESSAGE_TYPE, DEFAULT_HEADERS_TO_CHECK, NOTIFY_ALL_CLIENTS, } from './utils/constants.js'; +import './_version.js'; +// UA-sniff Safari: https://stackoverflow.com/questions/7944460/detect-safari-browser +// TODO(philipwalton): remove once this Safari bug fix has been released. +// https://bugs.webkit.org/show_bug.cgi?id=201169 +const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); +/** + * Generates the default payload used in update messages. By default the + * payload includes the `cacheName` and `updatedURL` fields. + * + * @return Object + * @private + */ +function defaultPayloadGenerator(data) { + return { + cacheName: data.cacheName, + updatedURL: data.request.url, + }; +} +/** + * Uses the `postMessage()` API to inform any open windows/tabs when a cached + * response has been updated. + * + * For efficiency's sake, the underlying response bodies are not compared; + * only specific response headers are checked. + * + * @memberof workbox-broadcast-update + */ +class BroadcastCacheUpdate { + /** + * Construct a BroadcastCacheUpdate instance with a specific `channelName` to + * broadcast messages on + * + * @param {Object} [options] + * @param {Array} [options.headersToCheck=['content-length', 'etag', 'last-modified']] + * A list of headers that will be used to determine whether the responses + * differ. + * @param {string} [options.generatePayload] A function whose return value + * will be used as the `payload` field in any cache update messages sent + * to the window clients. + * @param {boolean} [options.notifyAllClients=true] If true (the default) then + * all open clients will receive a message. If false, then only the client + * that make the original request will be notified of the update. + */ + constructor({ generatePayload, headersToCheck, notifyAllClients, } = {}) { + this._headersToCheck = headersToCheck || DEFAULT_HEADERS_TO_CHECK; + this._generatePayload = generatePayload || defaultPayloadGenerator; + this._notifyAllClients = notifyAllClients !== null && notifyAllClients !== void 0 ? notifyAllClients : NOTIFY_ALL_CLIENTS; + } + /** + * Compares two [Responses](https://developer.mozilla.org/en-US/docs/Web/API/Response) + * and sends a message (via `postMessage()`) to all window clients if the + * responses differ. Neither of the Responses can be + * [opaque](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses). + * + * The message that's posted has the following format (where `payload` can + * be customized via the `generatePayload` option the instance is created + * with): + * + * ``` + * { + * type: 'CACHE_UPDATED', + * meta: 'workbox-broadcast-update', + * payload: { + * cacheName: 'the-cache-name', + * updatedURL: 'https://example.com/' + * } + * } + * ``` + * + * @param {Object} options + * @param {Response} [options.oldResponse] Cached response to compare. + * @param {Response} options.newResponse Possibly updated response to compare. + * @param {Request} options.request The request. + * @param {string} options.cacheName Name of the cache the responses belong + * to. This is included in the broadcast message. + * @param {Event} options.event event The event that triggered + * this possible cache update. + * @return {Promise} Resolves once the update is sent. + */ + async notifyIfUpdated(options) { + if (process.env.NODE_ENV !== 'production') { + assert.isType(options.cacheName, 'string', { + moduleName: 'workbox-broadcast-update', + className: 'BroadcastCacheUpdate', + funcName: 'notifyIfUpdated', + paramName: 'cacheName', + }); + assert.isInstance(options.newResponse, Response, { + moduleName: 'workbox-broadcast-update', + className: 'BroadcastCacheUpdate', + funcName: 'notifyIfUpdated', + paramName: 'newResponse', + }); + assert.isInstance(options.request, Request, { + moduleName: 'workbox-broadcast-update', + className: 'BroadcastCacheUpdate', + funcName: 'notifyIfUpdated', + paramName: 'request', + }); + } + // Without two responses there is nothing to compare. + if (!options.oldResponse) { + return; + } + if (!responsesAreSame(options.oldResponse, options.newResponse, this._headersToCheck)) { + if (process.env.NODE_ENV !== 'production') { + logger.log(`Newer response found (and cached) for:`, options.request.url); + } + const messageData = { + type: CACHE_UPDATED_MESSAGE_TYPE, + meta: CACHE_UPDATED_MESSAGE_META, + payload: this._generatePayload(options), + }; + // For navigation requests, wait until the new window client exists + // before sending the message + if (options.request.mode === 'navigate') { + let resultingClientId; + if (options.event instanceof FetchEvent) { + resultingClientId = options.event.resultingClientId; + } + const resultingWin = await resultingClientExists(resultingClientId); + // Safari does not currently implement postMessage buffering and + // there's no good way to feature detect that, so to increase the + // chances of the message being delivered in Safari, we add a timeout. + // We also do this if `resultingClientExists()` didn't return a client, + // which means it timed out, so it's worth waiting a bit longer. + if (!resultingWin || isSafari) { + // 3500 is chosen because (according to CrUX data) 80% of mobile + // websites hit the DOMContentLoaded event in less than 3.5 seconds. + // And presumably sites implementing service worker are on the + // higher end of the performance spectrum. + await timeout(3500); + } + } + if (this._notifyAllClients) { + const windows = await self.clients.matchAll({ type: 'window' }); + for (const win of windows) { + win.postMessage(messageData); + } + } + else { + // See https://github.com/GoogleChrome/workbox/issues/2895 + if (options.event instanceof FetchEvent) { + const client = await self.clients.get(options.event.clientId); + client === null || client === void 0 ? void 0 : client.postMessage(messageData); + } + } + } + } +} +export { BroadcastCacheUpdate }; diff --git a/tools/ui/node_modules/workbox-broadcast-update/BroadcastCacheUpdate.mjs b/tools/ui/node_modules/workbox-broadcast-update/BroadcastCacheUpdate.mjs new file mode 100644 index 0000000000000000000000000000000000000000..5a63fb6dc89b3bdeaa2a0eb85093462edaac0532 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/BroadcastCacheUpdate.mjs @@ -0,0 +1 @@ +export * from './BroadcastCacheUpdate.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-broadcast-update/BroadcastUpdatePlugin.d.ts b/tools/ui/node_modules/workbox-broadcast-update/BroadcastUpdatePlugin.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a00f52d6a7431e16da3d5a4ed62e47eebb96320 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/BroadcastUpdatePlugin.d.ts @@ -0,0 +1,41 @@ +import { WorkboxPlugin } from 'workbox-core/types.js'; +import { BroadcastCacheUpdateOptions } from './BroadcastCacheUpdate.js'; +import './_version.js'; +/** + * This plugin will automatically broadcast a message whenever a cached response + * is updated. + * + * @memberof workbox-broadcast-update + */ +declare class BroadcastUpdatePlugin implements WorkboxPlugin { + private readonly _broadcastUpdate; + /** + * Construct a {@link workbox-broadcast-update.BroadcastUpdate} instance with + * the passed options and calls its `notifyIfUpdated` method whenever the + * plugin's `cacheDidUpdate` callback is invoked. + * + * @param {Object} [options] + * @param {Array} [options.headersToCheck=['content-length', 'etag', 'last-modified']] + * A list of headers that will be used to determine whether the responses + * differ. + * @param {string} [options.generatePayload] A function whose return value + * will be used as the `payload` field in any cache update messages sent + * to the window clients. + */ + constructor(options?: BroadcastCacheUpdateOptions); + /** + * A "lifecycle" callback that will be triggered automatically by the + * `workbox-sw` and `workbox-runtime-caching` handlers when an entry is + * added to a cache. + * + * @private + * @param {Object} options The input object to this function. + * @param {string} options.cacheName Name of the cache being updated. + * @param {Response} [options.oldResponse] The previous cached value, if any. + * @param {Response} options.newResponse The new value in the cache. + * @param {Request} options.request The request that triggered the update. + * @param {Request} options.event The event that triggered the update. + */ + cacheDidUpdate: WorkboxPlugin['cacheDidUpdate']; +} +export { BroadcastUpdatePlugin }; diff --git a/tools/ui/node_modules/workbox-broadcast-update/BroadcastUpdatePlugin.js b/tools/ui/node_modules/workbox-broadcast-update/BroadcastUpdatePlugin.js new file mode 100644 index 0000000000000000000000000000000000000000..95337fcea72a6971ae4969ae43749dde6bfd71aa --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/BroadcastUpdatePlugin.js @@ -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 { dontWaitFor } from 'workbox-core/_private/dontWaitFor.js'; +import { BroadcastCacheUpdate, } from './BroadcastCacheUpdate.js'; +import './_version.js'; +/** + * This plugin will automatically broadcast a message whenever a cached response + * is updated. + * + * @memberof workbox-broadcast-update + */ +class BroadcastUpdatePlugin { + /** + * Construct a {@link workbox-broadcast-update.BroadcastUpdate} instance with + * the passed options and calls its `notifyIfUpdated` method whenever the + * plugin's `cacheDidUpdate` callback is invoked. + * + * @param {Object} [options] + * @param {Array} [options.headersToCheck=['content-length', 'etag', 'last-modified']] + * A list of headers that will be used to determine whether the responses + * differ. + * @param {string} [options.generatePayload] A function whose return value + * will be used as the `payload` field in any cache update messages sent + * to the window clients. + */ + constructor(options) { + /** + * A "lifecycle" callback that will be triggered automatically by the + * `workbox-sw` and `workbox-runtime-caching` handlers when an entry is + * added to a cache. + * + * @private + * @param {Object} options The input object to this function. + * @param {string} options.cacheName Name of the cache being updated. + * @param {Response} [options.oldResponse] The previous cached value, if any. + * @param {Response} options.newResponse The new value in the cache. + * @param {Request} options.request The request that triggered the update. + * @param {Request} options.event The event that triggered the update. + */ + this.cacheDidUpdate = async (options) => { + dontWaitFor(this._broadcastUpdate.notifyIfUpdated(options)); + }; + this._broadcastUpdate = new BroadcastCacheUpdate(options); + } +} +export { BroadcastUpdatePlugin }; diff --git a/tools/ui/node_modules/workbox-broadcast-update/BroadcastUpdatePlugin.mjs b/tools/ui/node_modules/workbox-broadcast-update/BroadcastUpdatePlugin.mjs new file mode 100644 index 0000000000000000000000000000000000000000..974685cac0b7e62173a3c7e136ec5997230c5adf --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/BroadcastUpdatePlugin.mjs @@ -0,0 +1 @@ +export * from './BroadcastUpdatePlugin.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-broadcast-update/LICENSE b/tools/ui/node_modules/workbox-broadcast-update/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/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-broadcast-update/README.md b/tools/ui/node_modules/workbox-broadcast-update/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a6796d289926cc3b5b55d9e549009298c269eb60 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/README.md @@ -0,0 +1 @@ +This module's documentation can be found at https://developers.google.com/web/tools/workbox/modules/workbox-broadcast-update diff --git a/tools/ui/node_modules/workbox-broadcast-update/_version.d.ts b/tools/ui/node_modules/workbox-broadcast-update/_version.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tools/ui/node_modules/workbox-broadcast-update/_version.js b/tools/ui/node_modules/workbox-broadcast-update/_version.js new file mode 100644 index 0000000000000000000000000000000000000000..6c5403f2b0c85d215e82b88178633e3a38737fa3 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/_version.js @@ -0,0 +1,6 @@ +"use strict"; +// @ts-ignore +try { + self['workbox:broadcast-update:7.4.0'] && _(); +} +catch (e) { } diff --git a/tools/ui/node_modules/workbox-broadcast-update/_version.mjs b/tools/ui/node_modules/workbox-broadcast-update/_version.mjs new file mode 100644 index 0000000000000000000000000000000000000000..d66db8348cbe6b812ce2fb77c9fe5877081d7c20 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/_version.mjs @@ -0,0 +1 @@ +try{self['workbox:broadcast-update:7.4.1']&&_()}catch(e){}// eslint-disable-line \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-broadcast-update/build/workbox-broadcast-update.dev.js b/tools/ui/node_modules/workbox-broadcast-update/build/workbox-broadcast-update.dev.js new file mode 100644 index 0000000000000000000000000000000000000000..9b26ecc0493574b697788a13123b38c6487f602c --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/build/workbox-broadcast-update.dev.js @@ -0,0 +1,282 @@ +this.workbox = this.workbox || {}; +this.workbox.broadcastUpdate = (function (exports, assert_js, timeout_js, resultingClientExists_js, logger_js, WorkboxError_js, dontWaitFor_js) { + 'use strict'; + + // @ts-ignore + try { + self['workbox:broadcast-update: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. + */ + /** + * Given two `Response's`, compares several header values to see if they are + * the same or not. + * + * @param {Response} firstResponse + * @param {Response} secondResponse + * @param {Array} headersToCheck + * @return {boolean} + * + * @memberof workbox-broadcast-update + */ + const responsesAreSame = (firstResponse, secondResponse, headersToCheck) => { + { + if (!(firstResponse instanceof Response && secondResponse instanceof Response)) { + throw new WorkboxError_js.WorkboxError('invalid-responses-are-same-args'); + } + } + const atLeastOneHeaderAvailable = headersToCheck.some(header => { + return firstResponse.headers.has(header) && secondResponse.headers.has(header); + }); + if (!atLeastOneHeaderAvailable) { + { + logger_js.logger.warn(`Unable to determine where the response has been updated ` + `because none of the headers that would be checked are present.`); + logger_js.logger.debug(`Attempting to compare the following: `, firstResponse, secondResponse, headersToCheck); + } + // Just return true, indicating the that responses are the same, since we + // can't determine otherwise. + return true; + } + return headersToCheck.every(header => { + const headerStateComparison = firstResponse.headers.has(header) === secondResponse.headers.has(header); + const headerValueComparison = firstResponse.headers.get(header) === secondResponse.headers.get(header); + return headerStateComparison && headerValueComparison; + }); + }; + + /* + 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 CACHE_UPDATED_MESSAGE_TYPE = 'CACHE_UPDATED'; + const CACHE_UPDATED_MESSAGE_META = 'workbox-broadcast-update'; + const NOTIFY_ALL_CLIENTS = true; + const DEFAULT_HEADERS_TO_CHECK = ['content-length', 'etag', 'last-modified']; + + /* + 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. + */ + // UA-sniff Safari: https://stackoverflow.com/questions/7944460/detect-safari-browser + // TODO(philipwalton): remove once this Safari bug fix has been released. + // https://bugs.webkit.org/show_bug.cgi?id=201169 + const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); + /** + * Generates the default payload used in update messages. By default the + * payload includes the `cacheName` and `updatedURL` fields. + * + * @return Object + * @private + */ + function defaultPayloadGenerator(data) { + return { + cacheName: data.cacheName, + updatedURL: data.request.url + }; + } + /** + * Uses the `postMessage()` API to inform any open windows/tabs when a cached + * response has been updated. + * + * For efficiency's sake, the underlying response bodies are not compared; + * only specific response headers are checked. + * + * @memberof workbox-broadcast-update + */ + class BroadcastCacheUpdate { + /** + * Construct a BroadcastCacheUpdate instance with a specific `channelName` to + * broadcast messages on + * + * @param {Object} [options] + * @param {Array} [options.headersToCheck=['content-length', 'etag', 'last-modified']] + * A list of headers that will be used to determine whether the responses + * differ. + * @param {string} [options.generatePayload] A function whose return value + * will be used as the `payload` field in any cache update messages sent + * to the window clients. + * @param {boolean} [options.notifyAllClients=true] If true (the default) then + * all open clients will receive a message. If false, then only the client + * that make the original request will be notified of the update. + */ + constructor({ + generatePayload, + headersToCheck, + notifyAllClients + } = {}) { + this._headersToCheck = headersToCheck || DEFAULT_HEADERS_TO_CHECK; + this._generatePayload = generatePayload || defaultPayloadGenerator; + this._notifyAllClients = notifyAllClients !== null && notifyAllClients !== void 0 ? notifyAllClients : NOTIFY_ALL_CLIENTS; + } + /** + * Compares two [Responses](https://developer.mozilla.org/en-US/docs/Web/API/Response) + * and sends a message (via `postMessage()`) to all window clients if the + * responses differ. Neither of the Responses can be + * [opaque](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses). + * + * The message that's posted has the following format (where `payload` can + * be customized via the `generatePayload` option the instance is created + * with): + * + * ``` + * { + * type: 'CACHE_UPDATED', + * meta: 'workbox-broadcast-update', + * payload: { + * cacheName: 'the-cache-name', + * updatedURL: 'https://example.com/' + * } + * } + * ``` + * + * @param {Object} options + * @param {Response} [options.oldResponse] Cached response to compare. + * @param {Response} options.newResponse Possibly updated response to compare. + * @param {Request} options.request The request. + * @param {string} options.cacheName Name of the cache the responses belong + * to. This is included in the broadcast message. + * @param {Event} options.event event The event that triggered + * this possible cache update. + * @return {Promise} Resolves once the update is sent. + */ + async notifyIfUpdated(options) { + { + assert_js.assert.isType(options.cacheName, 'string', { + moduleName: 'workbox-broadcast-update', + className: 'BroadcastCacheUpdate', + funcName: 'notifyIfUpdated', + paramName: 'cacheName' + }); + assert_js.assert.isInstance(options.newResponse, Response, { + moduleName: 'workbox-broadcast-update', + className: 'BroadcastCacheUpdate', + funcName: 'notifyIfUpdated', + paramName: 'newResponse' + }); + assert_js.assert.isInstance(options.request, Request, { + moduleName: 'workbox-broadcast-update', + className: 'BroadcastCacheUpdate', + funcName: 'notifyIfUpdated', + paramName: 'request' + }); + } + // Without two responses there is nothing to compare. + if (!options.oldResponse) { + return; + } + if (!responsesAreSame(options.oldResponse, options.newResponse, this._headersToCheck)) { + { + logger_js.logger.log(`Newer response found (and cached) for:`, options.request.url); + } + const messageData = { + type: CACHE_UPDATED_MESSAGE_TYPE, + meta: CACHE_UPDATED_MESSAGE_META, + payload: this._generatePayload(options) + }; + // For navigation requests, wait until the new window client exists + // before sending the message + if (options.request.mode === 'navigate') { + let resultingClientId; + if (options.event instanceof FetchEvent) { + resultingClientId = options.event.resultingClientId; + } + const resultingWin = await resultingClientExists_js.resultingClientExists(resultingClientId); + // Safari does not currently implement postMessage buffering and + // there's no good way to feature detect that, so to increase the + // chances of the message being delivered in Safari, we add a timeout. + // We also do this if `resultingClientExists()` didn't return a client, + // which means it timed out, so it's worth waiting a bit longer. + if (!resultingWin || isSafari) { + // 3500 is chosen because (according to CrUX data) 80% of mobile + // websites hit the DOMContentLoaded event in less than 3.5 seconds. + // And presumably sites implementing service worker are on the + // higher end of the performance spectrum. + await timeout_js.timeout(3500); + } + } + if (this._notifyAllClients) { + const windows = await self.clients.matchAll({ + type: 'window' + }); + for (const win of windows) { + win.postMessage(messageData); + } + } else { + // See https://github.com/GoogleChrome/workbox/issues/2895 + if (options.event instanceof FetchEvent) { + const client = await self.clients.get(options.event.clientId); + client === null || client === void 0 ? void 0 : client.postMessage(messageData); + } + } + } + } + } + + /* + 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 will automatically broadcast a message whenever a cached response + * is updated. + * + * @memberof workbox-broadcast-update + */ + class BroadcastUpdatePlugin { + /** + * Construct a {@link workbox-broadcast-update.BroadcastUpdate} instance with + * the passed options and calls its `notifyIfUpdated` method whenever the + * plugin's `cacheDidUpdate` callback is invoked. + * + * @param {Object} [options] + * @param {Array} [options.headersToCheck=['content-length', 'etag', 'last-modified']] + * A list of headers that will be used to determine whether the responses + * differ. + * @param {string} [options.generatePayload] A function whose return value + * will be used as the `payload` field in any cache update messages sent + * to the window clients. + */ + constructor(options) { + /** + * A "lifecycle" callback that will be triggered automatically by the + * `workbox-sw` and `workbox-runtime-caching` handlers when an entry is + * added to a cache. + * + * @private + * @param {Object} options The input object to this function. + * @param {string} options.cacheName Name of the cache being updated. + * @param {Response} [options.oldResponse] The previous cached value, if any. + * @param {Response} options.newResponse The new value in the cache. + * @param {Request} options.request The request that triggered the update. + * @param {Request} options.event The event that triggered the update. + */ + this.cacheDidUpdate = async options => { + dontWaitFor_js.dontWaitFor(this._broadcastUpdate.notifyIfUpdated(options)); + }; + this._broadcastUpdate = new BroadcastCacheUpdate(options); + } + } + + exports.BroadcastCacheUpdate = BroadcastCacheUpdate; + exports.BroadcastUpdatePlugin = BroadcastUpdatePlugin; + exports.responsesAreSame = responsesAreSame; + + return exports; + +})({}, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private, workbox.core._private); +//# sourceMappingURL=workbox-broadcast-update.dev.js.map diff --git a/tools/ui/node_modules/workbox-broadcast-update/build/workbox-broadcast-update.dev.js.map b/tools/ui/node_modules/workbox-broadcast-update/build/workbox-broadcast-update.dev.js.map new file mode 100644 index 0000000000000000000000000000000000000000..de6fe0ba539f0259f4d7230a9c4b5ad8d8b1c49b --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/build/workbox-broadcast-update.dev.js.map @@ -0,0 +1 @@ +{"version":3,"file":"workbox-broadcast-update.dev.js","sources":["../_version.js","../responsesAreSame.js","../utils/constants.js","../BroadcastCacheUpdate.js","../BroadcastUpdatePlugin.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:broadcast-update: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 { logger } from 'workbox-core/_private/logger.js';\nimport './_version.js';\n/**\n * Given two `Response's`, compares several header values to see if they are\n * the same or not.\n *\n * @param {Response} firstResponse\n * @param {Response} secondResponse\n * @param {Array} headersToCheck\n * @return {boolean}\n *\n * @memberof workbox-broadcast-update\n */\nconst responsesAreSame = (firstResponse, secondResponse, headersToCheck) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!(firstResponse instanceof Response && secondResponse instanceof Response)) {\n throw new WorkboxError('invalid-responses-are-same-args');\n }\n }\n const atLeastOneHeaderAvailable = headersToCheck.some((header) => {\n return (firstResponse.headers.has(header) && secondResponse.headers.has(header));\n });\n if (!atLeastOneHeaderAvailable) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`Unable to determine where the response has been updated ` +\n `because none of the headers that would be checked are present.`);\n logger.debug(`Attempting to compare the following: `, firstResponse, secondResponse, headersToCheck);\n }\n // Just return true, indicating the that responses are the same, since we\n // can't determine otherwise.\n return true;\n }\n return headersToCheck.every((header) => {\n const headerStateComparison = firstResponse.headers.has(header) === secondResponse.headers.has(header);\n const headerValueComparison = firstResponse.headers.get(header) === secondResponse.headers.get(header);\n return headerStateComparison && headerValueComparison;\n });\n};\nexport { responsesAreSame };\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 CACHE_UPDATED_MESSAGE_TYPE = 'CACHE_UPDATED';\nexport const CACHE_UPDATED_MESSAGE_META = 'workbox-broadcast-update';\nexport const NOTIFY_ALL_CLIENTS = true;\nexport const DEFAULT_HEADERS_TO_CHECK = [\n 'content-length',\n 'etag',\n 'last-modified',\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 { timeout } from 'workbox-core/_private/timeout.js';\nimport { resultingClientExists } from 'workbox-core/_private/resultingClientExists.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { responsesAreSame } from './responsesAreSame.js';\nimport { CACHE_UPDATED_MESSAGE_META, CACHE_UPDATED_MESSAGE_TYPE, DEFAULT_HEADERS_TO_CHECK, NOTIFY_ALL_CLIENTS, } from './utils/constants.js';\nimport './_version.js';\n// UA-sniff Safari: https://stackoverflow.com/questions/7944460/detect-safari-browser\n// TODO(philipwalton): remove once this Safari bug fix has been released.\n// https://bugs.webkit.org/show_bug.cgi?id=201169\nconst isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n/**\n * Generates the default payload used in update messages. By default the\n * payload includes the `cacheName` and `updatedURL` fields.\n *\n * @return Object\n * @private\n */\nfunction defaultPayloadGenerator(data) {\n return {\n cacheName: data.cacheName,\n updatedURL: data.request.url,\n };\n}\n/**\n * Uses the `postMessage()` API to inform any open windows/tabs when a cached\n * response has been updated.\n *\n * For efficiency's sake, the underlying response bodies are not compared;\n * only specific response headers are checked.\n *\n * @memberof workbox-broadcast-update\n */\nclass BroadcastCacheUpdate {\n /**\n * Construct a BroadcastCacheUpdate instance with a specific `channelName` to\n * broadcast messages on\n *\n * @param {Object} [options]\n * @param {Array} [options.headersToCheck=['content-length', 'etag', 'last-modified']]\n * A list of headers that will be used to determine whether the responses\n * differ.\n * @param {string} [options.generatePayload] A function whose return value\n * will be used as the `payload` field in any cache update messages sent\n * to the window clients.\n * @param {boolean} [options.notifyAllClients=true] If true (the default) then\n * all open clients will receive a message. If false, then only the client\n * that make the original request will be notified of the update.\n */\n constructor({ generatePayload, headersToCheck, notifyAllClients, } = {}) {\n this._headersToCheck = headersToCheck || DEFAULT_HEADERS_TO_CHECK;\n this._generatePayload = generatePayload || defaultPayloadGenerator;\n this._notifyAllClients = notifyAllClients !== null && notifyAllClients !== void 0 ? notifyAllClients : NOTIFY_ALL_CLIENTS;\n }\n /**\n * Compares two [Responses](https://developer.mozilla.org/en-US/docs/Web/API/Response)\n * and sends a message (via `postMessage()`) to all window clients if the\n * responses differ. Neither of the Responses can be\n * [opaque](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).\n *\n * The message that's posted has the following format (where `payload` can\n * be customized via the `generatePayload` option the instance is created\n * with):\n *\n * ```\n * {\n * type: 'CACHE_UPDATED',\n * meta: 'workbox-broadcast-update',\n * payload: {\n * cacheName: 'the-cache-name',\n * updatedURL: 'https://example.com/'\n * }\n * }\n * ```\n *\n * @param {Object} options\n * @param {Response} [options.oldResponse] Cached response to compare.\n * @param {Response} options.newResponse Possibly updated response to compare.\n * @param {Request} options.request The request.\n * @param {string} options.cacheName Name of the cache the responses belong\n * to. This is included in the broadcast message.\n * @param {Event} options.event event The event that triggered\n * this possible cache update.\n * @return {Promise} Resolves once the update is sent.\n */\n async notifyIfUpdated(options) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(options.cacheName, 'string', {\n moduleName: 'workbox-broadcast-update',\n className: 'BroadcastCacheUpdate',\n funcName: 'notifyIfUpdated',\n paramName: 'cacheName',\n });\n assert.isInstance(options.newResponse, Response, {\n moduleName: 'workbox-broadcast-update',\n className: 'BroadcastCacheUpdate',\n funcName: 'notifyIfUpdated',\n paramName: 'newResponse',\n });\n assert.isInstance(options.request, Request, {\n moduleName: 'workbox-broadcast-update',\n className: 'BroadcastCacheUpdate',\n funcName: 'notifyIfUpdated',\n paramName: 'request',\n });\n }\n // Without two responses there is nothing to compare.\n if (!options.oldResponse) {\n return;\n }\n if (!responsesAreSame(options.oldResponse, options.newResponse, this._headersToCheck)) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Newer response found (and cached) for:`, options.request.url);\n }\n const messageData = {\n type: CACHE_UPDATED_MESSAGE_TYPE,\n meta: CACHE_UPDATED_MESSAGE_META,\n payload: this._generatePayload(options),\n };\n // For navigation requests, wait until the new window client exists\n // before sending the message\n if (options.request.mode === 'navigate') {\n let resultingClientId;\n if (options.event instanceof FetchEvent) {\n resultingClientId = options.event.resultingClientId;\n }\n const resultingWin = await resultingClientExists(resultingClientId);\n // Safari does not currently implement postMessage buffering and\n // there's no good way to feature detect that, so to increase the\n // chances of the message being delivered in Safari, we add a timeout.\n // We also do this if `resultingClientExists()` didn't return a client,\n // which means it timed out, so it's worth waiting a bit longer.\n if (!resultingWin || isSafari) {\n // 3500 is chosen because (according to CrUX data) 80% of mobile\n // websites hit the DOMContentLoaded event in less than 3.5 seconds.\n // And presumably sites implementing service worker are on the\n // higher end of the performance spectrum.\n await timeout(3500);\n }\n }\n if (this._notifyAllClients) {\n const windows = await self.clients.matchAll({ type: 'window' });\n for (const win of windows) {\n win.postMessage(messageData);\n }\n }\n else {\n // See https://github.com/GoogleChrome/workbox/issues/2895\n if (options.event instanceof FetchEvent) {\n const client = await self.clients.get(options.event.clientId);\n client === null || client === void 0 ? void 0 : client.postMessage(messageData);\n }\n }\n }\n }\n}\nexport { BroadcastCacheUpdate };\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 { dontWaitFor } from 'workbox-core/_private/dontWaitFor.js';\nimport { BroadcastCacheUpdate, } from './BroadcastCacheUpdate.js';\nimport './_version.js';\n/**\n * This plugin will automatically broadcast a message whenever a cached response\n * is updated.\n *\n * @memberof workbox-broadcast-update\n */\nclass BroadcastUpdatePlugin {\n /**\n * Construct a {@link workbox-broadcast-update.BroadcastUpdate} instance with\n * the passed options and calls its `notifyIfUpdated` method whenever the\n * plugin's `cacheDidUpdate` callback is invoked.\n *\n * @param {Object} [options]\n * @param {Array} [options.headersToCheck=['content-length', 'etag', 'last-modified']]\n * A list of headers that will be used to determine whether the responses\n * differ.\n * @param {string} [options.generatePayload] A function whose return value\n * will be used as the `payload` field in any cache update messages sent\n * to the window clients.\n */\n constructor(options) {\n /**\n * A \"lifecycle\" callback that will be triggered automatically by the\n * `workbox-sw` and `workbox-runtime-caching` handlers when an entry is\n * added to a cache.\n *\n * @private\n * @param {Object} options The input object to this function.\n * @param {string} options.cacheName Name of the cache being updated.\n * @param {Response} [options.oldResponse] The previous cached value, if any.\n * @param {Response} options.newResponse The new value in the cache.\n * @param {Request} options.request The request that triggered the update.\n * @param {Request} options.event The event that triggered the update.\n */\n this.cacheDidUpdate = async (options) => {\n dontWaitFor(this._broadcastUpdate.notifyIfUpdated(options));\n };\n this._broadcastUpdate = new BroadcastCacheUpdate(options);\n }\n}\nexport { BroadcastUpdatePlugin };\n"],"names":["self","_","e","responsesAreSame","firstResponse","secondResponse","headersToCheck","Response","WorkboxError","atLeastOneHeaderAvailable","some","header","headers","has","logger","warn","debug","every","headerStateComparison","headerValueComparison","get","CACHE_UPDATED_MESSAGE_TYPE","CACHE_UPDATED_MESSAGE_META","NOTIFY_ALL_CLIENTS","DEFAULT_HEADERS_TO_CHECK","isSafari","test","navigator","userAgent","defaultPayloadGenerator","data","cacheName","updatedURL","request","url","BroadcastCacheUpdate","constructor","generatePayload","notifyAllClients","_headersToCheck","_generatePayload","_notifyAllClients","notifyIfUpdated","options","assert","isType","moduleName","className","funcName","paramName","isInstance","newResponse","Request","oldResponse","log","messageData","type","meta","payload","mode","resultingClientId","event","FetchEvent","resultingWin","resultingClientExists","timeout","windows","clients","matchAll","win","postMessage","client","clientId","BroadcastUpdatePlugin","cacheDidUpdate","dontWaitFor","_broadcastUpdate"],"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;IAIA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;AACA,UAAMC,gBAAgB,GAAGA,CAACC,aAAa,EAAEC,cAAc,EAAEC,cAAc,KAAK;IACxE,EAA2C;QACvC,IAAI,EAAEF,aAAa,YAAYG,QAAQ,IAAIF,cAAc,YAAYE,QAAQ,CAAC,EAAE;IAC5E,MAAA,MAAM,IAAIC,4BAAY,CAAC,iCAAiC,CAAC;IAC7D,IAAA;IACJ,EAAA;IACA,EAAA,MAAMC,yBAAyB,GAAGH,cAAc,CAACI,IAAI,CAAEC,MAAM,IAAK;IAC9D,IAAA,OAAQP,aAAa,CAACQ,OAAO,CAACC,GAAG,CAACF,MAAM,CAAC,IAAIN,cAAc,CAACO,OAAO,CAACC,GAAG,CAACF,MAAM,CAAC;IACnF,EAAA,CAAC,CAAC;MACF,IAAI,CAACF,yBAAyB,EAAE;IAC5B,IAA2C;IACvCK,MAAAA,gBAAM,CAACC,IAAI,CAAE,CAAA,wDAAA,CAAyD,GACjE,gEAA+D,CAAC;UACrED,gBAAM,CAACE,KAAK,CAAE,CAAA,qCAAA,CAAsC,EAAEZ,aAAa,EAAEC,cAAc,EAAEC,cAAc,CAAC;IACxG,IAAA;IACA;IACA;IACA,IAAA,OAAO,IAAI;IACf,EAAA;IACA,EAAA,OAAOA,cAAc,CAACW,KAAK,CAAEN,MAAM,IAAK;IACpC,IAAA,MAAMO,qBAAqB,GAAGd,aAAa,CAACQ,OAAO,CAACC,GAAG,CAACF,MAAM,CAAC,KAAKN,cAAc,CAACO,OAAO,CAACC,GAAG,CAACF,MAAM,CAAC;IACtG,IAAA,MAAMQ,qBAAqB,GAAGf,aAAa,CAACQ,OAAO,CAACQ,GAAG,CAACT,MAAM,CAAC,KAAKN,cAAc,CAACO,OAAO,CAACQ,GAAG,CAACT,MAAM,CAAC;QACtG,OAAOO,qBAAqB,IAAIC,qBAAqB;IACzD,EAAA,CAAC,CAAC;IACN;;IC7CA;IACA;;IAEA;IACA;IACA;IACA;IAEO,MAAME,0BAA0B,GAAG,eAAe;IAClD,MAAMC,0BAA0B,GAAG,0BAA0B;IAC7D,MAAMC,kBAAkB,GAAG,IAAI;IAC/B,MAAMC,wBAAwB,GAAG,CACpC,gBAAgB,EAChB,MAAM,EACN,eAAe,CAClB;;ICfD;IACA;;IAEA;IACA;IACA;IACA;IAQA;IACA;IACA;IACA,MAAMC,QAAQ,GAAG,gCAAgC,CAACC,IAAI,CAACC,SAAS,CAACC,SAAS,CAAC;IAC3E;IACA;IACA;IACA;IACA;IACA;IACA;IACA,SAASC,uBAAuBA,CAACC,IAAI,EAAE;MACnC,OAAO;QACHC,SAAS,EAAED,IAAI,CAACC,SAAS;IACzBC,IAAAA,UAAU,EAAEF,IAAI,CAACG,OAAO,CAACC;OAC5B;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA,MAAMC,oBAAoB,CAAC;IACvB;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACIC,EAAAA,WAAWA,CAAC;QAAEC,eAAe;QAAE/B,cAAc;IAAEgC,IAAAA;OAAmB,GAAG,EAAE,EAAE;IACrE,IAAA,IAAI,CAACC,eAAe,GAAGjC,cAAc,IAAIkB,wBAAwB;IACjE,IAAA,IAAI,CAACgB,gBAAgB,GAAGH,eAAe,IAAIR,uBAAuB;IAClE,IAAA,IAAI,CAACY,iBAAiB,GAAGH,gBAAgB,KAAK,IAAI,IAAIA,gBAAgB,KAAK,MAAM,GAAGA,gBAAgB,GAAGf,kBAAkB;IAC7H,EAAA;IACA;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;MACI,MAAMmB,eAAeA,CAACC,OAAO,EAAE;IAC3B,IAA2C;UACvCC,gBAAM,CAACC,MAAM,CAACF,OAAO,CAACZ,SAAS,EAAE,QAAQ,EAAE;IACvCe,QAAAA,UAAU,EAAE,0BAA0B;IACtCC,QAAAA,SAAS,EAAE,sBAAsB;IACjCC,QAAAA,QAAQ,EAAE,iBAAiB;IAC3BC,QAAAA,SAAS,EAAE;IACf,OAAC,CAAC;UACFL,gBAAM,CAACM,UAAU,CAACP,OAAO,CAACQ,WAAW,EAAE5C,QAAQ,EAAE;IAC7CuC,QAAAA,UAAU,EAAE,0BAA0B;IACtCC,QAAAA,SAAS,EAAE,sBAAsB;IACjCC,QAAAA,QAAQ,EAAE,iBAAiB;IAC3BC,QAAAA,SAAS,EAAE;IACf,OAAC,CAAC;UACFL,gBAAM,CAACM,UAAU,CAACP,OAAO,CAACV,OAAO,EAAEmB,OAAO,EAAE;IACxCN,QAAAA,UAAU,EAAE,0BAA0B;IACtCC,QAAAA,SAAS,EAAE,sBAAsB;IACjCC,QAAAA,QAAQ,EAAE,iBAAiB;IAC3BC,QAAAA,SAAS,EAAE;IACf,OAAC,CAAC;IACN,IAAA;IACA;IACA,IAAA,IAAI,CAACN,OAAO,CAACU,WAAW,EAAE;IACtB,MAAA;IACJ,IAAA;IACA,IAAA,IAAI,CAAClD,gBAAgB,CAACwC,OAAO,CAACU,WAAW,EAAEV,OAAO,CAACQ,WAAW,EAAE,IAAI,CAACZ,eAAe,CAAC,EAAE;IACnF,MAA2C;YACvCzB,gBAAM,CAACwC,GAAG,CAAE,CAAA,sCAAA,CAAuC,EAAEX,OAAO,CAACV,OAAO,CAACC,GAAG,CAAC;IAC7E,MAAA;IACA,MAAA,MAAMqB,WAAW,GAAG;IAChBC,QAAAA,IAAI,EAAEnC,0BAA0B;IAChCoC,QAAAA,IAAI,EAAEnC,0BAA0B;IAChCoC,QAAAA,OAAO,EAAE,IAAI,CAAClB,gBAAgB,CAACG,OAAO;WACzC;IACD;IACA;IACA,MAAA,IAAIA,OAAO,CAACV,OAAO,CAAC0B,IAAI,KAAK,UAAU,EAAE;IACrC,QAAA,IAAIC,iBAAiB;IACrB,QAAA,IAAIjB,OAAO,CAACkB,KAAK,YAAYC,UAAU,EAAE;IACrCF,UAAAA,iBAAiB,GAAGjB,OAAO,CAACkB,KAAK,CAACD,iBAAiB;IACvD,QAAA;IACA,QAAA,MAAMG,YAAY,GAAG,MAAMC,8CAAqB,CAACJ,iBAAiB,CAAC;IACnE;IACA;IACA;IACA;IACA;IACA,QAAA,IAAI,CAACG,YAAY,IAAItC,QAAQ,EAAE;IAC3B;IACA;IACA;IACA;cACA,MAAMwC,kBAAO,CAAC,IAAI,CAAC;IACvB,QAAA;IACJ,MAAA;UACA,IAAI,IAAI,CAACxB,iBAAiB,EAAE;YACxB,MAAMyB,OAAO,GAAG,MAAMlE,IAAI,CAACmE,OAAO,CAACC,QAAQ,CAAC;IAAEZ,UAAAA,IAAI,EAAE;IAAS,SAAC,CAAC;IAC/D,QAAA,KAAK,MAAMa,GAAG,IAAIH,OAAO,EAAE;IACvBG,UAAAA,GAAG,CAACC,WAAW,CAACf,WAAW,CAAC;IAChC,QAAA;IACJ,MAAA,CAAC,MACI;IACD;IACA,QAAA,IAAIZ,OAAO,CAACkB,KAAK,YAAYC,UAAU,EAAE;IACrC,UAAA,MAAMS,MAAM,GAAG,MAAMvE,IAAI,CAACmE,OAAO,CAAC/C,GAAG,CAACuB,OAAO,CAACkB,KAAK,CAACW,QAAQ,CAAC;IAC7DD,UAAAA,MAAM,KAAK,IAAI,IAAIA,MAAM,KAAK,MAAM,GAAG,MAAM,GAAGA,MAAM,CAACD,WAAW,CAACf,WAAW,CAAC;IACnF,QAAA;IACJ,MAAA;IACJ,IAAA;IACJ,EAAA;IACJ;;IClKA;IACA;;IAEA;IACA;IACA;IACA;IAIA;IACA;IACA;IACA;IACA;IACA;IACA,MAAMkB,qBAAqB,CAAC;IACxB;IACJ;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;MACIrC,WAAWA,CAACO,OAAO,EAAE;IACjB;IACR;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACQ,IAAA,IAAI,CAAC+B,cAAc,GAAG,MAAO/B,OAAO,IAAK;UACrCgC,0BAAW,CAAC,IAAI,CAACC,gBAAgB,CAAClC,eAAe,CAACC,OAAO,CAAC,CAAC;QAC/D,CAAC;IACD,IAAA,IAAI,CAACiC,gBAAgB,GAAG,IAAIzC,oBAAoB,CAACQ,OAAO,CAAC;IAC7D,EAAA;IACJ;;;;;;;;;;;;"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-broadcast-update/build/workbox-broadcast-update.prod.js b/tools/ui/node_modules/workbox-broadcast-update/build/workbox-broadcast-update.prod.js new file mode 100644 index 0000000000000000000000000000000000000000..8f062c8973872ef4935a9b9e1b7ff85ff51f74bf --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/build/workbox-broadcast-update.prod.js @@ -0,0 +1,2 @@ +this.workbox=this.workbox||{},this.workbox.broadcastUpdate=function(t,s,a,e){"use strict";try{self["workbox:broadcast-update:7.4.0"]&&_()}catch(t){}const n=(t,s,a)=>!a.some((a=>t.headers.has(a)&&s.headers.has(a)))||a.every((a=>{const e=t.headers.has(a)===s.headers.has(a),n=t.headers.get(a)===s.headers.get(a);return e&&n})),i=["content-length","etag","last-modified"],o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function c(t){return{cacheName:t.cacheName,updatedURL:t.request.url}}class r{constructor({generatePayload:t,headersToCheck:s,notifyAllClients:a}={}){this.ht=s||i,this.ft=t||c,this.lt=null==a||a}async notifyIfUpdated(t){if(t.oldResponse&&!n(t.oldResponse,t.newResponse,this.ht)){const e={type:"CACHE_UPDATED",meta:"workbox-broadcast-update",payload:this.ft(t)};if("navigate"===t.request.mode){let e;t.event instanceof FetchEvent&&(e=t.event.resultingClientId);await a.resultingClientExists(e)&&!o||await s.timeout(3500)}if(this.lt){const t=await self.clients.matchAll({type:"window"});for(const s of t)s.postMessage(e)}else if(t.event instanceof FetchEvent){const s=await self.clients.get(t.event.clientId);null==s||s.postMessage(e)}}}}return t.BroadcastCacheUpdate=r,t.BroadcastUpdatePlugin=class{constructor(t){this.cacheDidUpdate=async t=>{e.dontWaitFor(this.dt.notifyIfUpdated(t))},this.dt=new r(t)}},t.responsesAreSame=n,t}({},workbox.core._private,workbox.core._private,workbox.core._private); +//# sourceMappingURL=workbox-broadcast-update.prod.js.map diff --git a/tools/ui/node_modules/workbox-broadcast-update/build/workbox-broadcast-update.prod.js.map b/tools/ui/node_modules/workbox-broadcast-update/build/workbox-broadcast-update.prod.js.map new file mode 100644 index 0000000000000000000000000000000000000000..f7c6ea56cb09c07ecd78df91ae5af0918700912d --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/build/workbox-broadcast-update.prod.js.map @@ -0,0 +1 @@ +{"version":3,"file":"workbox-broadcast-update.prod.js","sources":["../_version.js","../responsesAreSame.js","../utils/constants.js","../BroadcastCacheUpdate.js","../BroadcastUpdatePlugin.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:broadcast-update: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 { logger } from 'workbox-core/_private/logger.js';\nimport './_version.js';\n/**\n * Given two `Response's`, compares several header values to see if they are\n * the same or not.\n *\n * @param {Response} firstResponse\n * @param {Response} secondResponse\n * @param {Array} headersToCheck\n * @return {boolean}\n *\n * @memberof workbox-broadcast-update\n */\nconst responsesAreSame = (firstResponse, secondResponse, headersToCheck) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!(firstResponse instanceof Response && secondResponse instanceof Response)) {\n throw new WorkboxError('invalid-responses-are-same-args');\n }\n }\n const atLeastOneHeaderAvailable = headersToCheck.some((header) => {\n return (firstResponse.headers.has(header) && secondResponse.headers.has(header));\n });\n if (!atLeastOneHeaderAvailable) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`Unable to determine where the response has been updated ` +\n `because none of the headers that would be checked are present.`);\n logger.debug(`Attempting to compare the following: `, firstResponse, secondResponse, headersToCheck);\n }\n // Just return true, indicating the that responses are the same, since we\n // can't determine otherwise.\n return true;\n }\n return headersToCheck.every((header) => {\n const headerStateComparison = firstResponse.headers.has(header) === secondResponse.headers.has(header);\n const headerValueComparison = firstResponse.headers.get(header) === secondResponse.headers.get(header);\n return headerStateComparison && headerValueComparison;\n });\n};\nexport { responsesAreSame };\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 CACHE_UPDATED_MESSAGE_TYPE = 'CACHE_UPDATED';\nexport const CACHE_UPDATED_MESSAGE_META = 'workbox-broadcast-update';\nexport const NOTIFY_ALL_CLIENTS = true;\nexport const DEFAULT_HEADERS_TO_CHECK = [\n 'content-length',\n 'etag',\n 'last-modified',\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 { timeout } from 'workbox-core/_private/timeout.js';\nimport { resultingClientExists } from 'workbox-core/_private/resultingClientExists.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { responsesAreSame } from './responsesAreSame.js';\nimport { CACHE_UPDATED_MESSAGE_META, CACHE_UPDATED_MESSAGE_TYPE, DEFAULT_HEADERS_TO_CHECK, NOTIFY_ALL_CLIENTS, } from './utils/constants.js';\nimport './_version.js';\n// UA-sniff Safari: https://stackoverflow.com/questions/7944460/detect-safari-browser\n// TODO(philipwalton): remove once this Safari bug fix has been released.\n// https://bugs.webkit.org/show_bug.cgi?id=201169\nconst isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n/**\n * Generates the default payload used in update messages. By default the\n * payload includes the `cacheName` and `updatedURL` fields.\n *\n * @return Object\n * @private\n */\nfunction defaultPayloadGenerator(data) {\n return {\n cacheName: data.cacheName,\n updatedURL: data.request.url,\n };\n}\n/**\n * Uses the `postMessage()` API to inform any open windows/tabs when a cached\n * response has been updated.\n *\n * For efficiency's sake, the underlying response bodies are not compared;\n * only specific response headers are checked.\n *\n * @memberof workbox-broadcast-update\n */\nclass BroadcastCacheUpdate {\n /**\n * Construct a BroadcastCacheUpdate instance with a specific `channelName` to\n * broadcast messages on\n *\n * @param {Object} [options]\n * @param {Array} [options.headersToCheck=['content-length', 'etag', 'last-modified']]\n * A list of headers that will be used to determine whether the responses\n * differ.\n * @param {string} [options.generatePayload] A function whose return value\n * will be used as the `payload` field in any cache update messages sent\n * to the window clients.\n * @param {boolean} [options.notifyAllClients=true] If true (the default) then\n * all open clients will receive a message. If false, then only the client\n * that make the original request will be notified of the update.\n */\n constructor({ generatePayload, headersToCheck, notifyAllClients, } = {}) {\n this._headersToCheck = headersToCheck || DEFAULT_HEADERS_TO_CHECK;\n this._generatePayload = generatePayload || defaultPayloadGenerator;\n this._notifyAllClients = notifyAllClients !== null && notifyAllClients !== void 0 ? notifyAllClients : NOTIFY_ALL_CLIENTS;\n }\n /**\n * Compares two [Responses](https://developer.mozilla.org/en-US/docs/Web/API/Response)\n * and sends a message (via `postMessage()`) to all window clients if the\n * responses differ. Neither of the Responses can be\n * [opaque](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses).\n *\n * The message that's posted has the following format (where `payload` can\n * be customized via the `generatePayload` option the instance is created\n * with):\n *\n * ```\n * {\n * type: 'CACHE_UPDATED',\n * meta: 'workbox-broadcast-update',\n * payload: {\n * cacheName: 'the-cache-name',\n * updatedURL: 'https://example.com/'\n * }\n * }\n * ```\n *\n * @param {Object} options\n * @param {Response} [options.oldResponse] Cached response to compare.\n * @param {Response} options.newResponse Possibly updated response to compare.\n * @param {Request} options.request The request.\n * @param {string} options.cacheName Name of the cache the responses belong\n * to. This is included in the broadcast message.\n * @param {Event} options.event event The event that triggered\n * this possible cache update.\n * @return {Promise} Resolves once the update is sent.\n */\n async notifyIfUpdated(options) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(options.cacheName, 'string', {\n moduleName: 'workbox-broadcast-update',\n className: 'BroadcastCacheUpdate',\n funcName: 'notifyIfUpdated',\n paramName: 'cacheName',\n });\n assert.isInstance(options.newResponse, Response, {\n moduleName: 'workbox-broadcast-update',\n className: 'BroadcastCacheUpdate',\n funcName: 'notifyIfUpdated',\n paramName: 'newResponse',\n });\n assert.isInstance(options.request, Request, {\n moduleName: 'workbox-broadcast-update',\n className: 'BroadcastCacheUpdate',\n funcName: 'notifyIfUpdated',\n paramName: 'request',\n });\n }\n // Without two responses there is nothing to compare.\n if (!options.oldResponse) {\n return;\n }\n if (!responsesAreSame(options.oldResponse, options.newResponse, this._headersToCheck)) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Newer response found (and cached) for:`, options.request.url);\n }\n const messageData = {\n type: CACHE_UPDATED_MESSAGE_TYPE,\n meta: CACHE_UPDATED_MESSAGE_META,\n payload: this._generatePayload(options),\n };\n // For navigation requests, wait until the new window client exists\n // before sending the message\n if (options.request.mode === 'navigate') {\n let resultingClientId;\n if (options.event instanceof FetchEvent) {\n resultingClientId = options.event.resultingClientId;\n }\n const resultingWin = await resultingClientExists(resultingClientId);\n // Safari does not currently implement postMessage buffering and\n // there's no good way to feature detect that, so to increase the\n // chances of the message being delivered in Safari, we add a timeout.\n // We also do this if `resultingClientExists()` didn't return a client,\n // which means it timed out, so it's worth waiting a bit longer.\n if (!resultingWin || isSafari) {\n // 3500 is chosen because (according to CrUX data) 80% of mobile\n // websites hit the DOMContentLoaded event in less than 3.5 seconds.\n // And presumably sites implementing service worker are on the\n // higher end of the performance spectrum.\n await timeout(3500);\n }\n }\n if (this._notifyAllClients) {\n const windows = await self.clients.matchAll({ type: 'window' });\n for (const win of windows) {\n win.postMessage(messageData);\n }\n }\n else {\n // See https://github.com/GoogleChrome/workbox/issues/2895\n if (options.event instanceof FetchEvent) {\n const client = await self.clients.get(options.event.clientId);\n client === null || client === void 0 ? void 0 : client.postMessage(messageData);\n }\n }\n }\n }\n}\nexport { BroadcastCacheUpdate };\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 { dontWaitFor } from 'workbox-core/_private/dontWaitFor.js';\nimport { BroadcastCacheUpdate, } from './BroadcastCacheUpdate.js';\nimport './_version.js';\n/**\n * This plugin will automatically broadcast a message whenever a cached response\n * is updated.\n *\n * @memberof workbox-broadcast-update\n */\nclass BroadcastUpdatePlugin {\n /**\n * Construct a {@link workbox-broadcast-update.BroadcastUpdate} instance with\n * the passed options and calls its `notifyIfUpdated` method whenever the\n * plugin's `cacheDidUpdate` callback is invoked.\n *\n * @param {Object} [options]\n * @param {Array} [options.headersToCheck=['content-length', 'etag', 'last-modified']]\n * A list of headers that will be used to determine whether the responses\n * differ.\n * @param {string} [options.generatePayload] A function whose return value\n * will be used as the `payload` field in any cache update messages sent\n * to the window clients.\n */\n constructor(options) {\n /**\n * A \"lifecycle\" callback that will be triggered automatically by the\n * `workbox-sw` and `workbox-runtime-caching` handlers when an entry is\n * added to a cache.\n *\n * @private\n * @param {Object} options The input object to this function.\n * @param {string} options.cacheName Name of the cache being updated.\n * @param {Response} [options.oldResponse] The previous cached value, if any.\n * @param {Response} options.newResponse The new value in the cache.\n * @param {Request} options.request The request that triggered the update.\n * @param {Request} options.event The event that triggered the update.\n */\n this.cacheDidUpdate = async (options) => {\n dontWaitFor(this._broadcastUpdate.notifyIfUpdated(options));\n };\n this._broadcastUpdate = new BroadcastCacheUpdate(options);\n }\n}\nexport { BroadcastUpdatePlugin };\n"],"names":["self","_","e","responsesAreSame","firstResponse","secondResponse","headersToCheck","some","header","headers","has","every","headerStateComparison","headerValueComparison","get","DEFAULT_HEADERS_TO_CHECK","isSafari","test","navigator","userAgent","defaultPayloadGenerator","data","cacheName","updatedURL","request","url","BroadcastCacheUpdate","constructor","generatePayload","notifyAllClients","this","_headersToCheck","_generatePayload","_notifyAllClients","async","options","oldResponse","newResponse","messageData","type","meta","payload","mode","resultingClientId","event","FetchEvent","resultingClientExists","timeout","windows","clients","matchAll","win","postMessage","client","clientId","cacheDidUpdate","dontWaitFor","_broadcastUpdate","notifyIfUpdated"],"mappings":"0FAEA,IACIA,KAAK,mCAAqCC,GAC9C,CACA,MAAOC,GAAK,CCgBZ,MAAMC,EAAmBA,CAACC,EAAeC,EAAgBC,KAMnBA,EAAeC,MAAMC,GAC3CJ,EAAcK,QAAQC,IAAIF,IAAWH,EAAeI,QAAQC,IAAIF,MAYrEF,EAAeK,OAAOH,IACzB,MAAMI,EAAwBR,EAAcK,QAAQC,IAAIF,KAAYH,EAAeI,QAAQC,IAAIF,GACzFK,EAAwBT,EAAcK,QAAQK,IAAIN,KAAYH,EAAeI,QAAQK,IAAIN,GAC/F,OAAOI,GAAyBC,CAAqB,IChChDE,EAA2B,CACpC,iBACA,OACA,iBCGEC,EAAW,iCAAiCC,KAAKC,UAAUC,WAQjE,SAASC,EAAwBC,GAC7B,MAAO,CACHC,UAAWD,EAAKC,UAChBC,WAAYF,EAAKG,QAAQC,IAEjC,CAUA,MAAMC,EAgBFC,aAAYC,gBAAEA,EAAetB,eAAEA,EAAcuB,iBAAEA,GAAsB,IACjEC,KAAKC,GAAkBzB,GAAkBS,EACzCe,KAAKE,GAAmBJ,GAAmBR,EAC3CU,KAAKG,GAAoBJ,SAA2DA,CACxF,CAgCAK,sBAAsBC,GAsBlB,GAAKA,EAAQC,cAGRjC,EAAiBgC,EAAQC,YAAaD,EAAQE,YAAaP,KAAKC,IAAkB,CAInF,MAAMO,EAAc,CAChBC,KDlH0B,gBCmH1BC,KDlH0B,2BCmH1BC,QAASX,KAAKE,GAAiBG,IAInC,GAA6B,aAAzBA,EAAQX,QAAQkB,KAAqB,CACrC,IAAIC,EACAR,EAAQS,iBAAiBC,aACzBF,EAAoBR,EAAQS,MAAMD,yBAEXG,EAAAA,sBAAsBH,KAM5B3B,SAKX+B,EAAAA,QAAQ,KAEtB,CACA,GAAIjB,KAAKG,GAAmB,CACxB,MAAMe,QAAgBhD,KAAKiD,QAAQC,SAAS,CAAEX,KAAM,WACpD,IAAK,MAAMY,KAAOH,EACdG,EAAIC,YAAYd,EAExB,MAGI,GAAIH,EAAQS,iBAAiBC,WAAY,CACrC,MAAMQ,QAAerD,KAAKiD,QAAQnC,IAAIqB,EAAQS,MAAMU,UACpDD,SAAgDA,EAAOD,YAAYd,EACvE,CAER,CACJ,0DCjJJ,MAcIX,YAAYQ,GAcRL,KAAKyB,eAAiBrB,UAClBsB,EAAAA,YAAY1B,KAAK2B,GAAiBC,gBAAgBvB,GAAS,EAE/DL,KAAK2B,GAAmB,IAAI/B,EAAqBS,EACrD"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-broadcast-update/index.d.ts b/tools/ui/node_modules/workbox-broadcast-update/index.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..7589de0fe37b903363ca67e0e6f0b4760b3c6fd9 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/index.d.ts @@ -0,0 +1,8 @@ +import { BroadcastCacheUpdate, BroadcastCacheUpdateOptions } from './BroadcastCacheUpdate.js'; +import { BroadcastUpdatePlugin } from './BroadcastUpdatePlugin.js'; +import { responsesAreSame } from './responsesAreSame.js'; +import './_version.js'; +/** + * @module workbox-broadcast-update + */ +export { BroadcastCacheUpdate, BroadcastCacheUpdateOptions, BroadcastUpdatePlugin, responsesAreSame, }; diff --git a/tools/ui/node_modules/workbox-broadcast-update/index.js b/tools/ui/node_modules/workbox-broadcast-update/index.js new file mode 100644 index 0000000000000000000000000000000000000000..28b271fcfa879db2a735d5d17a52e5ec5a274b74 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/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 { BroadcastCacheUpdate, } from './BroadcastCacheUpdate.js'; +import { BroadcastUpdatePlugin } from './BroadcastUpdatePlugin.js'; +import { responsesAreSame } from './responsesAreSame.js'; +import './_version.js'; +/** + * @module workbox-broadcast-update + */ +export { BroadcastCacheUpdate, BroadcastUpdatePlugin, responsesAreSame, }; diff --git a/tools/ui/node_modules/workbox-broadcast-update/index.mjs b/tools/ui/node_modules/workbox-broadcast-update/index.mjs new file mode 100644 index 0000000000000000000000000000000000000000..833b6a2f3226fec78490a3b7a622dc5146f94b53 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/index.mjs @@ -0,0 +1 @@ +export * from './index.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-broadcast-update/package.json b/tools/ui/node_modules/workbox-broadcast-update/package.json new file mode 100644 index 0000000000000000000000000000000000000000..d32182a5771ef2edbc3a1567da8aca68534c9e70 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/package.json @@ -0,0 +1,31 @@ +{ + "name": "workbox-broadcast-update", + "version": "7.4.1", + "license": "MIT", + "author": "Google's Web DevRel Team and Google's Aurora Team", + "description": "A service worker helper library that uses the Broadcast Channel API to announce when a cached response has updated", + "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.broadcastUpdate", + "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-broadcast-update/responsesAreSame.d.ts b/tools/ui/node_modules/workbox-broadcast-update/responsesAreSame.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..d6d10aff40826458cd15b48fe5d5fab13b7872d9 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/responsesAreSame.d.ts @@ -0,0 +1,14 @@ +import './_version.js'; +/** + * Given two `Response's`, compares several header values to see if they are + * the same or not. + * + * @param {Response} firstResponse + * @param {Response} secondResponse + * @param {Array} headersToCheck + * @return {boolean} + * + * @memberof workbox-broadcast-update + */ +declare const responsesAreSame: (firstResponse: Response, secondResponse: Response, headersToCheck: string[]) => boolean; +export { responsesAreSame }; diff --git a/tools/ui/node_modules/workbox-broadcast-update/responsesAreSame.js b/tools/ui/node_modules/workbox-broadcast-update/responsesAreSame.js new file mode 100644 index 0000000000000000000000000000000000000000..708ea920f2a33c4a981b3dc2632724d459153445 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/responsesAreSame.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 { logger } from 'workbox-core/_private/logger.js'; +import './_version.js'; +/** + * Given two `Response's`, compares several header values to see if they are + * the same or not. + * + * @param {Response} firstResponse + * @param {Response} secondResponse + * @param {Array} headersToCheck + * @return {boolean} + * + * @memberof workbox-broadcast-update + */ +const responsesAreSame = (firstResponse, secondResponse, headersToCheck) => { + if (process.env.NODE_ENV !== 'production') { + if (!(firstResponse instanceof Response && secondResponse instanceof Response)) { + throw new WorkboxError('invalid-responses-are-same-args'); + } + } + const atLeastOneHeaderAvailable = headersToCheck.some((header) => { + return (firstResponse.headers.has(header) && secondResponse.headers.has(header)); + }); + if (!atLeastOneHeaderAvailable) { + if (process.env.NODE_ENV !== 'production') { + logger.warn(`Unable to determine where the response has been updated ` + + `because none of the headers that would be checked are present.`); + logger.debug(`Attempting to compare the following: `, firstResponse, secondResponse, headersToCheck); + } + // Just return true, indicating the that responses are the same, since we + // can't determine otherwise. + return true; + } + return headersToCheck.every((header) => { + const headerStateComparison = firstResponse.headers.has(header) === secondResponse.headers.has(header); + const headerValueComparison = firstResponse.headers.get(header) === secondResponse.headers.get(header); + return headerStateComparison && headerValueComparison; + }); +}; +export { responsesAreSame }; diff --git a/tools/ui/node_modules/workbox-broadcast-update/responsesAreSame.mjs b/tools/ui/node_modules/workbox-broadcast-update/responsesAreSame.mjs new file mode 100644 index 0000000000000000000000000000000000000000..02cb5347fd644090b948ca6021df9eb378ef9a76 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/responsesAreSame.mjs @@ -0,0 +1 @@ +export * from './responsesAreSame.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-broadcast-update/src/BroadcastCacheUpdate.ts b/tools/ui/node_modules/workbox-broadcast-update/src/BroadcastCacheUpdate.ts new file mode 100644 index 0000000000000000000000000000000000000000..8f708d4b73f68191906546e786cdbf707233fe86 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/src/BroadcastCacheUpdate.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 {assert} from 'workbox-core/_private/assert.js'; +import {timeout} from 'workbox-core/_private/timeout.js'; +import {resultingClientExists} from 'workbox-core/_private/resultingClientExists.js'; +import {CacheDidUpdateCallbackParam} from 'workbox-core/types.js'; +import {logger} from 'workbox-core/_private/logger.js'; +import {responsesAreSame} from './responsesAreSame.js'; +import { + CACHE_UPDATED_MESSAGE_META, + CACHE_UPDATED_MESSAGE_TYPE, + DEFAULT_HEADERS_TO_CHECK, + NOTIFY_ALL_CLIENTS, +} from './utils/constants.js'; + +import './_version.js'; + +// UA-sniff Safari: https://stackoverflow.com/questions/7944460/detect-safari-browser +// TODO(philipwalton): remove once this Safari bug fix has been released. +// https://bugs.webkit.org/show_bug.cgi?id=201169 +const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); + +// Give TypeScript the correct global. +declare let self: ServiceWorkerGlobalScope; + +export interface BroadcastCacheUpdateOptions { + headersToCheck?: string[]; + generatePayload?: ( + options: CacheDidUpdateCallbackParam, + ) => Record; + notifyAllClients?: boolean; +} + +/** + * Generates the default payload used in update messages. By default the + * payload includes the `cacheName` and `updatedURL` fields. + * + * @return Object + * @private + */ +function defaultPayloadGenerator( + data: CacheDidUpdateCallbackParam, +): Record { + return { + cacheName: data.cacheName, + updatedURL: data.request.url, + }; +} + +/** + * Uses the `postMessage()` API to inform any open windows/tabs when a cached + * response has been updated. + * + * For efficiency's sake, the underlying response bodies are not compared; + * only specific response headers are checked. + * + * @memberof workbox-broadcast-update + */ +class BroadcastCacheUpdate { + private readonly _headersToCheck: string[]; + private readonly _generatePayload: ( + options: CacheDidUpdateCallbackParam, + ) => Record; + private readonly _notifyAllClients: boolean; + + /** + * Construct a BroadcastCacheUpdate instance with a specific `channelName` to + * broadcast messages on + * + * @param {Object} [options] + * @param {Array} [options.headersToCheck=['content-length', 'etag', 'last-modified']] + * A list of headers that will be used to determine whether the responses + * differ. + * @param {string} [options.generatePayload] A function whose return value + * will be used as the `payload` field in any cache update messages sent + * to the window clients. + * @param {boolean} [options.notifyAllClients=true] If true (the default) then + * all open clients will receive a message. If false, then only the client + * that make the original request will be notified of the update. + */ + constructor({ + generatePayload, + headersToCheck, + notifyAllClients, + }: BroadcastCacheUpdateOptions = {}) { + this._headersToCheck = headersToCheck || DEFAULT_HEADERS_TO_CHECK; + this._generatePayload = generatePayload || defaultPayloadGenerator; + this._notifyAllClients = notifyAllClients ?? NOTIFY_ALL_CLIENTS; + } + + /** + * Compares two [Responses](https://developer.mozilla.org/en-US/docs/Web/API/Response) + * and sends a message (via `postMessage()`) to all window clients if the + * responses differ. Neither of the Responses can be + * [opaque](https://developer.chrome.com/docs/workbox/caching-resources-during-runtime/#opaque-responses). + * + * The message that's posted has the following format (where `payload` can + * be customized via the `generatePayload` option the instance is created + * with): + * + * ``` + * { + * type: 'CACHE_UPDATED', + * meta: 'workbox-broadcast-update', + * payload: { + * cacheName: 'the-cache-name', + * updatedURL: 'https://example.com/' + * } + * } + * ``` + * + * @param {Object} options + * @param {Response} [options.oldResponse] Cached response to compare. + * @param {Response} options.newResponse Possibly updated response to compare. + * @param {Request} options.request The request. + * @param {string} options.cacheName Name of the cache the responses belong + * to. This is included in the broadcast message. + * @param {Event} options.event event The event that triggered + * this possible cache update. + * @return {Promise} Resolves once the update is sent. + */ + async notifyIfUpdated(options: CacheDidUpdateCallbackParam): Promise { + if (process.env.NODE_ENV !== 'production') { + assert!.isType(options.cacheName, 'string', { + moduleName: 'workbox-broadcast-update', + className: 'BroadcastCacheUpdate', + funcName: 'notifyIfUpdated', + paramName: 'cacheName', + }); + assert!.isInstance(options.newResponse, Response, { + moduleName: 'workbox-broadcast-update', + className: 'BroadcastCacheUpdate', + funcName: 'notifyIfUpdated', + paramName: 'newResponse', + }); + assert!.isInstance(options.request, Request, { + moduleName: 'workbox-broadcast-update', + className: 'BroadcastCacheUpdate', + funcName: 'notifyIfUpdated', + paramName: 'request', + }); + } + + // Without two responses there is nothing to compare. + if (!options.oldResponse) { + return; + } + + if ( + !responsesAreSame( + options.oldResponse, + options.newResponse, + this._headersToCheck, + ) + ) { + if (process.env.NODE_ENV !== 'production') { + logger.log( + `Newer response found (and cached) for:`, + options.request.url, + ); + } + + const messageData = { + type: CACHE_UPDATED_MESSAGE_TYPE, + meta: CACHE_UPDATED_MESSAGE_META, + payload: this._generatePayload(options), + }; + + // For navigation requests, wait until the new window client exists + // before sending the message + if (options.request.mode === 'navigate') { + let resultingClientId: string | undefined; + if (options.event instanceof FetchEvent) { + resultingClientId = options.event.resultingClientId; + } + + const resultingWin = await resultingClientExists(resultingClientId); + + // Safari does not currently implement postMessage buffering and + // there's no good way to feature detect that, so to increase the + // chances of the message being delivered in Safari, we add a timeout. + // We also do this if `resultingClientExists()` didn't return a client, + // which means it timed out, so it's worth waiting a bit longer. + if (!resultingWin || isSafari) { + // 3500 is chosen because (according to CrUX data) 80% of mobile + // websites hit the DOMContentLoaded event in less than 3.5 seconds. + // And presumably sites implementing service worker are on the + // higher end of the performance spectrum. + await timeout(3500); + } + } + + if (this._notifyAllClients) { + const windows = await self.clients.matchAll({type: 'window'}); + for (const win of windows) { + win.postMessage(messageData); + } + } else { + // See https://github.com/GoogleChrome/workbox/issues/2895 + if (options.event instanceof FetchEvent) { + const client = await self.clients.get(options.event.clientId); + client?.postMessage(messageData); + } + } + } + } +} + +export {BroadcastCacheUpdate}; diff --git a/tools/ui/node_modules/workbox-broadcast-update/src/BroadcastUpdatePlugin.ts b/tools/ui/node_modules/workbox-broadcast-update/src/BroadcastUpdatePlugin.ts new file mode 100644 index 0000000000000000000000000000000000000000..886bf2ed16949c993625719c9eebcff6e71a50f7 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/src/BroadcastUpdatePlugin.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 {dontWaitFor} from 'workbox-core/_private/dontWaitFor.js'; +import {WorkboxPlugin} from 'workbox-core/types.js'; + +import { + BroadcastCacheUpdate, + BroadcastCacheUpdateOptions, +} from './BroadcastCacheUpdate.js'; + +import './_version.js'; + +/** + * This plugin will automatically broadcast a message whenever a cached response + * is updated. + * + * @memberof workbox-broadcast-update + */ +class BroadcastUpdatePlugin implements WorkboxPlugin { + private readonly _broadcastUpdate: BroadcastCacheUpdate; + + /** + * Construct a {@link workbox-broadcast-update.BroadcastUpdate} instance with + * the passed options and calls its `notifyIfUpdated` method whenever the + * plugin's `cacheDidUpdate` callback is invoked. + * + * @param {Object} [options] + * @param {Array} [options.headersToCheck=['content-length', 'etag', 'last-modified']] + * A list of headers that will be used to determine whether the responses + * differ. + * @param {string} [options.generatePayload] A function whose return value + * will be used as the `payload` field in any cache update messages sent + * to the window clients. + */ + constructor(options?: BroadcastCacheUpdateOptions) { + this._broadcastUpdate = new BroadcastCacheUpdate(options); + } + + /** + * A "lifecycle" callback that will be triggered automatically by the + * `workbox-sw` and `workbox-runtime-caching` handlers when an entry is + * added to a cache. + * + * @private + * @param {Object} options The input object to this function. + * @param {string} options.cacheName Name of the cache being updated. + * @param {Response} [options.oldResponse] The previous cached value, if any. + * @param {Response} options.newResponse The new value in the cache. + * @param {Request} options.request The request that triggered the update. + * @param {Request} options.event The event that triggered the update. + */ + cacheDidUpdate: WorkboxPlugin['cacheDidUpdate'] = async (options) => { + dontWaitFor(this._broadcastUpdate.notifyIfUpdated(options)); + }; +} + +export {BroadcastUpdatePlugin}; diff --git a/tools/ui/node_modules/workbox-broadcast-update/src/_version.ts b/tools/ui/node_modules/workbox-broadcast-update/src/_version.ts new file mode 100644 index 0000000000000000000000000000000000000000..c019524599c3326f7431e8904edcb2322d0ce055 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/src/_version.ts @@ -0,0 +1,2 @@ +// @ts-ignore +try{self['workbox:broadcast-update:7.4.1']&&_()}catch(e){} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-broadcast-update/src/index.ts b/tools/ui/node_modules/workbox-broadcast-update/src/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..88f0969563703b96f6e5788ce24319e8b2991288 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/src/index.ts @@ -0,0 +1,27 @@ +/* + 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 { + BroadcastCacheUpdate, + BroadcastCacheUpdateOptions, +} from './BroadcastCacheUpdate.js'; +import {BroadcastUpdatePlugin} from './BroadcastUpdatePlugin.js'; +import {responsesAreSame} from './responsesAreSame.js'; + +import './_version.js'; + +/** + * @module workbox-broadcast-update + */ + +export { + BroadcastCacheUpdate, + BroadcastCacheUpdateOptions, + BroadcastUpdatePlugin, + responsesAreSame, +}; diff --git a/tools/ui/node_modules/workbox-broadcast-update/src/responsesAreSame.ts b/tools/ui/node_modules/workbox-broadcast-update/src/responsesAreSame.ts new file mode 100644 index 0000000000000000000000000000000000000000..a2e6dd4a1d845a769a09f11b05dc7ddec08308a7 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/src/responsesAreSame.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 {WorkboxError} from 'workbox-core/_private/WorkboxError.js'; +import {logger} from 'workbox-core/_private/logger.js'; +import './_version.js'; + +/** + * Given two `Response's`, compares several header values to see if they are + * the same or not. + * + * @param {Response} firstResponse + * @param {Response} secondResponse + * @param {Array} headersToCheck + * @return {boolean} + * + * @memberof workbox-broadcast-update + */ +const responsesAreSame = ( + firstResponse: Response, + secondResponse: Response, + headersToCheck: string[], +): boolean => { + if (process.env.NODE_ENV !== 'production') { + if ( + !(firstResponse instanceof Response && secondResponse instanceof Response) + ) { + throw new WorkboxError('invalid-responses-are-same-args'); + } + } + + const atLeastOneHeaderAvailable = headersToCheck.some((header) => { + return ( + firstResponse.headers.has(header) && secondResponse.headers.has(header) + ); + }); + + if (!atLeastOneHeaderAvailable) { + if (process.env.NODE_ENV !== 'production') { + logger.warn( + `Unable to determine where the response has been updated ` + + `because none of the headers that would be checked are present.`, + ); + logger.debug( + `Attempting to compare the following: `, + firstResponse, + secondResponse, + headersToCheck, + ); + } + + // Just return true, indicating the that responses are the same, since we + // can't determine otherwise. + return true; + } + + return headersToCheck.every((header) => { + const headerStateComparison = + firstResponse.headers.has(header) === secondResponse.headers.has(header); + const headerValueComparison = + firstResponse.headers.get(header) === secondResponse.headers.get(header); + + return headerStateComparison && headerValueComparison; + }); +}; + +export {responsesAreSame}; diff --git a/tools/ui/node_modules/workbox-broadcast-update/src/utils/constants.ts b/tools/ui/node_modules/workbox-broadcast-update/src/utils/constants.ts new file mode 100644 index 0000000000000000000000000000000000000000..fb05156675c5e3a11c50a93c0884ebb2d6bc6fac --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/src/utils/constants.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'; + +export const CACHE_UPDATED_MESSAGE_TYPE = 'CACHE_UPDATED'; +export const CACHE_UPDATED_MESSAGE_META = 'workbox-broadcast-update'; +export const NOTIFY_ALL_CLIENTS = true; +export const DEFAULT_HEADERS_TO_CHECK: string[] = [ + 'content-length', + 'etag', + 'last-modified', +]; diff --git a/tools/ui/node_modules/workbox-broadcast-update/tsconfig.json b/tools/ui/node_modules/workbox-broadcast-update/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..3bb2772b586c4d0ceee3d014e64dba7aafbdd570 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/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-broadcast-update/tsconfig.tsbuildinfo b/tools/ui/node_modules/workbox-broadcast-update/tsconfig.tsbuildinfo new file mode 100644 index 0000000000000000000000000000000000000000..456e633f5dbaf1ea81ffef3272b397d8602062fb --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/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/timeout.d.ts","../workbox-core/_private/resultingclientexists.d.ts","../workbox-core/_private/logger.d.ts","../workbox-core/_private/workboxerror.d.ts","./src/_version.ts","./src/responsesaresame.ts","./src/utils/constants.ts","./src/broadcastcacheupdate.ts","../workbox-core/_private/dontwaitfor.d.ts","./src/broadcastupdateplugin.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","f69dd422840e809218633c76acb5eed2a6aa81914299f9b8d74101148526e27e","1b5906124bb3a63826d30d4ca5547143b0d6308e9db51ce453bd759ba88df530",{"version":"d763b9ef68a16f3896187af5b51b5a959b479218cc65c2930bcb440cbbf10728","affectsGlobalScope":true},"0b066351c69855f76970a460fe20a500d20f369a02d2069aa49e1195cd04c3c5",{"version":"56732d635e8ebc3abf4168c3c9894380a9ef16ef8d9f3c0e9cecd9ea0a427278","signature":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","affectsGlobalScope":true},{"version":"29c4816f84d95542f7e5927328c6f63e459e51ebf2e3e43c1d48196e20fb9b0e","signature":"46cf5dafafde199251af03894df1326d4132338d5ed8787398acc1ffbc8060f0"},{"version":"dd7963835ab07991d0da9271a09fe1418bc94afedc44d6bf33d3202e51aadd35","signature":"cb2636e4ead2ccfba2f0adf6d0b5b84b5690c65676445bd1e4549242c8c37829"},{"version":"bd4f9c421a16a9e828ed68716b9839f0e8c97310e5d21cf3278bb98343dcd438","signature":"46b907ed13bd5023adeb5446ad96e9680b1a40d4e4288344d0d0e31d9034d20a"},"365f3bd8994af50572b562a002e0fa2e72e74f54ed996e2444ea3df562678f50",{"version":"db0ca07c95df22c9004fbaad372b3dea21b761c5ed6fd14a99eb0f7b3e6c3866","signature":"5c1b58d0f72081d9cb7b56ae2658c7f61f9bc10c68b241bc067314dd4400bf5b"},{"version":"9ca83759a1dd18fb00739cfc3d4bc303c5de4b7d09ba2850ce9bb833a222d4d0","signature":"989ea68a123a6573bdd68264912093d6697646ceeecb7d82252deb463b32abc5"},"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":[[75,117],[57,75,117],[57,58,59,60,61,75,117],[57,59,75,117],[66,68,75,117],[65,66,67,75,117],[75,117,130,166],[75,117,129,166,168],[75,117,191],[75,117,176],[75,117,180,181,182],[75,117,179],[75,117,181],[75,117,171,177,178,183,186,188,189,190],[75,117,178,184,185,191],[75,117,184,187],[75,117,178,179,184,191],[75,117,178,191],[75,117,172,173,174,175],[75,114,117],[75,116,117],[75,117,122,151],[75,117,118,123,129,130,137,148,159],[75,117,118,119,129,137],[70,71,72,75,117],[75,117,120,160],[75,117,121,122,130,138],[75,117,122,148,156],[75,117,123,125,129,137],[75,116,117,124],[75,117,125,126],[75,117,129],[75,117,127,129],[75,116,117,129],[75,117,129,130,131,148,159],[75,117,129,130,131,144,148,151],[75,112,117,164],[75,117,125,129,132,137,148,159],[75,117,129,130,132,133,137,148,156,159],[75,117,132,134,148,156,159],[75,117,129,135],[75,117,136,159,164],[75,117,125,129,137,148],[75,117,138],[75,117,139],[75,116,117,140],[75,114,115,116,117,118,119,120,121,122,123,124,125,126,127,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],[75,117,142],[75,117,143],[75,117,129,144,145],[75,117,144,146,160,162],[75,117,129,148,149,151],[75,117,150,151],[75,117,148,149],[75,117,151],[75,117,152],[75,114,117,148],[75,117,129,154,155],[75,117,154,155],[75,117,122,137,148,156],[75,117,157],[117],[73,74,75,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,163,164,165],[75,117,137,158],[75,117,132,143,159],[75,117,122,160],[75,117,148,161],[75,117,136,162],[75,117,163],[75,117,122,129,131,140,148,159,162,164],[75,117,148,165],[75,117,197,236],[75,117,197,221,236],[75,117,236],[75,117,197],[75,117,197,222,236],[75,117,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,233,234,235],[75,117,222,236],[75,117,240],[75,117,166,243,244,245,246,247,248,249,250,251,252,253],[75,117,242,243,252],[75,117,243,252],[75,117,237,242,243,252],[75,117,242,243,244,245,246,247,248,249,250,251,253],[75,117,243],[75,117,122,242,252],[75,84,88,117,159],[75,84,117,148,159],[75,79,117],[75,81,84,117,156,159],[75,117,137,156],[75,117,166],[75,79,117,166],[75,81,84,117,137,159],[75,76,77,80,83,117,129,148,159],[75,84,91,117],[75,76,82,117],[75,84,105,106,117],[75,80,84,117,151,159,166],[75,105,117,166],[75,78,79,117,166],[75,84,117],[75,78,79,80,81,82,83,84,85,86,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,107,108,109,110,111,117],[75,84,99,117],[75,84,91,92,117],[75,82,84,92,93,117],[75,83,117],[75,76,79,84,117],[75,84,88,92,93,117],[75,88,117],[75,82,84,87,117,159],[75,76,81,84,91,117],[75,117,148],[75,79,84,105,117,164,166],[44,45,46,47,48,51,52,75,117],[44,53,54,75,117],[51,53,55,75,117],[48,49,75,117],[44,75,117],[44],[44,53],[51,53,55]],"referencedMap":[[42,1],[59,2],[57,1],[62,3],[58,2],[63,1],[60,4],[61,2],[64,1],[69,5],[65,1],[68,6],[66,1],[167,7],[169,8],[170,1],[67,1],[171,1],[192,9],[177,10],[183,11],[181,1],[180,12],[182,13],[191,14],[186,15],[188,16],[189,17],[190,18],[184,1],[185,18],[187,18],[179,18],[178,1],[173,1],[172,1],[175,10],[176,19],[174,10],[168,1],[193,1],[114,20],[115,20],[116,21],[117,22],[118,23],[119,24],[70,1],[73,25],[71,1],[72,1],[120,26],[121,27],[122,28],[123,29],[124,30],[125,31],[126,31],[128,32],[127,33],[129,34],[130,35],[131,36],[113,37],[132,38],[133,39],[134,40],[135,41],[136,42],[137,43],[138,44],[139,45],[140,46],[141,47],[142,48],[143,49],[144,50],[145,50],[146,51],[147,1],[148,52],[150,53],[149,54],[151,55],[152,56],[153,57],[154,58],[155,59],[156,60],[157,61],[75,62],[74,1],[166,63],[158,64],[159,65],[160,66],[161,67],[162,68],[163,69],[164,70],[165,71],[194,1],[195,1],[196,1],[221,72],[222,73],[197,74],[200,74],[219,72],[220,72],[210,72],[209,75],[207,72],[202,72],[215,72],[213,72],[217,72],[201,72],[214,72],[218,72],[203,72],[204,72],[216,72],[198,72],[205,72],[206,72],[208,72],[212,72],[223,76],[211,72],[199,72],[236,77],[235,1],[230,76],[232,78],[231,76],[224,76],[225,76],[227,76],[229,76],[233,78],[234,78],[226,78],[228,78],[237,1],[238,1],[239,1],[241,79],[240,1],[254,80],[253,81],[244,82],[245,83],[252,84],[246,83],[247,82],[248,82],[249,82],[250,85],[243,86],[251,81],[242,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],[91,87],[101,88],[90,87],[111,89],[82,90],[81,91],[110,92],[104,93],[109,94],[84,95],[98,96],[83,97],[107,98],[79,99],[78,92],[108,100],[80,101],[85,102],[86,1],[89,102],[76,1],[112,103],[102,104],[93,105],[94,106],[96,107],[92,108],[95,109],[105,92],[87,110],[88,111],[97,112],[77,113],[100,104],[99,102],[103,1],[106,114],[50,1],[53,115],[55,116],[56,117],[51,118],[52,1],[45,119],[54,1],[48,1],[47,1],[46,1],[49,119],[43,1],[44,1]],"exportedModulesMap":[[42,1],[59,2],[57,1],[62,3],[58,2],[63,1],[60,4],[61,2],[64,1],[69,5],[65,1],[68,6],[66,1],[167,7],[169,8],[170,1],[67,1],[171,1],[192,9],[177,10],[183,11],[181,1],[180,12],[182,13],[191,14],[186,15],[188,16],[189,17],[190,18],[184,1],[185,18],[187,18],[179,18],[178,1],[173,1],[172,1],[175,10],[176,19],[174,10],[168,1],[193,1],[114,20],[115,20],[116,21],[117,22],[118,23],[119,24],[70,1],[73,25],[71,1],[72,1],[120,26],[121,27],[122,28],[123,29],[124,30],[125,31],[126,31],[128,32],[127,33],[129,34],[130,35],[131,36],[113,37],[132,38],[133,39],[134,40],[135,41],[136,42],[137,43],[138,44],[139,45],[140,46],[141,47],[142,48],[143,49],[144,50],[145,50],[146,51],[147,1],[148,52],[150,53],[149,54],[151,55],[152,56],[153,57],[154,58],[155,59],[156,60],[157,61],[75,62],[74,1],[166,63],[158,64],[159,65],[160,66],[161,67],[162,68],[163,69],[164,70],[165,71],[194,1],[195,1],[196,1],[221,72],[222,73],[197,74],[200,74],[219,72],[220,72],[210,72],[209,75],[207,72],[202,72],[215,72],[213,72],[217,72],[201,72],[214,72],[218,72],[203,72],[204,72],[216,72],[198,72],[205,72],[206,72],[208,72],[212,72],[223,76],[211,72],[199,72],[236,77],[235,1],[230,76],[232,78],[231,76],[224,76],[225,76],[227,76],[229,76],[233,78],[234,78],[226,78],[228,78],[237,1],[238,1],[239,1],[241,79],[240,1],[254,80],[253,81],[244,82],[245,83],[252,84],[246,83],[247,82],[248,82],[249,82],[250,85],[243,86],[251,81],[242,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],[91,87],[101,88],[90,87],[111,89],[82,90],[81,91],[110,92],[104,93],[109,94],[84,95],[98,96],[83,97],[107,98],[79,99],[78,92],[108,100],[80,101],[85,102],[86,1],[89,102],[76,1],[112,103],[102,104],[93,105],[94,106],[96,107],[92,108],[95,109],[105,92],[87,110],[88,111],[97,112],[77,113],[100,104],[99,102],[103,1],[106,114],[53,120],[55,121],[56,122],[45,119],[54,1],[48,1],[47,1],[46,1],[49,119],[43,1],[44,1]],"semanticDiagnosticsPerFile":[42,59,57,62,58,63,60,61,64,69,65,68,66,167,169,170,67,171,192,177,183,181,180,182,191,186,188,189,190,184,185,187,179,178,173,172,175,176,174,168,193,114,115,116,117,118,119,70,73,71,72,120,121,122,123,124,125,126,128,127,129,130,131,113,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,150,149,151,152,153,154,155,156,157,75,74,166,158,159,160,161,162,163,164,165,194,195,196,221,222,197,200,219,220,210,209,207,202,215,213,217,201,214,218,203,204,216,198,205,206,208,212,223,211,199,236,235,230,232,231,224,225,227,229,233,234,226,228,237,238,239,241,240,254,253,244,245,252,246,247,248,249,250,243,251,242,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,91,101,90,111,82,81,110,104,109,84,98,83,107,79,78,108,80,85,86,89,76,112,102,93,94,96,92,95,105,87,88,97,77,100,99,103,106,50,53,55,56,51,52,45,54,48,47,46,49,43,44],"latestChangedDtsFile":"./index.d.ts"},"version":"4.9.5"} \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-broadcast-update/utils/constants.d.ts b/tools/ui/node_modules/workbox-broadcast-update/utils/constants.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..f3cdefdf5beb63e659336a453e022d33c12d493c --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/utils/constants.d.ts @@ -0,0 +1,5 @@ +import '../_version.js'; +export declare const CACHE_UPDATED_MESSAGE_TYPE = "CACHE_UPDATED"; +export declare const CACHE_UPDATED_MESSAGE_META = "workbox-broadcast-update"; +export declare const NOTIFY_ALL_CLIENTS = true; +export declare const DEFAULT_HEADERS_TO_CHECK: string[]; diff --git a/tools/ui/node_modules/workbox-broadcast-update/utils/constants.js b/tools/ui/node_modules/workbox-broadcast-update/utils/constants.js new file mode 100644 index 0000000000000000000000000000000000000000..bad6da02d9efb5b57a80b3a69cc67ab5fb0b1259 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/utils/constants.js @@ -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'; +export const CACHE_UPDATED_MESSAGE_TYPE = 'CACHE_UPDATED'; +export const CACHE_UPDATED_MESSAGE_META = 'workbox-broadcast-update'; +export const NOTIFY_ALL_CLIENTS = true; +export const DEFAULT_HEADERS_TO_CHECK = [ + 'content-length', + 'etag', + 'last-modified', +]; diff --git a/tools/ui/node_modules/workbox-broadcast-update/utils/constants.mjs b/tools/ui/node_modules/workbox-broadcast-update/utils/constants.mjs new file mode 100644 index 0000000000000000000000000000000000000000..f3f4c8f2658cad983ad14478588d456cb83091d0 --- /dev/null +++ b/tools/ui/node_modules/workbox-broadcast-update/utils/constants.mjs @@ -0,0 +1 @@ +export * from './constants.js'; \ No newline at end of file diff --git a/tools/ui/node_modules/workbox-build/.ncurc.js b/tools/ui/node_modules/workbox-build/.ncurc.js new file mode 100644 index 0000000000000000000000000000000000000000..4c0afaf979de33dd8a5295fdee1764b7cb9f4f7a --- /dev/null +++ b/tools/ui/node_modules/workbox-build/.ncurc.js @@ -0,0 +1,19 @@ +/* + 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. +*/ + +// We use `npx npm-check-updates` to find updates to dependencies. +// Some dependencies have breaking changes that we can't resolve. +// This config file excludes those dependencies from the checks +// until we're able to remediate our code to deal with them. +module.exports = { + reject: [ + // joi v16 is the last release to support Node v10: + // https://github.com/sideway/joi/issues/2262 + '@hapi/joi', + ], +}; diff --git a/tools/ui/node_modules/workbox-build/LICENSE b/tools/ui/node_modules/workbox-build/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..845b545fd0f5031a944cda8cf9018eb066500040 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/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-build/README.md b/tools/ui/node_modules/workbox-build/README.md new file mode 100644 index 0000000000000000000000000000000000000000..01fb53f19ff6c720815c57b8c52f0fc0ac7bf3df --- /dev/null +++ b/tools/ui/node_modules/workbox-build/README.md @@ -0,0 +1 @@ +This module's documentation can be found at https://developer.chrome.com/docs/workbox/modules/workbox-build diff --git a/tools/ui/node_modules/workbox-build/build/cdn-details.json b/tools/ui/node_modules/workbox-build/build/cdn-details.json new file mode 100644 index 0000000000000000000000000000000000000000..a08cb94e7acc44e12d320310ea7d404dba28e8c2 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/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/build/generate-sw.d.ts b/tools/ui/node_modules/workbox-build/build/generate-sw.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..66b6fa8b60439483877056f88bf84e864b060871 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/generate-sw.d.ts @@ -0,0 +1,47 @@ +import { BuildResult, GenerateSWOptions } from './types'; +/** + * 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 declare function generateSW(config: GenerateSWOptions): Promise; diff --git a/tools/ui/node_modules/workbox-build/build/generate-sw.js b/tools/ui/node_modules/workbox-build/build/generate-sw.js new file mode 100644 index 0000000000000000000000000000000000000000..87c5248f06950b512808433cc2f913c13a151ec8 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/generate-sw.js @@ -0,0 +1,105 @@ +"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.generateSW = void 0; +const upath_1 = __importDefault(require("upath")); +const get_file_manifest_entries_1 = require("./lib/get-file-manifest-entries"); +const rebase_path_1 = require("./lib/rebase-path"); +const validate_options_1 = require("./lib/validate-options"); +const write_sw_using_default_template_1 = require("./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 + */ +async function generateSW(config) { + const options = (0, validate_options_1.validateGenerateSWOptions)(config); + let entriesResult; + if (options.globDirectory) { + // Make sure we leave swDest out of the precache manifest. + options.globIgnores.push((0, rebase_path_1.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_1.default.dirname(options.swDest); + const workboxRuntimeFile = upath_1.default.join(swDestDir, 'workbox-*.js'); + options.globIgnores.push((0, rebase_path_1.rebasePath)({ + baseDirectory: options.globDirectory, + file: workboxRuntimeFile, + })); + } + // We've previously asserted that options.globDirectory is set, so this + // should be a safe cast. + entriesResult = await (0, get_file_manifest_entries_1.getFileManifestEntries)(options); + } + else { + entriesResult = { + count: 0, + manifestEntries: [], + size: 0, + warnings: [], + }; + } + const filePaths = await (0, write_sw_using_default_template_1.writeSWUsingDefaultTemplate)(Object.assign({ + manifestEntries: entriesResult.manifestEntries, + }, options)); + return { + filePaths, + count: entriesResult.count, + size: entriesResult.size, + warnings: entriesResult.warnings, + }; +} +exports.generateSW = generateSW; diff --git a/tools/ui/node_modules/workbox-build/build/get-manifest.d.ts b/tools/ui/node_modules/workbox-build/build/get-manifest.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..95c61adf226bbd2a30d0d1110d523d56c362ea38 --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/get-manifest.d.ts @@ -0,0 +1,20 @@ +import { GetManifestOptions, GetManifestResult } from './types'; +/** + * 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 declare function getManifest(config: GetManifestOptions): Promise; diff --git a/tools/ui/node_modules/workbox-build/build/get-manifest.js b/tools/ui/node_modules/workbox-build/build/get-manifest.js new file mode 100644 index 0000000000000000000000000000000000000000..ebf65ceb9715bb40466122081d51da45412c9b1e --- /dev/null +++ b/tools/ui/node_modules/workbox-build/build/get-manifest.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. +*/ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getManifest = void 0; +const get_file_manifest_entries_1 = require("./lib/get-file-manifest-entries"); +const validate_options_1 = require("./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 + */ +async function getManifest(config) { + const options = (0, validate_options_1.validateGetManifestOptions)(config); + return await (0, get_file_manifest_entries_1.getFileManifestEntries)(options); +} +exports.getManifest = getManifest;