docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped

This commit is contained in:
TanTan committed 2026-11-13 09:27:07 +08:00
1 parent fa9c73363d
commit 2a69b23b47
18210 files changed
+5101211 -16

No files matched your search

@@ -0,0 +1,59 @@
'use strict';
module.exports = function (data, opts) {
if (!opts) opts = {};
if (typeof opts === 'function') opts = { cmp: opts };
var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;
var cmp = opts.cmp && (function (f) {
return function (node) {
return function (a, b) {
var aobj = { key: a, value: node[a] };
var bobj = { key: b, value: node[b] };
return f(aobj, bobj);
};
};
})(opts.cmp);
var seen = [];
return (function stringify (node) {
if (node && node.toJSON && typeof node.toJSON === 'function') {
node = node.toJSON();
}
if (node === undefined) return;
if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';
if (typeof node !== 'object') return JSON.stringify(node);
var i, out;
if (Array.isArray(node)) {
out = '[';
for (i = 0; i < node.length; i++) {
if (i) out += ',';
out += stringify(node[i]) || 'null';
}
return out + ']';
}
if (node === null) return 'null';
if (seen.indexOf(node) !== -1) {
if (cycles) return JSON.stringify('__cycle__');
throw new TypeError('Converting circular structure to JSON');
}
var seenIndex = seen.push(node) - 1;
var keys = Object.keys(node).sort(cmp && cmp(node));
out = '';
for (i = 0; i < keys.length; i++) {
var key = keys[i];
var value = stringify(node[key]);
if (!value) continue;
if (out) out += ',';
out += JSON.stringify(key) + ':' + value;
}
seen.splice(seenIndex, 1);
return '{' + out + '}';
})(data);
};
@@ -0,0 +1 @@
{"version":3,"file":"use-follow-value.mjs","sources":["../../../src/value/use-follow-value.ts"],"sourcesContent":["\"use client\"\n\nimport {\n AnyResolvedKeyframe,\n attachFollow,\n FollowValueOptions,\n isMotionValue,\n MotionValue,\n} from \"motion-dom\"\nimport { useContext, useInsertionEffect } from \"react\"\nimport { MotionConfigContext } from \"../context/MotionConfigContext\"\nimport { useMotionValue } from \"./use-motion-value\"\nimport { useTransform } from \"./use-transform\"\n\n/**\n * Creates a `MotionValue` that, when `set`, will use the specified animation transition to animate to its new state.\n *\n * Unlike `useSpring` which is limited to spring animations, `useFollowValue` accepts any motion transition\n * including spring, tween, inertia, and keyframes.\n *\n * It can either work as a stand-alone `MotionValue` by initialising it with a value, or as a subscriber\n * to another `MotionValue`.\n *\n * @remarks\n *\n * ```jsx\n * // Spring animation (default)\n * const x = useFollowValue(0, { stiffness: 300 })\n *\n * // Tween animation\n * const y = useFollowValue(0, { type: \"tween\", duration: 0.5, ease: \"easeOut\" })\n *\n * // Track another MotionValue with spring\n * const source = useMotionValue(0)\n * const z = useFollowValue(source, { type: \"spring\", damping: 10 })\n *\n * // Inertia animation\n * const w = useFollowValue(0, { type: \"inertia\", velocity: 100 })\n * ```\n *\n * @param inputValue - `MotionValue` or number. If provided a `MotionValue`, when the input `MotionValue` changes, the created `MotionValue` will animate towards that value using the specified transition.\n * @param options - Animation transition options. Supports all transition types: spring, tween, inertia, keyframes.\n * @returns `MotionValue`\n *\n * @public\n */\nexport function useFollowValue(\n source: MotionValue<string>,\n options?: FollowValueOptions\n): MotionValue<string>\nexport function useFollowValue(\n source: string,\n options?: FollowValueOptions\n): MotionValue<string>\nexport function useFollowValue(\n source: MotionValue<number>,\n options?: FollowValueOptions\n): MotionValue<number>\nexport function useFollowValue(\n source: number,\n options?: FollowValueOptions\n): MotionValue<number>\nexport function useFollowValue(\n source: MotionValue<string> | MotionValue<number> | AnyResolvedKeyframe,\n options: FollowValueOptions = {}\n) {\n const { isStatic } = useContext(MotionConfigContext)\n const getFromSource = () => (isMotionValue(source) ? source.get() : source)\n\n // isStatic will never change, allowing early hooks return\n if (isStatic) {\n return useTransform(getFromSource)\n }\n\n const value = useMotionValue(getFromSource())\n\n useInsertionEffect(() => {\n return attachFollow(value, source, options)\n }, [value, JSON.stringify(options)])\n\n return value\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAuEQ;;AAGJ;;;AAIA;AAEA;AACJ;;"}
@@ -0,0 +1,311 @@
export default `flf2a$ 3 3 8 0 3
Block Letters By Joan Stark
Website: http://www.geocities.com/SoHo/7373/
Figlet conversion by patorjk, April 17, 2008
$ $@
$ $@
$ $@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
____ @
/ () \\ @
/__/\\__\\@@
_____ @
| () )@
|_()_)@@
____ @
/ (__\`@
\\____)@@
____ @
| _) \\@
|____/@@
____ @
| ===|@
|____|@@
____ @
| ===|@
|__| @@
____ @
/ (_,\`@
\\____)@@
_ _ @
| |_| |@
|_| |_|@@
_ @
| |@
|_|@@
__ @
__) |@
\\___/@@
__ __ @
| |/ /@
|__|\\__\\@@
_ @
| |__ @
|____|@@
__ __ @
| \\/ |@
|_|\\/|_|@@
__ _ @
| \\| |@
|_|\\__|@@
____ @
/ () \\@
\\____/@@
_____ @
| ()_)@
|_| @@
____ @
/ () \\ @
\\____/=@@
_____ @
| () )@
|_|\\_\\@@
____ @
(_ (_\`@
.__)__)@@
_____ @
|_ _|@
|_| @@
__ __ @
| | |@
\\___/ @@
__ __@
\\ \\/ /@
\\__/ @@
__ __@
\\ \\/\\/ /@
\\_/\\_/ @@
__ __@
\\ \\/ /@
/_/\\_\\@@
__ __@
\\ \\/ /@
|__| @@
_____ @
\` / /_@
/___/@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
____ @
/ () \\ @
/__/\\__\\@@
_____ @
| () )@
|_()_)@@
____ @
/ (__\`@
\\____)@@
____ @
| _) \\@
|____/@@
____ @
| ===|@
|____|@@
____ @
| ===|@
|__| @@
____ @
/ (_,\`@
\\____)@@
_ _ @
| |_| |@
|_| |_|@@
_ @
| |@
|_|@@
__ @
__) |@
\\___/@@
__ __ @
| |/ /@
|__|\\__\\@@
_ @
| |__ @
|____|@@
__ __ @
| \\/ |@
|_|\\/|_|@@
__ _ @
| \\| |@
|_|\\__|@@
____ @
/ () \\@
\\____/@@
_____ @
| ()_)@
|_| @@
____ @
/ () \\ @
\\____/=@@
_____ @
| () )@
|_|\\_\\@@
____ @
(_ (_\`@
.__)__)@@
_____ @
|_ _|@
|_| @@
__ __ @
| | |@
\\___/ @@
__ __@
\\ \\/ /@
\\__/ @@
__ __@
\\ \\/\\/ /@
\\_/\\_/ @@
__ __@
\\ \\/ /@
/_/\\_\\@@
__ __@
\\ \\/ /@
|__| @@
_____ @
\` / /_@
/___/@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
@
@
@@
`
@@ -0,0 +1 @@
{"version":3,"file":"upload.js","sources":["../../../src/icons/upload.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Upload\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTV2NGEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMnYtNCIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4IiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMyIgeTI9IjE1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/upload\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Upload = createLucideIcon('Upload', [\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4', key: 'ih7n3h' }],\n ['polyline', { points: '17 8 12 3 7 8', key: 't8dd8p' }],\n ['line', { x1: '12', x2: '12', y1: '3', y2: '15', key: 'widbto' }],\n]);\n\nexport default Upload;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACvD,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,473 @@
declare module "buffer" {
global {
interface BufferConstructor {
// see ../buffer.d.ts for implementation shared with all TypeScript versions
/**
* Allocates a new buffer containing the given {str}.
*
* @param str String to store in buffer.
* @param encoding encoding to use, optional. Default is 'utf8'
* @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
*/
new(str: string, encoding?: BufferEncoding): Buffer;
/**
* Allocates a new buffer of {size} octets.
*
* @param size count of octets to allocate.
* @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
*/
new(size: number): Buffer;
/**
* Allocates a new buffer containing the given {array} of octets.
*
* @param array The octets to store.
* @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
*/
new(array: ArrayLike<number>): Buffer;
/**
* Produces a Buffer backed by the same allocated memory as
* the given {ArrayBuffer}/{SharedArrayBuffer}.
*
* @param arrayBuffer The ArrayBuffer with which to share memory.
* @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
*/
new(arrayBuffer: ArrayBufferLike): Buffer;
/**
* Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
* Array entries outside that range will be truncated to fit into it.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
* const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
* ```
*
* If `array` is an `Array`-like object (that is, one with a `length` property of
* type `number`), it is treated as if it is an array, unless it is a `Buffer` or
* a `Uint8Array`. This means all other `TypedArray` variants get treated as an
* `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use
* `Buffer.copyBytesFrom()`.
*
* A `TypeError` will be thrown if `array` is not an `Array` or another type
* appropriate for `Buffer.from()` variants.
*
* `Buffer.from(array)` and `Buffer.from(string)` may also use the internal
* `Buffer` pool like `Buffer.allocUnsafe()` does.
* @since v5.10.0
*/
from(array: WithImplicitCoercion<ArrayLike<number>>): Buffer;
/**
* This creates a view of the `ArrayBuffer` without copying the underlying
* memory. For example, when passed a reference to the `.buffer` property of a
* `TypedArray` instance, the newly created `Buffer` will share the same
* allocated memory as the `TypedArray`'s underlying `ArrayBuffer`.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const arr = new Uint16Array(2);
*
* arr[0] = 5000;
* arr[1] = 4000;
*
* // Shares memory with `arr`.
* const buf = Buffer.from(arr.buffer);
*
* console.log(buf);
* // Prints: <Buffer 88 13 a0 0f>
*
* // Changing the original Uint16Array changes the Buffer also.
* arr[1] = 6000;
*
* console.log(buf);
* // Prints: <Buffer 88 13 70 17>
* ```
*
* The optional `byteOffset` and `length` arguments specify a memory range within
* the `arrayBuffer` that will be shared by the `Buffer`.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const ab = new ArrayBuffer(10);
* const buf = Buffer.from(ab, 0, 2);
*
* console.log(buf.length);
* // Prints: 2
* ```
*
* A `TypeError` will be thrown if `arrayBuffer` is not an `ArrayBuffer` or a
* `SharedArrayBuffer` or another type appropriate for `Buffer.from()`
* variants.
*
* It is important to remember that a backing `ArrayBuffer` can cover a range
* of memory that extends beyond the bounds of a `TypedArray` view. A new
* `Buffer` created using the `buffer` property of a `TypedArray` may extend
* beyond the range of the `TypedArray`:
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const arrA = Uint8Array.from([0x63, 0x64, 0x65, 0x66]); // 4 elements
* const arrB = new Uint8Array(arrA.buffer, 1, 2); // 2 elements
* console.log(arrA.buffer === arrB.buffer); // true
*
* const buf = Buffer.from(arrB.buffer);
* console.log(buf);
* // Prints: <Buffer 63 64 65 66>
* ```
* @since v5.10.0
* @param arrayBuffer An `ArrayBuffer`, `SharedArrayBuffer`, for example the
* `.buffer` property of a `TypedArray`.
* @param byteOffset Index of first byte to expose. **Default:** `0`.
* @param length Number of bytes to expose. **Default:**
* `arrayBuffer.byteLength - byteOffset`.
*/
from(
arrayBuffer: WithImplicitCoercion<ArrayBufferLike>,
byteOffset?: number,
length?: number,
): Buffer;
/**
* Creates a new `Buffer` containing `string`. The `encoding` parameter identifies
* the character encoding to be used when converting `string` into bytes.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf1 = Buffer.from('this is a tést');
* const buf2 = Buffer.from('7468697320697320612074c3a97374', 'hex');
*
* console.log(buf1.toString());
* // Prints: this is a tést
* console.log(buf2.toString());
* // Prints: this is a tést
* console.log(buf1.toString('latin1'));
* // Prints: this is a tést
* ```
*
* A `TypeError` will be thrown if `string` is not a string or another type
* appropriate for `Buffer.from()` variants.
*
* `Buffer.from(string)` may also use the internal `Buffer` pool like
* `Buffer.allocUnsafe()` does.
* @since v5.10.0
* @param string A string to encode.
* @param encoding The encoding of `string`. **Default:** `'utf8'`.
*/
from(string: WithImplicitCoercion<string>, encoding?: BufferEncoding): Buffer;
from(arrayOrString: WithImplicitCoercion<ArrayLike<number> | string>): Buffer;
/**
* Creates a new Buffer using the passed {data}
* @param values to create a new Buffer
*/
of(...items: number[]): Buffer;
/**
* Returns a new `Buffer` which is the result of concatenating all the `Buffer` instances in the `list` together.
*
* If the list has no items, or if the `totalLength` is 0, then a new zero-length `Buffer` is returned.
*
* If `totalLength` is not provided, it is calculated from the `Buffer` instances
* in `list` by adding their lengths.
*
* If `totalLength` is provided, it is coerced to an unsigned integer. If the
* combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
* truncated to `totalLength`.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* // Create a single `Buffer` from a list of three `Buffer` instances.
*
* const buf1 = Buffer.alloc(10);
* const buf2 = Buffer.alloc(14);
* const buf3 = Buffer.alloc(18);
* const totalLength = buf1.length + buf2.length + buf3.length;
*
* console.log(totalLength);
* // Prints: 42
*
* const bufA = Buffer.concat([buf1, buf2, buf3], totalLength);
*
* console.log(bufA);
* // Prints: <Buffer 00 00 00 00 ...>
* console.log(bufA.length);
* // Prints: 42
* ```
*
* `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
* @since v0.7.11
* @param list List of `Buffer` or {@link Uint8Array} instances to concatenate.
* @param totalLength Total length of the `Buffer` instances in `list` when concatenated.
*/
concat(list: readonly Uint8Array[], totalLength?: number): Buffer;
/**
* Copies the underlying memory of `view` into a new `Buffer`.
*
* ```js
* const u16 = new Uint16Array([0, 0xffff]);
* const buf = Buffer.copyBytesFrom(u16, 1, 1);
* u16[1] = 0;
* console.log(buf.length); // 2
* console.log(buf[0]); // 255
* console.log(buf[1]); // 255
* ```
* @since v19.8.0
* @param view The {TypedArray} to copy.
* @param [offset=0] The starting offset within `view`.
* @param [length=view.length - offset] The number of elements from `view` to copy.
*/
copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer;
/**
* Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf = Buffer.alloc(5);
*
* console.log(buf);
* // Prints: <Buffer 00 00 00 00 00>
* ```
*
* If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
*
* If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf = Buffer.alloc(5, 'a');
*
* console.log(buf);
* // Prints: <Buffer 61 61 61 61 61>
* ```
*
* If both `fill` and `encoding` are specified, the allocated `Buffer` will be
* initialized by calling `buf.fill(fill, encoding)`.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
*
* console.log(buf);
* // Prints: <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
* ```
*
* Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance
* contents will never contain sensitive data from previous allocations, including
* data that might not have been allocated for `Buffer`s.
*
* A `TypeError` will be thrown if `size` is not a number.
* @since v5.10.0
* @param size The desired length of the new `Buffer`.
* @param [fill=0] A value to pre-fill the new `Buffer` with.
* @param [encoding='utf8'] If `fill` is a string, this is its encoding.
*/
alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer;
/**
* Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
*
* The underlying memory for `Buffer` instances created in this way is _not_
* _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf = Buffer.allocUnsafe(10);
*
* console.log(buf);
* // Prints (contents may vary): <Buffer a0 8b 28 3f 01 00 00 00 50 32>
*
* buf.fill(0);
*
* console.log(buf);
* // Prints: <Buffer 00 00 00 00 00 00 00 00 00 00>
* ```
*
* A `TypeError` will be thrown if `size` is not a number.
*
* The `Buffer` module pre-allocates an internal `Buffer` instance of
* size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`,
* and `Buffer.concat()` only when `size` is less than `Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two).
*
* Use of this pre-allocated internal memory pool is a key difference between
* calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
* Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less
* than or equal to half `Buffer.poolSize`. The
* difference is subtle but can be important when an application requires the
* additional performance that `Buffer.allocUnsafe()` provides.
* @since v5.10.0
* @param size The desired length of the new `Buffer`.
*/
allocUnsafe(size: number): Buffer;
/**
* Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if
* `size` is 0.
*
* The underlying memory for `Buffer` instances created in this way is _not_
* _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize
* such `Buffer` instances with zeroes.
*
* When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
* allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This
* allows applications to avoid the garbage collection overhead of creating many
* individually allocated `Buffer` instances. This approach improves both
* performance and memory usage by eliminating the need to track and clean up as
* many individual `ArrayBuffer` objects.
*
* However, in the case where a developer may need to retain a small chunk of
* memory from a pool for an indeterminate amount of time, it may be appropriate
* to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and
* then copying out the relevant bits.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* // Need to keep around a few small chunks of memory.
* const store = [];
*
* socket.on('readable', () => {
* let data;
* while (null !== (data = readable.read())) {
* // Allocate for retained data.
* const sb = Buffer.allocUnsafeSlow(10);
*
* // Copy the data into the new allocation.
* data.copy(sb, 0, 0, 10);
*
* store.push(sb);
* }
* });
* ```
*
* A `TypeError` will be thrown if `size` is not a number.
* @since v5.12.0
* @param size The desired length of the new `Buffer`.
*/
allocUnsafeSlow(size: number): Buffer;
}
interface Buffer extends Uint8Array {
// see ../buffer.d.ts for implementation shared with all TypeScript versions
/**
* Returns a new `Buffer` that references the same memory as the original, but
* offset and cropped by the `start` and `end` indices.
*
* This method is not compatible with the `Uint8Array.prototype.slice()`,
* which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf = Buffer.from('buffer');
*
* const copiedBuf = Uint8Array.prototype.slice.call(buf);
* copiedBuf[0]++;
* console.log(copiedBuf.toString());
* // Prints: cuffer
*
* console.log(buf.toString());
* // Prints: buffer
*
* // With buf.slice(), the original buffer is modified.
* const notReallyCopiedBuf = buf.slice();
* notReallyCopiedBuf[0]++;
* console.log(notReallyCopiedBuf.toString());
* // Prints: cuffer
* console.log(buf.toString());
* // Also prints: cuffer (!)
* ```
* @since v0.3.0
* @deprecated Use `subarray` instead.
* @param [start=0] Where the new `Buffer` will start.
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
*/
slice(start?: number, end?: number): Buffer;
/**
* Returns a new `Buffer` that references the same memory as the original, but
* offset and cropped by the `start` and `end` indices.
*
* Specifying `end` greater than `buf.length` will return the same result as
* that of `end` equal to `buf.length`.
*
* This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray).
*
* Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
* // from the original `Buffer`.
*
* const buf1 = Buffer.allocUnsafe(26);
*
* for (let i = 0; i < 26; i++) {
* // 97 is the decimal ASCII value for 'a'.
* buf1[i] = i + 97;
* }
*
* const buf2 = buf1.subarray(0, 3);
*
* console.log(buf2.toString('ascii', 0, buf2.length));
* // Prints: abc
*
* buf1[0] = 33;
*
* console.log(buf2.toString('ascii', 0, buf2.length));
* // Prints: !bc
* ```
*
* Specifying negative indexes causes the slice to be generated relative to the
* end of `buf` rather than the beginning.
*
* ```js
* import { Buffer } from 'node:buffer';
*
* const buf = Buffer.from('buffer');
*
* console.log(buf.subarray(-6, -1).toString());
* // Prints: buffe
* // (Equivalent to buf.subarray(0, 5).)
*
* console.log(buf.subarray(-6, -2).toString());
* // Prints: buff
* // (Equivalent to buf.subarray(0, 4).)
*
* console.log(buf.subarray(-5, -2).toString());
* // Prints: uff
* // (Equivalent to buf.subarray(1, 4).)
* ```
* @since v3.0.0
* @param [start=0] Where the new `Buffer` will start.
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
*/
subarray(start?: number, end?: number): Buffer;
}
/**
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
* TypeScript versions earlier than 5.7.
*/
type NonSharedBuffer = Buffer;
/**
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
* TypeScript versions earlier than 5.7.
*/
type AllowSharedBuffer = Buffer;
}
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
var SlowBuffer: {
/** @deprecated Use `Buffer.allocUnsafeSlow()` instead. */
new(size: number): Buffer;
prototype: Buffer;
};
/**
* @deprecated This is intended for internal use, and will be removed once `@types/node` no longer supports
* TypeScript versions earlier than 5.7.
*/
type BufferView<T extends NodeJS.ArrayBufferView> = Buffer;
}
@@ -0,0 +1 @@
{"version":3,"file":"dom-exception.d.ts","sourceRoot":"","sources":["../../../web/dom-exception.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,kBAAkB,KA8CtB,CAAC;AAEH,eAAe,kBAAkB,CAAC"}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_w","2":"_f"},D:{"1":"_7D","2":"J"},E:{"1":"_dB","2":"_k","4":"_UQ"},F:{"1":"_vK _KL","2":"_SR"},G:{"1":"_t","2":"_sC","4":"ED"},H:{"2":"1D"},I:{"1":"I _fQ _mN","2":"_HD 2D 5D"},J:{"1":"_B"},K:{"1":"_eN","2":"_A"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"Session history management",D:true};
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
class Hub {
getCode() {}
getScope() {}
addHelper() {
throw new Error("Helpers are not supported by the default hub.");
}
buildError(node, msg, Error = TypeError) {
return new Error(msg);
}
}
exports.default = Hub;
//# sourceMappingURL=hub.js.map
@@ -0,0 +1,15 @@
import { DateInput } from './types';
/**
* Calculates the difference in hours between two dates.
* 计算两个日期之间的小时差
*
* @param date - The first date to compare.
* @param input - The second date to compare.
* @param asFloat - Whether to return the result as a float.
* @returns The difference in hours between the two dates.
* @example
* ```ts
* diffInHours(new Date(2023, 0, 1), new Date(2023, 0, 2)) // 24
* ```
*/
export default function diffInHours(date: Date, input: DateInput, asFloat?: boolean): number;
@@ -0,0 +1,341 @@
flf2a$ 3 3 10 -1 34 0 7999 0
Author : myflix
Date : 2004/2/16 15:18:10
Version: 1.0
-------------------------------------------------
This font is a variation of double designed by Kent Nassen 11/24/94
double.flf (FIGlet font)
figlet conversion by Kent Nassen, kentn@cyberspace.org, 11/24/94
From: stuce@csv.warwick.ac.uk (Peter Weighill)
Newsgroups: alt.ascii-art
Subject: FONT: double (not .flf)
Date: 15 Mar 1994 16:20:01 -0000
Organization: Commodore 64 Services, University of Warwick, UK
Lines: 30
Message-ID: <2m4n7h$2ti@basil.csv.warwick.ac.uk>
NNTP-Posting-Host: basil.csv.warwick.ac.uk
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Keywords: font
Status: RO
-------------------------------------------------
This font has been created using JavE's FIGlet font export assistant.
Have a look at: http://www.jave.de
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $#
$ $#
$ $##
__ #
|| #
.. ##
#
// #
##
__ __ #
=||=||= #
|| || ##
$#
#
##
_ #
O // #
// O ##
&#
#
##
// #
#
##
_ #
(( #
\\ ##
_ #
)) #
// ##
*#
#
##
+#
#
##
#
#
// ##
-#
#
##
#
#
|| ##
/#
#
##
0#
#
##
1#
#
##
2#
#
##
3#
#
##
4#
#
##
5#
#
##
6#
#
##
7#
#
##
8#
#
##
9#
#
##
:#
#
##
;#
#
##
<#
#
##
=#
#
##
>#
#
##
____ #
'_// #
|| ##
@#
#
##
___ #
||=|| #
|| || ##
____ #
||=) #
||_)) ##
____ #
(( #
\\__ ##
_____ #
|| ) #
||_// ##
_____ #
||== #
||___ ##
_____ #
||== #
|| ##
____ #
(( ___ #
\\_|| ##
__ __ #
||==|| #
|| || ##
__ #
|| #
|| ##
__ #
|| #
|__|| ##
__ __ #
||<< #
|| \\ ##
__ #
|| #
||__| ##
___ __ #
|| \/ | #
|| | ##
__ __ #
||\\|| #
|| \|| ##
_____ #
(( )) #
\\_// ##
_____ #
||_// #
|| ##
_____ #
(( )) #
\\_/X| ##
_____ #
||_// #
|| \\ ##
__ #
(( #
\_)) ##
_____ #
|| #
|| ##
__ __ #
|| || #
\\_// ##
__ __ #
\\ // #
\V/ ##
__ __#
\\ /\ //#
\V/\V/ ##
_ _ #
\\// #
//\\ ##
_ _ #
\\// #
// ##
____ #
// #
//__ ##
[#
#
##
\#
#
##
]#
#
##
^#
#
##
_#
#
##
`#
#
##
___ #
||=|| #
|| || ##
____ #
||=) #
||_)) ##
____ #
(( #
\\__ ##
_____ #
|| ) #
||_// ##
_____ #
||== #
||___ ##
_____ #
||== #
|| ##
____ #
(( ___ #
\\_|| ##
__ __ #
||==|| #
|| || ##
__ #
|| #
|| ##
__ #
|| #
|__|| ##
__ __ #
||<< #
|| \\ ##
__ #
|| #
||__| ##
___ __ #
|| \/ | #
|| | ##
__ __ #
||\\|| #
|| \|| ##
_____ #
(( )) #
\\_// ##
_____ #
||_// #
|| ##
_____ #
(( )) #
\\_/X| ##
_____ #
||_// #
|| \\ ##
__ #
(( #
\_)) ##
_____ #
|| #
|| ##
__ __ #
|| || #
\\_// ##
__ __ #
\\ // #
\V/ ##
__ __#
\\ /\ //#
\V/\V/ ##
_ _ #
\\// #
//\\ ##
_ _ #
\\// #
// ##
____ #
// #
//__ ##
{#
#
##
|#
#
##
}#
#
##
~#
#
##
___ #
||=|| #
|| || ##
_____ #
(( )) #
\\_// ##
__ __ #
|| || #
\\_// ##
___ #
||=|| #
|| || ##
_____ #
(( )) #
\\_// ##
__ __ #
|| || #
\\_// ##
#
#
_ ##
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2017_date: LibDefinition;
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Grid2x2Check = createLucideIcon("Grid2x2Check", [
[
"path",
{
d: "M12 3v17a1 1 0 0 1-1 1H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v6a1 1 0 0 1-1 1H3",
key: "11za1p"
}
],
["path", { d: "m16 19 2 2 4-4", key: "1b14m6" }]
]);
export { Grid2x2Check as default };
//# sourceMappingURL=grid-2x2-check.js.map
@@ -0,0 +1 @@
{"version":3,"file":"beer-off.js","sources":["../../../src/icons/beer-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BeerOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTMgMTN2NSIgLz4KICA8cGF0aCBkPSJNMTcgMTEuNDdWOCIgLz4KICA8cGF0aCBkPSJNMTcgMTFoMWEzIDMgMCAwIDEgMi43NDUgNC4yMTEiIC8+CiAgPHBhdGggZD0ibTIgMiAyMCAyMCIgLz4KICA8cGF0aCBkPSJNNSA4djEyYTIgMiAwIDAgMCAyIDJoOGEyIDIgMCAwIDAgMi0ydi0zIiAvPgogIDxwYXRoIGQ9Ik03LjUzNiA3LjUzNUM2Ljc2NiA3LjY0OSA2LjE1NCA4IDUuNSA4YTIuNSAyLjUgMCAwIDEtMS43NjgtNC4yNjgiIC8+CiAgPHBhdGggZD0iTTguNzI3IDMuMjA0QzkuMzA2IDIuNzY3IDkuODg1IDIgMTEgMmMxLjU2IDAgMiAxLjUgMyAxLjVzMS43Mi0uNSAyLjUtLjVhMSAxIDAgMSAxIDAgNWMtLjc4IDAtMS41LS41LTIuNS0uNWEzLjE0OSAzLjE0OSAwIDAgMC0uODQyLjEyIiAvPgogIDxwYXRoIGQ9Ik05IDE0LjZWMTgiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/beer-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst BeerOff = createLucideIcon('BeerOff', [\n ['path', { d: 'M13 13v5', key: 'igwfh0' }],\n ['path', { d: 'M17 11.47V8', key: '16yw0g' }],\n ['path', { d: 'M17 11h1a3 3 0 0 1 2.745 4.211', key: '1xbt65' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n ['path', { d: 'M5 8v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2v-3', key: 'c55o3e' }],\n [\n 'path',\n { d: 'M7.536 7.535C6.766 7.649 6.154 8 5.5 8a2.5 2.5 0 0 1-1.768-4.268', key: '1ydug7' },\n ],\n [\n 'path',\n {\n d: 'M8.727 3.204C9.306 2.767 9.885 2 11 2c1.56 0 2 1.5 3 1.5s1.72-.5 2.5-.5a1 1 0 1 1 0 5c-.78 0-1.5-.5-2.5-.5a3.149 3.149 0 0 0-.842.12',\n key: 'q81o7q',\n },\n ],\n ['path', { d: 'M9 14.6V18', key: '20ek98' }],\n]);\n\nexport default BeerOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzE,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CACzF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAALine truncated
@@ -0,0 +1 @@
{"version":3,"file":"use-visual-element.mjs","sources":["../../../../src/motion/utils/use-visual-element.ts"],"sourcesContent":["\"use client\"\n\nimport {\n optimizedAppearDataAttribute,\n type HTMLRenderState,\n type SVGRenderState,\n type VisualElement,\n} from \"motion-dom\"\nimport * as React from \"react\"\nimport { useContext, useEffect, useInsertionEffect, useRef } from \"react\"\nimport { LazyContext } from \"../../context/LazyContext\"\nimport { MotionConfigContext } from \"../../context/MotionConfigContext\"\nimport { MotionContext } from \"../../context/MotionContext\"\nimport { PresenceContext } from \"../../context/PresenceContext\"\nimport {\n InitialPromotionConfig,\n SwitchLayoutGroupContext,\n} from \"../../context/SwitchLayoutGroupContext\"\nimport { MotionProps } from \"../../motion/types\"\nimport type { IProjectionNode } from \"motion-dom\"\nimport { DOMMotionComponents } from \"../../render/dom/types\"\nimport { CreateVisualElement } from \"../../render/types\"\nimport { isRefObject } from \"../../utils/is-ref-object\"\nimport { useIsomorphicLayoutEffect } from \"../../utils/use-isomorphic-effect\"\nimport { VisualState } from \"./use-visual-state\"\n\nexport function useVisualElement<\n Props,\n TagName extends keyof DOMMotionComponents | string\n>(\n Component: TagName | string | React.ComponentType<Props>,\n visualState:\n | VisualState<SVGElement, SVGRenderState>\n | VisualState<HTMLElement, HTMLRenderState>,\n props: MotionProps & Partial<MotionConfigContext>,\n createVisualElement?: CreateVisualElement<Props, TagName>,\n ProjectionNodeConstructor?: any,\n isSVG?: boolean\n): VisualElement<HTMLElement | SVGElement> | undefined {\n const { visualElement: parent } = useContext(MotionContext)\n const lazyContext = useContext(LazyContext)\n const presenceContext = useContext(PresenceContext)\n const motionConfig = useContext(MotionConfigContext)\n const reducedMotionConfig = motionConfig.reducedMotion\n const skipAnimations = motionConfig.skipAnimations\n\n const visualElementRef = useRef<VisualElement<\n HTMLElement | SVGElement\n > | null>(null)\n\n /**\n * Track whether the component has been through React's commit phase.\n * Used to detect when LazyMotion features load after the component has mounted.\n */\n const hasMountedOnce = useRef(false)\n\n /**\n * If we haven't preloaded a renderer, check to see if we have one lazy-loaded\n */\n createVisualElement =\n createVisualElement ||\n (lazyContext.renderer as CreateVisualElement<Props, TagName>)\n\n if (!visualElementRef.current && createVisualElement) {\n visualElementRef.current = createVisualElement(Component, {\n visualState,\n parent,\n props,\n presenceContext,\n blockInitialAnimation: presenceContext\n ? presenceContext.initial === false\n : false,\n reducedMotionConfig,\n skipAnimations,\n isSVG,\n })\n\n /**\n * If the component has already mounted before features loaded (e.g. via\n * LazyMotion with async feature loading), we need to force the initial\n * animation to run. Otherwise state changes that occurred before features\n * loaded will be lost and the element will snap to its final state.\n */\n if (hasMountedOnce.current && visualElementRef.current) {\n visualElementRef.current.manuallyAnimateOnMount = true\n }\n }\n\n const visualElement = visualElementRef.current\n\n /**\n * Load Motion gesture and animation features. These are rendered as renderless\n * components so each feature can optionally make use of React lifecycle methods.\n */\n const initialLayoutGroupConfig = useContext(SwitchLayoutGroupContext)\n\n if (\n visualElement &&\n !visualElement.projection &&\n ProjectionNodeConstructor &&\n (visualElement.type === \"html\" || visualElement.type === \"svg\")\n ) {\n createProjectionNode(\n visualElementRef.current!,\n props,\n ProjectionNodeConstructor,\n initialLayoutGroupConfig\n )\n }\n\n const isMounted = useRef(false)\n useInsertionEffect(() => {\n /**\n * Check the component has already mounted before calling\n * `update` unnecessarily. This ensures we skip the initial update.\n */\n if (visualElement && isMounted.current) {\n visualElement.update(props, presenceContext)\n }\n })\n\n /**\n * Cache this value as we want to know whether HandoffAppearAnimations\n * was present on initial render - it will be deleted after this.\n */\n const optimisedAppearId =\n props[optimizedAppearDataAttribute as keyof typeof props]\n const wantsHandoff = useRef(\n BLine truncated
@@ -0,0 +1,480 @@
import * as core from "../core/index.cjs";
import type { $ZodBigIntFormats } from "../core/index.cjs";
import * as util from "../core/util.cjs";
type SomeType = core.SomeType;
export interface ZodMiniType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
type: Internals["def"]["type"];
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
with(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
clone(def?: Internals["def"], params?: {
parent: boolean;
}): this;
register<R extends core.$ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [core.$replace<R["_meta"], this>?] : [core.$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
brand<T extends PropertyKey = PropertyKey, Dir extends "in" | "out" | "inout" = "out">(value?: T): PropertyKey extends T ? this : core.$ZodBranded<this, T, Dir>;
def: Internals["def"];
parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): util.SafeParseResult<core.output<this>>;
parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<util.SafeParseResult<core.output<this>>>;
apply<T, TArgs extends unknown[] = []>(fn: (schema: this, ...args: TArgs) => T, ...args: TArgs): T;
}
interface _ZodMiniType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals> extends ZodMiniType<any, any, Internals> {
}
export declare const ZodMiniType: core.$constructor<ZodMiniType>;
export interface _ZodMiniString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>> extends _ZodMiniType<T>, core.$ZodString<T["input"]> {
_zod: T;
}
export interface ZodMiniString<Input = unknown> extends _ZodMiniString<core.$ZodStringInternals<Input>>, core.$ZodString<Input> {
}
export declare const ZodMiniString: core.$constructor<ZodMiniString>;
export declare function string(params?: string | core.$ZodStringParams): ZodMiniString<string>;
export interface ZodMiniStringFormat<Format extends string = string> extends _ZodMiniString<core.$ZodStringFormatInternals<Format>>, core.$ZodStringFormat<Format> {
}
export declare const ZodMiniStringFormat: core.$constructor<ZodMiniStringFormat>;
export interface ZodMiniEmail extends _ZodMiniString<core.$ZodEmailInternals> {
}
export declare const ZodMiniEmail: core.$constructor<ZodMiniEmail>;
export declare function email(params?: string | core.$ZodEmailParams): ZodMiniEmail;
export interface ZodMiniGUID extends _ZodMiniString<core.$ZodGUIDInternals> {
}
export declare const ZodMiniGUID: core.$constructor<ZodMiniGUID>;
export declare function guid(params?: string | core.$ZodGUIDParams): ZodMiniGUID;
export interface ZodMiniUUID extends _ZodMiniString<core.$ZodUUIDInternals> {
}
export declare const ZodMiniUUID: core.$constructor<ZodMiniUUID>;
export declare function uuid(params?: string | core.$ZodUUIDParams): ZodMiniUUID;
export declare function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodMiniUUID;
export declare function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodMiniUUID;
export declare function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodMiniUUID;
export interface ZodMiniURL extends _ZodMiniString<core.$ZodURLInternals> {
}
export declare const ZodMiniURL: core.$constructor<ZodMiniURL>;
export declare function url(params?: string | core.$ZodURLParams): ZodMiniURL;
export declare function httpUrl(params?: string | Omit<core.$ZodURLParams, "protocol" | "hostname">): ZodMiniURL;
export interface ZodMiniEmoji extends _ZodMiniString<core.$ZodEmojiInternals> {
}
export declare const ZodMiniEmoji: core.$constructor<ZodMiniEmoji>;
export declare function emoji(params?: string | core.$ZodEmojiParams): ZodMiniEmoji;
export interface ZodMiniNanoID extends _ZodMiniString<core.$ZodNanoIDInternals> {
}
export declare const ZodMiniNanoID: core.$constructor<ZodMiniNanoID>;
export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodMiniNanoID;
/**
* @deprecated CUID v1 is deprecated by its authors due to information leakage
* (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
* See https://github.com/paralleldrive/cuid.
*/
export interface ZodMiniCUID extends _ZodMiniString<core.$ZodCUIDInternals> {
}
/**
* @deprecated CUID v1 is deprecated by its authors due to information leakage
* (timestamps embedded in the id). Use {@link ZodMiniCUID2} instead.
* See https://github.com/paralleldrive/cuid.
*/
export declare const ZodMiniCUID: core.$constructor<ZodMiniCUID>;
/**
* Validates a CUID v1 string.
*
* @deprecated CUID v1 is deprecated by its authors due to information leakage
* (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.
* See https://github.com/paralleldrive/cuid.
*/
export declare function cuid(params?: string | core.$ZodCUIDParams): ZodMiniCUID;
export interface ZodMiniCUID2 extends _ZodMiniString<core.$ZodCUID2Internals> {
}
export declare const ZodMiniCUID2: core.$constructor<ZodMiniCUID2>;
export declare function cuid2(params?: string | core.$ZodCUID2Params): ZodMiniCUID2;
export interface ZodMiniULID extends _ZodMiniString<core.$ZodULIDInternals> {
}
export declare const ZodMiniULID: core.$constructor<ZodMiniULID>;
export declare function ulid(params?: string | core.$ZodULIDParams): ZodMiniULID;
export interface ZodMiniXID extends _ZodMiniString<core.$ZodXIDInternals> {
}
export declare const ZodMiniXID: core.$constructor<ZodMiniXID>;
export declare function xid(params?: string | core.$ZodXIDParams): ZodMiniXID;
export interface ZodMiniKSUID extends _ZodMiniString<core.$ZodKSUIDInternals> {
}
export declare const ZodMiniKSUID: core.$constructor<ZodMiniKSUID>;
export declare function ksuid(params?: string | core.$ZodKSUIDParams): ZodMiniKSUID;
export interface ZodMiniIPv4 extends _ZodMiniString<core.$ZodIPv4Internals> {
}
export declare const ZodMiniIPv4: core.$constructor<ZodMiniIPv4>;
export declare function ipv4(params?: string | core.$ZodIPv4Params): ZodMiniIPv4;
export interface ZodMiniIPv6 extends _ZodMiniString<core.$ZodIPv6Internals> {
}
export declare const ZodMiniIPv6: core.$constructor<ZodMiniIPv6>;
export declare function ipv6(params?: string | core.$ZodIPv6Params): ZodMiniIPv6;
export interface ZodMiniCIDRv4 extends _ZodMiniString<core.$ZodCIDRv4Internals> {
}
export declare const ZodMiniCIDRv4: core.$constructor<ZodMiniCIDRv4>;
export declare function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodMiniCIDRv4;
export interface ZodMiniCIDRv6 extends _ZodMiniString<core.$ZodCIDRv6Internals> {
}
export declare const ZodMiniCIDRv6: core.$constructor<ZodMiniCIDRv6>;
export declare function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodMiniCIDRv6;
export interface ZodMiniMAC extends _ZodMiniString<core.$ZodMACInternals> {
}
export declare const ZodMiniMAC: core.$constructor<ZodMiniMAC>;
export declare function mac(params?: string | core.$ZodMACParams): ZodMiniMAC;
export interface ZodMiniBase64 extends _ZodMiniString<core.$ZodBase64Internals> {
}
export declare const ZodMiniBase64: core.$constructor<ZodMiniBase64>;
export declare function base64(params?: string | core.$ZodBase64Params): ZodMiniBase64;
export interface ZodMiniBase64URL extends _ZodMiniString<core.$ZodBase64URLInternals> {
}
export declare const ZodMiniBase64URL: core.$constructor<ZodMiniBase64URL>;
export declare function base64url(params?: string | core.$ZodBase64URLParams): ZodMiniBase64URL;
export interface ZodMiniE164 extends _ZodMiniString<core.$ZodE164Internals> {
}
export declare const ZodMiniE164: core.$constructor<ZodMiniE164>;
export declare function e164(params?: string | core.$ZodE164Params): ZodMiniE164;
export interface ZodMiniCreditCard extends _ZodMiniString<core.$ZodCreditCardInternals> {
}
export declare const ZodMiniCreditCard: core.$constructor<ZodMiniCreditCard>;
export declare function creditCard(params?: string | core.$ZodCreditCardParams): ZodMiniCreditCard;
export interface ZodMiniIBAN extends _ZodMiniString<core.$ZodIBANInternals> {
}
export declare const ZodMiniIBAN: core.$constructor<ZodMiniIBAN>;
export declare function iban(params?: string | core.$ZodIBANParams): ZodMiniIBAN;
export interface ZodMiniJWT extends _ZodMiniString<core.$ZodJWTInternals> {
}
export declare const ZodMiniJWT: core.$constructor<ZodMiniJWT>;
export declare function jwt(params?: string | core.$ZodJWTParams): ZodMiniJWT;
export interface ZodMiniCustomStringFormat<Format extends string = string> extends ZodMiniStringFormat<Format>, core.$ZodCustomStringFormat<Format> {
_zod: core.$ZodCustomStringFormatInternals<Format>;
}
export declare const ZodMiniCustomStringFormat: core.$constructor<ZodMiniCustomStringFormat>;
export declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<Format>;
export declare function hostname(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hostname">;
export declare function hex(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"hex">;
export declare function currencyCode(_params?: string | core.$ZodStringFormatParams): ZodMiniCustomStringFormat<"currency_code">;
export declare function hash<Alg extends util.HashAlgorithm, Enc extends util.HashEncoding = "hex">(alg: Alg, params?: {
enc?: Enc;
} & core.$ZodStringFormatParams): ZodMiniCustomStringFormat<`${Alg}_${Enc}`>;
interface _ZodMiniNumber<T extends core.$ZodNumberInternals<unknown> = core.$ZodNumberInternals<unknown>> extends _ZodMiniType<T>, core.$ZodNumber<T["input"]> {
_zod: T;
}
export interface ZodMiniNumber<Input = unknown> extends _ZodMiniNumber<core.$ZodNumberInternals<Input>>, core.$ZodNumber<Input> {
}
export declare const ZodMiniNumber: core.$constructor<ZodMiniNumber>;
export declare function number(params?: string | core.$ZodNumberParams): ZodMiniNumber<number>;
export interface ZodMiniNumberFormat<Format extends core.$ZodNumberFormats = core.$ZodNumberFormats> extends _ZodMiniNumber<core.$ZodNumberFormatInternals<Format>>, core.$ZodNumberFormat<Format> {
}
export declare const ZodMiniNumberFormat: core.$constructor<ZodMiniNumberFormat>;
export interface ZodMiniInt extends ZodMiniNumberFormat<"safeint"> {
}
export declare function int(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniInt;
export interface ZodMiniFloat32 extends ZodMiniNumberFormat<"float32"> {
}
export declare function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniFloat32;
export interface ZodMiniFloat64 extends ZodMiniNumberFormat<"float64"> {
}
export declare function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniFloat64;
export interface ZodMiniInt32 extends ZodMiniNumberFormat<"int32"> {
}
export declare function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniInt32;
export interface ZodMiniUInt32 extends ZodMiniNumberFormat<"uint32"> {
}
export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodMiniUInt32;
export interface ZodMiniBoolean<T = unknown> extends _ZodMiniType<core.$ZodBooleanInternals<T>> {
}
export declare const ZodMiniBoolean: core.$constructor<ZodMiniBoolean>;
export declare function boolean(params?: string | core.$ZodBooleanParams): ZodMiniBoolean<boolean>;
export interface ZodMiniBigInt<T = unknown> extends _ZodMiniType<core.$ZodBigIntInternals<T>>, core.$ZodBigInt<T> {
}
export declare const ZodMiniBigInt: core.$constructor<ZodMiniBigInt>;
export declare function bigint(params?: string | core.$ZodBigIntParams): ZodMiniBigInt<bigint>;
export interface ZodMiniBigIntFormat<Format extends $ZodBigIntFormats = $ZodBigIntFormats> extends _ZodMiniType<core.$ZodBigIntFormatInternals<Format>> {
}
export declare const ZodMiniBigIntFormat: core.$constructor<ZodMiniBigIntFormat>;
export interface ZodMiniInt64 extends ZodMiniBigIntFormat<"int64"> {
}
export declare function int64(params?: string | core.$ZodBigIntFormatParams): ZodMiniInt64;
export interface ZodMiniUInt64 extends ZodMiniBigIntFormat<"uint64"> {
}
export declare function uint64(params?: string | core.$ZodBigIntFormatParams): ZodMiniUInt64;
export interface ZodMiniSymbol extends _ZodMiniType<core.$ZodSymbolInternals> {
}
export declare const ZodMiniSymbol: core.$constructor<ZodMiniSymbol>;
export declare function symbol(params?: string | core.$ZodSymbolParams): ZodMiniSymbol;
export interface ZodMiniUndefined extends _ZodMiniType<core.$ZodUndefinedInternals> {
}
export declare const ZodMiniUndefined: core.$constructor<ZodMiniUndefined>;
declare function _undefined(params?: string | core.$ZodUndefinedParams): ZodMiniUndefined;
export { _undefined as undefined };
export interface ZodMiniNull extends _ZodMiniType<core.$ZodNullInternals> {
}
export declare const ZodMiniNull: core.$constructor<ZodMiniNull>;
declare function _null(params?: string | core.$ZodNullParams): ZodMiniNull;
export { _null as null };
export interface ZodMiniAny extends _ZodMiniType<core.$ZodAnyInternals> {
}
export declare const ZodMiniAny: core.$constructor<ZodMiniAny>;
export declare function any(): ZodMiniAny;
export interface ZodMiniUnknown extends _ZodMiniType<core.$ZodUnknownInternals> {
}
export declare const ZodMiniUnknown: core.$constructor<ZodMiniUnknown>;
export declare function unknown(): ZodMiniUnknown;
export interface ZodMiniNever extends _ZodMiniType<core.$ZodNeverInternals> {
}
export declare const ZodMiniNever: core.$constructor<ZodMiniNever>;
export declare function never(params?: string | core.$ZodNeverParams): ZodMiniNever;
export interface ZodMiniVoid extends _ZodMiniType<core.$ZodVoidInternals> {
}
export declare const ZodMiniVoid: core.$constructor<ZodMiniVoid>;
declare function _void(params?: string | core.$ZodVoidParams): ZodMiniVoid;
export { _void as void };
export interface ZodMiniDate<T = unknown> extends _ZodMiniType<core.$ZodDateInternals<T>> {
}
export declare const ZodMiniDate: core.$constructor<ZodMiniDate>;
export declare function date(params?: string | core.$ZodDateParams): ZodMiniDate<Date>;
export interface ZodMiniArray<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodArrayInternals<T>>, core.$ZodArray<T> {
}
export declare const ZodMiniArray: core.$constructor<ZodMiniArray>;
export declare function array<T extends SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodMiniArray<T>;
export declare function keyof<T extends ZodMiniObject>(schema: T): ZodMiniEnum<util.KeysEnum<T["shape"]>>;
export interface ZodMiniObject<
/** @ts-ignore Cast variance */
out Shape extends core.$ZodShape = core.$ZodShape, out Config extends core.$ZodObjectConfig = core.$strip> extends ZodMiniType<any, any, core.$ZodObjectInternals<Shape, Config>>, core.$ZodObject<Shape, Config> {
shape: Shape;
}
export declare const ZodMiniObject: core.$constructor<ZodMiniObject>;
export declare function object<T extends core.$ZodLooseShape = Record<never, SomeType>>(shape?: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$strip>;
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$strict>;
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodMiniObject<util.Writeable<T>, core.$loose>;
export declare function extend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: U): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]>;
export type SafeExtendShape<Base extends core.$ZodShape, Ext extends core.$ZodLooseShape> = {
[K in keyof Ext]: K extends keyof Base ? core.output<Ext[K]> extends core.output<Base[K]> ? core.input<Ext[K]> extends core.input<Base[K]> ? Ext[K] : never : never : Ext[K];
};
export declare function safeExtend<T extends ZodMiniObject, U extends core.$ZodLooseShape>(schema: T, shape: SafeExtendShape<T["shape"], U>): ZodMiniObject<util.Extend<T["shape"], util.Writeable<U>>, T["_zod"]["config"]>;
/**
* @deprecated Use [`z.extend(A, B.shape)`](https://zod.dev/api?id=extend) instead.
*/
export declare function merge<T extends ZodMiniObject, U extends ZodMiniObject>(a: T, b: U): ZodMiniObject<util.Extend<T["shape"], U["shape"]>, U["_zod"]["config"]>;
export declare function pick<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Flatten<Pick<T["shape"], keyof T["shape"] & keyof M>>, T["_zod"]["config"]>;
export declare function omit<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Flatten<Omit<T["shape"], keyof M>>, T["_zod"]["config"]>;
export declare function partial<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
-readonly [k in keyof T["shape"]]: ZodMiniOptional<T["shape"][k]>;
}, T["_zod"]["config"]>;
export declare function partial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<{
-readonly [k in keyof T["shape"]]: k extends keyof M ? ZodMiniOptional<T["shape"][k]> : T["shape"][k];
}, T["_zod"]["config"]>;
export declare function partial<T extends util.TupleItems, Rest extends SomeType | null>(schema: ZodMiniTuple<T, Rest>): ZodMiniTuple<{
-readonly [k in keyof T]: ZodMiniOptional<T[k]>;
}, Rest>;
export declare function exactPartial<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
-readonly [k in keyof T["shape"]]: ZodMiniExactOptional<T["shape"][k]>;
}, T["_zod"]["config"]>;
export declare function exactPartial<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<{
-readonly [k in keyof T["shape"]]: k extends keyof M ? ZodMiniExactOptional<T["shape"][k]> : T["shape"][k];
}, T["_zod"]["config"]>;
export type RequiredInterfaceShape<Shape extends core.$ZodLooseShape, Keys extends PropertyKey = keyof Shape> = util.Identity<{
[k in keyof Shape as k extends Keys ? k : never]: ZodMiniNonOptional<Shape[k]>;
} & {
[k in keyof Shape as k extends Keys ? never : k]: Shape[k];
}>;
export declare function required<T extends ZodMiniObject>(schema: T): ZodMiniObject<{
-readonly [k in keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
}, T["_zod"]["config"]>;
export declare function required<T extends ZodMiniObject, M extends util.Mask<keyof T["shape"]>>(schema: T, mask: M & Record<Exclude<keyof M, keyof T["shape"]>, never>): ZodMiniObject<util.Extend<T["shape"], {
[k in keyof M & keyof T["shape"]]: ZodMiniNonOptional<T["shape"][k]>;
}>, T["_zod"]["config"]>;
export declare function catchall<T extends ZodMiniObject, U extends SomeType>(inst: T, catchall: U): ZodMiniObject<T["shape"], core.$catchall<U>>;
export interface ZodMiniUnion<T extends readonly SomeType[] = readonly core.$ZodType[]> extends _ZodMiniType<core.$ZodUnionInternals<T>> {
}
export declare const ZodMiniUnion: core.$constructor<ZodMiniUnion>;
export declare function union<const T extends readonly SomeType[]>(options: T, params?: string | core.$ZodUnionParams): ZodMiniUnion<T>;
export interface ZodMiniXor<T extends readonly SomeType[] = readonly core.$ZodType[]> extends _ZodMiniType<core.$ZodXorInternals<T>> {
}
export declare const ZodMiniXor: core.$constructor<ZodMiniXor>;
/** Creates an exclusive union (XOR) where exactly one option must match.
* Unlike regular unions that succeed when any option matches, xor fails if
* zero or more than one option matches the input. */
export declare function xor<const T extends readonly SomeType[]>(options: T, params?: string | core.$ZodXorParams): ZodMiniXor<T>;
export interface ZodMiniDiscriminatedUnion<Options extends readonly SomeType[] = readonly core.$ZodType[], Disc extends string = string> extends ZodMiniUnion<Options> {
_zod: core.$ZodDiscriminatedUnionInternals<Options, Disc>;
}
export declare const ZodMiniDiscriminatedUnion: core.$constructor<ZodMiniDiscriminatedUnion>;
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]], Disc extends string>(discriminator: Disc, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodMiniDiscriminatedUnion<Types, Disc>;
export interface ZodMiniIntersection<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodIntersectionInternals<A, B>> {
}
export declare const ZodMiniIntersection: core.$constructor<ZodMiniIntersection>;
export declare function intersection<T extends SomeType, U extends SomeType>(left: T, right: U): ZodMiniIntersection<T, U>;
export interface ZodMiniTuple<T extends util.TupleItems = readonly core.$ZodType[], Rest extends SomeType | null = core.$ZodType | null> extends _ZodMiniType<core.$ZodTupleInternals<T, Rest>> {
}
export declare const ZodMiniTuple: core.$constructor<ZodMiniTuple>;
export declare function tuple<const T extends readonly [SomeType, ...SomeType[]]>(items: T, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, null>;
export declare function tuple<const T extends readonly [SomeType, ...SomeType[]], Rest extends SomeType>(items: T, rest: Rest, params?: string | core.$ZodTupleParams): ZodMiniTuple<T, Rest>;
export declare function tuple(items: [], params?: string | core.$ZodTupleParams): ZodMiniTuple<[], null>;
export interface ZodMiniRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodRecordInternals<Key, Value>> {
}
export declare const ZodMiniRecord: core.$constructor<ZodMiniRecord>;
export declare function record<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key, Value>;
export declare function partialRecord<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key & core.$partial, Value>;
export declare function looseRecord<Key extends core.$ZodRecordKey, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodMiniRecord<Key, Value>;
export interface ZodMiniMap<Key extends SomeType = core.$ZodType, Value extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodMapInternals<Key, Value>> {
}
export declare const ZodMiniMap: core.$constructor<ZodMiniMap>;
export declare function map<Key extends SomeType, Value extends SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodMapParams): ZodMiniMap<Key, Value>;
export interface ZodMiniSet<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodSetInternals<T>> {
}
export declare const ZodMiniSet: core.$constructor<ZodMiniSet>;
export declare function set<Value extends SomeType>(valueType: Value, params?: string | core.$ZodSetParams): ZodMiniSet<Value>;
export interface ZodMiniEnum<T extends util.EnumLike = util.EnumLike> extends _ZodMiniType<core.$ZodEnumInternals<T>> {
options: Array<T[keyof T]>;
}
export declare const ZodMiniEnum: core.$constructor<ZodMiniEnum>;
declare function _enum<const T extends readonly string[]>(values: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<util.ToEnum<T[number]>>;
declare function _enum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<T>;
export { _enum as enum };
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
*
* ```ts
* enum Colors { red, green, blue }
* z.enum(Colors);
* ```
*/
export declare function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodMiniEnum<T>;
export interface ZodMiniLiteral<T extends util.Literal = util.Literal> extends _ZodMiniType<core.$ZodLiteralInternals<T>> {
}
export declare const ZodMiniLiteral: core.$constructor<ZodMiniLiteral>;
export declare function literal<const T extends ReadonlyArray<util.Literal>>(value: T, params?: string | core.$ZodLiteralParams): ZodMiniLiteral<T[number]>;
export declare function literal<const T extends util.Literal>(value: T, params?: string | core.$ZodLiteralParams): ZodMiniLiteral<T>;
export interface ZodMiniFile extends _ZodMiniType<core.$ZodFileInternals> {
}
export declare const ZodMiniFile: core.$constructor<ZodMiniFile>;
export declare function file(params?: string | core.$ZodFileParams): ZodMiniFile;
export interface ZodMiniTransform<O = unknown, I = unknown> extends _ZodMiniType<core.$ZodTransformInternals<O, I>> {
}
export declare const ZodMiniTransform: core.$constructor<ZodMiniTransform>;
export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): ZodMiniTransform<Awaited<O>, I>;
export interface ZodMiniOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodOptionalInternals<T>>, core.$ZodOptional<T> {
}
export declare const ZodMiniOptional: core.$constructor<ZodMiniOptional>;
export declare function optional<T extends SomeType>(innerType: T): ZodMiniOptional<T>;
export interface ZodMiniExactOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodExactOptionalInternals<T>>, core.$ZodExactOptional<T> {
}
export declare const ZodMiniExactOptional: core.$constructor<ZodMiniExactOptional>;
export declare function exactOptional<T extends SomeType>(innerType: T): ZodMiniExactOptional<T>;
export interface ZodMiniNullable<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodNullableInternals<T>> {
}
export declare const ZodMiniNullable: core.$constructor<ZodMiniNullable>;
export declare function nullable<T extends SomeType>(innerType: T): ZodMiniNullable<T>;
export declare function nullish<T extends SomeType>(innerType: T): ZodMiniOptional<ZodMiniNullable<T>>;
export interface ZodMiniDefault<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodDefaultInternals<T>> {
}
export declare const ZodMiniDefault: core.$constructor<ZodMiniDefault>;
export declare function _default<T extends SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)): ZodMiniDefault<T>;
export interface ZodMiniPrefault<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPrefaultInternals<T>> {
}
export declare const ZodMiniPrefault: core.$constructor<ZodMiniPrefault>;
export declare function prefault<T extends SomeType>(innerType: T, defaultValue: core.input<T> | (() => core.input<T>)): ZodMiniPrefault<T>;
export interface ZodMiniNonOptional<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodNonOptionalInternals<T>> {
}
export declare const ZodMiniNonOptional: core.$constructor<ZodMiniNonOptional>;
export declare function nonoptional<T extends SomeType>(innerType: T, params?: string | core.$ZodNonOptionalParams): ZodMiniNonOptional<T>;
export interface ZodMiniSuccess<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodSuccessInternals<T>> {
}
export declare const ZodMiniSuccess: core.$constructor<ZodMiniSuccess>;
export declare function success<T extends SomeType>(innerType: T): ZodMiniSuccess<T>;
export interface ZodMiniCatch<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodCatchInternals<T>> {
}
export declare const ZodMiniCatch: core.$constructor<ZodMiniCatch>;
declare function _catch<T extends SomeType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)): ZodMiniCatch<T>;
export { _catch as catch };
export interface ZodMiniNaN extends _ZodMiniType<core.$ZodNaNInternals> {
}
export declare const ZodMiniNaN: core.$constructor<ZodMiniNaN>;
export declare function nan(params?: string | core.$ZodNaNParams): ZodMiniNaN;
export interface ZodMiniPipe<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPipeInternals<A, B>> {
}
export declare const ZodMiniPipe: core.$constructor<ZodMiniPipe>;
export declare function pipe<const A extends SomeType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodMiniPipe<A, B>;
export interface ZodMiniCodec<A extends SomeType = core.$ZodType, B extends SomeType = core.$ZodType> extends ZodMiniPipe<A, B>, core.$ZodCodec<A, B> {
_zod: core.$ZodCodecInternals<A, B>;
def: core.$ZodCodecDef<A, B>;
}
export declare const ZodMiniCodec: core.$constructor<ZodMiniCodec>;
export declare function codec<const A extends SomeType, B extends core.SomeType = core.$ZodType>(in_: A, out: B, params: {
decode: (value: core.output<A>, payload: core.ParsePayload<core.output<A>>) => core.util.MaybeAsync<core.input<B>>;
encode: (value: core.input<B>, payload: core.ParsePayload<core.input<B>>) => core.util.MaybeAsync<core.output<A>>;
}): ZodMiniCodec<A, B>;
export declare function invertCodec<A extends SomeType, B extends SomeType>(codec: ZodMiniCodec<A, B>): ZodMiniCodec<B, A>;
export interface ZodMiniReadonly<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodReadonlyInternals<T>> {
}
export declare const ZodMiniReadonly: core.$constructor<ZodMiniReadonly>;
export declare function readonly<T extends SomeType>(innerType: T): ZodMiniReadonly<T>;
export interface ZodMiniTemplateLiteral<Template extends string = string> extends _ZodMiniType<core.$ZodTemplateLiteralInternals<Template>> {
}
export declare const ZodMiniTemplateLiteral: core.$constructor<ZodMiniTemplateLiteral>;
export declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams): ZodMiniTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
export interface ZodMiniLazy<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodLazyInternals<T>> {
}
export declare const ZodMiniLazy: core.$constructor<ZodMiniLazy>;
declare function _lazy<T extends SomeType>(getter: () => T): ZodMiniLazy<T>;
export { _lazy as lazy };
export interface ZodMiniPromise<T extends SomeType = core.$ZodType> extends _ZodMiniType<core.$ZodPromiseInternals<T>> {
}
export declare const ZodMiniPromise: core.$constructor<ZodMiniPromise>;
export declare function promise<T extends SomeType>(innerType: T): ZodMiniPromise<T>;
export interface ZodMiniCustom<O = unknown, I = unknown> extends _ZodMiniType<core.$ZodCustomInternals<O, I>> {
}
export declare const ZodMiniCustom: core.$constructor<ZodMiniCustom>;
export declare function check<O = unknown>(fn: core.CheckFn<O>, params?: string | core.$ZodCustomParams): core.$ZodCheck<O>;
export declare function custom<O = unknown, I = O>(fn?: (data: O) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodMiniCustom<O, I>;
export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
export declare function superRefine<T>(fn: (arg: T, payload: core.$RefinementCtx<T>) => void | Promise<void>, params?: core.$ZodSuperRefineParams): core.$ZodCheck<T>;
export declare const describe: typeof core.describe;
export declare const meta: typeof core.meta;
declare abstract class Class {
constructor(..._args: any[]);
}
declare function _instanceof<T extends typeof Class>(cls: T, params?: core.$ZodCustomParams): ZodMiniCustom<InstanceType<T>, InstanceType<T>>;
export { _instanceof as instanceof };
export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodMiniCodec<ZodMiniString, ZodMiniBoolean>;
export type _ZodMiniJSONSchema = ZodMiniUnion<[
ZodMiniString,
ZodMiniNumber,
ZodMiniBoolean,
ZodMiniNull,
ZodMiniArray<ZodMiniJSONSchema>,
ZodMiniRecord<ZodMiniString<string>, ZodMiniJSONSchema>
]>;
export type _ZodMiniJSONSchemaInternals = _ZodMiniJSONSchema["_zod"];
export interface ZodMiniJSONSchemaInternals extends _ZodMiniJSONSchemaInternals {
output: util.JSONType;
input: util.JSONType;
}
export interface ZodMiniJSONSchema extends _ZodMiniJSONSchema {
_zod: ZodMiniJSONSchemaInternals;
}
export declare function json(): ZodMiniJSONSchema;
export interface ZodMiniFunction<Args extends core.$ZodFunctionIn = core.$ZodFunctionIn, Returns extends core.$ZodFunctionOut = core.$ZodFunctionOut> extends _ZodMiniType<core.$ZodFunctionInternals<Args, Returns>>, core.$ZodFunction<Args, Returns> {
_def: core.$ZodFunctionDef<Args, Returns>;
_input: core.$InferInnerFunctionType<Args, Returns>;
_output: core.$InferOuterFunctionType<Args, Returns>;
input<const Items extends util.TupleItems, const Rest extends core.$ZodFunctionOut = core.$ZodFunctionOut>(args: Items, rest?: Rest): ZodMiniFunction<ZodMiniTuple<Items, Rest>, Returns>;
input<NewArgs extends core.$ZodFunctionIn>(args: NewArgs): ZodMiniFunction<NewArgs, Returns>;
input(...args: any[]): ZodMiniFunction<any, Returns>;
output<NewReturns extends core.$ZodFunctionOut>(output: NewReturns): ZodMiniFunction<Args, NewReturns>;
}
export declare const ZodMiniFunction: core.$constructor<ZodMiniFunction>;
export declare function _function(): ZodMiniFunction;
export declare function _function<const In extends Array<SomeType> = Array<SomeType>>(params: {
input: In;
}): ZodMiniFunction<ZodMiniTuple<In, null>, core.$ZodFunctionOut>;
export declare function _function<const In extends Array<SomeType> = Array<SomeType>, const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
input: In;
output: Out;
}): ZodMiniFunction<ZodMiniTuple<In, null>, Out>;
export declare function _function<const In extends core.$ZodFunctionIn = core.$ZodFunctionIn>(params: {
input: In;
}): ZodMiniFunction<In, core.$ZodFunctionOut>;
export declare function _function<const Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params: {
output: Out;
}): ZodMiniFunction<core.$ZodFunctionIn, Out>;
export declare function _function<In extends core.$ZodFunctionIn = core.$ZodFunctionIn, Out extends core.$ZodFunctionOut = core.$ZodFunctionOut>(params?: {
input: In;
output: Out;
}): ZodMiniFunction<In, Out>;
export { _function as function };
@@ -0,0 +1,225 @@
flf2a$ 2 2 8 -1 20
Cyberfont - small
Figlet conversion by Kent Nassen, kentn@cyberspace.org, 8-11-94
From: stock@fwi.uva.nl (Lennert Stock)
Date: 15 Jul 1994 00:04:25 GMT
Here are some fonts. Non-figlet I'm afraid, if you wanna convert them, be
my guest. I posted the isometric fonts before.
------------------------------------------------------------------------------
.x%%%%%%x. .x%%%%%%x.
,%%%%%%%%%%. .%%%%%%%%%%.
,%%%' )' \) :( `( `%%%.
,%x%)________) --------- L e n n e r t S t o c k ( _ __ (%x%.
(%%%~^88P~88P| |~=> .=-~ %%%)
(%%::. .:,\ .' `. /,:. .::%%)
`;%:`\. `-' | | `-' ./':%:'
``x`. -===.' stock@fwi.uva.nl -------- `.===- .'x''
/ `:`.__.; :.__.':' \
.d8b. ..`. .'.. .d8b.
$@
$@@
/@
. @@
''@
@@
@
@@
@
@@
@
@@
@
@@
'@
@@
@
@@
@
@@
@
@@
@
@@
$ @
,@@
@
--@@
$@
.@@
/@
/ @@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
.@
.@@
.@
,@@
@
@@
@
@@
@
@@
-,@
. @@
@
@@
____@
|--|@@
___ @
|==]@@
____@
|___@@
___ @
|__>@@
____@
|===@@
____@
|---@@
____@
|__,@@
_ _@
|--|@@
_@
|@@
_@
___|@@
_ _@
|-:_@@
_ @
|___@@
_ _@
|\/|@@
__ _@
| \|@@
____@
[__]@@
___ @
|--'@@
__ @
[_,]@@
____@
|--<@@
____@
====@@
___@
| @@
_ _@
|__|@@
_ _@
\/ @@
_ _@
|/\|@@
_ _@
_X_@@
_ _@
Y @@
___ @
/__@@
@
@@
\ @
\@@
@
@@
@
@@
@
___@@
`@
@@
____@
|--|@@
___ @
|==]@@
____@
|___@@
___ @
|__>@@
____@
|===@@
____@
|---@@
____@
|__,@@
_ _@
|--|@@
_@
|@@
_@
___|@@
_ _@
|-:_@@
_ @
|___@@
_ _@
|\/|@@
__ _@
| \|@@
____@
[__]@@
___ @
|--'@@
__ @
[_,]@@
____@
|--<@@
____@
====@@
___@
| @@
_ _@
|__|@@
_ _@
\/ @@
_ _@
|/\|@@
_ _@
_X_@@
_ _@
Y @@
___ @
/__@@
@
@@
|@
|@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@
@@
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const PenLine = createLucideIcon("PenLine", [
["path", { d: "M12 20h9", key: "t2du7b" }],
[
"path",
{
d: "M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",
key: "1ykcvy"
}
]
]);
export { PenLine as default };
//# sourceMappingURL=pen-line.js.map
@@ -0,0 +1 @@
{"version":3,"file":"velocity.mjs","sources":["../../../../../src/animation/generators/utils/velocity.ts"],"sourcesContent":["import { velocityPerSecond } from \"motion-utils\"\n\nconst velocitySampleDuration = 5 // ms\n\nexport function getGeneratorVelocity(\n resolveValue: (v: number) => number,\n t: number,\n current: number\n) {\n const prevT = Math.max(t - velocitySampleDuration, 0)\n return velocityPerSecond(current - resolveValue(prevT), t - prevT)\n}\n"],"names":[],"mappings":";;AAEA,MAAM,sBAAsB,GAAG,CAAC,CAAA;SAEhB,oBAAoB,CAChC,YAAmC,EACnC,CAAS,EACT,OAAe,EAAA;AAEf,IAAA,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,sBAAsB,EAAE,CAAC,CAAC;AACrD,IAAA,OAAO,iBAAiB,CAAC,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC;AACtE;;;;"}
@@ -0,0 +1,325 @@
tlf2a 3 3 8 -1 18 0 0 0
===============================================================================
This is emboss.tlf, or “Emboss”, by Sam Hocevar <sam@hocevar.net>. It was
created on September 30th, 2006.
This font is free software. It comes without any warranty, to the extent
permitted by applicable law. You can redistribute it and/or modify it under
the terms of the Do What The Fuck You Want To Public License, Version 2,
as published by Sam Hocevar. See http://sam.zoy.org/wtfpl/COPYING for more
details.
Missing characters: # $ % , ; < >
To create emboss2.tlf, use the following command:
$ sed '/@@/,$y/═║╔╗╚╝/═║╔╗╚╝/' < emboss.tlf > emboss2.tlf
This font is part of TOIlet’s official distribution. More information
on the TOIlet website at http://caca.zoy.org/wiki/toilet
===============================================================================
@
@
@@
║!
╝!
╝!!
╝╝"
"
""
@
@
#@@
@
@
$@@
@
@
%@@
╔╝║ &
║═╔╝&
══╝ &&
╝'
'
''
╝(
║ (
╝((
═ )
║)
═ ))
╝ ╝*
═╔╝*
╝ ╝**
║ +
═╔╝+
╝ ++
@
@
,@@
-
═╝-
--
.
.
╝..
╝/
╝ /
╝ //
╔═║0
║╝║0
══╝00
═║ 1
║ 1
══╝11
══║2
╔═╝2
══╝22
══║3
══║3
══╝33
║ ║4
══║4
╝44
╔═╝5
══║5
══╝55
╔═╝6
╔═║6
══╝66
╔═║7
║7
╝77
╔═║8
╔═║8
══╝88
╔═║9
══║9
══╝99
:
╝:
╝::
@
@
;@@
@
@
<@@
=
══╝=
══╝==
@
@
>@@
╔═║?
╝?
╝ ??
╔═║@
║╝╝@
══╝@@
╔═║A
╔═║A
╝ ╝AA
╔═ B
╔═║B
══ BB
╔═╝C
║ C
══╝CC
╔═ D
║ ║D
══ DD
╔═╝E
╔═╝E
══╝EE
╔═╝F
╔═╝F
╝ FF
╔═╝G
║ ║G
══╝GG
║ ║H
╔═║H
╝ ╝HH
╝I
║I
╝II
╝J
║J
═╝JJ
║ ║K
╔╝ K
╝ ╝KK
║ L
║ L
══╝LL
╔╔ M
║║║M
╝╝╝MM
╔═ N
║ ║N
╝ ╝NN
╔═║O
║ ║O
══╝OO
╔═║p
╔═╝P
╝ PP
╔═║ Q
║ ║ Q
═══╝QQ
╔═║R
╔╔╝R
╝ ╝RR
╔═╝S
══║S
══╝SS
═╔╝T
║ T
╝ TT
║ ║U
║ ║U
══╝UU
║ ║V
║ ║V
╝ VV
║║║W
║║║W
══╝WW
║ ║X
╝ X
╝ ╝XX
║ ║Y
═╔╝Y
╝ YY
══║Z
╔╝ Z
══╝ZZ
╔╝[
║ [
═╝[[
╝ \
╝ \
╝\\
═║]
║]
═╝]]
╝ ^
╝ ╝^
^^
_
_
══╝__
╝ `
╝`
``
╔═║a
╔═║a
╝ ╝aa
╔═ b
╔═║b
══ bb
╔═╝c
║ c
══╝cc
╔═ d
║ ║d
══ dd
╔═╝e
╔═╝e
══╝ee
╔═╝f
╔═╝f
╝ ff
╔═╝g
║ ║g
══╝gg
║ ║h
╔═║h
╝ ╝hh
╝i
║i
╝ii
╝j
║j
═╝jj
║ ║k
╔╝ k
╝ ╝kk
║ l
║ l
══╝ll
╔╔ m
║║║m
╝╝╝mm
╔═ n
║ ║n
╝ ╝nn
╔═║o
║ ║o
══╝oo
╔═║p
╔═╝p
╝ pp
╔═║ q
║ ║ q
═══╝qq
╔═║r
╔╔╝r
╝ ╝rr
╔═╝s
══║s
══╝ss
═╔╝t
║ t
╝ tt
║ ║u
║ ║u
══╝uu
║ ║v
║ ║v
╝ vv
║║║w
║║║w
══╝ww
║ ║x
╝ x
╝ ╝xx
║ ║y
═╔╝y
╝ yy
══║z
╔╝ z
══╝zz
╔╝{
═║ {
═╝{{
║|
║|
╝||
═║ }
╔╝}
═╝ }}
╝ ╝~
╝ ╝ ~
~~
╔═║╔═╝Ä
╔═║╔═╝Ä
╝ ╝══╝ÄÄ
╔═║╔═╝Ö
║ ║╔═╝Ö
══╝══╝ÖÖ
║ ║╔═╝Ü
║ ║╔═╝Ü
══╝══╝ÜÜ
╔═║╔═╝ä
╔═║╔═╝ä
╝ ╝══╝ää
╔═║╔═╝ö
║ ║╔═╝ö
══╝══╝öö
║ ║╔═╝ü
║ ║╔═╝ü
══╝══╝üü
╔═╝╔═╝ß
══║══║ß
══╝══╝ßß
@@ -0,0 +1,183 @@
//#region src/adapter/aws-lambda/types.d.ts
/**
* @deprecated `hono/aws-lambda` will be removed in v5. Install `@hono/aws-lambda` and import from there instead.
*/
export interface CognitoIdentity {
cognitoIdentityId: string;
cognitoIdentityPoolId: string;
}
/**
* @deprecated `hono/aws-lambda` will be removed in v5. Install `@hono/aws-lambda` and import from there instead.
*/
export interface ClientContext {
client: ClientContextClient;
Custom?: any;
env: ClientContextEnv;
}
/**
* @deprecated `hono/aws-lambda` will be removed in v5. Install `@hono/aws-lambda` and import from there instead.
*/
export interface ClientContextClient {
installationId: string;
appTitle: string;
appVersionName: string;
appVersionCode: string;
appPackageName: string;
}
/**
* @deprecated `hono/aws-lambda` will be removed in v5. Install `@hono/aws-lambda` and import from there instead.
*/
export interface ClientContextEnv {
platformVersion: string;
platform: string;
make: string;
model: string;
locale: string;
}
/**
* {@link Handler} context parameter.
* See {@link https://docs.aws.amazon.com/lambda/latest/dg/nodejs-prog-model-context.html AWS documentation}.
* @deprecated `hono/aws-lambda` will be removed in v5. Install `@hono/aws-lambda` and import from there instead.
*/
export interface LambdaContext {
callbackWaitsForEmptyEventLoop: boolean;
functionName: string;
functionVersion: string;
invokedFunctionArn: string;
memoryLimitInMB: string;
awsRequestId: string;
logGroupName: string;
logStreamName: string;
identity?: CognitoIdentity | undefined;
clientContext?: ClientContext | undefined;
getRemainingTimeInMillis(): number;
}
type Callback<TResult = any> = (error?: Error | string | null, result?: TResult) => void;
/**
* @deprecated `hono/aws-lambda` will be removed in v5. Install `@hono/aws-lambda` and import from there instead.
*/
export type Handler<TEvent = any, TResult = any> = (event: TEvent, context: LambdaContext, callback: Callback<TResult>) => void | Promise<TResult>;
interface ClientCert {
clientCertPem: string;
subjectDN: string;
issuerDN: string;
serialNumber: string;
validity: {
notBefore: string;
notAfter: string;
};
}
interface Identity {
accessKey?: string;
accountId?: string;
caller?: string;
cognitoAuthenticationProvider?: string;
cognitoAuthenticationType?: string;
cognitoIdentityId?: string;
cognitoIdentityPoolId?: string;
principalOrgId?: string;
sourceIp: string;
user?: string;
userAgent: string;
userArn?: string;
clientCert?: ClientCert;
}
/**
* @deprecated `hono/aws-lambda` will be removed in v5. Install `@hono/aws-lambda` and import from there instead.
*/
export interface ApiGatewayRequestContext {
accountId: string;
apiId: string;
authorizer: {
claims?: unknown;
scopes?: unknown;
};
domainName: string;
domainPrefix: string;
extendedRequestId: string;
httpMethod: string;
identity: Identity;
path: string;
protocol: string;
requestId: string;
requestTime: string;
requestTimeEpoch: number;
resourceId?: string;
resourcePath: string;
stage: string;
}
interface Authorizer {
iam?: {
accessKey: string;
accountId: string;
callerId: string;
cognitoIdentity: null;
principalOrgId: null;
userArn: string;
userId: string;
};
jwt?: {
claims: Record<string, string | number | boolean | string[]>;
scopes: string[] | null;
};
/**
* The `context` object returned by a Lambda (REQUEST) authorizer.
* It is `null` when the authorizer returns no context.
*/
lambda?: Record<string, unknown> | null;
}
/**
* @deprecated `hono/aws-lambda` will be removed in v5. Install `@hono/aws-lambda` and import from there instead.
*/
export interface ApiGatewayRequestContextV2 {
accountId: string;
apiId: string;
authentication: null;
authorizer: Authorizer;
domainName: string;
domainPrefix: string;
http: {
method: string;
path: string;
protocol: string;
sourceIp: string;
userAgent: string;
};
requestId: string;
routeKey: string;
stage: string;
time: string;
timeEpoch: number;
}
/**
* @deprecated `hono/aws-lambda` will be removed in v5. Install `@hono/aws-lambda` and import from there instead.
*/
export interface ALBRequestContext {
elb: {
targetGroupArn: string;
};
}
/**
* @deprecated `hono/aws-lambda` will be removed in v5. Install `@hono/aws-lambda` and import from there instead.
*/
export interface LatticeRequestContextV2 {
serviceNetworkArn: string;
serviceArn: string;
targetGroupArn: string;
region: string;
timeEpoch: string;
identity: {
sourceVpcArn?: string;
type?: string;
principal?: string;
principalOrgID?: string;
sessionName?: string;
x509IssuerOu?: string;
x509SanDns?: string;
x509SanNameCn?: string;
x509SanUri?: string;
x509SubjectCn?: string;
};
}
//#endregion
export {};
@@ -0,0 +1,2 @@
declare const _default: "# Authenticated Routes\n\nAuthentication is an extremely common requirement for web applications. In this guide, we'll walk through how to use TanStack Router to build protected routes, and how to redirect users to login if they try to access them.\n\n> **A route guard does not protect a server function.** This guide shows how to gate a route's UI behind `beforeLoad`. If you also have a `createServerFn` that fetches sensitive data, the route guard does NOT stop a direct request to that RPC \u2014 server functions are reachable by POST regardless of which route renders them. Pair routing-side guards with **handler-level enforcement** (auth middleware or in-handler check). See [Authentication Server Primitives](../../start/framework/react/guide/authentication-server-primitives.md) in the Start docs.\n\n## The `route.beforeLoad` Option\n\nThe `route.beforeLoad` option allows you to specify a function that will be called before a route is loaded. It receives all of the same arguments that the `route.loader` function does. This is a great place to check if a user is authenticated, and redirect them to a login page if they are not.\n\nThe `beforeLoad` function runs in relative order to these other route loading functions:\n\n- Route Matching (Top-Down)\n - `route.params.parse`\n - `route.validateSearch`\n- Route Loading (including Preloading)\n - **`route.beforeLoad`**\n - `route.onError`\n- Route Loading (Parallel)\n - `route.component.preload?`\n - `route.load`\n\n**It's important to know that the `beforeLoad` function for a route is called _before any of its child routes' `beforeLoad` functions_.** It is essentially a middleware function for the route and all of its children.\n\n**If you throw an error in `beforeLoad`, none of its children will attempt to load**.\n\n## Redirecting\n\nWhile not required, some authentication flows require redirecting to a login page. To do this, you can **throw a `redirect()`** from `beforeLoad`:\n\n```tsx\n// src/routes/_authenticated.tsx\nexport const Route = createFileRoute('/_authenticated')({\n beforeLoad: async ({ location }) => {\n if (!isAuthenticated()) {\n throw redirect({\n to: '/login',\n search: {\n // Use the current location to power a redirect after login\n // (Do not use `router.state.resolvedLocation` as it can\n // potentially lag behind the actual current location)\n redirect: location.href,\n },\n })\n }\n },\n})\n```\n\n> [!TIP]\n> The `redirect()` function takes all of the same options as the `navigate` function, so you can pass options like `replace: true` if you want to replace the current history entry instead of adding a new one.\n\n### Handling Auth Check Failures\n\nIf your authentication check can throw errors (network failures, token validation, etc.), wrap it in try/catch:\n\n<!-- ::start:framework -->\n\n# React\n\n```tsx\nimport { createFileRoute, redirect, isRedirect } from '@tanstack/react-router'\n\n// src/routes/_authenticated.tsx\nexport const Route = createFileRoute('/_authenticated')({\n beforeLoad: async ({ location }) => {\n try {\n const user = await verifySession() // might throw on network error\n if (!user) {\n throw redirect({\n to: '/login',\n search: { redirect: location.href },\n })\n }\n return { user }\n } catch (error) {\n // Re-throw redirects (they're intentional, not errors)\n if (isRedirect(error)) throw error\n\n // Auth check failed (network error, etc.) - redirect to login\n throw redirect({\n to: '/login',\n search: { redirect: location.href },\n })\n }\n },\n})\n```\n\n# Solid\n\n```tsx\nimport { createFileRoute, redirect, isRedirect } from '@tanstack/solid-router'\n\n// src/routes/_authenticated.tsx\nexport const Route = createFileRoute('/_authenticated')({\n beforeLoad: async ({ location }) => {\n try {\n const user = await verifySession() // might throw on network error\n if (!user) {\n throw redirect({\n to: '/login',\n search: { redirect: location.href },\n })\n }\n return { user }\n } catch (error) {\n // Re-throw redirects (they're intentional, not errors)\n if (isRedirect(error)) throw error\n\n // Auth check failed (network error, etc.) - redirect to login\n throw redirect({\n to: '/login',\n search: { redirect: location.href },\n })\n }\n },\n})\n```\n\n<!-- ::end:framework -->\n\nThe [`isRedirect()`](../api/router/isRedirectFunction.md) helper distinguishes between actual errors and intentional redirects.\n\nOnce you have authenticated a user, it's also common practice to redirect them back to the page they were trying to access. To do this, you can utilize the `redirect` search param that we added in our original redirect. Since we'll be replacing the entire URL with what it was, `router.history.pushLine truncated
export default _default;
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_J"},C:{"1":"_H _JN","33":"_Y _hU","164":"_g"},D:{"1":"_Q"},E:{"1":"_vG","16":"MD"},F:{"1":"_a","2":"_T"},G:{"1":"_eB","16":"lC"},H:{"2":"1D"},I:{"1":"_SB","16":"_m"},J:{"1":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:4,C:"CSS initial value",D:true};
@@ -0,0 +1,581 @@
import { crossSerializeStream, getCrossReferenceHeader } from 'seroval'
import { invariant } from '../invariant'
import {
createInlineCssPlaceholderAsset,
createInlineCssStyleAsset,
getStylesheetHref,
isInlinableStylesheet,
} from '../manifest'
import { decodePath } from '../utils'
import { createLRUCache } from '../lru-cache'
import { rootRouteId } from '../root'
import minifiedTsrBootStrapScript from './tsrScript?script-string'
import { GLOBAL_TSR, TSR_SCRIPT_BARRIER_ID } from './constants'
import { dehydrateSsrMatchId } from './ssr-match-id'
import { defaultSerovalPlugins } from './serializer/seroval-plugins'
import { makeSsrSerovalPlugin } from './serializer/transformer'
import type { LRUCache } from '../lru-cache'
import type { DehydratedMatch, DehydratedRouter } from './types'
import type { AnySerializationAdapter } from './serializer/transformer'
import type { AnyRouter } from '../router'
import type { AnyRouteMatch } from '../Matches'
import type { Manifest, RouterManagedTag } from '../manifest'
declare module '../router' {
interface ServerSsr {
setRenderFinished: () => void
cleanup: () => void
}
interface RouterEvents {
onInjectedHtml: {
type: 'onInjectedHtml'
}
onSerializationFinished: {
type: 'onSerializationFinished'
}
}
}
const SCOPE_ID = 'tsr'
const TSR_PREFIX = GLOBAL_TSR + '.router='
const P_PREFIX = GLOBAL_TSR + '.p(()=>'
const P_SUFFIX = ')'
export function dehydrateMatch(match: AnyRouteMatch): DehydratedMatch {
const dehydratedMatch: DehydratedMatch = {
i: dehydrateSsrMatchId(match.id),
u: match.updatedAt,
s: match.status,
}
const properties = [
['__beforeLoadContext', 'b'],
['loaderData', 'l'],
['error', 'e'],
['ssr', 'ssr'],
] as const
for (const [key, shorthand] of properties) {
if (match[key] !== undefined) {
dehydratedMatch[shorthand] = match[key]
}
}
if (match.globalNotFound) {
dehydratedMatch.g = true
}
return dehydratedMatch
}
const INITIAL_SCRIPTS = [
getCrossReferenceHeader(SCOPE_ID),
minifiedTsrBootStrapScript,
]
class ScriptBuffer {
private router: AnyRouter | undefined
private _queue: Array<string>
private _scriptBarrierLifted = false
private _cleanedUp = false
private _pendingMicrotask = false
constructor(router: AnyRouter) {
this.router = router
// Copy INITIAL_SCRIPTS to avoid mutating the shared array
this._queue = INITIAL_SCRIPTS.slice()
}
enqueue(script: string) {
if (this._cleanedUp) return
this._queue.push(script)
// If barrier is lifted, schedule injection (if not already scheduled)
if (this._scriptBarrierLifted && !this._pendingMicrotask) {
this._pendingMicrotask = true
queueMicrotask(() => {
this._pendingMicrotask = false
this.injectBufferedScripts()
})
}
}
liftBarrier() {
if (this._scriptBarrierLifted || this._cleanedUp) return
this._scriptBarrierLifted = true
if (this._queue.length > 0 && !this._pendingMicrotask) {
this._pendingMicrotask = true
queueMicrotask(() => {
this._pendingMicrotask = false
this.injectBufferedScripts()
})
}
}
/**
* Flushes any pending scripts synchronously.
* Call this before emitting onSerializationFinished to ensure all scripts are injected.
*
* IMPORTANT: Only injects if the barrier has been lifted. Before the barrier is lifted,
* scripts should remain in the queue so takeBufferedScripts() can retrieve them
*/
flush() {
if (!this._scriptBarrierLifted) return
if (this._cleanedUp) return
this._pendingMicrotask = false
const scriptsToInject = this.takeAll()
if (scriptsToInject && this.router?.serverSsr) {
this.router.serverSsr.injectScript(scriptsToInject)
}
}
takeAll() {
const bufferedScripts = this._queue
this._queue = []
if (bufferedScripts.length === 0) {
return undefined
}
// Optimization: if only one script, avoid join
if (bufferedScripts.length === 1) {
return bufferedScripts[0] + ';document.currentScript.remove()'
}
// Append cleanup script and join - avoid push() to not mutate then iterate
return bufferedScripts.join(';') + ';document.currentScript.remove()'
}
injectBufferedScripts() {
if (this._cleanedUp) return
// Early return if queue is empty (avoids unnecessary takeAll() call)
if (this._queue.length === 0) return
const scriptsToInject = this.takeAll()
if (scriptsToInject && this.router?.serverSsr) {
this.router.serverSsr.injectScript(scriptsToInject)
}
}
cleanup() {
this._cleanedUp = true
this._queue = []
this.router = undefined
}
}
const isProd = process.env.NODE_ENV === 'production'
type FilteredRoutes = Manifest['routes']
type ManifestLRU = LRUCache<string, FilteredRoutes>
type InlineCssLRU = LRUCache<string, string>
const MANIFEST_CACHE_SIZE = 100
const manifestCaches = new WeakMap<Manifest, ManifestLRU>()
const inlineCssCaches = new WeakMap<Manifest, InlineCssLRU>()
function getManifestCache(manifest: Manifest): ManifestLRU {
const cache = manifestCaches.get(manifest)
if (cache) return cache
const newCache = createLRUCache<string, FilteredRoutes>(MANIFEST_CACHE_SIZE)
manifestCaches.set(manifest, newCache)
return newCache
}
function getInlineCssCache(manifest: Manifest): InlineCssLRU {
const cache = inlineCssCaches.get(manifest)
if (cache) return cache
const newCache = createLRUCache<string, string>(MANIFEST_CACHE_SIZE)
inlineCssCaches.set(manifest, newCache)
return newCache
}
function getInlineCssHrefsForMatches(
manifest: Manifest | undefined,
matches: Array<AnyRouteMatch>,
) {
const styles = manifest?.inlineCss?.styles
if (!styles) return []
const seen = new Set<string>()
const hrefs: Array<string> = []
for (const match of matches) {
const assets = manifest?.routes[match.routeId]?.assets ?? []
for (const asset of assets) {
const href = getStylesheetHref(asset)
if (!href || seen.has(href) || styles[href] === undefined) {
continue
}
seen.add(href)
hrefs.push(href)
}
}
return hrefs
}
function getInlineCssForHrefs(manifest: Manifest, hrefs: Array<string>) {
const styles = manifest.inlineCss?.styles
if (!styles || hrefs.length === 0) return undefined
const cacheKey = hrefs.join('\0')
if (isProd) {
const cached = getInlineCssCache(manifest).get(cacheKey)
if (cached !== undefined) return cached
}
const css = hrefs.map((href) => styles[href]!).join('')
if (isProd) {
getInlineCssCache(manifest).set(cacheKey, css)
}
return css
}
function getInlineCssAssetForMatches(
manifest: Manifest | undefined,
matches: Array<AnyRouteMatch>,
) {
if (!manifest?.inlineCss) return undefined
const hrefs = getInlineCssHrefsForMatches(manifest, matches)
const css = getInlineCssForHrefs(manifest, hrefs)
return css === undefined ? undefined : createInlineCssStyleAsset(css)
}
function stripInlinedStylesheetAssets(
manifest: Manifest,
routes: FilteredRoutes,
matches: Array<AnyRouteMatch>,
): FilteredRoutes {
if (!manifest.inlineCss) {
return routes
}
const nextRoutes: FilteredRoutes = {}
for (const [routeId, route] of Object.entries(routes)) {
const assets = route.assets?.filter(
(asset) => !isInlinableStylesheet(manifest, asset),
)
const nextRoute = { ...route }
if (assets) {
if (assets.length > 0) {
nextRoute.assets = assets
} else {
delete nextRoute.assets
}
}
nextRoutes[routeId] = nextRoute
}
if (getInlineCssAssetForMatches(manifest, matches)) {
const rootRoute = nextRoutes[rootRouteId] ?? {}
nextRoutes[rootRouteId] = {
...rootRoute,
assets: [createInlineCssPlaceholderAsset(), ...(rootRoute.assets ?? [])],
}
}
return nextRoutes
}
export function attachRouterServerSsrUtils({
router,
manifest,
getRequestAssets,
includeUnmatchedRouteAssets = true,
}: {
router: AnyRouter
manifest: Manifest | undefined
getRequestAssets?: () => Array<RouterManagedTag> | undefined
includeUnmatchedRouteAssets?: boolean
}) {
router.ssr = {
get manifest() {
const requestAssets = getRequestAssets?.()
const inlineCssAsset = getInlineCssAssetForMatches(
manifest,
router.stores.matches.get(),
)
if (!requestAssets?.length && !inlineCssAsset) return manifest
// Merge request-scoped assets into root route without mutating cached manifest
return {
...manifest,
routes: {
...manifest?.routes,
[rootRouteId]: {
...manifest?.routes?.[rootRouteId],
assets: [
...(requestAssets ?? []),
...(inlineCssAsset ? [inlineCssAsset] : []),
...(manifest?.routes?.[rootRouteId]?.assets ?? []),
],
},
},
}
},
}
let _dehydrated = false
let _serializationFinished = false
const renderFinishedListeners: Array<() => void> = []
const serializationFinishedListeners: Array<() => void> = []
const scriptBuffer = new ScriptBuffer(router)
let injectedHtmlBuffer = ''
router.serverSsr = {
injectHtml: (html: string) => {
if (!html) return
// Buffer the HTML so it can be retrieved via takeBufferedHtml()
injectedHtmlBuffer += html
// Emit event to notify subscribers that new HTML is available
router.emit({
type: 'onInjectedHtml',
})
},
injectScript: (script: string) => {
if (!script) return
const html = `<script${router.options.ssr?.nonce ? ` nonce='${router.options.ssr.nonce}'` : ''}>${script}</script>`
router.serverSsr!.injectHtml(html)
},
dehydrate: async (opts?: { requestAssets?: Array<RouterManagedTag> }) => {
if (_dehydrated) {
if (process.env.NODE_ENV !== 'production') {
throw new Error('Invariant failed: router is already dehydrated!')
}
invariant()
}
let matchesToDehydrate = router.stores.matches.get()
if (router.isShell()) {
// In SPA mode we only want to dehydrate the root match
matchesToDehydrate = matchesToDehydrate.slice(0, 1)
}
const matches = matchesToDehydrate.map(dehydrateMatch)
let manifestToDehydrate: Manifest | undefined = undefined
// For currently matched routes, send full manifest (preloads + assets).
// For unmatched routes, include assets only when includeUnmatchedRouteAssets
// is true; otherwise omit them entirely. Preloads for unmatched routes are
// still excluded because they are handled via dynamic imports.
if (manifest) {
// Prod-only caching; in dev manifests may be replaced/updated (HMR)
const currentRouteIdsList = matchesToDehydrate.map((m) => m.routeId)
const manifestCacheKey = `${currentRouteIdsList.join('\0')}\0includeUnmatchedRouteAssets=${includeUnmatchedRouteAssets}`
let filteredRoutes: FilteredRoutes | undefined
if (isProd) {
filteredRoutes = getManifestCache(manifest).get(manifestCacheKey)
}
if (!filteredRoutes) {
const currentRouteIds = new Set(currentRouteIdsList)
const nextFilteredRoutes: FilteredRoutes = {}
for (const routeId in manifest.routes) {
const routeManifest = manifest.routes[routeId]!
if (currentRouteIds.has(routeId)) {
nextFilteredRoutes[routeId] = routeManifest
} else if (
includeUnmatchedRouteAssets &&
routeManifest.assets &&
routeManifest.assets.length > 0
) {
nextFilteredRoutes[routeId] = {
assets: routeManifest.assets,
}
}
}
filteredRoutes = stripInlinedStylesheetAssets(
manifest,
nextFilteredRoutes,
matchesToDehydrate,
)
if (isProd) {
getManifestCache(manifest).set(manifestCacheKey, filteredRoutes)
}
}
manifestToDehydrate = {
routes: { ...filteredRoutes },
}
// Merge request-scoped assets into root route (without mutating cached manifest)
if (opts?.requestAssets?.length) {
const existingRoot = manifestToDehydrate.routes[rootRouteId]
manifestToDehydrate.routes[rootRouteId] = {
...existingRoot,
assets: [...opts.requestAssets, ...(existingRoot?.assets ?? [])],
}
}
}
const dehydratedRouter: DehydratedRouter = {
manifest: manifestToDehydrate,
matches,
}
const lastMatchId = matchesToDehydrate[matchesToDehydrate.length - 1]?.id
if (lastMatchId) {
dehydratedRouter.lastMatchId = dehydrateSsrMatchId(lastMatchId)
}
const dehydratedData = await router.options.dehydrate?.()
if (dehydratedData) {
dehydratedRouter.dehydratedData = dehydratedData
}
_dehydrated = true
const trackPlugins = { didRun: false }
const serializationAdapters = router.options.serializationAdapters as
| Array<AnySerializationAdapter>
| undefined
const plugins = serializationAdapters
? serializationAdapters
.map((t) => makeSsrSerovalPlugin(t, trackPlugins))
.concat(defaultSerovalPlugins)
: defaultSerovalPlugins
const signalSerializationComplete = () => {
_serializationFinished = true
try {
serializationFinishedListeners.forEach((l) => l())
router.emit({ type: 'onSerializationFinished' })
} catch (err) {
console.error('Serialization listener error:', err)
} finally {
serializationFinishedListeners.length = 0
renderFinishedListeners.length = 0
}
}
crossSerializeStream(dehydratedRouter, {
refs: new Map(),
plugins,
onSerialize: (data, initial) => {
let serialized = initial ? TSR_PREFIX + data : data
if (trackPlugins.didRun) {
serialized = P_PREFIX + serialized + P_SUFFIX
}
scriptBuffer.enqueue(serialized)
},
onError: (err: unknown) => {
console.error('Serialization error:', err)
if (err && (err as any).stack) {
console.error((err as any).stack)
}
signalSerializationComplete()
},
scopeId: SCOPE_ID,
onDone: () => {
scriptBuffer.enqueue(GLOBAL_TSR + '.e()')
// Flush all pending scripts synchronously before signaling completion
// This ensures all scripts are injected before onSerializationFinished is emitted
scriptBuffer.flush()
signalSerializationComplete()
},
})
},
isDehydrated() {
return _dehydrated
},
isSerializationFinished() {
return _serializationFinished
},
onRenderFinished: (listener) => renderFinishedListeners.push(listener),
onSerializationFinished: (listener) =>
serializationFinishedListeners.push(listener),
setRenderFinished: () => {
// Wrap in try-catch to ensure scriptBuffer.liftBarrier() is always called
try {
renderFinishedListeners.forEach((l) => l())
} catch (err) {
console.error('Error in render finished listener:', err)
} finally {
// Clear listeners after calling them to prevent memory leaks
renderFinishedListeners.length = 0
}
scriptBuffer.liftBarrier()
},
takeBufferedScripts() {
const scripts = scriptBuffer.takeAll()
const serverBufferedScript: RouterManagedTag = {
tag: 'script',
attrs: {
nonce: router.options.ssr?.nonce,
className: '$tsr',
id: TSR_SCRIPT_BARRIER_ID,
},
children: scripts,
}
return serverBufferedScript
},
liftScriptBarrier() {
scriptBuffer.liftBarrier()
},
takeBufferedHtml() {
if (!injectedHtmlBuffer) {
return undefined
}
const buffered = injectedHtmlBuffer
injectedHtmlBuffer = ''
return buffered
},
cleanup() {
// Guard against multiple cleanup calls
if (!router.serverSsr) return
renderFinishedListeners.length = 0
serializationFinishedListeners.length = 0
injectedHtmlBuffer = ''
scriptBuffer.cleanup()
router.serverSsr = undefined
},
}
}
/**
* Get the origin for the request.
*
* SECURITY: We intentionally do NOT trust the Origin header for determining
* the router's origin. The Origin header can be spoofed by attackers, which
* could lead to SSRF-like vulnerabilities where redirects are constructed
* using a malicious origin (CVE-2024-34351).
*
* Instead, we derive the origin from request.url, which is typically set by
* the server infrastructure (not client-controlled headers).
*
* For applications behind proxies that need to trust forwarded headers,
* use the router's `origin` option to explicitly configure a trusted origin.
*/
export function getOrigin(request: Request) {
try {
return new URL(request.url).origin
} catch {}
return 'http://localhost'
}
// server and browser can decode/encode characters differently in paths and search params.
// Server generally strictly follows the WHATWG URL Standard, while browsers may differ for legacy reasons.
// for example, in paths "|" is not encoded on the server but is encoded on chromium (and not on firefox) while "대" is encoded on both sides.
// Another anomaly is that in Node new URLSearchParams and new URL also decode/encode characters differently.
// new URLSearchParams() encodes "|" while new URL() does not, and in this instance
// chromium treats search params differently than paths, i.e. "|" is not encoded in search params.
export function getNormalizedURL(url: string | URL, base?: string | URL) {
// ensure backslashes are encoded correctly in the URL
if (typeof url === 'string') url = url.replace('\\', '%5C')
const rawUrl = new URL(url, base)
const { path: decodedPathname, handledProtocolRelativeURL } = decodePath(
rawUrl.pathname,
)
const searchParams = new URLSearchParams(rawUrl.search)
const normalizedHref =
decodedPathname +
(searchParams.size > 0 ? '?' : '') +
searchParams.toString() +
rawUrl.hash
return {
url: new URL(normalizedHref, rawUrl.origin),
handledProtocolRelativeURL,
}
}
@@ -0,0 +1,165 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const { cachedJoin } = require("./util/path");
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
/** @typedef {import("./Resolver").ResolveContextYield} ResolveContextYield */
/** @typedef {{ [k: string]: undefined | ResolveRequest | ResolveRequest[] }} Cache */
const RELATIVE_REQUEST_REGEXP = /^\.\.?(?:\/|$)/;
/**
* @param {string} relativePath relative path from package root
* @param {string} request relative request
* @returns {string} normalized request with a preserved leading dot
*/
function joinRelativePreservingLeadingDot(relativePath, request) {
const normalized = cachedJoin(relativePath, request);
return RELATIVE_REQUEST_REGEXP.test(normalized)
? normalized
: `./${normalized}`;
}
/**
* @param {ResolveRequest} request request
* @returns {string | false | undefined} normalized path
*/
function getCachePath(request) {
if (request.descriptionFileRoot && !request.module) {
return request.descriptionFileRoot;
}
return request.path;
}
/**
* @param {ResolveRequest} request request
* @returns {string | undefined} normalized request string
*/
function getCacheRequest(request) {
const requestString = request.request;
if (
!requestString ||
!request.relativePath ||
!RELATIVE_REQUEST_REGEXP.test(requestString)
) {
return requestString;
}
return joinRelativePreservingLeadingDot(request.relativePath, requestString);
}
/**
* @param {string} type type of cache
* @param {ResolveRequest} request request
* @param {boolean} withContext cache with context?
* @returns {string} cache id
*/
function getCacheId(type, request, withContext) {
return JSON.stringify({
type,
context: withContext ? request.context : "",
path: getCachePath(request),
query: request.query,
fragment: request.fragment,
request: getCacheRequest(request),
});
}
module.exports = class UnsafeCachePlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {(request: ResolveRequest) => boolean} filterPredicate filterPredicate
* @param {Cache} cache cache
* @param {boolean} withContext withContext
* @param {string | ResolveStepHook} target target
*/
constructor(source, filterPredicate, cache, withContext, target) {
this.source = source;
this.filterPredicate = filterPredicate;
this.withContext = withContext;
this.cache = cache;
this.target = target;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
const target = resolver.ensureHook(this.target);
resolver
.getHook(this.source)
.tapAsync("UnsafeCachePlugin", (request, resolveContext, callback) => {
if (!this.filterPredicate(request)) {
return resolver.doResolve(
target,
request,
null,
resolveContext,
callback,
);
}
const isYield = typeof resolveContext.yield === "function";
const cacheId = getCacheId(
isYield ? "yield" : "default",
request,
this.withContext,
);
const cacheEntry = this.cache[cacheId];
if (cacheEntry) {
if (isYield) {
const yield_ =
/** @type {ResolveContextYield} */
(resolveContext.yield);
if (Array.isArray(cacheEntry)) {
for (const result of cacheEntry) yield_(result);
} else {
yield_(cacheEntry);
}
return callback(null, null);
}
return callback(null, /** @type {ResolveRequest} */ (cacheEntry));
}
/** @type {ResolveContextYield | undefined} */
let yieldFn;
/** @type {ResolveContextYield | undefined} */
let yield_;
/** @type {ResolveRequest[]} */
const yieldResult = [];
if (isYield) {
yieldFn = resolveContext.yield;
yield_ = (result) => {
yieldResult.push(result);
};
}
resolver.doResolve(
target,
request,
null,
yield_ ? { ...resolveContext, yield: yield_ } : resolveContext,
(err, result) => {
if (err) return callback(err);
if (isYield) {
if (result) yieldResult.push(result);
for (const result of yieldResult) {
/** @type {ResolveContextYield} */
(yieldFn)(result);
}
this.cache[cacheId] = yieldResult;
return callback(null, null);
}
if (result) return callback(null, (this.cache[cacheId] = result));
callback();
},
);
});
}
};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_Z","8":"_A"},B:{"1":"R","2":"_XJ _lE","8":"_I"},C:{"2":"_PL _2B _GD _zE","66":"_GH _CG PB","72":"QB _eG"},D:{"1":"_ET _zI _3D","2":"_H _Y _ON _gQ","66":"_iH _ZQ"},E:{"2":"_u","8":"_dB"},F:{"1":"_GB _DM _oC","2":"_0B _gR","66":"_cC"},G:{"2":"_r","8":"_2"},H:{"2":"1D"},I:{"1":"7D","2":"_IG _oK 6D"},J:{"2":"_B"},K:{"2":"_N"},L:{"2":"I"},M:{"2":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_ZH","2":"_WL"},Q:{"1":"JE"},R:{"2":"KE"},S:{"2":"ME","72":"LE"}},B:7,C:"Custom Elements (deprecated V0 spec)",D:true};
@@ -0,0 +1,25 @@
{
'defines': [ 'NAPI_CPP_EXCEPTIONS' ],
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'conditions': [
["OS=='win'", {
"defines": [
"_HAS_EXCEPTIONS=1"
],
"msvs_settings": {
"VCCLCompilerTool": {
"ExceptionHandling": 1,
'EnablePREfast': 'true',
},
},
}],
["OS=='mac'", {
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
},
}],
],
}
@@ -0,0 +1,10 @@
'use strict'
const { readFileSync, writeFileSync } = require('node:fs')
const { transcode } = require('node:buffer')
const buffer = transcode
? transcode(readFileSync('./undici-fetch.js'), 'utf8', 'latin1')
: readFileSync('./undici-fetch.js')
writeFileSync('./undici-fetch.js', buffer.toString('latin1'))
@@ -0,0 +1,30 @@
/// <reference types="node" />
import type { Headers } from './fetch'
export interface Cookie {
name: string
value: string
expires?: Date | number
maxAge?: number
domain?: string
path?: string
secure?: boolean
httpOnly?: boolean
sameSite?: 'Strict' | 'Lax' | 'None'
unparsed?: string[]
}
export function deleteCookie (
headers: Headers,
name: string,
attributes?: { name?: string, domain?: string }
): void
export function getCookies (headers: Headers): Record<string, string>
export function getSetCookies (headers: Headers): Cookie[]
export function setCookie (headers: Headers, cookie: Cookie): void
export function parseCookie (cookie: string): Cookie | null
@@ -0,0 +1,68 @@
<p align=center>
AssertionError and AssertionResult classes.
</p>
<p align=center>
<a href="https://github.com/chaijs/assertion-error/actions">
<img
alt="build:?"
src="https://github.com/chaijs/assertion-error/actions/workflows/nodejs.yml/badge.svg"
/>
</a><a href="https://www.npmjs.com/package/assertion-error">
<img
alt="downloads:?"
src="https://img.shields.io/npm/dm/assertion-error.svg"
/>
</a><a href="">
<img
alt="devDependencies:none"
src="https://img.shields.io/badge/dependencies-none-brightgreen"
/>
</a>
</p>
## What is AssertionError?
Assertion Error is a module that contains two classes: `AssertionError`, which
is an instance of an `Error`, and `AssertionResult` which is not an instance of
Error.
These can be useful for returning from a function - if the function "succeeds"
return an `AssertionResult` and if the function fails return (or throw) an
`AssertionError`.
Both `AssertionError` and `AssertionResult` implement the `Result` interface:
```typescript
interface Result {
name: "AssertionError" | "AssertionResult";
ok: boolean;
toJSON(...args: unknown[]): Record<string, unknown>;
}
```
So if a function returns `AssertionResult | AssertionError` it is easy to check
_which_ one is returned by checking either `.name` or `.ok`, or check
`instanceof Error`.
## Installation
### Node.js
`assertion-error` is available on [npm](http://npmjs.org).
```
$ npm install --save assertion-error
```
### Deno
`assertion_error` is available on
[Deno.land](https://deno.land/x/assertion_error)
```typescript
import {
AssertionError,
AssertionResult,
} from "https://deno.land/x/assertion_error@2.0.0/mod.ts";
```
@@ -0,0 +1 @@
{"version":3,"file":"arrow-up-wide-narrow.js","sources":["../../../src/icons/arrow-up-wide-narrow.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowUpWideNarrow\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMyA4IDQtNCA0IDQiIC8+CiAgPHBhdGggZD0iTTcgNHYxNiIgLz4KICA8cGF0aCBkPSJNMTEgMTJoMTAiIC8+CiAgPHBhdGggZD0iTTExIDE2aDciIC8+CiAgPHBhdGggZD0iTTExIDIwaDQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/arrow-up-wide-narrow\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ArrowUpWideNarrow = createLucideIcon('ArrowUpWideNarrow', [\n ['path', { d: 'm3 8 4-4 4 4', key: '11wl7u' }],\n ['path', { d: 'M7 4v16', key: '1glfcx' }],\n ['path', { d: 'M11 12h10', key: '1438ji' }],\n ['path', { d: 'M11 16h7', key: 'uosisv' }],\n ['path', { d: 'M11 20h4', key: '1krc32' }],\n]);\n\nexport default ArrowUpWideNarrow;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB,iBAAiB,mBAAqB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const BluetoothSearching = createLucideIcon("BluetoothSearching", [
["path", { d: "m7 7 10 10-5 5V2l5 5L7 17", key: "1q5490" }],
["path", { d: "M20.83 14.83a4 4 0 0 0 0-5.66", key: "k8tn1j" }],
["path", { d: "M18 12h.01", key: "yjnet6" }]
]);
export { BluetoothSearching as default };
//# sourceMappingURL=bluetooth-searching.js.map
@@ -0,0 +1 @@
{"version":3,"file":"full.jitter.js","sourceRoot":"","sources":["../../../src/jitter/full/full.jitter.ts"],"names":[],"mappings":";;AAAA,SAAgB,UAAU,CAAC,KAAa;IACpC,IAAM,aAAa,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC;IAC5C,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;AACrC,CAAC;AAHD,gCAGC"}
@@ -0,0 +1,22 @@
import { HoverGesture } from '../../gestures/hover.mjs';
import { FocusGesture } from '../../gestures/focus.mjs';
import { PressGesture } from '../../gestures/press.mjs';
import { InViewFeature } from './viewport/index.mjs';
const gestureAnimations = {
inView: {
Feature: InViewFeature,
},
tap: {
Feature: PressGesture,
},
focus: {
Feature: FocusGesture,
},
hover: {
Feature: HoverGesture,
},
};
export { gestureAnimations };
//# sourceMappingURL=gestures.mjs.map
@@ -0,0 +1,29 @@
# ESLint Core
## Overview
This package is the future home of the rewritten, runtime-agnostic ESLint core.
Right now, it exports the core types necessary to implement language plugins.
## License
Apache 2.0
<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->
## Sponsors
The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).
<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="#"><img src="https://images.opencollective.com/aeriusventilations-org/avatar.png" alt="aeriusventilation's Org" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
@@ -0,0 +1,42 @@
//#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 __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
var __exportAll = (all, symbols) => {
let target = {};
for (var name in all) {
__defProp(target, name, {
get: all[name],
enumerable: true
});
}
if (symbols) {
__defProp(target, Symbol.toStringTag, { value: "Module" });
}
return target;
};
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
export { __exportAll as n, __toESM as r, __commonJSMin as t };
@@ -0,0 +1 @@
{"version":3,"file":"drumstick.js","sources":["../../../src/icons/drumstick.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Drumstick\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUuNCAxNS42M2E3Ljg3NSA2IDEzNSAxIDEgNi4yMy02LjIzIDQuNSAzLjQzIDEzNSAwIDAtNi4yMyA2LjIzIiAvPgogIDxwYXRoIGQ9Im04LjI5IDEyLjcxLTIuNiAyLjZhMi41IDIuNSAwIDEgMC0xLjY1IDQuNjVBMi41IDIuNSAwIDEgMCA4LjcgMTguM2wyLjU5LTIuNTkiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/drumstick\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Drumstick = createLucideIcon('Drumstick', [\n [\n 'path',\n { d: 'M15.4 15.63a7.875 6 135 1 1 6.23-6.23 4.5 3.43 135 0 0-6.23 6.23', key: '1dtqwm' },\n ],\n [\n 'path',\n {\n d: 'm8.29 12.71-2.6 2.6a2.5 2.5 0 1 0-1.65 4.65A2.5 2.5 0 1 0 8.7 18.3l2.59-2.59',\n key: '1oq1fw',\n },\n ],\n]);\n\nexport default Drumstick;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CACzF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,58 @@
import { F as FormatOptions } from './shared/confbox.9745c98f.js';
/**
* Converts a [JSON5](https://json5.org/) string into an object.
*
* @template T The type of the return value.
* @param text The string to parse as JSON5.
* @param options Parsing options.
* @returns The JavaScript value converted from the JSON5 string.
*/
declare function parseJSON5<T = unknown>(text: string, options?: JSON5ParseOptions): T;
/**
* Converts a JavaScript value to a [JSON5](https://json5.org/) string.
*
* @param value
* @param options
* @returns The JSON string converted from the JavaScript value.
*/
declare function stringifyJSON5(value: any, options?: JSON5StringifyOptions): string;
interface JSON5ParseOptions extends FormatOptions {
/**
* A function that alters the behavior of the parsing process, or an array of
* String and Number objects that serve as a allowlist for selecting/filtering
* the properties of the value object to be included in the resulting
* JavaScript object. If this value is null or not provided, all properties of
* the object are included in the resulting JavaScript object.
*/
reviver?: (this: any, key: string, value: any) => any;
}
interface JSON5StringifyOptions extends FormatOptions {
/**
* A function that alters the behavior of the stringification process, or an
* array of String and Number objects that serve as a allowlist for
* selecting/filtering the properties of the value object to be included in
* the JSON5 string. If this value is null or not provided, all properties
* of the object are included in the resulting JSON5 string.
*/
replacer?: ((this: any, key: string, value: any) => any) | null;
/**
* A String or Number object that's used to insert white space into the
* output JSON5 string for readability purposes. If this is a Number, it
* indicates the number of space characters to use as white space; this
* number is capped at 10 (if it is greater, the value is just 10). Values
* less than 1 indicate that no space should be used. If this is a String,
* the string (or the first 10 characters of the string, if it's longer than
* that) is used as white space. If this parameter is not provided (or is
* null), no white space is used. If white space is used, trailing commas
* will be used in objects and arrays.
*/
space?: string | number | null;
/**
* A String representing the quote character to use when serializing
* strings.
*/
quote?: string | null;
}
export { type JSON5ParseOptions, type JSON5StringifyOptions, parseJSON5, stringifyJSON5 };
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_5J","2":"_KM"},D:{"1":"_9L","2":"_tJ"},E:{"1":"_uC","2":"_BH"},F:{"1":"_TO","2":"_GM"},G:{"1":"_7B","2":"_XE"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_xB","2":"_3B"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:1,C:"BroadcastChannel",D:true};
@@ -0,0 +1,70 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
const slashCode = "/".charCodeAt(0);
const backslashCode = "\\".charCodeAt(0);
/**
* @param {string} path path
* @param {string} parent parent path
* @returns {boolean} true, if path is inside of parent
*/
const isInside = (path, parent) => {
if (!path.startsWith(parent)) return false;
if (path.length === parent.length) return true;
const charCode = path.charCodeAt(parent.length);
return charCode === slashCode || charCode === backslashCode;
};
module.exports = class RestrictionsPlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {Set<string | RegExp>} restrictions restrictions
*/
constructor(source, restrictions) {
this.source = source;
this.restrictions = restrictions;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
resolver
.getHook(this.source)
.tapAsync("RestrictionsPlugin", (request, resolveContext, callback) => {
if (typeof request.path === "string") {
const { path } = request;
for (const rule of this.restrictions) {
if (typeof rule === "string") {
if (!isInside(path, rule)) {
if (resolveContext.log) {
resolveContext.log(
`${path} is not inside of the restriction ${rule}`,
);
}
return callback(null, null);
}
} else if (!rule.test(path)) {
if (resolveContext.log) {
resolveContext.log(
`${path} doesn't match the restriction ${rule}`,
);
}
return callback(null, null);
}
}
}
callback();
});
}
};
@@ -0,0 +1,129 @@
# Connecting through a proxy
<!--type=misc-->
Connecting through a proxy is possible by:
- Using {ProxyAgent}.
- Configuring `Client` or `Pool` constructor.
The proxy url should be passed to the `Client` or `Pool` constructor, while the upstream server url
should be added to every request call in the `path`.
For instance, if you need to send a request to the `/hello` route of your upstream server,
the `path` should be `path: 'http://upstream.server:port/hello?foo=bar'`.
If you proxy requires basic authentication, you can send it via the `proxy-authorization` header.
### Connect without authentication
```js
import { Client } from 'undici'
import { createServer } from 'http'
import { createProxy } from 'proxy'
const server = await buildServer()
const proxyServer = await buildProxy()
const serverUrl = `http://localhost:${server.address().port}`
const proxyUrl = `http://localhost:${proxyServer.address().port}`
server.on('request', (req, res) => {
console.log(req.url) // '/hello?foo=bar'
res.setHeader('content-type', 'application/json')
res.end(JSON.stringify({ hello: 'world' }))
})
const client = new Client(proxyUrl)
const response = await client.request({
method: 'GET',
path: serverUrl + '/hello?foo=bar'
})
response.body.setEncoding('utf8')
let data = ''
for await (const chunk of response.body) {
data += chunk
}
console.log(response.statusCode) // 200
console.log(JSON.parse(data)) // { hello: 'world' }
server.close()
proxyServer.close()
client.close()
function buildServer () {
return new Promise((resolve, reject) => {
const server = createServer()
server.listen(0, () => resolve(server))
})
}
function buildProxy () {
return new Promise((resolve, reject) => {
const server = createProxy(createServer())
server.listen(0, () => resolve(server))
})
}
```
### Connect with authentication
```js
import { Client } from 'undici'
import { createServer } from 'http'
import { createProxy } from 'proxy'
const server = await buildServer()
const proxyServer = await buildProxy()
const serverUrl = `http://localhost:${server.address().port}`
const proxyUrl = `http://localhost:${proxyServer.address().port}`
proxyServer.authenticate = function (req) {
return req.headers['proxy-authorization'] === `Basic ${Buffer.from('user:pass').toString('base64')}`
}
server.on('request', (req, res) => {
console.log(req.url) // '/hello?foo=bar'
res.setHeader('content-type', 'application/json')
res.end(JSON.stringify({ hello: 'world' }))
})
const client = new Client(proxyUrl)
const response = await client.request({
method: 'GET',
path: serverUrl + '/hello?foo=bar',
headers: {
'proxy-authorization': `Basic ${Buffer.from('user:pass').toString('base64')}`
}
})
response.body.setEncoding('utf8')
let data = ''
for await (const chunk of response.body) {
data += chunk
}
console.log(response.statusCode) // 200
console.log(JSON.parse(data)) // { hello: 'world' }
server.close()
proxyServer.close()
client.close()
function buildServer () {
return new Promise((resolve, reject) => {
const server = createServer()
server.listen(0, () => resolve(server))
})
}
function buildProxy () {
return new Promise((resolve, reject) => {
const server = createProxy(createServer())
server.listen(0, () => resolve(server))
})
}
```
@@ -0,0 +1,60 @@
/**
* Example MCP server using Hono with WebStandardStreamableHTTPServerTransport
*
* This example demonstrates using the Web Standard transport directly with Hono,
* which works on any runtime: Node.js, Cloudflare Workers, Deno, Bun, etc.
*
* Run with: npx tsx src/examples/server/honoWebStandardStreamableHttp.ts
*/
import { Hono } from 'hono';
import { cors } from 'hono/cors';
import { serve } from '@hono/node-server';
import * as z from 'zod/v4';
import { McpServer } from '../../server/mcp.js';
import { WebStandardStreamableHTTPServerTransport } from '../../server/webStandardStreamableHttp.js';
// Factory function to create a new MCP server per request (stateless mode)
const getServer = () => {
const server = new McpServer({
name: 'hono-webstandard-mcp-server',
version: '1.0.0'
});
// Register a simple greeting tool
server.registerTool('greet', {
title: 'Greeting Tool',
description: 'A simple greeting tool',
inputSchema: { name: z.string().describe('Name to greet') }
}, async ({ name }) => {
return {
content: [{ type: 'text', text: `Hello, ${name}! (from Hono + WebStandard transport)` }]
};
});
return server;
};
// Create the Hono app
const app = new Hono();
// Enable CORS for all origins
app.use('*', cors({
origin: '*',
allowMethods: ['GET', 'POST', 'DELETE', 'OPTIONS'],
allowHeaders: ['Content-Type', 'mcp-session-id', 'Last-Event-ID', 'mcp-protocol-version'],
exposeHeaders: ['mcp-session-id', 'mcp-protocol-version']
}));
// Health check endpoint
app.get('/health', c => c.json({ status: 'ok' }));
// MCP endpoint - create a fresh transport and server per request (stateless)
app.all('/mcp', async (c) => {
const transport = new WebStandardStreamableHTTPServerTransport();
const server = getServer();
await server.connect(transport);
return transport.handleRequest(c.req.raw);
});
// Start the server
const PORT = process.env.MCP_PORT ? parseInt(process.env.MCP_PORT, 10) : 3000;
console.log(`Starting Hono MCP server on port ${PORT}`);
console.log(`Health check: http://localhost:${PORT}/health`);
console.log(`MCP endpoint: http://localhost:${PORT}/mcp`);
serve({
fetch: app.fetch,
port: PORT
});
//# sourceMappingURL=honoWebStandardStreamableHttp.js.map
@@ -0,0 +1,18 @@
import { IBackOffOptions } from "../options";
import { SkipFirstDelay } from "./skip-first/skip-first.delay";
import { AlwaysDelay } from "./always/always.delay";
import { IDelay } from "./delay.interface";
export function DelayFactory(options: IBackOffOptions, attempt: number): IDelay {
const delay = initDelayClass(options);
delay.setAttemptNumber(attempt);
return delay;
}
function initDelayClass(options: IBackOffOptions) {
if (!options.delayFirstAttempt) {
return new SkipFirstDelay(options);
}
return new AlwaysDelay(options);
}
@@ -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
@@ -0,0 +1 @@
module.exports={C:{"5":0.05989,"32":0.00461,"52":0.00921,"78":0.00461,"115":0.10135,"116":0.00461,"120":0.05528,"121":0.11057,"128":0.00461,"131":0.00461,"133":0.00461,"135":0.00461,"136":0.00921,"140":0.01382,"144":0.00461,"146":0.00461,"147":0.00461,"149":0.00461,"150":0.01843,"151":0.00921,"152":0.01382,"153":0.01382,"154":0.1336,"155":0.31788,"156":0.29946,"157":0.00461,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 117 118 119 122 123 124 125 126 127 129 130 132 134 137 138 139 141 142 143 145 148 158 159 160 3.5 3.6"},D:{"45":0.00461,"48":0.03686,"49":0.00921,"53":0.03686,"55":0.00461,"57":0.00461,"58":0.00461,"60":0.01382,"63":0.01382,"65":0.00461,"67":0.00921,"68":0.00461,"69":0.03225,"70":0.13821,"71":0.00461,"72":0.00461,"73":0.00921,"75":0.00461,"78":0.01843,"79":0.07371,"80":0.02304,"81":0.00461,"83":0.02764,"85":0.00461,"86":0.06911,"87":0.03225,"88":0.00461,"89":0.00921,"90":0.00461,"91":0.01843,"92":0.03225,"93":0.00461,"94":0.00461,"95":0.00461,"96":0.01382,"97":0.08293,"98":0.02764,"99":0.03686,"100":0.03225,"101":0.11518,"102":0.02764,"103":0.28563,"104":0.26721,"105":0.27181,"106":0.27642,"107":0.29485,"108":0.36856,"109":0.84769,"110":0.26721,"111":0.27181,"112":0.30867,"113":0.00921,"114":0.02764,"115":0.11057,"116":0.5252,"117":0.27181,"118":0.07371,"119":0.16125,"120":0.42845,"121":0.09675,"122":0.03225,"123":0.05528,"124":0.30867,"125":0.18889,"126":0.11518,"127":0.02764,"128":0.10596,"129":0.01382,"130":0.11518,"131":0.54363,"132":0.129,"133":0.54363,"134":0.0645,"135":0.23496,"136":0.02304,"137":0.10135,"138":0.2626,"139":0.04146,"140":0.17507,"141":0.29946,"142":0.09214,"143":0.08293,"144":2.50621,"145":0.02304,"146":0.44227,"147":0.18889,"148":0.88915,"149":0.35474,"150":0.44227,"151":1.32682,"152":1.7783,"153":1.3821,"154":0.19349,"155":0.02764,"156":0.01843,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 50 51 52 54 56 59 61 62 64 66 74 76 77 84 157"},F:{"95":0.00461,"116":0.00461,"117":0.00461,"121":0.00461,"131":0.02764,"135":0.00461,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 118 119 120 122 123 124 125 126 127 132 133 134 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.01382,"89":0.00461,"90":0.00461,"92":0.09675,"100":0.02304,"102":0.00461,"106":0.02764,"107":0.01843,"108":0.00461,"109":0.09214,"110":0.00921,"111":0.00921,"112":0.00921,"113":0.03225,"114":0.02764,"115":0.00921,"116":0.02764,"117":0.01843,"118":0.01843,"119":0.07371,"120":0.1981,"121":0.02304,"122":0.0645,"123":0.03686,"124":0.01843,"125":0.01843,"126":0.04607,"127":0.0645,"128":0.03225,"129":0.03686,"130":0.04146,"131":0.08293,"132":0.04607,"133":0.07371,"134":0.05068,"135":0.05989,"136":0.05989,"137":0.05528,"138":0.10135,"139":0.0645,"140":0.11057,"141":0.08753,"142":0.08753,"143":0.11978,"144":0.07371,"145":0.07832,"146":0.10135,"147":0.11057,"148":0.13821,"149":0.19349,"150":0.29485,"151":0.63577,"152":4.57936,"153":4.98938,"154":1.14254,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 91 93 94 95 96 97 98 99 101 103 104 105"},E:{"13":0.00461,"14":0.01382,"15":0.00461,"27":0.05068,_:"4 5 6 7 8 9 10 11 12 3.1 3.2 5.1 6.1 7.1 9.1 10.1 16.0 27.1 27.2 TP","11.1":0.00461,"12.1":0.00921,"13.1":0.01382,"14.1":0.03225,"15.1":0.00461,"15.2-15.3":0.00461,"15.4":0.00921,"15.5":0.00921,"15.6":0.04607,"16.1":0.01382,"16.2":0.00921,"16.3":0.01382,"16.4":0.00461,"16.5":0.00921,"16.6":0.0645,"17.0":0.00461,"17.1":0.04146,"17.2":0.00461,"17.3":0.00461,"17.4":0.00921,"17.5":0.01843,"17.6":0.05068,"18.0":0.00921,"18.1":0.00921,"18.2":0.00461,"18.3":0.02304,"18.4":0.00461,"18.5-18.7":0.02764,"26.0":0.01382,"26.1":0.01382,"26.2":0.03225,"26.3":0.04607,"26.4":0.03225,"26.5":0.11518,"26.6":0.46531},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00137,"5.0-5.1":0.00137,"6.0-6.1":0,"7.0-7.1":0.00275,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01374,"11.0-11.2":0.00137,"11.3-11.4":0.00275,"12.0-12.1":0,"12.2-12.5":0.03571,"13.0-13.1":0,"13.2":0.00687,"13.3":0,"13.4-13.7":0.00137,"14.0-14.4":0.00549,"14.5-14.8":0.00824,"15.0-15.1":0.00824,"15.2-15.3":0.00549,"15.4":0.00687,"15.5":0.00824,"15.6-15.8":0.17857,"16.0":0.01374,"16.1":0.02472,"16.2":0.01374,"16.3":0.03022,"16.4":0.00687,"16.5":0.01099,"16.6-16.7":0.24862,"17.0":0.00962,"17.1":0.01374,"17.2":0.01374,"17.3":0.0206,"17.4":0.02885,"17.5":0.05632,"17.6-17.7":0.1456,"18.0":0.03022,"18.1":0.06044,"18.2":0.08242,"18.3":0.1428Line truncated
@@ -0,0 +1,569 @@
flf2a$ 5 4 20 0 16
Font : Dr. Pepper (after a name in one sig done in this style).
Author: Eero Tamminen, t150315@cc.tut.fi.
Characters '#' and '&' are lousy and I'm not very satisfied
with the '$' or 't'... Suggestions?
Explanation of first line:
flf2 - "magic number" for file identifiction
a - should always be `a', for now
$ - the "hardblank" -- prints s a blank, but can't be smushed
5 - height of a character
4 - height of a character, not including descenders
20 - max line length (excluding comment lines) + fudge factor
0 - default smushmode for this font
16 - number of comment lines
$@
$@
$@
$@
$@@
_ @
| |@
|_/@
<_>@
@@
_ _@
|/|/@
@
@
@@
@
$_|_|_$@
$_|_|_$@
| | @
@@
@
||_@
<_-<@
/__/@
|| @@
__@
<>/ /@
/ / @
/_/<>@
@@
_ @
< > @
/.\/$@
\_/\$@
@@
_@
|/@
@
@
@@
__@
/ /@
| | @
| | @
\_\@@
__ @
\ \ @
| |@
| |@
/_/ @@
@
_/\_@
> <@
\/ @
@@
_ @
_| |_ @
|_ _|@
|_| @
@@
@
@
_@
|/@
@@
@
___ @
|___|@
@
@@
@
@
_ @
<_>@
@@
__@
/ /@
/ / @
/_/ @
@@
___ @
| |@
| / |@
`___'@
@@
_ @
/ |@
| |@
|_|@
@@
___ @
<_ >@
/ / @
<___>@
@@
____@
<__ /@
<_ \@
<___/@
@@
__ @
/. | @
/_ .|@
|_| @
@@
___ @
| __|@
`__ \@
|___/@
@@
___ @
| __>@
| . \@
`___/@
@@
___ @
|_ |@
/ / @
/_/ @
@@
___ @
< . >@
/ . \@
\___/@
@@
___ @
| . |@
`_ /@
/_/ @
@@
_ @
<_>@
_ @
<_>@
@@
_ @
<_>@
_ @
|/ @
@@
__@
/ /@
< < @
\_\@
@@
___ @
|___|@
___ @
|___|@
@@
__ @
\ \ @
> >@
/_/ @
@@
___ @
<_. >@
/_/ @
<_> @
@@
___ @
| "|@
| \_|@
`___/@
@@
___ @
| . |@
| |@
|_|_|@
@@
___ @
| . >@
| . \@
|___/@
@@
___ @
| _>@
| <__@
`___/@
@@
___ @
| . \@
| | |@
|___/@
@@
___ @
| __>@
| _> @
|___>@
@@
___ @
| __>@
| _> @
|_| @
@@
___ @
/ _> @
| <_/\@
`____/@
@@
_ _ @
| | |@
| |@
|_|_|@
@@
_ @
| |@
| |@
|_|@
@@
_ @
| |@
_| |@
\__/@
@@
_ __@
| / /@
| \ @
|_\_\@
@@
_ @
| | @
| |_ @
|___|@
@@
__ __ @
| \ \@
| |@
|_|_|_|@
@@
_ _ @
| \ |@
| |@
|_\_|@
@@
___ @
| . |@
| | |@
`___'@
@@
___ @
| . \@
| _/@
|_| @
@@
___ @
| . |@
| | |@
`___\@
@@
___ @
| . \@
| /@
|_\_\@
@@
___ @
/ __>@
\__ \@
<___/@
@@
___ @
|_ _|@
| | @
|_| @
@@
_ _ @
| | |@
| ' |@
`___'@
@@
_ _ @
| | |@
| ' |@
|__/ @
@@
_ _ _ @
| | | |@
| | | |@
|__/_/ @
@@
__ _$@
\ \/ @
\ \ @
_/\_\ @
@@
_ _ @
| | |@
\ /@
|_| @
@@
____@
|_ /@
/ / @
/___|@
@@
___ @
| _|@
| | @
| |_ @
|___|@@
__ @
\ \ @
\ \ @
\_\@
@@
___ @
|_ |@
| |@
_| |@
|___|@@
/\ @
</\>@
@
@
@@
@
@
___ @
|___|@
@@
_ @
\|@
@
@
@@
@
___ @
<_> |@
<___|@
@@
_ @
| |_ @
| . \@
|___/@
@@
@
___ @
/ | '@
\_|_.@
@@
_ @
_| |@
/ . |@
\___|@
@@
@
___ @
/ ._>@
\___.@
@@
___ @
| | '@
| |- @
|_| @
@@
@
___ @
/ . |@
\_. |@
<___'@@
_ @
| |_ @
| . |@
|_|_|@
@@
_ @
<_>@
| |@
|_|@
@@
_ @
<_>@
| |@
| |@
<__'@@
_ @
| |__@
| / /@
|_\_\@
@@
_ @
| |@
| |@
|_|@
@@
@
._ _ _ @
| ' ' |@
|_|_|_|@
@@
@
._ _ @
| ' |@
|_|_|@
@@
@
___ @
/ . \@
\___/@
@@
@
___ @
| . \@
| _/@
|_| @@
@
___ @
/ . |@
\_ |@
|_|@@
@
_ _ @
| '_>@
|_| @
@@
@
___@
<_-<@
/__/@
@@
_ @
$_| |_$@
| | @
|_| @
@@
@
_ _ @
| | |@
`___|@
@@
@
_ _ @
| | |@
|__/ @
@@
@
_ _ _ @
| | | |@
|__/_/ @
@@
@
__ @
\ \/@
/\_\@
@@
@
_ _ @
| | |@
`_. |@
<___'@@
@
.___@
/ /@
/___@
@@
__@
/ /@
/ | @
\ | @
\_\@@
||@
||@
||@
||@
@@
__ @
\ \ @
| \@
| /@
/_/ @@
@
/\/|@
|/\/ @
@
@@
<>_<>@
| . |@
| |@
|_|_|@
@@
<>_<>@
| . |@
| | |@
`___'@
@@
<>_<>@
| | |@
| ' |@
`___'@
@@
@
<>_<>@
`_> |@
<___|@
@@
@
<>_<>@
/ . \@
\___/@
@@
@
<>_<>@
| | |@
`___|@
@@
___ @
| . >@
| . \@
| ._/@
|_| @@
196
<>_<>@
| . |@
| |@
|_|_|@
@@
214
<>_<>@
| . |@
| | |@
`___'@
@@
220
<>_<>@
| | |@
| ' |@
`___'@
@@
223
___ @
| . >@
| . \@
| ._/@
|_| @@
228
@
<>_<>@
`_> |@
<___|@
@@
246
@
<>_<>@
/ . \@
\___/@
@@
252
@
<>_<>@
| | |@
`___|@
@@
@@ -0,0 +1,62 @@
{
"name": "@eslint/object-schema",
"version": "3.0.5",
"description": "An object schema merger/validator",
"type": "module",
"main": "dist/esm/index.js",
"types": "dist/esm/index.d.ts",
"exports": {
"require": {
"types": "./dist/cjs/index.d.cts",
"default": "./dist/cjs/index.cjs"
},
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
}
},
"files": [
"dist"
],
"publishConfig": {
"access": "public"
},
"directories": {
"test": "tests"
},
"scripts": {
"build:dedupe-types": "node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js",
"build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts",
"build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts",
"lint:types": "attw --pack",
"pretest": "npm run build",
"test": "npm run test:types && npm run test:unit",
"test:coverage": "c8 npm run test:unit",
"test:jsr": "npx -y jsr@latest publish --dry-run",
"test:types": "tsc -p tests/types/tsconfig.json",
"test:unit": "mocha \"tests/**/*.test.js\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/eslint/rewrite.git",
"directory": "packages/object-schema"
},
"keywords": [
"object",
"validation",
"schema",
"merge"
],
"author": "Nicholas C. Zakas",
"license": "Apache-2.0",
"bugs": {
"url": "https://github.com/eslint/rewrite/issues"
},
"homepage": "https://github.com/eslint/rewrite/tree/main/packages/object-schema#readme",
"devDependencies": {
"rollup-plugin-copy": "^3.5.0"
},
"engines": {
"node": "^20.19.0 || ^22.13.0 || >=24"
}
}
@@ -0,0 +1,103 @@
import * as _radix_ui_react_context from '@radix-ui/react-context';
import * as React from 'react';
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
import { FocusScope } from '@radix-ui/react-focus-scope';
import { Portal as Portal$1 } from '@radix-ui/react-portal';
import { Primitive } from '@radix-ui/react-primitive';
declare const createDialogScope: _radix_ui_react_context.CreateScope;
interface DialogProps {
children?: React.ReactNode;
open?: boolean;
defaultOpen?: boolean;
onOpenChange?(open: boolean): void;
modal?: boolean;
}
declare const Dialog: React.FC<DialogProps>;
type PrimitiveButtonProps = React.ComponentPropsWithoutRef<typeof Primitive.button>;
interface DialogTriggerProps extends PrimitiveButtonProps {
}
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
interface DialogPortalProps {
children?: React.ReactNode;
/**
* Specify a container element to portal the content into.
*/
container?: PortalProps['container'];
/**
* Used to force mounting when more control is needed. Useful when
* controlling animation with React animation libraries.
*/
forceMount?: true;
}
declare const DialogPortal: React.FC<DialogPortalProps>;
interface DialogOverlayProps extends DialogOverlayImplProps {
/**
* Used to force mounting when more control is needed. Useful when
* controlling animation with React animation libraries.
*/
forceMount?: true;
}
declare const DialogOverlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
type PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;
interface DialogOverlayImplProps extends PrimitiveDivProps {
}
interface DialogContentProps extends DialogContentTypeProps {
/**
* Used to force mounting when more control is needed. Useful when
* controlling animation with React animation libraries.
*/
forceMount?: true;
}
declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
interface DialogContentTypeProps extends Omit<DialogContentImplProps, 'trapFocus' | 'disableOutsidePointerEvents'> {
}
type DismissableLayerProps = React.ComponentPropsWithoutRef<typeof DismissableLayer>;
type FocusScopeProps = React.ComponentPropsWithoutRef<typeof FocusScope>;
interface DialogContentImplProps extends Omit<DismissableLayerProps, 'onDismiss'> {
/**
* When `true`, focus cannot escape the `Content` via keyboard,
* pointer, or a programmatic focus.
* @defaultValue false
*/
trapFocus?: FocusScopeProps['trapped'];
/**
* Event handler called when auto-focusing on open.
* Can be prevented.
*/
onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];
/**
* Event handler called when auto-focusing on close.
* Can be prevented.
*/
onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];
}
type PrimitiveHeading2Props = React.ComponentPropsWithoutRef<typeof Primitive.h2>;
interface DialogTitleProps extends PrimitiveHeading2Props {
}
declare const DialogTitle: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
type PrimitiveParagraphProps = React.ComponentPropsWithoutRef<typeof Primitive.p>;
interface DialogDescriptionProps extends PrimitiveParagraphProps {
}
declare const DialogDescription: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
interface DialogCloseProps extends PrimitiveButtonProps {
}
declare const DialogClose: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
declare const WarningProvider: React.FC<{
contentName: string;
titleName: string;
docsSlug: string;
} & {
children: React.ReactNode;
}>;
declare const Root: React.FC<DialogProps>;
declare const Trigger: React.ForwardRefExoticComponent<DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
declare const Portal: React.FC<DialogPortalProps>;
declare const Overlay: React.ForwardRefExoticComponent<DialogOverlayProps & React.RefAttributes<HTMLDivElement>>;
declare const Content: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
declare const Title: React.ForwardRefExoticComponent<DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
declare const Description: React.ForwardRefExoticComponent<DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
declare const Close: React.ForwardRefExoticComponent<DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
export { Close, Content, Description, Dialog, DialogClose, type DialogCloseProps, DialogContent, type DialogContentProps, DialogDescription, type DialogDescriptionProps, DialogOverlay, type DialogOverlayProps, DialogPortal, type DialogPortalProps, type DialogProps, DialogTitle, type DialogTitleProps, DialogTrigger, type DialogTriggerProps, Overlay, Portal, Root, Title, Trigger, WarningProvider, createDialogScope };
@@ -0,0 +1,63 @@
'use strict';
var callBind = require('../');
var hasStrictMode = require('has-strict-mode')();
var forEach = require('for-each');
var inspect = require('object-inspect');
var v = require('es-value-fixtures');
var test = require('tape');
test('callBindBasic', function (t) {
forEach(v.nonFunctions, function (nonFunction) {
t['throws'](
// @ts-expect-error
function () { callBind([nonFunction]); },
TypeError,
inspect(nonFunction) + ' is not a function'
);
});
var sentinel = { sentinel: true };
/** @type {<T, A extends number, B extends number>(this: T, a: A, b: B) => [T | undefined, A, B]} */
var func = function (a, b) {
// eslint-disable-next-line no-invalid-this
return [!hasStrictMode && this === global ? undefined : this, a, b];
};
t.equal(func.length, 2, 'original function length is 2');
/** type {(thisArg: unknown, a: number, b: number) => [unknown, number, number]} */
var bound = callBind([func]);
/** type {((a: number, b: number) => [typeof sentinel, typeof a, typeof b])} */
var boundR = callBind([func, sentinel]);
/** type {((b: number) => [typeof sentinel, number, typeof b])} */
var boundArg = callBind([func, sentinel, /** @type {const} */ (1)]);
// @ts-expect-error
t.deepEqual(bound(), [undefined, undefined, undefined], 'bound func with no args');
// @ts-expect-error
t.deepEqual(func(), [undefined, undefined, undefined], 'unbound func with too few args');
// @ts-expect-error
t.deepEqual(bound(1, 2), [hasStrictMode ? 1 : Object(1), 2, undefined], 'bound func too few args');
// @ts-expect-error
t.deepEqual(boundR(), [sentinel, undefined, undefined], 'bound func with receiver, with too few args');
// @ts-expect-error
t.deepEqual(boundArg(), [sentinel, 1, undefined], 'bound func with receiver and arg, with too few args');
t.deepEqual(func(1, 2), [undefined, 1, 2], 'unbound func with right args');
t.deepEqual(bound(1, 2, 3), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with right args');
t.deepEqual(boundR(1, 2), [sentinel, 1, 2], 'bound func with receiver, with right args');
t.deepEqual(boundArg(2), [sentinel, 1, 2], 'bound func with receiver and arg, with right arg');
// @ts-expect-error
t.deepEqual(func(1, 2, 3), [undefined, 1, 2], 'unbound func with too many args');
// @ts-expect-error
t.deepEqual(bound(1, 2, 3, 4), [hasStrictMode ? 1 : Object(1), 2, 3], 'bound func with too many args');
// @ts-expect-error
t.deepEqual(boundR(1, 2, 3), [sentinel, 1, 2], 'bound func with receiver, with too many args');
// @ts-expect-error
t.deepEqual(boundArg(2, 3), [sentinel, 1, 2], 'bound func with receiver and arg, with too many args');
t.end();
});
@@ -0,0 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.stripTrailingSlashes = void 0;
// warning: extremely hot code path.
// This has been meticulously optimized for use
// within npm install on large package trees.
// Do not edit without careful benchmarking.
const stripTrailingSlashes = (str) => {
let i = str.length - 1;
let slashesStart = -1;
while (i > -1 && str.charAt(i) === '/') {
slashesStart = i;
i--;
}
return slashesStart === -1 ? str : str.slice(0, slashesStart);
};
exports.stripTrailingSlashes = stripTrailingSlashes;
//# sourceMappingURL=strip-trailing-slashes.js.map
@@ -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 <danilo.sampaio@gmail.com> (localhost:8080)",
"Fede Ramirez <i@2fd.me> (https://2fd.github.io)",
"Joe Hildebrand <joe-github@cursive.net> (https://twitter.com/hildjj)",
"Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)",
"Todd Kennedy (https://tck.io)",
"Waldemar Reusch (https://github.com/lordvlad)",
"Wolfgang Faust (http://www.linestarve.com)",
"Zach Hale <zachhale@gmail.com> (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"
]
}
}
@@ -0,0 +1,21 @@
import { parseDef } from "../parseDef.js";
import { parseAnyDef } from "./any.js";
export const parseOptionalDef = (def, refs) => {
if (refs.currentPath.toString() === refs.propertyPath?.toString()) {
return parseDef(def.innerType._def, refs);
}
const innerSchema = parseDef(def.innerType._def, {
...refs,
currentPath: [...refs.currentPath, "anyOf", "1"],
});
return innerSchema
? {
anyOf: [
{
not: parseAnyDef(refs),
},
innerSchema,
],
}
: parseAnyDef(refs);
};
@@ -0,0 +1 @@
export default function formatMessage(message: any[], callback?: (value: string) => string): string;
@@ -0,0 +1,9 @@
/**
* Type-checked examples for {@link registerAppTool `registerAppTool`} and {@link registerAppResource `registerAppResource`}.
*
* These examples are included in the API documentation via `@includeCode` tags.
* Each function's region markers define the code snippet that appears in the docs.
*
* @module
*/
export {};
@@ -0,0 +1,35 @@
{
"name": "@babel/traverse",
"version": "7.29.7",
"description": "The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-traverse",
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20traverse%22+is%3Aopen",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-traverse"
},
"main": "./lib/index.js",
"dependencies": {
"@babel/code-frame": "^7.29.7",
"@babel/generator": "^7.29.7",
"@babel/helper-globals": "^7.29.7",
"@babel/parser": "^7.29.7",
"@babel/template": "^7.29.7",
"@babel/types": "^7.29.7",
"debug": "^4.3.1"
},
"devDependencies": {
"@babel/core": "^7.29.7",
"@babel/helper-plugin-test-runner": "^7.29.7"
},
"engines": {
"node": ">=6.9.0"
},
"type": "commonjs"
}
@@ -0,0 +1,647 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
const getWrappedCode_1 = require("../util/getWrappedCode");
const isMemberAccessLike = (0, util_1.isNodeOfTypes)([
utils_1.AST_NODE_TYPES.ChainExpression,
utils_1.AST_NODE_TYPES.Identifier,
utils_1.AST_NODE_TYPES.MemberExpression,
]);
const isNullLiteralOrUndefinedIdentifier = (node) => (0, util_1.isNullLiteral)(node) || (0, util_1.isUndefinedIdentifier)(node);
const isNodeNullishComparison = (node) => isNullLiteralOrUndefinedIdentifier(node.left) &&
isNullLiteralOrUndefinedIdentifier(node.right);
exports.default = (0, util_1.createRule)({
name: 'prefer-nullish-coalescing',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce using the nullish coalescing operator instead of logical assignments or chaining',
recommended: 'stylistic',
requiresTypeChecking: true,
},
hasSuggestions: true,
messages: {
noStrictNullCheck: 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.',
preferNullishOverAssignment: 'Prefer using nullish coalescing operator (`??{{ equals }}`) instead of an assignment expression, as it is simpler to read.',
preferNullishOverOr: 'Prefer using nullish coalescing operator (`??{{ equals }}`) instead of a logical {{ description }} (`||{{ equals }}`), as it is a safer operator.',
preferNullishOverTernary: 'Prefer using nullish coalescing operator (`??{{ equals }}`) instead of a ternary expression, as it is simpler to read.',
suggestNullish: 'Fix to nullish coalescing operator (`??{{ equals }}`).',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: {
type: 'boolean',
description: 'Unless this is set to `true`, the rule will error on every file whose `tsconfig.json` does _not_ have the `strictNullChecks` compiler option (or `strict`) set to `true`.',
},
ignoreBooleanCoercion: {
type: 'boolean',
description: 'Whether to ignore arguments to the `Boolean` constructor',
},
ignoreConditionalTests: {
type: 'boolean',
description: 'Whether to ignore cases that are located within a conditional test.',
},
ignoreIfStatements: {
type: 'boolean',
description: 'Whether to ignore any if statements that could be simplified by using the nullish coalescing operator.',
},
ignoreMixedLogicalExpressions: {
type: 'boolean',
description: 'Whether to ignore any logical or expressions that are part of a mixed logical expression (with `&&`).',
},
ignorePrimitives: {
description: 'Whether to ignore all (`true`) or some (an object with properties) primitive types.',
oneOf: [
{
type: 'object',
additionalProperties: false,
description: 'Which primitives types may be ignored.',
properties: {
bigint: {
type: 'boolean',
description: 'Ignore bigint primitive types.',
},
boolean: {
type: 'boolean',
description: 'Ignore boolean primitive types.',
},
number: {
type: 'boolean',
description: 'Ignore number primitive types.',
},
string: {
type: 'boolean',
description: 'Ignore string primitive types.',
},
},
},
{
type: 'boolean',
description: 'Ignore all primitive types.',
enum: [true],
},
],
},
ignoreTernaryTests: {
type: 'boolean',
description: 'Whether to ignore any ternary expressions that could be simplified by using the nullish coalescing operator.',
},
},
},
],
},
defaultOptions: [
{
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
ignoreBooleanCoercion: false,
ignoreConditionalTests: true,
ignoreIfStatements: false,
ignoreMixedLogicalExpressions: false,
ignorePrimitives: {
bigint: false,
boolean: false,
number: false,
string: false,
},
ignoreTernaryTests: false,
},
],
create(context, [{ allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing, ignoreBooleanCoercion, ignoreConditionalTests, ignoreIfStatements, ignoreMixedLogicalExpressions, ignorePrimitives, ignoreTernaryTests, },]) {
const parserServices = (0, util_1.getParserServices)(context);
const compilerOptions = parserServices.program.getCompilerOptions();
const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled(compilerOptions, 'strictNullChecks');
if (!isStrictNullChecks &&
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true) {
context.report({
loc: {
start: { column: 0, line: 0 },
end: { column: 0, line: 0 },
},
messageId: 'noStrictNullCheck',
});
}
/**
* Checks whether a type tested for truthiness is eligible for conversion to
* a nullishness check, taking into account the rule's configuration.
*/
function isTypeEligibleForPreferNullish(type) {
if (!(0, util_1.isNullableType)(type)) {
return false;
}
const ignorableFlags = [
/* eslint-disable @typescript-eslint/no-non-null-assertion */
(ignorePrimitives === true || ignorePrimitives.bigint) &&
ts.TypeFlags.BigIntLike,
(ignorePrimitives === true || ignorePrimitives.boolean) &&
ts.TypeFlags.BooleanLike,
(ignorePrimitives === true || ignorePrimitives.number) &&
ts.TypeFlags.NumberLike,
(ignorePrimitives === true || ignorePrimitives.string) &&
ts.TypeFlags.StringLike,
/* eslint-enable @typescript-eslint/no-non-null-assertion */
]
.filter((flag) => typeof flag === 'number')
.reduce((previous, flag) => previous | flag, 0);
if (ignorableFlags === 0) {
// any types are eligible for conversion.
return true;
}
// if the type is `any` or `unknown` we can't make any assumptions
// about the value, so it could be any primitive, even though the flags
// won't be set.
//
// technically, this is true of `void` as well, however, it's a TS error
// to test `void` for truthiness, so we don't need to bother checking for
// it in valid code.
if (tsutils.isTypeFlagSet(type, ts.TypeFlags.Any | ts.TypeFlags.Unknown)) {
return false;
}
if (tsutils
.typeConstituents(type)
.some(t => tsutils
.intersectionConstituents(t)
.some(t => tsutils.isTypeFlagSet(t, ignorableFlags)))) {
return false;
}
return true;
}
/**
* Determines whether a control flow construct that uses the truthiness of
* a test expression is eligible for conversion to the nullish coalescing
* operator, taking into account (both dependent on the rule's configuration):
* 1. Whether the construct is in a permitted syntactic context
* 2. Whether the type of the test expression is deemed eligible for
* conversion
*
* @param node The overall node to be converted (e.g. `a || b` or `a ? a : b`)
* @param testNode The node being tested (i.e. `a`)
*/
function isTruthinessCheckEligibleForPreferNullish({ node, testNode, }) {
const testType = parserServices.getTypeAtLocation(testNode);
if (!isTypeEligibleForPreferNullish(testType)) {
return false;
}
if (ignoreConditionalTests === true && isConditionalTest(node)) {
return false;
}
if (ignoreBooleanCoercion === true &&
isBooleanConstructorContext(node, context) &&
!(node.type === utils_1.AST_NODE_TYPES.ConditionalExpression &&
node.parent.type === utils_1.AST_NODE_TYPES.CallExpression)) {
return false;
}
return true;
}
function checkAndFixWithPreferNullishOverOr(node, description, equals) {
if (!isTruthinessCheckEligibleForPreferNullish({
node,
testNode: node.left,
})) {
return;
}
if (ignoreMixedLogicalExpressions === true &&
isMixedLogicalExpression(node)) {
return;
}
const barBarOperator = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.left, token => token.type === utils_1.AST_TOKEN_TYPES.Punctuator &&
token.value === node.operator), util_1.NullThrowsReasons.MissingToken('operator', node.type));
function* fix(fixer) {
if ((0, util_1.isLogicalOrOperator)(node.parent)) {
// '&&' and '??' operations cannot be mixed without parentheses (e.g. a && b ?? c)
if (node.left.type === utils_1.AST_NODE_TYPES.LogicalExpression &&
!(0, util_1.isLogicalOrOperator)(node.left.left)) {
yield fixer.insertTextBefore(node.left.right, '(');
}
else {
yield fixer.insertTextBefore(node.left, '(');
}
yield fixer.insertTextAfter(node.right, ')');
}
yield fixer.replaceText(barBarOperator, node.operator.replace('||', '??'));
}
context.report({
node: barBarOperator,
messageId: 'preferNullishOverOr',
data: { description, equals },
suggest: [
{
messageId: 'suggestNullish',
data: { equals },
fix,
},
],
});
}
function getNullishCoalescingParams(node, nonNullishNode, nodesInsideTestExpression, operator) {
let nullishCoalescingLeftNode;
let hasTruthinessCheck = false;
let hasNullCheckWithoutTruthinessCheck = false;
let hasUndefinedCheckWithoutTruthinessCheck = false;
if (!nodesInsideTestExpression.length) {
hasTruthinessCheck = true;
nullishCoalescingLeftNode =
node.test.type === utils_1.AST_NODE_TYPES.UnaryExpression
? node.test.argument
: node.test;
if (!areNodesSimilarMemberAccess(nullishCoalescingLeftNode, nonNullishNode)) {
return { isFixable: false };
}
}
else {
// we check that the test only contains null, undefined and the identifier
for (const testNode of nodesInsideTestExpression) {
if ((0, util_1.isNullLiteral)(testNode)) {
hasNullCheckWithoutTruthinessCheck = true;
}
else if ((0, util_1.isUndefinedIdentifier)(testNode)) {
hasUndefinedCheckWithoutTruthinessCheck = true;
}
else if (areNodesSimilarMemberAccess(testNode, nonNullishNode)) {
// Only consider the first expression in a multi-part nullish check,
// as subsequent expressions might not require all the optional chaining operators.
// For example: a?.b?.c !== undefined && a.b.c !== null ? a.b.c : 'foo';
// This works because `node.test` is always evaluated first in the loop
// and has the same or more necessary optional chaining operators
// than `node.alternate` or `node.consequent`.
nullishCoalescingLeftNode ??= testNode;
}
else {
return { isFixable: false };
}
}
}
if (!nullishCoalescingLeftNode) {
return { isFixable: false };
}
const isFixable = (() => {
if (hasTruthinessCheck) {
return isTruthinessCheckEligibleForPreferNullish({
node,
testNode: nullishCoalescingLeftNode,
});
}
// it is fixable if we check for both null and undefined, or not if neither
if (hasUndefinedCheckWithoutTruthinessCheck ===
hasNullCheckWithoutTruthinessCheck) {
return hasUndefinedCheckWithoutTruthinessCheck;
}
// it is fixable if we loosely check for either null or undefined
if (['==', '!='].includes(operator)) {
return true;
}
const type = parserServices.getTypeAtLocation(nullishCoalescingLeftNode);
const flags = (0, util_1.getTypeFlags)(type);
if (flags & (ts.TypeFlags.Any | ts.TypeFlags.Unknown)) {
return false;
}
const hasNullType = (flags & ts.TypeFlags.Null) !== 0;
// it is fixable if we check for undefined and the type is not nullable
if (hasUndefinedCheckWithoutTruthinessCheck && !hasNullType) {
return true;
}
const hasUndefinedType = (flags & ts.TypeFlags.Undefined) !== 0;
// it is fixable if we check for null and the type can't be undefined
return hasNullCheckWithoutTruthinessCheck && !hasUndefinedType;
})();
return isFixable
? { isFixable: true, nullishCoalescingLeftNode }
: { isFixable: false };
}
return {
'AssignmentExpression[operator = "||="]'(node) {
checkAndFixWithPreferNullishOverOr(node, 'assignment', '=');
},
ConditionalExpression(node) {
if (ignoreTernaryTests) {
return;
}
const { nodesInsideTestExpression, operator } = getOperatorAndNodesInsideTestExpression(node);
if (operator == null) {
return;
}
const { nonNullishBranch, nullishBranch } = getBranchNodes(node, operator);
const nullishCoalescingParams = getNullishCoalescingParams(node, nonNullishBranch, nodesInsideTestExpression, operator);
if (nullishCoalescingParams.isFixable) {
context.report({
node,
messageId: 'preferNullishOverTernary',
// TODO: also account for = in the ternary clause
data: { equals: '' },
suggest: [
{
messageId: 'suggestNullish',
data: { equals: '' },
fix(fixer) {
const nullishBranchText = (0, util_1.getTextWithParentheses)(context.sourceCode, nullishBranch);
const rightOperandReplacement = (0, util_1.isParenthesized)(nullishBranch, context.sourceCode)
? nullishBranchText
: (0, getWrappedCode_1.getWrappedCode)(nullishBranchText, (0, util_1.getOperatorPrecedenceForNode)(nullishBranch), util_1.OperatorPrecedence.Coalesce);
return fixer.replaceText(node, `${(0, util_1.getTextWithParentheses)(context.sourceCode, nullishCoalescingParams.nullishCoalescingLeftNode)} ?? ${rightOperandReplacement}`);
},
},
],
});
}
},
IfStatement(node) {
if (ignoreIfStatements || node.alternate != null) {
return;
}
let assignmentExpression;
if (node.consequent.type === utils_1.AST_NODE_TYPES.BlockStatement &&
node.consequent.body.length === 1 &&
node.consequent.body[0].type === utils_1.AST_NODE_TYPES.ExpressionStatement) {
assignmentExpression = node.consequent.body[0].expression;
}
else if (node.consequent.type === utils_1.AST_NODE_TYPES.ExpressionStatement) {
assignmentExpression = node.consequent.expression;
}
if (assignmentExpression?.type !== utils_1.AST_NODE_TYPES.AssignmentExpression ||
!isMemberAccessLike(assignmentExpression.left)) {
return;
}
const nullishCoalescingLeftNode = assignmentExpression.left;
const nullishCoalescingRightNode = assignmentExpression.right;
const { nodesInsideTestExpression, operator } = getOperatorAndNodesInsideTestExpression(node);
if (operator == null || !['!', '==', '==='].includes(operator)) {
return;
}
const nullishCoalescingParams = getNullishCoalescingParams(node, nullishCoalescingLeftNode, nodesInsideTestExpression, operator);
if (nullishCoalescingParams.isFixable) {
// Handle comments
const isConsequentNodeBlockStatement = node.consequent.type === utils_1.AST_NODE_TYPES.BlockStatement;
const commentsBefore = formatComments(context.sourceCode.getCommentsBefore(assignmentExpression), isConsequentNodeBlockStatement ? '\n' : ' ');
const commentsAfter = isConsequentNodeBlockStatement
? formatComments(context.sourceCode.getCommentsAfter(assignmentExpression.parent), '\n')
: '';
context.report({
node,
messageId: 'preferNullishOverAssignment',
data: { equals: '=' },
suggest: [
{
messageId: 'suggestNullish',
data: { equals: '=' },
fix(fixer) {
const fixes = [];
if (commentsBefore) {
fixes.push(fixer.insertTextBefore(node, commentsBefore));
}
fixes.push(fixer.replaceText(node, `${(0, util_1.getTextWithParentheses)(context.sourceCode, nullishCoalescingLeftNode)} ??= ${(0, util_1.getTextWithParentheses)(context.sourceCode, nullishCoalescingRightNode)};`));
if (commentsAfter) {
fixes.push(fixer.insertTextAfter(node, ` ${commentsAfter.slice(0, -1)}`));
}
return fixes;
},
},
],
});
}
},
'LogicalExpression[operator = "||"]'(node) {
checkAndFixWithPreferNullishOverOr(node, 'or', '');
},
};
},
});
function isConditionalTest(node) {
const parent = node.parent;
if (parent == null) {
return false;
}
if (parent.type === utils_1.AST_NODE_TYPES.LogicalExpression) {
return isConditionalTest(parent);
}
if (parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression &&
(parent.consequent === node || parent.alternate === node)) {
return isConditionalTest(parent);
}
if (parent.type === utils_1.AST_NODE_TYPES.SequenceExpression &&
parent.expressions.at(-1) === node) {
return isConditionalTest(parent);
}
if (parent.type === utils_1.AST_NODE_TYPES.UnaryExpression &&
parent.operator === '!') {
return isConditionalTest(parent);
}
if ((parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression ||
parent.type === utils_1.AST_NODE_TYPES.DoWhileStatement ||
parent.type === utils_1.AST_NODE_TYPES.IfStatement ||
parent.type === utils_1.AST_NODE_TYPES.ForStatement ||
parent.type === utils_1.AST_NODE_TYPES.WhileStatement) &&
parent.test === node) {
return true;
}
return false;
}
function isBooleanConstructorContext(node, context) {
const parent = node.parent;
if (parent == null) {
return false;
}
if (parent.type === utils_1.AST_NODE_TYPES.LogicalExpression) {
return isBooleanConstructorContext(parent, context);
}
if (parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression &&
(parent.consequent === node || parent.alternate === node)) {
return isBooleanConstructorContext(parent, context);
}
if (parent.type === utils_1.AST_NODE_TYPES.SequenceExpression &&
parent.expressions.at(-1) === node) {
return isBooleanConstructorContext(parent, context);
}
return isBuiltInBooleanCall(parent, context);
}
function isBuiltInBooleanCall(node, context) {
if (node.type === utils_1.AST_NODE_TYPES.CallExpression &&
node.callee.type === utils_1.AST_NODE_TYPES.Identifier &&
// eslint-disable-next-line @typescript-eslint/internal/prefer-ast-types-enum
node.callee.name === 'Boolean' &&
node.arguments[0]) {
const scope = context.sourceCode.getScope(node);
const variable = scope.set.get(utils_1.AST_TOKEN_TYPES.Boolean);
return variable == null || variable.defs.length === 0;
}
return false;
}
function isMixedLogicalExpression(node) {
const seen = new Set();
const queue = [node.parent, node.left, node.right];
for (const current of queue) {
if (seen.has(current)) {
continue;
}
seen.add(current);
if (current.type === utils_1.AST_NODE_TYPES.LogicalExpression) {
if (current.operator === '&&') {
return true;
}
if (['||', '||='].includes(current.operator)) {
// check the pieces of the node to catch cases like `a || b || c && d`
queue.push(current.parent, current.left, current.right);
}
}
}
return false;
}
/**
* Checks if two TSESTree nodes have the same member access sequence,
* regardless of optional chaining differences.
*
* Note: This does not imply that the nodes are runtime-equivalent.
*
* Example: `a.b.c`, `a?.b.c`, `a.b?.c`, `(a?.b).c`, `(a.b)?.c` are considered similar.
*
* @param a First TSESTree node.
* @param b Second TSESTree node.
* @returns `true` if the nodes access members in the same order; otherwise, `false`.
*/
function areNodesSimilarMemberAccess(a, b) {
if (a.type === utils_1.AST_NODE_TYPES.MemberExpression &&
b.type === utils_1.AST_NODE_TYPES.MemberExpression) {
if (!areNodesSimilarMemberAccess(a.object, b.object)) {
return false;
}
if (a.computed === b.computed) {
return (0, util_1.isNodeEqual)(a.property, b.property);
}
if (a.property.type === utils_1.AST_NODE_TYPES.Literal &&
b.property.type === utils_1.AST_NODE_TYPES.Identifier) {
return a.property.value === b.property.name;
}
if (a.property.type === utils_1.AST_NODE_TYPES.Identifier &&
b.property.type === utils_1.AST_NODE_TYPES.Literal) {
return a.property.name === b.property.value;
}
return false;
}
if (a.type === utils_1.AST_NODE_TYPES.ChainExpression ||
b.type === utils_1.AST_NODE_TYPES.ChainExpression) {
return areNodesSimilarMemberAccess((0, util_1.skipChainExpression)(a), (0, util_1.skipChainExpression)(b));
}
return (0, util_1.isNodeEqual)(a, b);
}
/**
* Returns the branch nodes of a conditional expression:
* - the "nonNullish branch" is the branch when test node is not nullish
* - the "nullish branch" is the branch when test node is nullish
*/
function getBranchNodes(node, operator) {
if (['', '!=', '!=='].includes(operator)) {
return { nonNullishBranch: node.consequent, nullishBranch: node.alternate };
}
return { nonNullishBranch: node.alternate, nullishBranch: node.consequent };
}
function getOperatorAndNodesInsideTestExpression(node) {
let operator = null;
let nodesInsideTestExpression = [];
if (isMemberAccessLike(node.test) ||
node.test.type === utils_1.AST_NODE_TYPES.UnaryExpression) {
operator = getNonBinaryNodeOperator(node.test);
}
else if (node.test.type === utils_1.AST_NODE_TYPES.BinaryExpression) {
nodesInsideTestExpression = [node.test.left, node.test.right];
if (node.test.operator === '==' ||
node.test.operator === '!=' ||
node.test.operator === '===' ||
node.test.operator === '!==') {
operator = node.test.operator;
}
}
else if (node.test.type === utils_1.AST_NODE_TYPES.LogicalExpression &&
node.test.left.type === utils_1.AST_NODE_TYPES.BinaryExpression &&
node.test.right.type === utils_1.AST_NODE_TYPES.BinaryExpression) {
if (isNodeNullishComparison(node.test.left) ||
isNodeNullishComparison(node.test.right)) {
return { nodesInsideTestExpression, operator };
}
nodesInsideTestExpression = [
node.test.left.left,
node.test.left.right,
node.test.right.left,
node.test.right.right,
];
if (['||', '||='].includes(node.test.operator)) {
if (node.test.left.operator === '===' &&
node.test.right.operator === '===') {
operator = '===';
}
else if (((node.test.left.operator === '===' ||
node.test.right.operator === '===') &&
(node.test.left.operator === '==' ||
node.test.right.operator === '==')) ||
(node.test.left.operator === '==' && node.test.right.operator === '==')) {
operator = '==';
}
}
else if (node.test.operator === '&&') {
if (node.test.left.operator === '!==' &&
node.test.right.operator === '!==') {
operator = '!==';
}
else if (((node.test.left.operator === '!==' ||
node.test.right.operator === '!==') &&
(node.test.left.operator === '!=' ||
node.test.right.operator === '!=')) ||
(node.test.left.operator === '!=' && node.test.right.operator === '!=')) {
operator = '!=';
}
}
}
return { nodesInsideTestExpression, operator };
}
function getNonBinaryNodeOperator(node) {
if (node.type !== utils_1.AST_NODE_TYPES.UnaryExpression) {
return '';
}
if (isMemberAccessLike(node.argument) && node.operator === '!') {
return '!';
}
return null;
}
function formatComments(comments, separator) {
return comments
.map(({ type, value }) => type === utils_1.AST_TOKEN_TYPES.Line
? `//${value}${separator}`
: `/*${value}*/${separator}`)
.join('');
}
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts", "../src/use-controllable-state.tsx", "../src/use-controllable-state-reducer.tsx"],
"sourcesContent": ["export { useControllableState } from './use-controllable-state';\nexport { useControllableStateReducer } from './use-controllable-state-reducer';\n", "import * as React from 'react';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\n\n// Prevent bundlers from trying to optimize the import\nconst useInsertionEffect: typeof useLayoutEffect =\n (React as any)[' useInsertionEffect '.trim().toString()] || useLayoutEffect;\n\ntype ChangeHandler<T> = (state: T) => void;\ntype SetStateFn<T> = React.Dispatch<React.SetStateAction<T>>;\n\ninterface UseControllableStateParams<T> {\n prop?: T | undefined;\n defaultProp: T;\n onChange?: ChangeHandler<T>;\n caller?: string;\n}\n\nexport function useControllableState<T>({\n prop,\n defaultProp,\n onChange = () => {},\n caller,\n}: UseControllableStateParams<T>): [T, SetStateFn<T>] {\n const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({\n defaultProp,\n onChange,\n });\n const isControlled = prop !== undefined;\n const value = isControlled ? prop : uncontrolledProp;\n\n // OK to disable conditionally calling hooks here because they will always run\n // consistently in the same environment. Bundlers should be able to remove the\n // code block entirely in production.\n /* eslint-disable react-hooks/rules-of-hooks */\n if (process.env.NODE_ENV !== 'production') {\n const isControlledRef = React.useRef(prop !== undefined);\n React.useEffect(() => {\n const wasControlled = isControlledRef.current;\n if (wasControlled !== isControlled) {\n const from = wasControlled ? 'controlled' : 'uncontrolled';\n const to = isControlled ? 'controlled' : 'uncontrolled';\n console.warn(\n `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`\n );\n }\n isControlledRef.current = isControlled;\n }, [isControlled, caller]);\n }\n /* eslint-enable react-hooks/rules-of-hooks */\n\n const setValue = React.useCallback<SetStateFn<T>>(\n (nextValue) => {\n if (isControlled) {\n const value = isFunction(nextValue) ? nextValue(prop) : nextValue;\n if (value !== prop) {\n onChangeRef.current?.(value);\n }\n } else {\n setUncontrolledProp(nextValue);\n }\n },\n [isControlled, prop, setUncontrolledProp, onChangeRef]\n );\n\n return [value, setValue];\n}\n\nfunction useUncontrolledState<T>({\n defaultProp,\n onChange,\n}: Omit<UseControllableStateParams<T>, 'prop'>): [\n Value: T,\n setValue: React.Dispatch<React.SetStateAction<T>>,\n OnChangeRef: React.RefObject<ChangeHandler<T> | undefined>,\n] {\n const [value, setValue] = React.useState(defaultProp);\n const prevValueRef = React.useRef(value);\n\n const onChangeRef = React.useRef(onChange);\n useInsertionEffect(() => {\n onChangeRef.current = onChange;\n }, [onChange]);\n\n React.useEffect(() => {\n if (prevValueRef.current !== value) {\n onChangeRef.current?.(value);\n prevValueRef.current = value;\n }\n }, [value, prevValueRef]);\n\n return [value, setValue, onChangeRef];\n}\n\nfunction isFunction(value: unknown): value is (...args: any[]) => any {\n return typeof value === 'function';\n}\n", "import * as React from 'react';\nimport { useEffectEvent } from '@radix-ui/react-use-effect-event';\n\ntype ChangeHandler<T> = (state: T) => void;\n\ninterface UseControllableStateParams<T> {\n prop: T | undefined;\n defaultProp: T;\n onChange: ChangeHandler<T> | undefined;\n caller: string;\n}\n\ninterface AnyAction {\n type: string;\n}\n\nconst SYNC_STATE = Symbol('RADIX:SYNC_STATE');\n\ninterface SyncStateAction<T> {\n type: typeof SYNC_STATE;\n state: T;\n}\n\nexport function useControllableStateReducer<T, S extends {}, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialState: S\n): [S & { state: T }, React.Dispatch<A>];\n\nexport function useControllableStateReducer<T, S extends {}, I, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialArg: I,\n init: (i: I & { state: T }) => S\n): [S & { state: T }, React.Dispatch<A>];\n\nexport function useControllableStateReducer<T, S extends {}, A extends AnyAction>(\n reducer: (prevState: S & { state: T }, action: A) => S & { state: T },\n userArgs: UseControllableStateParams<T>,\n initialArg: any,\n init?: (i: any) => Omit<S, 'state'>\n): [S & { state: T }, React.Dispatch<A>] {\n const { prop: controlledState, defaultProp, onChange: onChangeProp, caller } = userArgs;\n const isControlled = controlledState !== undefined;\n\n const onChange = useEffectEvent(onChangeProp);\n\n // OK to disableLine truncated
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,qCAAgC;AAGhC,IAAM,qBACH,MAAc,uBAAuB,KAAK,EAAE,SAAS,CAAC,KAAK;AAYvD,SAAS,qBAAwB;AAAA,EACtC;AAAA,EACA;AAAA,EACA,WAAW,MAAM;AAAA,EAAC;AAAA,EAClB;AACF,GAAsD;AACpD,QAAM,CAAC,kBAAkB,qBAAqB,WAAW,IAAI,qBAAqB;AAAA,IAChF;AAAA,IACA;AAAA,EACF,CAAC;AACD,QAAM,eAAe,SAAS;AAC9B,QAAM,QAAQ,eAAe,OAAO;AAMpC,MAAI,MAAuC;AACzC,UAAM,kBAAwB,aAAO,SAAS,MAAS;AACvD,IAAM,gBAAU,MAAM;AACpB,YAAM,gBAAgB,gBAAgB;AACtC,UAAI,kBAAkB,cAAc;AAClC,cAAM,OAAO,gBAAgB,eAAe;AAC5C,cAAM,KAAK,eAAe,eAAe;AACzC,gBAAQ;AAAA,UACN,GAAG,MAAM,qBAAqB,IAAI,OAAO,EAAE;AAAA,QAC7C;AAAA,MACF;AACA,sBAAgB,UAAU;AAAA,IAC5B,GAAG,CAAC,cAAc,MAAM,CAAC;AAAA,EAC3B;AAGA,QAAM,WAAiB;AAAA,IACrB,CAAC,cAAc;AACb,UAAI,cAAc;AAChB,cAAMA,SAAQ,WAAW,SAAS,IAAI,UAAU,IAAI,IAAI;AACxD,YAAIA,WAAU,MAAM;AAClB,sBAAY,UAAUA,MAAK;AAAA,QAC7B;AAAA,MACF,OAAO;AACL,4BAAoB,SAAS;AAAA,MAC/B;AAAA,IACF;AAAA,IACA,CAAC,cAAc,MAAM,qBAAqB,WAAW;AAAA,EACvD;AAEA,SAAO,CAAC,OAAO,QAAQ;AACzB;AAEA,SAAS,qBAAwB;AAAA,EAC/B;AAAA,EACA;AACF,GAIE;AACA,QAAM,CAAC,OAAO,QAAQ,IAAU,eAAS,WAAW;AACpD,QAAM,eAAqB,aAAO,KAAK;AAEvC,QAAM,cAAoB,aAAO,QAAQ;AACzC,qBAAmB,MAAM;AACvB,gBAAY,UAAU;AAAA,EACxB,GAAG,CAAC,QAAQ,CAAC;AAEb,EAAM,gBAAU,MAAM;AACpB,QAAI,aAAa,YAAY,OAAO;AAClC,kBAAY,UAAU,KAAK;AAC3B,mBAAa,UAAU;AAAA,IACzB;AAAA,EACF,GAAG,CAAC,OAAO,YAAY,CAAC;AAExB,SAAO,CAAC,OAAO,UAAU,WAAW;AACtC;AAEA,SAAS,WAAW,OAAkD;AACpE,SAAO,OAAO,UAAU;AAC1B;;;AC/FA,IAAAC,SAAuB;AACvB,oCAA+B;AAe/B,IAAM,aAAa,OAAO,kBAAkB;AAoBrC,SAAS,4BACd,SACA,UACA,YACA,MACuC;AACvC,QAAM,EAAE,MAAM,iBAAiB,aAAa,UAAU,cAAc,OAAO,IAAI;AAC/E,QAAM,eAAe,oBAAoB;AAEzC,QAAM,eAAW,8CAAe,YAAY;AAM5C,MAAI,MAAuC;AACzC,UAAM,kBAAwB,cAAO,oBAAoB,MAAS;AAClE,IAAM,iBAAU,MAAM;AACpB,YAAM,gBAAgB,gBAAgB;AACtC,UAAI,kBAAkB,cAAc;AAClC,cAAM,OAAO,gBAAgB,eAAe;AAC5C,cAAM,KAAK,eAAe,eAAe;AACzC,gBAAQ;AAAA,UACN,GAAG,MAAM,qBAAqB,IAAI,OAAO,EAAE;AAAA,QAC7C;AAAA,MACF;AACA,sBAAgB,UAAU;AAAA,IAC5B,GAAG,CAAC,cAAc,MAAM,CAAC;AAAA,EAC3B;AAIA,QAAM,OAAwB,CAAC,EAAE,GAAG,YAAY,OAAO,YAAY,CAAC;AACpE,MAAI,MAAM;AAER,SAAK,KAAK,IAAI;AAAA,EAChB;AAEA,QAAM,CAAC,eAAe,QAAQ,IAAU;AAAA,IACtC,CAACC,QAAsB,WAAkD;AACvE,UAAI,OAAO,SAAS,YAAY;AAC9B,eAAO,EAAE,GAAGA,QAAO,OAAO,OAAO,MAAM;AAAA,MACzC;AAEA,YAAM,OAAO,QAAQA,QAAO,MAAM;AAClC,UAAI,gBAAgB,CAAC,OAAO,GAAG,KAAK,OAAOA,OAAM,KAAK,GAAG;AACvD,iBAAS,KAAK,KAAK;AAAA,MACrB;AACA,aAAO;AAAA,IACT;AAAA,IACA,GAAG;AAAA,EACL;AAEA,QAAM,oBAAoB,cAAc;AACxC,QAAM,eAAqB,cAAO,iBAAiB;AACnD,EAAM,iBAAU,MAAM;AACpB,QAAI,aAAa,YAAY,mBAAmB;AAC9C,mBAAa,UAAU;AACvB,UAAI,CAAC,cAAc;AACjB,iBAAS,iBAAiB;AAAA,MAC5B;AAAA,IACF;AAAA,EACF,GAAG,CAAC,UAAU,mBAAmB,cAAc,YAAY,CAAC;AAE5D,QAAM,QAAc,eAAQ,MAAM;AAChC,UAAMC,gBAAe,oBAAoB;AACzC,QAAIA,eAAc;AAChB,aAAO,EAAE,GAAG,eAAe,OAAO,gBAAgB;AAAA,IACpD;AAEA,WAAO;AAAA,EACT,GAAG,CAAC,eAAe,eAAe,CAAC;AAEnC,EAAM,iBAAU,MAAM;AAGpB,QAAI,gBAAgB,CAAC,OAAO,GAAG,iBAAiB,cAAc,KAAK,GAAG;AACpE,eAAS,EAAE,MAAM,YAAY,OAAO,gBAAgB,CAAC;AAAA,IACvD;AAAA,EACF,GAAG,CAAC,iBAAiB,cAAc,OAAO,YAAY,CAAC;AAEvD,SAAO,CAAC,OAAO,QAA6B;AAC9C;",
"names": ["value", "React", "state", "isControlled"]
}
@@ -0,0 +1,30 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Popcorn = createLucideIcon("Popcorn", [
[
"path",
{
d: "M18 8a2 2 0 0 0 0-4 2 2 0 0 0-4 0 2 2 0 0 0-4 0 2 2 0 0 0-4 0 2 2 0 0 0 0 4",
key: "10td1f"
}
],
["path", { d: "M10 22 9 8", key: "yjptiv" }],
["path", { d: "m14 22 1-14", key: "8jwc8b" }],
[
"path",
{
d: "M20 8c.5 0 .9.4.8 1l-2.6 12c-.1.5-.7 1-1.2 1H7c-.6 0-1.1-.4-1.2-1L3.2 9c-.1-.6.3-1 .8-1Z",
key: "1qo33t"
}
]
]);
export { Popcorn as default };
//# sourceMappingURL=popcorn.js.map
@@ -0,0 +1,87 @@
import type { FlatConfig } from '../Config';
import type * as Shared from './ESLintShared';
declare class FlatESLintBase extends Shared.ESLintBase<FlatConfig.Config | FlatConfig.ConfigArray, FlatESLint.ESLintOptions> {
static readonly configType: 'flat';
/**
* Returns a configuration object for the given file based on the CLI options.
* This is the same logic used by the ESLint CLI executable to determine
* configuration for each file it processes.
* @param filePath The path of the file to retrieve a config object for.
* @returns A configuration object for the file or `undefined` if there is no configuration data for the object.
*/
calculateConfigForFile(filePath: string): Promise<FlatConfig.Config>;
/**
* Finds the config file being used by this instance based on the options
* passed to the constructor.
* @returns The path to the config file being used or `undefined` if no config file is being used.
*/
findConfigFile(): Promise<string | undefined>;
}
declare const FlatESLint_base: typeof FlatESLintBase;
/**
* The ESLint class is the primary class to use in Node.js applications.
* This class depends on the Node.js fs module and the file system, so you cannot use it in browsers.
*
* If you want to lint code on browsers, use the Linter class instead.
*/
export declare class FlatESLint extends FlatESLint_base {
}
export declare namespace FlatESLint {
interface ESLintOptions extends Shared.ESLintOptions<FlatConfig.ConfigArray> {
/**
* If false is present, the eslint.lintFiles() method doesn't respect `ignorePatterns` ignorePatterns in your configuration.
* @default true
*/
ignore?: boolean;
/**
* Ignore file patterns to use in addition to config ignores. These patterns are relative to cwd.
* @default null
*/
ignorePatterns?: string[] | null;
/**
* The path to a configuration file. Overrides all configurations used with this instance.
* The options.overrideConfig option is applied after this option is applied.
*
* - When falsy, searches for default config file.
* - When `true`, does not do any config file lookup.
* - When a string, considered to be a config file name.
*
* @default false
*/
overrideConfigFile?: boolean | string;
/**
* A predicate function that filters rules to be run.
* This function is called with an object containing `ruleId` and `severity`, and returns `true` if the rule should be run.
* @default () => true
*/
ruleFilter?: RuleFilter;
/**
* When set to true, additional statistics are added to the lint results.
* @see {@link https://eslint.org/docs/latest/extend/stats}
* @default false
*/
stats?: boolean;
/**
* Show warnings when the file list includes ignored files.
* @default true
*/
warnIgnored?: boolean;
}
type DeprecatedRuleInfo = Shared.DeprecatedRuleInfo;
type EditInfo = Shared.EditInfo;
type Formatter = Shared.Formatter;
type LintMessage = Shared.LintMessage;
type LintResult = Shared.LintResult;
type LintStats = Shared.LintStats;
type LintStatsFixTime = Shared.LintStatsFixTime;
type LintStatsParseTime = Shared.LintStatsParseTime;
type LintStatsRuleTime = Shared.LintStatsRuleTime;
type LintStatsTimePass = Shared.LintStatsTimePass;
type LintTextOptions = Shared.LintTextOptions;
type SuppressedLintMessage = Shared.SuppressedLintMessage;
type RuleFilter = (rule: {
ruleId: string;
severity: number;
}) => boolean;
}
export {};
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './square-arrow-right.js';
//# sourceMappingURL=arrow-right-square.js.map
@@ -0,0 +1,19 @@
export * from './BlockScope';
export * from './CatchScope';
export * from './ClassFieldInitializerScope';
export * from './ClassScope';
export * from './ConditionalTypeScope';
export * from './ForScope';
export * from './FunctionExpressionNameScope';
export * from './FunctionScope';
export * from './FunctionTypeScope';
export * from './GlobalScope';
export * from './MappedTypeScope';
export * from './ModuleScope';
export * from './Scope';
export * from './ScopeType';
export * from './SwitchScope';
export * from './TSEnumScope';
export * from './TSModuleScope';
export * from './TypeScope';
export * from './WithScope';
@@ -0,0 +1,162 @@
import * as React from 'react';
import { RemoveScrollBar } from 'react-remove-scroll-bar';
import { styleSingleton } from 'react-style-singleton';
import { nonPassive } from './aggresiveCapture';
import { handleScroll, locationCouldBeScrolled } from './handleScroll';
export const getTouchXY = (event) => 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];
export const getDeltaXY = (event) => [event.deltaX, event.deltaY];
const extractRef = (ref) => ref && 'current' in ref ? ref.current : ref;
const deltaCompare = (x, y) => x[0] === y[0] && x[1] === y[1];
const generateStyle = (id) => `
.block-interactivity-${id} {pointer-events: none;}
.allow-interactivity-${id} {pointer-events: all;}
`;
let idCounter = 0;
let lockStack = [];
export function RemoveScrollSideCar(props) {
const shouldPreventQueue = React.useRef([]);
const touchStartRef = React.useRef([0, 0]);
const activeAxis = React.useRef();
const [id] = React.useState(idCounter++);
const [Style] = React.useState(styleSingleton);
const lastProps = React.useRef(props);
React.useEffect(() => {
lastProps.current = props;
}, [props]);
React.useEffect(() => {
if (props.inert) {
document.body.classList.add(`block-interactivity-${id}`);
const allow = [props.lockRef.current, ...(props.shards || []).map(extractRef)].filter(Boolean);
allow.forEach((el) => el.classList.add(`allow-interactivity-${id}`));
return () => {
document.body.classList.remove(`block-interactivity-${id}`);
allow.forEach((el) => el.classList.remove(`allow-interactivity-${id}`));
};
}
return;
}, [props.inert, props.lockRef.current, props.shards]);
const shouldCancelEvent = React.useCallback((event, parent) => {
if (('touches' in event && event.touches.length === 2) || (event.type === 'wheel' && event.ctrlKey)) {
return !lastProps.current.allowPinchZoom;
}
const touch = getTouchXY(event);
const touchStart = touchStartRef.current;
const deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];
const deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];
let currentAxis;
const target = event.target;
const moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';
// allow horizontal touch move on Range inputs. They will not cause any scroll
if ('touches' in event && moveDirection === 'h' && target.type === 'range') {
return false;
}
// allow drag selection (iOS); check if selection's anchorNode is the same as target or contains target
const selection = window.getSelection();
const anchorNode = selection && selection.anchorNode;
const isTouchingSelection = anchorNode ? anchorNode === target || anchorNode.contains(target) : false;
if (isTouchingSelection) {
return false;
}
let canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
if (!canBeScrolledInMainDirection) {
return true;
}
if (canBeScrolledInMainDirection) {
currentAxis = moveDirection;
}
else {
currentAxis = moveDirection === 'v' ? 'h' : 'v';
canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);
// other axis might be not scrollable
}
if (!canBeScrolledInMainDirection) {
return false;
}
if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {
activeAxis.current = currentAxis;
}
if (!currentAxis) {
return true;
}
const cancelingAxis = activeAxis.current || currentAxis;
return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);
}, []);
const shouldPrevent = React.useCallback((_event) => {
const event = _event;
if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {
// not the last active
return;
}
const delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);
const sourceEvent = shouldPreventQueue.current.filter((e) => e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta))[0];
// self event, and should be canceled
if (sourceEvent && sourceEvent.should) {
if (event.cancelable) {
event.preventDefault();
}
return;
}
// outside or shard event
if (!sourceEvent) {
const shardNodes = (lastProps.current.shards || [])
.map(extractRef)
.filter(Boolean)
.filter((node) => node.contains(event.target));
const shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;
if (shouldStop) {
if (event.cancelable) {
event.preventDefault();
}
}
}
}, []);
const shouldCancel = React.useCallback((name, delta, target, should) => {
const event = { name, delta, target, should, shadowParent: getOutermostShadowParent(target) };
shouldPreventQueue.current.push(event);
setTimeout(() => {
shouldPreventQueue.current = shouldPreventQueue.current.filter((e) => e !== event);
}, 1);
}, []);
const scrollTouchStart = React.useCallback((event) => {
touchStartRef.current = getTouchXY(event);
activeAxis.current = undefined;
}, []);
const scrollWheel = React.useCallback((event) => {
shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
}, []);
const scrollTouchMove = React.useCallback((event) => {
shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));
}, []);
React.useEffect(() => {
lockStack.push(Style);
props.setCallbacks({
onScrollCapture: scrollWheel,
onWheelCapture: scrollWheel,
onTouchMoveCapture: scrollTouchMove,
});
document.addEventListener('wheel', shouldPrevent, nonPassive);
document.addEventListener('touchmove', shouldPrevent, nonPassive);
document.addEventListener('touchstart', scrollTouchStart, nonPassive);
return () => {
lockStack = lockStack.filter((inst) => inst !== Style);
document.removeEventListener('wheel', shouldPrevent, nonPassive);
document.removeEventListener('touchmove', shouldPrevent, nonPassive);
document.removeEventListener('touchstart', scrollTouchStart, nonPassive);
};
}, []);
const { removeScrollBar, inert } = props;
return (React.createElement(React.Fragment, null,
inert ? React.createElement(Style, { styles: generateStyle(id) }) : null,
removeScrollBar ? React.createElement(RemoveScrollBar, { noRelative: props.noRelative, gapMode: props.gapMode }) : null));
}
function getOutermostShadowParent(node) {
let shadowParent = null;
while (node !== null) {
if (node instanceof ShadowRoot) {
shadowParent = node.host;
node = node.host;
}
node = node.parentNode;
}
return shadowParent;
}
@@ -0,0 +1 @@
{"version":3,"file":"shield-ellipsis.js","sources":["../../../src/icons/shield-ellipsis.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ShieldEllipsis\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjAgMTNjMCA1LTMuNSA3LjUtNy42NiA4Ljk1YTEgMSAwIDAgMS0uNjctLjAxQzcuNSAyMC41IDQgMTggNCAxM1Y2YTEgMSAwIDAgMSAxLTFjMiAwIDQuNS0xLjIgNi4yNC0yLjcyYTEuMTcgMS4xNyAwIDAgMSAxLjUyIDBDMTQuNTEgMy44MSAxNyA1IDE5IDVhMSAxIDAgMCAxIDEgMXoiIC8+CiAgPHBhdGggZD0iTTggMTJoLjAxIiAvPgogIDxwYXRoIGQ9Ik0xMiAxMmguMDEiIC8+CiAgPHBhdGggZD0iTTE2IDEyaC4wMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/shield-ellipsis\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ShieldEllipsis = createLucideIcon('ShieldEllipsis', [\n [\n 'path',\n {\n d: 'M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z',\n key: 'oel41y',\n },\n ],\n ['path', { d: 'M8 12h.01', key: 'czm47f' }],\n ['path', { d: 'M12 12h.01', key: '1mp3jc' }],\n ['path', { d: 'M16 12h.01', key: '1l6xoz' }],\n]);\n\nexport default ShieldEllipsis;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CACxD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
module.exports={A:"ie",B:"edge",C:"firefox",D:"chrome",E:"safari",F:"opera",G:"ios_saf",H:"op_mini",I:"android",J:"bb",K:"op_mob",L:"and_chr",M:"and_ff",N:"ie_mob",O:"and_uc",P:"samsung",Q:"and_qq",R:"baidu",S:"kaios"};
@@ -0,0 +1,134 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Maël Nison @arcanis
*/
"use strict";
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/**
* @typedef {object} PnpApiImpl
* @property {(packageName: string, issuer: string, options: { considerBuiltins: boolean }) => string | null} resolveToUnqualified resolve to unqualified
*/
module.exports = class PnpPlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {PnpApiImpl} pnpApi pnpApi
* @param {string | ResolveStepHook} target target
* @param {string | ResolveStepHook} alternateTarget alternateTarget
*/
constructor(source, pnpApi, target, alternateTarget) {
this.source = source;
this.pnpApi = pnpApi;
this.target = target;
this.alternateTarget = alternateTarget;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
/** @type {ResolveStepHook} */
const target = resolver.ensureHook(this.target);
const alternateTarget = resolver.ensureHook(this.alternateTarget);
resolver
.getHook(this.source)
.tapAsync("PnpPlugin", (request, resolveContext, callback) => {
const req = request.request;
if (!req) return callback();
// The trailing slash indicates to PnP that this value is a folder rather than a file
const issuer = `${request.path}/`;
const packageMatch = /^(@[^/]+\/)?[^/]+/.exec(req);
if (!packageMatch) return callback();
const [packageName] = packageMatch;
const innerRequest = `.${req.slice(packageName.length)}`;
/** @type {string | undefined | null} */
let resolution;
/** @type {string | undefined | null} */
let apiResolution;
try {
resolution = this.pnpApi.resolveToUnqualified(packageName, issuer, {
considerBuiltins: false,
});
if (resolution === null) {
// This is either not a PnP managed issuer or it's a Node builtin
// Try to continue resolving with our alternatives
resolver.doResolve(
alternateTarget,
request,
"issuer is not managed by a pnpapi",
resolveContext,
(err, result) => {
if (err) return callback(err);
if (result) return callback(null, result);
// Skip alternatives
return callback(null, null);
},
);
return;
}
if (resolveContext.fileDependencies) {
apiResolution = this.pnpApi.resolveToUnqualified("pnpapi", issuer, {
considerBuiltins: false,
});
}
} catch (/** @type {unknown} */ error) {
if (
/** @type {Error & { code: string }} */
(error).code === "MODULE_NOT_FOUND" &&
/** @type {Error & { pnpCode: string }} */
(error).pnpCode === "UNDECLARED_DEPENDENCY"
) {
// This is not a PnP managed dependency.
// Try to continue resolving with our alternatives
if (resolveContext.log) {
resolveContext.log("request is not managed by the pnpapi");
for (const line of /** @type {Error} */ (error).message
.split("\n")
.filter(Boolean)) {
resolveContext.log(` ${line}`);
}
}
return callback();
}
return callback(/** @type {Error} */ (error));
}
if (resolution === packageName) return callback();
if (apiResolution && resolveContext.fileDependencies) {
resolveContext.fileDependencies.add(apiResolution);
}
/** @type {ResolveRequest} */
const obj = {
...request,
path: resolution,
request: innerRequest,
ignoreSymlinks: true,
fullySpecified: request.fullySpecified && innerRequest !== ".",
};
resolver.doResolve(
target,
obj,
`resolved by pnp to ${resolution}`,
resolveContext,
(err, result) => {
if (err) return callback(err);
if (result) return callback(null, result);
// Skip alternatives
return callback(null, null);
},
);
});
}
};
@@ -0,0 +1,69 @@
{
"name": "@vitest/coverage-istanbul",
"type": "module",
"version": "4.1.12",
"description": "Istanbul coverage provider for Vitest",
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
"license": "MIT",
"funding": "https://opencollective.com/vitest",
"homepage": "https://vitest.dev/guide/coverage",
"repository": {
"type": "git",
"url": "git+https://github.com/vitest-dev/vitest.git",
"directory": "packages/coverage-istanbul"
},
"bugs": {
"url": "https://github.com/vitest-dev/vitest/issues"
},
"keywords": [
"vite",
"vitest",
"test",
"coverage",
"istanbul"
],
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./*": "./*"
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"peerDependencies": {
"vitest": "4.1.12"
},
"dependencies": {
"@babel/core": "^7.29.0",
"@istanbuljs/schema": "^0.1.3",
"@jridgewell/gen-mapping": "^0.3.13",
"@jridgewell/trace-mapping": "0.3.31",
"istanbul-lib-coverage": "^3.2.2",
"istanbul-lib-report": "^3.0.1",
"istanbul-reports": "^3.2.0",
"magicast": "^0.5.2",
"obug": "^2.1.1",
"tinyrainbow": "^3.1.0"
},
"devDependencies": {
"@types/istanbul-lib-coverage": "^2.0.6",
"@types/istanbul-lib-instrument": "^1.7.8",
"@types/istanbul-lib-report": "^3.0.3",
"@types/istanbul-lib-source-maps": "^4.0.4",
"@types/istanbul-reports": "^3.0.4",
"istanbul-lib-instrument": "^6.0.3",
"istanbul-lib-source-maps": "^5.0.6",
"pathe": "^2.0.3",
"vitest": "4.1.12"
},
"scripts": {
"build": "premove dist && rollup -c",
"dev": "rollup -c --watch --watch.include 'src/**'"
}
}
@@ -0,0 +1,2 @@
import { TrieRouter } from "./router.js";
export { TrieRouter };
@@ -0,0 +1 @@
{"version":3,"file":"octagon-minus.js","sources":["../../../src/icons/octagon-minus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name OctagonMinus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMi41ODYgMTYuNzI2QTIgMiAwIDAgMSAyIDE1LjMxMlY4LjY4OGEyIDIgMCAwIDEgLjU4Ni0xLjQxNGw0LjY4OC00LjY4OEEyIDIgMCAwIDEgOC42ODggMmg2LjYyNGEyIDIgMCAwIDEgMS40MTQuNTg2bDQuNjg4IDQuNjg4QTIgMiAwIDAgMSAyMiA4LjY4OHY2LjYyNGEyIDIgMCAwIDEtLjU4NiAxLjQxNGwtNC42ODggNC42ODhhMiAyIDAgMCAxLTEuNDE0LjU4Nkg4LjY4OGEyIDIgMCAwIDEtMS40MTQtLjU4NnoiIC8+CiAgPHBhdGggZD0iTTggMTJoOCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/octagon-minus\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst OctagonMinus = createLucideIcon('OctagonMinus', [\n [\n 'path',\n {\n d: 'M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z',\n key: '2d38gg',\n },\n ],\n ['path', { d: 'M8 12h8', key: '1wcyev' }],\n]);\n\nexport default OctagonMinus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CACpD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,11 @@
//#region src/adapter/netlify/handler.ts
/**
* @deprecated `hono/netlify` will be removed in v5. Install `@hono/netlify` and import from there instead.
*/
const handle = (app) => {
return (req, context) => {
return app.fetch(req, { context });
};
};
//#endregion
export { handle };
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2025: LibDefinition;
@@ -0,0 +1 @@
{"version":3,"file":"clock-7.js","sources":["../../../src/icons/clock-7.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Clock7\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSIxMiA2IDEyIDEyIDkuNSAxNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/clock-7\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Clock7 = createLucideIcon('Clock7', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['polyline', { points: '12 6 12 12 9.5 16', key: 'ka3394' }],\n]);\n\nexport default Clock7;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CACxC,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,CAAqB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"unlink-2.js","sources":["../../../src/icons/unlink-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Unlink2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgN2gyYTUgNSAwIDAgMSAwIDEwaC0ybS02IDBIN0E1IDUgMCAwIDEgNyA3aDIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/unlink-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Unlink2 = createLucideIcon('Unlink2', [\n ['path', { d: 'M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2', key: '1re2ne' }],\n]);\n\nexport default Unlink2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,102 @@
/**
SHA1 (RFC 3174), MD5 (RFC 1321), and RIPEMD160 legacy, weak hash functions.
RFC 2286 only covers HMAC-RIPEMD160 wrapper material and test vectors,
not the base RIPEMD-160 compression spec.
Don't use them in a new protocol. What "weak" means:
- Collisions can be made with 2^18 effort in MD5, 2^60 in SHA1, 2^80 in RIPEMD160.
- No practical pre-image attacks (only theoretical, 2^123.4)
- HMAC seems kinda ok: https://www.rfc-editor.org/rfc/rfc6151
* @module
*/
import { HashMD } from './_md.ts';
import { type CHash, type TRet } from './utils.ts';
/** Internal SHA1 legacy hash class. */
export declare class _SHA1 extends HashMD<_SHA1> {
private A;
private B;
private C;
private D;
private E;
constructor();
protected get(): [number, number, number, number, number];
protected set(A: number, B: number, C: number, D: number, E: number): void;
protected process(view: DataView, offset: number): void;
protected roundClean(): void;
destroy(): void;
}
/**
* SHA1 (RFC 3174) legacy hash function. It was cryptographically broken.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with SHA1.
* ```ts
* sha1(new Uint8Array([97, 98, 99]));
* ```
*/
export declare const sha1: TRet<CHash>;
/** Internal MD5 legacy hash class. */
export declare class _MD5 extends HashMD<_MD5> {
private A;
private B;
private C;
private D;
constructor();
protected get(): [number, number, number, number];
protected set(A: number, B: number, C: number, D: number): void;
protected process(view: DataView, offset: number): void;
protected roundClean(): void;
destroy(): void;
}
/**
* MD5 (RFC 1321) legacy hash function. It was cryptographically broken.
* MD5 architecture is similar to SHA1, with some differences:
* - Reduced output length: 16 bytes (128 bit) instead of 20
* - 64 rounds, instead of 80
* - Little-endian: could be faster, but will require more code
* - Non-linear index selection: huge speed-up for unroll
* - Per round constants: more memory accesses, additional speed-up for unroll
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with MD5.
* ```ts
* md5(new Uint8Array([97, 98, 99]));
* ```
*/
export declare const md5: TRet<CHash>;
/**
* Internal RIPEMD-160 legacy hash class.
* RFC 2286 only adds HMAC-RIPEMD160 material, not the core hash specification.
*/
export declare class _RIPEMD160 extends HashMD<_RIPEMD160> {
private h0;
private h1;
private h2;
private h3;
private h4;
constructor();
protected get(): [number, number, number, number, number];
protected set(h0: number, h1: number, h2: number, h3: number, h4: number): void;
protected process(view: DataView, offset: number): void;
protected roundClean(): void;
destroy(): void;
}
/**
* RIPEMD-160 - a legacy hash function from 1990s.
* RFC 2286 only covers HMAC-RIPEMD160 test material; the links below point
* at the base RIPEMD-160 references.
* * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160.html}
* * {@link https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf}
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with RIPEMD-160.
* ```ts
* ripemd160(new Uint8Array([97, 98, 99]));
* ```
*/
export declare const ripemd160: TRet<CHash>;
//# sourceMappingURL=legacy.d.ts.map
@@ -0,0 +1,11 @@
'use strict'
const jsonFile = require('jsonfile')
module.exports = {
// jsonfile exports
readJson: jsonFile.readFile,
readJsonSync: jsonFile.readFileSync,
writeJson: jsonFile.writeFile,
writeJsonSync: jsonFile.writeFileSync
}
@@ -0,0 +1,36 @@
# wrappy
Callback wrapping utility
## USAGE
```javascript
var wrappy = require("wrappy")
// var wrapper = wrappy(wrapperFunction)
// make sure a cb is called only once
// See also: http://npm.im/once for this specific use case
var once = wrappy(function (cb) {
var called = false
return function () {
if (called) return
called = true
return cb.apply(this, arguments)
}
})
function printBoo () {
console.log('boo')
}
// has some rando property
printBoo.iAmBooPrinter = true
var onlyPrintOnce = once(printBoo)
onlyPrintOnce() // prints 'boo'
onlyPrintOnce() // does nothing
// random property is retained!
assert.equal(onlyPrintOnce.iAmBooPrinter, true)
```
@@ -0,0 +1,319 @@
/**
* A class that represents each benchmark task in Tinybench. It keeps track of the
* results, name, Bench instance, the task function and the number times the task
* function has been executed.
*/
declare class Task extends EventTarget {
bench: Bench;
/**
* task name
*/
name: string;
fn: Fn;
runs: number;
/**
* the result object
*/
result?: TaskResult;
/**
* Task options
*/
opts: FnOptions;
constructor(bench: Bench, name: string, fn: Fn, opts?: FnOptions);
private loop;
/**
* run the current task and write the results in `Task.result` object
*/
run(): Promise<this>;
/**
* warmup the current task
*/
warmup(): Promise<void>;
addEventListener<K extends TaskEvents, T = TaskEventsMap[K]>(type: K, listener: T, options?: AddEventListenerOptionsArgument): void;
removeEventListener<K extends TaskEvents, T = TaskEventsMap[K]>(type: K, listener: T, options?: RemoveEventListenerOptionsArgument): void;
/**
* change the result object values
*/
setResult(result: Partial<TaskResult>): void;
/**
* reset the task to make the `Task.runs` a zero-value and remove the `Task.result`
* object
*/
reset(): void;
}
/**
* the task function
*/
type Fn = () => any | Promise<any>;
interface FnOptions {
/**
* An optional function that is run before iterations of this task begin
*/
beforeAll?: (this: Task) => void | Promise<void>;
/**
* An optional function that is run before each iteration of this task
*/
beforeEach?: (this: Task) => void | Promise<void>;
/**
* An optional function that is run after each iteration of this task
*/
afterEach?: (this: Task) => void | Promise<void>;
/**
* An optional function that is run after all iterations of this task end
*/
afterAll?: (this: Task) => void | Promise<void>;
}
/**
* the benchmark task result object
*/
type TaskResult = {
error?: unknown;
/**
* The amount of time in milliseconds to run the benchmark task (cycle).
*/
totalTime: number;
/**
* the minimum value in the samples
*/
min: number;
/**
* the maximum value in the samples
*/
max: number;
/**
* the number of operations per second
*/
hz: number;
/**
* how long each operation takes (ms)
*/
period: number;
/**
* task samples of each task iteration time (ms)
*/
samples: number[];
/**
* samples mean/average (estimate of the population mean)
*/
mean: number;
/**
* samples variance (estimate of the population variance)
*/
variance: number;
/**
* samples standard deviation (estimate of the population standard deviation)
*/
sd: number;
/**
* standard error of the mean (a.k.a. the standard deviation of the sampling distribution of the sample mean)
*/
sem: number;
/**
* degrees of freedom
*/
df: number;
/**
* critical value of the samples
*/
critical: number;
/**
* margin of error
*/
moe: number;
/**
* relative margin of error
*/
rme: number;
/**
* p75 percentile
*/
p75: number;
/**
* p99 percentile
*/
p99: number;
/**
* p995 percentile
*/
p995: number;
/**
* p999 percentile
*/
p999: number;
};
/**
* Both the `Task` and `Bench` objects extend the `EventTarget` object,
* so you can attach a listeners to different types of events
* to each class instance using the universal `addEventListener` and
* `removeEventListener`
*/
/**
* Bench events
*/
type BenchEvents = 'abort' | 'complete' | 'error' | 'reset' | 'start' | 'warmup' | 'cycle' | 'add' | 'remove' | 'todo';
type Hook = (task: Task, mode: 'warmup' | 'run') => void | Promise<void>;
type NoopEventListener = () => any | Promise<any>;
type TaskEventListener = (e: Event & {
task: Task;
}) => any | Promise<any>;
interface BenchEventsMap {
abort: NoopEventListener;
start: NoopEventListener;
complete: NoopEventListener;
warmup: NoopEventListener;
reset: NoopEventListener;
add: TaskEventListener;
remove: TaskEventListener;
cycle: TaskEventListener;
error: TaskEventListener;
todo: TaskEventListener;
}
/**
* task events
*/
type TaskEvents = 'abort' | 'complete' | 'error' | 'reset' | 'start' | 'warmup' | 'cycle';
type TaskEventsMap = {
abort: NoopEventListener;
start: TaskEventListener;
error: TaskEventListener;
cycle: TaskEventListener;
complete: TaskEventListener;
warmup: TaskEventListener;
reset: TaskEventListener;
};
type Options = {
/**
* time needed for running a benchmark task (milliseconds) @default 500
*/
time?: number;
/**
* number of times that a task should run if even the time option is finished @default 10
*/
iterations?: number;
/**
* function to get the current timestamp in milliseconds
*/
now?: () => number;
/**
* An AbortSignal for aborting the benchmark
*/
signal?: AbortSignal;
/**
* Throw if a task fails (events will not work if true)
*/
throws?: boolean;
/**
* warmup time (milliseconds) @default 100ms
*/
warmupTime?: number;
/**
* warmup iterations @default 5
*/
warmupIterations?: number;
/**
* setup function to run before each benchmark task (cycle)
*/
setup?: Hook;
/**
* teardown function to run after each benchmark task (cycle)
*/
teardown?: Hook;
};
type BenchEvent = Event & {
task: Task | null;
};
type RemoveEventListenerOptionsArgument = Parameters<typeof EventTarget.prototype.removeEventListener>[2];
type AddEventListenerOptionsArgument = Parameters<typeof EventTarget.prototype.addEventListener>[2];
/**
* The Benchmark instance for keeping track of the benchmark tasks and controlling
* them.
*/
declare class Bench extends EventTarget {
_tasks: Map<string, Task>;
_todos: Map<string, Task>;
/**
* Executes tasks concurrently based on the specified concurrency mode.
*
* - When `mode` is set to `null` (default), concurrency is disabled.
* - When `mode` is set to 'task', each task's iterations (calls of a task function) run concurrently.
* - When `mode` is set to 'bench', different tasks within the bench run concurrently.
*/
concurrency: 'task' | 'bench' | null;
/**
* The maximum number of concurrent tasks to run. Defaults to Infinity.
*/
threshold: number;
signal?: AbortSignal;
throws: boolean;
warmupTime: number;
warmupIterations: number;
time: number;
iterations: number;
now: () => number;
setup: Hook;
teardown: Hook;
constructor(options?: Options);
private runTask;
/**
* run the added tasks that were registered using the
* {@link add} method.
* Note: This method does not do any warmup. Call {@link warmup} for that.
*/
run(): Promise<Task[]>;
/**
* See Bench.{@link concurrency}
*/
runConcurrently(threshold?: number, mode?: NonNullable<Bench['concurrency']>): Promise<Task[]>;
/**
* warmup the benchmark tasks.
* This is not run by default by the {@link run} method.
*/
warmup(): Promise<void>;
/**
* warmup the benchmark tasks concurrently.
* This is not run by default by the {@link runConcurrently} method.
*/
warmupConcurrently(threshold?: number, mode?: NonNullable<Bench['concurrency']>): Promise<void>;
/**
* reset each task and remove its result
*/
reset(): void;
/**
* add a benchmark task to the task map
*/
add(name: string, fn: Fn, opts?: FnOptions): this;
/**
* add a benchmark todo to the todo map
*/
todo(name: string, fn?: Fn, opts?: FnOptions): this;
/**
* remove a benchmark task from the task map
*/
remove(name: string): this;
addEventListener<K extends BenchEvents, T = BenchEventsMap[K]>(type: K, listener: T, options?: AddEventListenerOptionsArgument): void;
removeEventListener<K extends BenchEvents, T = BenchEventsMap[K]>(type: K, listener: T, options?: RemoveEventListenerOptionsArgument): void;
/**
* table of the tasks results
*/
table(convert?: (task: Task) => Record<string, string | number> | undefined): (Record<string, string | number> | null)[];
/**
* (getter) tasks results as an array
*/
get results(): (TaskResult | undefined)[];
/**
* (getter) tasks as an array
*/
get tasks(): Task[];
get todos(): Task[];
/**
* get a task based on the task name
*/
getTask(name: string): Task | undefined;
}
declare const hrtimeNow: () => number;
declare const now: () => number;
export { Bench, type BenchEvent, type BenchEvents, type Fn, type Hook, type Options, Task, type TaskEvents, type TaskResult, hrtimeNow, now };
@@ -0,0 +1,4 @@
declare module '*?script-string' {
const content: string
export default content
}
@@ -0,0 +1,249 @@
/**
* @fileoverview Require or disallow newlines around directives.
* @author Kai Cataldo
* @deprecated in ESLint v4.0.0
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
docs: {
description: "Require or disallow newlines around directives",
recommended: false,
url: "https://eslint.org/docs/latest/rules/lines-around-directive",
},
schema: [
{
oneOf: [
{
enum: ["always", "never"],
},
{
type: "object",
properties: {
before: {
enum: ["always", "never"],
},
after: {
enum: ["always", "never"],
},
},
additionalProperties: false,
minProperties: 2,
},
],
},
],
fixable: "whitespace",
messages: {
expected: 'Expected newline {{location}} "{{value}}" directive.',
unexpected:
'Unexpected newline {{location}} "{{value}}" directive.',
},
deprecated: {
message: "The rule was replaced with a more general rule.",
url: "https://eslint.org/blog/2017/06/eslint-v4.0.0-released/",
deprecatedSince: "4.0.0",
availableUntil: "11.0.0",
replacedBy: [
{
message: "The new rule moved to a plugin.",
url: "https://eslint.org/docs/latest/rules/padding-line-between-statements#examples",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "padding-line-between-statements",
url: "https://eslint.style/rules/padding-line-between-statements",
},
},
],
},
},
create(context) {
const sourceCode = context.sourceCode;
const config = context.options[0] || "always";
const expectLineBefore =
typeof config === "string" ? config : config.before;
const expectLineAfter =
typeof config === "string" ? config : config.after;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Check if node is preceded by a blank newline.
* @param {ASTNode} node Node to check.
* @returns {boolean} Whether or not the passed in node is preceded by a blank newline.
*/
function hasNewlineBefore(node) {
const tokenBefore = sourceCode.getTokenBefore(node, {
includeComments: true,
});
const tokenLineBefore = tokenBefore ? tokenBefore.loc.end.line : 0;
return node.loc.start.line - tokenLineBefore >= 2;
}
/**
* Gets the last token of a node that is on the same line as the rest of the node.
* This will usually be the last token of the node, but it will be the second-to-last token if the node has a trailing
* semicolon on a different line.
* @param {ASTNode} node A directive node
* @returns {Token} The last token of the node on the line
*/
function getLastTokenOnLine(node) {
const lastToken = sourceCode.getLastToken(node);
const secondToLastToken = sourceCode.getTokenBefore(lastToken);
return astUtils.isSemicolonToken(lastToken) &&
lastToken.loc.start.line > secondToLastToken.loc.end.line
? secondToLastToken
: lastToken;
}
/**
* Check if node is followed by a blank newline.
* @param {ASTNode} node Node to check.
* @returns {boolean} Whether or not the passed in node is followed by a blank newline.
*/
function hasNewlineAfter(node) {
const lastToken = getLastTokenOnLine(node);
const tokenAfter = sourceCode.getTokenAfter(lastToken, {
includeComments: true,
});
return tokenAfter.loc.start.line - lastToken.loc.end.line >= 2;
}
/**
* Report errors for newlines around directives.
* @param {ASTNode} node Node to check.
* @param {string} location Whether the error was found before or after the directive.
* @param {boolean} expected Whether or not a newline was expected or unexpected.
* @returns {void}
*/
function reportError(node, location, expected) {
context.report({
node,
messageId: expected ? "expected" : "unexpected",
data: {
value: node.expression.value,
location,
},
fix(fixer) {
const lastToken = getLastTokenOnLine(node);
if (expected) {
return location === "before"
? fixer.insertTextBefore(node, "\n")
: fixer.insertTextAfter(lastToken, "\n");
}
return fixer.removeRange(
location === "before"
? [node.range[0] - 1, node.range[0]]
: [lastToken.range[1], lastToken.range[1] + 1],
);
},
});
}
/**
* Check lines around directives in node
* @param {ASTNode} node node to check
* @returns {void}
*/
function checkDirectives(node) {
const directives = astUtils.getDirectivePrologue(node);
if (!directives.length) {
return;
}
const firstDirective = directives[0];
const leadingComments =
sourceCode.getCommentsBefore(firstDirective);
/*
* Only check before the first directive if it is preceded by a comment or if it is at the top of
* the file and expectLineBefore is set to "never". This is to not force a newline at the top of
* the file if there are no comments as well as for compatibility with padded-blocks.
*/
if (leadingComments.length) {
if (
expectLineBefore === "always" &&
!hasNewlineBefore(firstDirective)
) {
reportError(firstDirective, "before", true);
}
if (
expectLineBefore === "never" &&
hasNewlineBefore(firstDirective)
) {
reportError(firstDirective, "before", false);
}
} else if (
node.type === "Program" &&
expectLineBefore === "never" &&
!leadingComments.length &&
hasNewlineBefore(firstDirective)
) {
reportError(firstDirective, "before", false);
}
const lastDirective = directives.at(-1);
const statements =
node.type === "Program" ? node.body : node.body.body;
/*
* Do not check after the last directive if the body only
* contains a directive prologue and isn't followed by a comment to ensure
* this rule behaves well with padded-blocks.
*/
if (
lastDirective === statements.at(-1) &&
!lastDirective.trailingComments
) {
return;
}
if (
expectLineAfter === "always" &&
!hasNewlineAfter(lastDirective)
) {
reportError(lastDirective, "after", true);
}
if (expectLineAfter === "never" && hasNewlineAfter(lastDirective)) {
reportError(lastDirective, "after", false);
}
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
Program: checkDirectives,
FunctionDeclaration: checkDirectives,
FunctionExpression: checkDirectives,
ArrowFunctionExpression: checkDirectives,
};
},
};
@@ -0,0 +1,58 @@
/**
* @fileoverview Utilities to operate on strings.
* @author Stephen Wade
*/
"use strict";
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
// eslint-disable-next-line no-control-regex -- intentionally including control characters
const ASCII_REGEX = /^[\u0000-\u007f]*$/u;
/** @type {Intl.Segmenter | undefined} */
let segmenter;
//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------
/**
* Converts the first letter of a string to uppercase.
* @param {string} string The string to operate on
* @returns {string} The converted string
*/
function upperCaseFirst(string) {
if (string.length <= 1) {
return string.toUpperCase();
}
return string[0].toUpperCase() + string.slice(1);
}
/**
* Counts graphemes in a given string.
* @param {string} value A string to count graphemes.
* @returns {number} The number of graphemes in `value`.
*/
function getGraphemeCount(value) {
if (ASCII_REGEX.test(value)) {
return value.length;
}
segmenter ??= new Intl.Segmenter("en-US"); // en-US locale should be supported everywhere
let graphemeCount = 0;
// eslint-disable-next-line no-unused-vars -- for-of needs a variable
for (const unused of segmenter.segment(value)) {
graphemeCount++;
}
return graphemeCount;
}
module.exports = {
upperCaseFirst,
getGraphemeCount,
};
@@ -0,0 +1,60 @@
{
"name": "@radix-ui/react-use-layout-effect",
"version": "1.1.2",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"devDependencies": {
"@types/react": "^19.2.2",
"@types/react-dom": "^19.2.2",
"react": "^19.2.0",
"react-dom": "^19.2.0",
"typescript": "^5.9.3",
"@repo/builder": "0.0.0",
"@repo/typescript-config": "0.0.0"
},
"peerDependencies": {
"@types/react": "*",
"react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc"
},
"peerDependenciesMeta": {
"@types/react": {
"optional": true
}
},
"homepage": "https://radix-ui.com/primitives",
"repository": {
"type": "git",
"url": "git+https://github.com/radix-ui/primitives.git",
"directory": "packages/react/use-layout-effect"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "oxlint --max-warnings 0 src",
"clean": "rm -rf dist",
"reset": "rm -rf dist node_modules",
"typecheck": "tsc --noEmit",
"build": "radix-build"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
}
}
@@ -0,0 +1,291 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
const tsutils = __importStar(require("ts-api-utils"));
const ts = __importStar(require("typescript"));
const util_1 = require("../util");
const DEFAULT_COMMENT_PATTERN = /^no default$/iu;
exports.default = (0, util_1.createRule)({
name: 'switch-exhaustiveness-check',
meta: {
type: 'suggestion',
docs: {
description: 'Require switch-case statements to be exhaustive',
requiresTypeChecking: true,
},
hasSuggestions: true,
messages: {
addMissingCases: 'Add branches for missing cases.',
dangerousDefaultCase: 'The switch statement is exhaustive, so the default case is unnecessary.',
switchIsNotExhaustive: 'Switch is not exhaustive. Cases not matched: {{missingBranches}}',
},
schema: [
{
type: 'object',
additionalProperties: false,
properties: {
allowDefaultCaseForExhaustiveSwitch: {
type: 'boolean',
description: `If 'true', allow 'default' cases on switch statements with exhaustive cases.`,
},
considerDefaultExhaustiveForUnions: {
type: 'boolean',
description: `If 'true', the 'default' clause is used to determine whether the switch statement is exhaustive for union type`,
},
defaultCaseCommentPattern: {
type: 'string',
description: `Regular expression for a comment that can indicate an intentionally omitted default case.`,
},
requireDefaultForNonUnion: {
type: 'boolean',
description: `If 'true', require a 'default' clause for switches on non-union types.`,
},
},
},
],
},
defaultOptions: [
{
allowDefaultCaseForExhaustiveSwitch: true,
considerDefaultExhaustiveForUnions: false,
requireDefaultForNonUnion: false,
},
],
create(context, [{ allowDefaultCaseForExhaustiveSwitch, considerDefaultExhaustiveForUnions, defaultCaseCommentPattern, requireDefaultForNonUnion, },]) {
const services = (0, util_1.getParserServices)(context);
const checker = services.program.getTypeChecker();
const compilerOptions = services.program.getCompilerOptions();
const commentRegExp = defaultCaseCommentPattern != null
? new RegExp(defaultCaseCommentPattern, 'u')
: DEFAULT_COMMENT_PATTERN;
function getCommentDefaultCase(node) {
const lastCase = node.cases.at(-1);
const commentsAfterLastCase = lastCase
? context.sourceCode.getCommentsAfter(lastCase)
: [];
const defaultCaseComment = commentsAfterLastCase.at(-1);
if (commentRegExp.test(defaultCaseComment?.value.trim() || '')) {
return defaultCaseComment;
}
return;
}
function typeToString(type) {
return checker.typeToString(type, undefined, ts.TypeFormatFlags.AllowUniqueESSymbolType |
ts.TypeFormatFlags.UseAliasDefinedOutsideCurrentScope |
ts.TypeFormatFlags.UseFullyQualifiedType);
}
function getSwitchMetadata(node) {
const defaultCase = node.cases.find(switchCase => switchCase.test == null);
const discriminantType = (0, util_1.getConstrainedTypeAtLocation)(services, node.discriminant);
const symbolName = discriminantType.getSymbol()?.escapedName;
const containsNonLiteralType = doesTypeContainNonLiteralType(discriminantType);
const caseTypes = new Set();
for (const switchCase of node.cases) {
// If the `test` property of the switch case is `null`, then we are on a
// `default` case.
if (switchCase.test == null) {
continue;
}
const caseType = (0, util_1.getConstrainedTypeAtLocation)(services, switchCase.test);
caseTypes.add(caseType);
}
const missingLiteralBranchTypes = [];
for (const unionPart of tsutils.unionConstituents(discriminantType)) {
for (const intersectionPart of tsutils.intersectionConstituents(unionPart)) {
if (caseTypes.has(intersectionPart) ||
!isTypeLiteralLikeType(intersectionPart)) {
continue;
}
// "missing", "optional" and "undefined" types are different runtime objects,
// but all of them have TypeFlags.Undefined type flag
if ([...caseTypes].some(tsutils.isIntrinsicUndefinedType) &&
tsutils.isIntrinsicUndefinedType(intersectionPart)) {
continue;
}
missingLiteralBranchTypes.push(intersectionPart);
}
}
return {
containsNonLiteralType,
defaultCase: defaultCase ?? getCommentDefaultCase(node),
missingLiteralBranchTypes,
symbolName,
};
}
function checkSwitchExhaustive(node, switchMetadata) {
const { defaultCase, missingLiteralBranchTypes, symbolName } = switchMetadata;
// If considerDefaultExhaustiveForUnions is enabled, the presence of a default case
// always makes the switch exhaustive.
if (considerDefaultExhaustiveForUnions && defaultCase != null) {
return;
}
if (missingLiteralBranchTypes.length > 0) {
context.report({
node: node.discriminant,
messageId: 'switchIsNotExhaustive',
data: {
missingBranches: missingLiteralBranchTypes
.map(missingType => tsutils.isTypeFlagSet(missingType, ts.TypeFlags.ESSymbolLike)
? `typeof ${missingType.getSymbol()?.escapedName}`
: typeToString(missingType))
.join(' | '),
},
suggest: [
{
messageId: 'addMissingCases',
fix(fixer) {
return fixSwitch(fixer, node, missingLiteralBranchTypes, defaultCase, symbolName?.toString());
},
},
],
});
}
}
function fixSwitch(fixer, node, missingBranchTypes, // null means default branch
defaultCase, symbolName) {
const lastCase = node.cases.length > 0 ? node.cases[node.cases.length - 1] : null;
const caseIndent = lastCase
? ' '.repeat(lastCase.loc.start.column)
: // If there are no cases, use indentation of the switch statement and
// leave it to the user to format it correctly.
' '.repeat(node.loc.start.column);
const missingCases = [];
for (const missingBranchType of missingBranchTypes) {
if (missingBranchType == null) {
missingCases.push(`default: { throw new Error('default case') }`);
continue;
}
const missingBranchName = missingBranchType.getSymbol()?.escapedName;
let caseTest = tsutils.isTypeFlagSet(missingBranchType, ts.TypeFlags.ESSymbolLike)
? // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
missingBranchName
: typeToString(missingBranchType);
if (symbolName &&
(missingBranchName || missingBranchName === '') &&
(0, util_1.requiresQuoting)(missingBranchName.toString(), compilerOptions.target)) {
const escapedBranchName = missingBranchName
.replaceAll("'", "\\'")
.replaceAll('\n', '\\n')
.replaceAll('\r', '\\r');
caseTest = `${symbolName}['${escapedBranchName}']`;
}
missingCases.push(`case ${caseTest}: { throw new Error('Not implemented yet: ${caseTest
.replaceAll('\\', '\\\\')
.replaceAll("'", "\\'")} case') }`);
}
const fixString = missingCases
.map(code => `${caseIndent}${code}`)
.join('\n');
if (lastCase) {
if (defaultCase) {
const beforeFixString = missingCases
.map(code => `${code}\n${caseIndent}`)
.join('');
return fixer.insertTextBefore(defaultCase, beforeFixString);
}
return fixer.insertTextAfter(lastCase, `\n${fixString}`);
}
// There were no existing cases.
const openingBrace = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.discriminant, util_1.isOpeningBraceToken), util_1.NullThrowsReasons.MissingToken('{', 'discriminant'));
const closingBrace = (0, util_1.nullThrows)(context.sourceCode.getTokenAfter(node.discriminant, util_1.isClosingBraceToken), util_1.NullThrowsReasons.MissingToken('}', 'discriminant'));
return fixer.replaceTextRange([openingBrace.range[0], closingBrace.range[1]], ['{', fixString, `${caseIndent}}`].join('\n'));
}
function checkSwitchUnnecessaryDefaultCase(switchMetadata) {
if (allowDefaultCaseForExhaustiveSwitch) {
return;
}
const { containsNonLiteralType, defaultCase, missingLiteralBranchTypes } = switchMetadata;
if (missingLiteralBranchTypes.length === 0 &&
defaultCase != null &&
!containsNonLiteralType) {
context.report({
node: defaultCase,
messageId: 'dangerousDefaultCase',
});
}
}
function checkSwitchNoUnionDefaultCase(node, switchMetadata) {
if (!requireDefaultForNonUnion) {
return;
}
const { containsNonLiteralType, defaultCase } = switchMetadata;
if (containsNonLiteralType && defaultCase == null) {
context.report({
node: node.discriminant,
messageId: 'switchIsNotExhaustive',
data: { missingBranches: 'default' },
suggest: [
{
messageId: 'addMissingCases',
fix(fixer) {
return fixSwitch(fixer, node, [null], defaultCase);
},
},
],
});
}
}
return {
SwitchStatement(node) {
const switchMetadata = getSwitchMetadata(node);
checkSwitchExhaustive(node, switchMetadata);
checkSwitchUnnecessaryDefaultCase(switchMetadata);
checkSwitchNoUnionDefaultCase(node, switchMetadata);
},
};
},
});
function isTypeLiteralLikeType(type) {
return tsutils.isTypeFlagSet(type, ts.TypeFlags.Literal |
ts.TypeFlags.Undefined |
ts.TypeFlags.Null |
ts.TypeFlags.UniqueESSymbol);
}
/**
* For example:
*
* - `"foo" | "bar"` is a type with all literal types.
* - `"foo" | number` is a type that contains non-literal types.
* - `"foo" & { bar: 1 }` is a type that contains non-literal types.
*
* Default cases are never superfluous in switches with non-literal types.
*/
function doesTypeContainNonLiteralType(type) {
return tsutils
.unionConstituents(type)
.some(type => tsutils
.intersectionConstituents(type)
.every(subType => !isTypeLiteralLikeType(subType)));
}
@@ -0,0 +1,39 @@
import{Protocol as gQ}from"@modelcontextprotocol/client";import{EmptyResultSchema as vQ}from"@modelcontextprotocol/core";var n="ui/resourceUri",o="text/html;profile=mcp-app";class L{_eventSlots=new Map;setHandler(X,Y){let Z=this._ensureEventSlot(X);if(Z.onHandler&&Y)console.warn(`[MCP Apps] on${String(X)} handler replaced. Use addEventListener("${String(X)}", …) to add multiple listeners without replacing.`);Z.onHandler=Y}getHandler(X){return this._eventSlots.get(X)?.onHandler}addEventListener(X,Y){this._ensureEventSlot(X).listeners.push(Y)}removeEventListener(X,Y){let Z=this._eventSlots.get(X);if(!Z)return;let $=Z.listeners.indexOf(Y);if($!==-1)Z.listeners.splice($,1)}dispatch(X,Y){let Z=this._eventSlots.get(X);if(!Z)return;Z.onHandler?.(Y);for(let $ of[...Z.listeners])$(Y)}_ensureEventSlot(X){let Y=this._eventSlots.get(X);if(!Y)Y={listeners:[]},this._eventSlots.set(X,Y);return Y}}class _{_methods=new Set;claim(X,Y){if(this._methods.has(X))throw Error(`Handler for "${X}" already registered (via ${Y}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(X)}replace(X){this._methods.add(X)}release(X){this._methods.delete(X)}has(X){return this._methods.has(X)}}var f=new Set;function O(X,Y){let[Z,$]=Y,D=Z?.shape;if(typeof D?.method?.value!=="string")return;let K=D.method.value,W=X==="request"?"setRequestHandler":"setNotificationHandler";if(!f.has(W))f.add(W),console.warn(`[ext-apps] ${W}(Schema, handler) is deprecated; use ${W}("${K}", { params: Schema.shape.params }, handler).`);let G=$;return[K,{params:D.params},X==="request"?(J,N)=>G({method:K,params:J},a(N)):(J)=>G({method:K,params:J})]}function a(X){return{signal:X.mcpReq.signal,requestId:X.mcpReq.id,sessionId:X.sessionId,_meta:X.mcpReq._meta,sendRequest:X.mcpReq.send,sendNotification:X.mcpReq.notify,authInfo:X.http?.authInfo}}import{JSONRPCMessageSchema as LQ}from"@modelcontextprotocol/core";var E="2026-01-26",s="ui/open-link",t="ui/download-file",e="ui/message",QQ="ui/notifications/sandbox-proxy-ready",XQ="ui/notifications/sandbox-resource-ready",YQ="ui/notifications/size-changed",ZQ="ui/notifications/tool-input",q="ui/notifications/tool-input-partial",$Q="ui/notifications/tool-result",DQ="ui/notifications/tool-cancelled",KQ="ui/notifications/host-context-changed",WQ="ui/notifications/request-teardown",GQ="ui/resource-teardown",JQ="ui/initialize",NQ="ui/notifications/initialized",VQ="ui/request-display-mode";class j{eventTarget;eventSource;messageListener;constructor(X=window.parent,Y){this.eventTarget=X;this.eventSource=Y;this.messageListener=(Z)=>{if(Y&&Z.source!==this.eventSource){console.debug("Ignoring message from unknown source",Z);return}let $=LQ.safeParse(Z.data);if($.success)console.debug("Parsed message",$.data),this.onmessage?.($.data);else if(Z.data?.jsonrpc!=="2.0")console.debug("Ignoring non-JSON-RPC message",$.error.message,Z);else console.error("Failed to parse message",$.error.message,Z),this.onerror?.(Error("Invalid JSON-RPC message received: "+$.error.message))}}async start(){window.addEventListener("message",this.messageListener)}async send(X,Y){if(X.method!==q)console.debug("Sending message",X);this.eventTarget.postMessage(X,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}import{z as Q}from"zod/v4";import{ContentBlockSchema as g,CallToolResultSchema as jQ,EmbeddedResourceSchema as zQ,ImplementationSchema as v,RequestIdSchema as BQ,ResourceLinkSchema as _Q,ToolSchema as OQ}from"@modelcontextprotocol/core";var d=Q.union([Q.literal("light"),Q.literal("dark")]).describe("Color theme preference for the host environment."),V=Q.union([Q.literal("inline"),Q.literal("fullscreen"),Q.literal("pip")]).describe("Display mode for UI presentation."),EQ=Q.union([Q.literal("--color-background-primary"),Q.literal("--color-background-secondary"),Q.literal("--color-background-tertiary"),Q.literal("--color-background-inverse"),Q.literal("--color-background-ghost"),Q.literal("--color-background-info"),Q.literal("--color-background-danger"),Q.literal("--color-background-success"),Q.literal("--color-background-warning"),Q.literal("--color-background-disabled"),Q.literal("--color-text-primary"),Q.literal("--color-text-secondary"),Q.literal("--color-text-tertiary"),Q.literal("--color-text-inverse"),Q.literal("--color-text-ghost"),Q.literal("--color-text-info"),Q.literal("--color-text-danger"),Q.literal("--color-text-success"),Q.literal("--color-text-warning"),Q.literal("--color-text-disabled"),Q.literal("--color-border-primary"),Q.literal("--color-border-secondary"),Q.literal("--color-border-tertiary"),Q.literal("--color-border-inverse"),Q.literal("--color-border-ghost"),Q.literal("--color-border-info"),Q.literal("--color-border-danger"),Q.literal("--color-border-success"),Q.literal("--color-border-warning"),Q.literal("--color-border-disabled"),Q.literal("--color-ring-primary"),Q.literal("--colLine truncated
Individual style keys are optional - hosts may provide any subset of these values.
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Q.union([Q.string(),Q.undefined()]).describe(`Style variables for theming MCP apps.
Individual style keys are optional - hosts may provide any subset of these values.
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
Individual style keys are optional - hosts may provide any subset of these values.
Values are strings containing CSS values (colors, sizes, font stacks, etc.).
Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),FQ=Q.object({method:Q.literal("ui/open-link"),params:Q.object({url:Q.string().describe("URL to open in the host's browser")})}),I=Q.object({isError:Q.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),P=Q.object({isError:Q.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),R=Q.object({isError:Q.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),IQ=Q.object({method:Q.literal("ui/notifications/sandbox-proxy-ready"),params:Q.object({})}),z=Q.object({connectDomains:Q.array(Q.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
- Maps to CSP \`connect-src\` directive
- Empty or omitted → no network connections (secure default)`),resourceDomains:Q.array(Q.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:Q.array(Q.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:Q.array(Q.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),B=Q.object({camera:Q.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:Q.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:Q.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:Q.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),PQ=Q.object({method:Q.literal("ui/notifications/size-changed"),params:Q.object({width:Q.number().optional().describe("New width in pixels."),height:Q.number().optional().describe("New height in pixels.")})}),w=Q.object({method:Q.literal("ui/notifications/tool-input"),params:Q.object({arguments:Q.record(Q.string(),Q.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),A=Q.object({method:Q.literal("ui/notifications/tool-input-partial"),params:Q.object({arguments:Q.record(Q.string(),Q.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),H=Q.object({method:Q.literal("ui/notifications/tool-cancelled"),params:Q.object({reason:Q.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),h=Q.object({fonts:Q.string().optional()}),m=Q.object({variables:qQ.optional().describe("CSS variables for theming the app."),css:h.optional().describe("CSS blocks that apps can inject.")}),U=Q.object({method:Q.literal("ui/resource-teardown"),params:Q.object({})}),T=Q.record(Q.string(),Q.unknown()),F=Q.object({text:Q.object({}).optional().describe("Host supports text content blocks."),image:Q.object({}).optional().describe("Host supports image content blocks."),audio:Q.object({}).optional().describe("Host supports audio content blocks."),resource:Q.object({}).optional().describe("Host supports resource content blocks."),resourceLink:Q.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:Q.object({}).optional().describe("Host supports structured content.")}),RQ=Q.object({method:Q.literal("ui/notifications/request-teardown"),params:Q.object({}).optional()}),c=Q.object({experimental:Q.record(Q.string(),Q.record(Q.string(),Q.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed by identifier."),openLinks:Q.object({}).optional().describe("Host supports opening external URLs."),downloadFile:Q.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:Q.object({listChanged:Q.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:Q.object({listChanged:Q.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:Q.object({}).optional().describe("Host accepts log messages."),sandbox:Q.object({permissions:B.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:z.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:F.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:F.optional().describe("Host supports receiving content messages (ui/message) from the view."),sampling:Q.object({tools:Q.object({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),p=Q.object({experimental:Q.record(Q.string(),Q.record(Q.string(),Q.any()).describe("Experimental features keyed by identifier.")).optional().describe("Experimental features keyed Line truncated
Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include:
- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:Q.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.
Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
- \`true\`: request visible border + background
- \`false\`: request no visible border + background
- omitted: host decides border`)}),HQ=Q.object({method:Q.literal("ui/request-display-mode"),params:Q.object({mode:V.describe("The display mode being requested.")})}),C=Q.object({mode:V.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),i=Q.union([Q.literal("model"),Q.literal("app")]).describe("Tool visibility scope - who can access the tool."),UQ=Q.object({resourceUri:Q.string().optional(),visibility:Q.array(i).optional().describe(`Who can access this tool. Default: ["model", "app"]
- "model": Tool visible to and callable by the agent
- "app": Tool callable by the app from this server only`),csp:Q.never().optional(),permissions:Q.never().optional()}),sQ=Q.object({mimeTypes:Q.array(Q.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),TQ=Q.object({method:Q.literal("ui/download-file"),params:Q.object({contents:Q.array(Q.union([zQ,_Q])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),CQ=Q.object({method:Q.literal("ui/message"),params:Q.object({role:Q.literal("user").describe('Message role, currently only "user" is supported.'),content:Q.array(g).describe("Message content blocks (text, image, etc.).")})}),MQ=Q.object({method:Q.literal("ui/notifications/sandbox-resource-ready"),params:Q.object({html:Q.string().describe("HTML content to load into the inner iframe."),sandbox:Q.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:z.optional().describe("CSP configuration from resource metadata."),permissions:B.optional().describe("Sandbox permissions from resource metadata.")})}),M=Q.object({method:Q.literal("ui/notifications/tool-result"),params:jQ.describe("Standard MCP tool execution result.")}),k=Q.object({toolInfo:Q.object({id:BQ.optional().describe("JSON-RPC id of the tools/call request."),tool:OQ.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:d.optional().describe("Current color theme preference."),styles:m.optional().describe("Style configuration for theming the app."),displayMode:V.optional().describe("How the UI is currently displayed."),availableDisplayModes:Q.array(V).optional().describe("Display modes the host supports."),containerDimensions:Q.union([Q.object({height:Q.number().describe("Fixed container height in pixels.")}),Q.object({maxHeight:Q.union([Q.number(),Q.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(Q.union([Q.object({width:Q.number().describe("Fixed container width in pixels.")}),Q.object({maxWidth:Q.union([Q.number(),Q.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:Q.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:Q.string().optional().describe("User's timezone in IANA format."),userAgent:Q.string().optional().describe("Host application identifier."),platform:Q.union([Q.literal("web"),Q.literal("desktop"),Q.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:Q.object({touch:Q.boolean().optional().describe("Whether the device supports touch input."),hover:Q.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:Q.object({top:Q.number().describe("Top safe area inset in pixels."),right:Q.number().describe("Right safe area inset in pixels."),bottom:Q.number().describe("Bottom safe area inset in pixels."),left:Q.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),b=Q.object({method:Q.literal("ui/notifications/host-context-changed"),params:k.describe("Partial context update containing only changed fields.")}),kQ=Q.object({method:Q.literal("ui/update-model-context"),params:Q.object({content:Q.array(g).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:Q.record(Q.string(),Q.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),bQ=Q.object({method:Q.literal("ui/initialize"),params:Q.object({appInfo:v.describe("App identification (name and version)."),appCapabilities:p.describe("Features and capabilities this app provides."),protocolVersion:Q.string().describe("Protocol version this app supports.")})}),S=Q.object({protocolVersion:Q.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:v.describe("Host application identification and version."),hostCapabilities:c.describe("Features and capabilities provided by the host."),hostContext:k.describe("Rich context about the host environment.")}).passthrough();var SQ={target:"draft-2020-12"};async function y(X,Y){let Z=X["~standard"];if(Z.jsonSchema)return Z.jsonSchema[Y](SQ);throw Error(`Schema (vendor: ${Z.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function x(X,Y,Z=""){let $=await X["~standard"].validate(Y);if($.issues){let D=$.issues.map((K)=>{let W=K.path?.map((G)=>typeof G==="object"?G.key:G).join(".");return W?`${W}: ${K.message}`:K.message}).join("; ");throw Error(Z+D)}return $.value}import{z as dQ}from"zod/v4";function yQ(){let X=document.documentElement.getAttribute("data-theme");if(X==="dark"||X==="light")return X;return document.documentElement.classList.contains("dark")?"dark":"light"}function xQ(X){let Y=document.documentElement;Y.setAttribute("data-theme",X),Y.style.colorScheme=X}function uQ(X,Y=document.documentElement){for(let[Z,$]of Object.entries(X))if($!==void 0)Y.style.setProperty(Z,$)}function fQ(X){if(document.getElementById("__mcp-host-fonts"))return;let Z=document.createElement("style");Z.id="__mcp-host-fonts",Z.textContent=X,document.head.appendChild(Z)}function hQ(X,Y){let Z={...X,...Y};if(Y.experimental!==void 0)Z.experimental={...X.experimental,...Y.experimental};if(Y.tools!==void 0)Z.tools={...X.tools,...Y.tools};return Z}class l extends gQ{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new L;_methods=new _;setRequestHandler=(...X)=>{let[Y,...Z]=O("request",X)??X;this._methods.claim(Y,"setRequestHandler"),super.setRequestHandler.call(this,Y,...Z)};setNotificationHandler=(...X)=>{let[Y,...Z]=O("notification",X)??X;this._methods.claim(Y,"setNotificationHandler"),super.setNotificationHandler.call(this,Y,...Z)};removeRequestHandler=(X)=>{this._methods.release(X),super.removeRequestHandler(X)};removeNotificationHandler=(X)=>{this._methods.release(X),super.removeNotificationHandler(X)};replaceRequestHandler=(X,...Y)=>{this._methods.replace(X),super.setRequestHandler.call(this,X,...Y)};_assertInitialized(X){if(this._initializedSent)return;let Y=`[ext-apps] App.${X}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(Y);console.warn(`${Y}. This will throw in a future release.`)}eventSchemas={toolinput:w,toolinputpartial:A,toolresult:M,toolcancelled:H,hostcontextchanged:b};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(X){if(!l.ONE_SHOT_EVENTS.has(X)||this._everHadListener.has(X))return;if(this._everHadListener.add(X),Line truncated
@@ -0,0 +1 @@
{"version":3,"file":"receipt-japanese-yen.js","sources":["../../../src/icons/receipt-japanese-yen.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ReceiptJapaneseYen\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAydjIwbDItMSAyIDEgMi0xIDIgMSAyLTEgMiAxIDItMSAyIDFWMmwtMiAxLTItMS0yIDEtMi0xLTIgMS0yLTEtMiAxWiIgLz4KICA8cGF0aCBkPSJtMTIgMTAgMy0zIiAvPgogIDxwYXRoIGQ9Im05IDcgMyAzdjcuNSIgLz4KICA8cGF0aCBkPSJNOSAxMWg2IiAvPgogIDxwYXRoIGQ9Ik05IDE1aDYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/receipt-japanese-yen\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ReceiptJapaneseYen = createLucideIcon('ReceiptJapaneseYen', [\n [\n 'path',\n { d: 'M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z', key: 'q3az6g' },\n ],\n ['path', { d: 'm12 10 3-3', key: '1mc12w' }],\n ['path', { d: 'm9 7 3 3v7.5', key: '39i0xv' }],\n ['path', { d: 'M9 11h6', key: '1fldmi' }],\n ['path', { d: 'M9 15h6', key: 'cctwl0' }],\n]);\n\nexport default ReceiptJapaneseYen;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,iBAAiB,oBAAsB,CAAA,CAAA,CAAA;AAAA,CAChE,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2E,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAChG,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2017-2025 Kent C. Dodds
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.