docs: 仓库链接指向本镜像仓库
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run

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,184 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWrappingFixer = getWrappingFixer;
exports.getMovedNodeCode = getMovedNodeCode;
exports.isStrongPrecedenceNode = isStrongPrecedenceNode;
const utils_1 = require("@typescript-eslint/utils");
/**
* Wraps node with some code. Adds parentheses as necessary.
* @returns Fixer which adds the specified code and parens if necessary.
*/
function getWrappingFixer(params) {
const { node, innerNode = node, sourceCode, wrap } = params;
const innerNodes = Array.isArray(innerNode) ? innerNode : [innerNode];
return (fixer) => {
const innerCodes = innerNodes.map(innerNode => {
let code = sourceCode.getText(innerNode);
/**
* Wrap our node in parens to prevent the following cases:
* - It has a weaker precedence than the code we are wrapping it in
* - It's gotten mistaken as block statement instead of object expression
*/
if (!isStrongPrecedenceNode(innerNode) ||
isObjectExpressionInOneLineReturn(node, innerNode)) {
code = `(${code})`;
}
return code;
});
if (!wrap) {
return fixer.replaceText(node, innerCodes.join(''));
}
// do the wrapping
let code = wrap(...innerCodes);
// check the outer expression's precedence
if (isWeakPrecedenceParent(node) &&
// we wrapped the node in some expression which very likely has a different precedence than original wrapped node
// let's wrap the whole expression in parens just in case
!utils_1.ASTUtils.isParenthesized(node, sourceCode)) {
code = `(${code})`;
}
// check if we need to insert semicolon
if (/^[`([]/.test(code) && isMissingSemicolonBefore(node, sourceCode)) {
code = `;${code}`;
}
return fixer.replaceText(node, code);
};
}
/**
* If the node to be moved and the destination node require parentheses, include parentheses in the node to be moved.
* @param sourceCode Source code of current file
* @param nodeToMove Nodes that need to be moved
* @param destinationNode Final destination node with nodeToMove
* @returns If parentheses are required, code for the nodeToMove node is returned with parentheses at both ends of the code.
*/
function getMovedNodeCode(params) {
const { destinationNode, nodeToMove: existingNode, sourceCode } = params;
const code = sourceCode.getText(existingNode);
if (isStrongPrecedenceNode(existingNode)) {
// Moved node never needs parens
return code;
}
if (!isWeakPrecedenceParent(destinationNode)) {
// Destination would never needs parens, regardless what node moves there
return code;
}
// Parens may be necessary
return `(${code})`;
}
/**
* Check if a node will always have the same precedence if its parent changes.
*/
function isStrongPrecedenceNode(innerNode) {
return (innerNode.type === utils_1.AST_NODE_TYPES.Literal ||
innerNode.type === utils_1.AST_NODE_TYPES.Identifier ||
innerNode.type === utils_1.AST_NODE_TYPES.TSTypeReference ||
innerNode.type === utils_1.AST_NODE_TYPES.TSTypeOperator ||
innerNode.type === utils_1.AST_NODE_TYPES.ArrayExpression ||
innerNode.type === utils_1.AST_NODE_TYPES.ObjectExpression ||
innerNode.type === utils_1.AST_NODE_TYPES.MemberExpression ||
innerNode.type === utils_1.AST_NODE_TYPES.CallExpression ||
innerNode.type === utils_1.AST_NODE_TYPES.NewExpression ||
innerNode.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression ||
innerNode.type === utils_1.AST_NODE_TYPES.TSInstantiationExpression);
}
/**
* Check if a node's parent could have different precedence if the node changes.
*/
function isWeakPrecedenceParent(node) {
const parent = node.parent;
if (!parent) {
return false;
}
if (parent.type === utils_1.AST_NODE_TYPES.UpdateExpression ||
parent.type === utils_1.AST_NODE_TYPES.UnaryExpression ||
parent.type === utils_1.AST_NODE_TYPES.BinaryExpression ||
parent.type === utils_1.AST_NODE_TYPES.LogicalExpression ||
parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression ||
parent.type === utils_1.AST_NODE_TYPES.AwaitExpression) {
return true;
}
if (parent.type === utils_1.AST_NODE_TYPES.MemberExpression &&
parent.object === node) {
return true;
}
if ((parent.type === utils_1.AST_NODE_TYPES.CallExpression ||
parent.type === utils_1.AST_NODE_TYPES.NewExpression) &&
parent.callee === node) {
return true;
}
if (parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression &&
parent.tag === node) {
return true;
}
return false;
}
/**
* Returns true if a node is at the beginning of expression statement and the statement above doesn't end with semicolon.
* Doesn't check if the node begins with `(`, `[` or `` ` ``.
*/
function isMissingSemicolonBefore(node, sourceCode) {
for (;;) {
// https://github.com/typescript-eslint/typescript-eslint/issues/6225
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const parent = node.parent;
if (parent.type === utils_1.AST_NODE_TYPES.ExpressionStatement) {
const block = parent.parent;
if (block.type === utils_1.AST_NODE_TYPES.Program ||
block.type === utils_1.AST_NODE_TYPES.BlockStatement) {
// parent is an expression statement in a block
const statementIndex = block.body.indexOf(parent);
const previousStatement = block.body[statementIndex - 1];
if (statementIndex > 0 &&
utils_1.ESLintUtils.nullThrows(sourceCode.getLastToken(previousStatement), 'Mismatched semicolon and block').value !== ';') {
return true;
}
}
}
if (!isLeftHandSide(node)) {
return false;
}
node = parent;
}
}
/**
* Checks if a node is LHS of an operator.
*/
function isLeftHandSide(node) {
// https://github.com/typescript-eslint/typescript-eslint/issues/6225
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
const parent = node.parent;
// a++
if (parent.type === utils_1.AST_NODE_TYPES.UpdateExpression) {
return true;
}
// a + b
if ((parent.type === utils_1.AST_NODE_TYPES.BinaryExpression ||
parent.type === utils_1.AST_NODE_TYPES.LogicalExpression ||
parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression) &&
node === parent.left) {
return true;
}
// a ? b : c
if (parent.type === utils_1.AST_NODE_TYPES.ConditionalExpression &&
node === parent.test) {
return true;
}
// a(b)
if (parent.type === utils_1.AST_NODE_TYPES.CallExpression && node === parent.callee) {
return true;
}
// a`b`
if (parent.type === utils_1.AST_NODE_TYPES.TaggedTemplateExpression &&
node === parent.tag) {
return true;
}
return false;
}
/**
* Checks if a node's parent is arrow function expression and a inner node is object expression
*/
function isObjectExpressionInOneLineReturn(node, innerNode) {
return (node.parent?.type === utils_1.AST_NODE_TYPES.ArrowFunctionExpression &&
node.parent.body === node &&
innerNode.type === utils_1.AST_NODE_TYPES.ObjectExpression);
}
@@ -0,0 +1 @@
{"version":3,"file":"ticket-minus.js","sources":["../../../src/icons/ticket-minus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TicketMinus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiA5YTMgMyAwIDAgMSAwIDZ2MmEyIDIgMCAwIDAgMiAyaDE2YTIgMiAwIDAgMCAyLTJ2LTJhMyAzIDAgMCAxIDAtNlY3YTIgMiAwIDAgMC0yLTJINGEyIDIgMCAwIDAtMiAyWiIgLz4KICA8cGF0aCBkPSJNOSAxMmg2IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/ticket-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 TicketMinus = createLucideIcon('TicketMinus', [\n [\n 'path',\n {\n d: 'M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z',\n key: 'qn84l0',\n },\n ],\n ['path', { d: 'M9 12h6', key: '1c52cq' }],\n]);\n\nexport default TicketMinus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,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A,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_I","2":"_K"},C:{"2":"_S"},D:{"1":"_fS _XL _wC","2":"_xF _RG _YP"},E:{"1":"_dB","2":"_u"},F:{"2":"_c"},G:{"1":"_M"},H:{"2":"1D"},I:{"1":"_8B","2":"_n"},J:{"1":"A","2":"D"},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:{"2":"_C"}},B:7,C:"HTTP Live Streaming (HLS)",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"arrow-big-up.js","sources":["../../../src/icons/arrow-big-up.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowBigUp\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOSAxOHYtNkg1bDctNyA3IDdoLTR2Nkg5eiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-big-up\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 ArrowBigUp = createLucideIcon('ArrowBigUp', [\n ['path', { d: 'M9 18v-6H5l7-7 7 7h-4v6H9z', key: '1x06kx' }],\n]);\n\nexport default ArrowBigUp;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,12 @@
import type * as JSONSchema from "../core/json-schema.cjs";
import { type $ZodRegistry } from "../core/registries.cjs";
import type { ZodType } from "./schemas.cjs";
type JSONSchemaVersion = "draft-2020-12" | "draft-7" | "draft-4" | "openapi-3.0";
interface FromJSONSchemaParams {
defaultTarget?: JSONSchemaVersion;
registry?: $ZodRegistry<any>;
}
/**
* Converts a JSON Schema to a Zod schema. This function should be considered semi-experimental. It's behavior is liable to change. */
export declare function fromJSONSchema(schema: JSONSchema.JSONSchema | boolean, params?: FromJSONSchemaParams): ZodType;
export {};
@@ -0,0 +1,32 @@
import { URL } from 'node:url'
import Pool from './pool'
import Dispatcher from './dispatcher'
import TClientStats from './client-stats'
import TPoolStats from './pool-stats'
export default Agent
declare class Agent extends Dispatcher {
constructor (opts?: Agent.Options)
/** `true` after `dispatcher.close()` has been called. */
closed: boolean
/** `true` after `dispatcher.destroyed()` has been called or `dispatcher.close()` has been called and the dispatcher shutdown has completed. */
destroyed: boolean
/** Dispatches a request. */
dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
/** Aggregate stats for a Agent by origin. */
readonly stats: Record<string, TClientStats | TPoolStats>
}
declare namespace Agent {
export interface Options extends Pool.Options {
/** Default: `(origin, opts) => new Pool(origin, opts)`. */
factory?(origin: string | URL, opts: Object): Dispatcher;
interceptors?: { Agent?: readonly Dispatcher.DispatchInterceptor[] } & Pool.Options['interceptors']
maxOrigins?: number
}
export interface DispatchOptions extends Dispatcher.DispatchOptions {
}
}
@@ -0,0 +1,44 @@
import type { SourceMapSegment } from './sourcemap-segment.cts';
export interface SourceMapV3 {
file?: string | null;
names: readonly string[];
sourceRoot?: string;
sources: readonly (string | null)[];
sourcesContent?: readonly (string | null)[];
version: 3;
ignoreList?: readonly number[];
}
export interface EncodedSourceMap extends SourceMapV3 {
mappings: string;
}
export interface DecodedSourceMap extends SourceMapV3 {
mappings: readonly SourceMapSegment[][];
}
export interface Pos {
line: number;
column: number;
}
export interface OriginalPos extends Pos {
source: string;
}
export interface BindingExpressionRange {
start: Pos;
expression: string;
}
export type Mapping = {
generated: Pos;
source: undefined;
original: undefined;
name: undefined;
} | {
generated: Pos;
source: string;
original: Pos;
name: string;
} | {
generated: Pos;
source: string;
original: Pos;
name: undefined;
};
//# sourceMappingURL=types.d.ts.map
@@ -0,0 +1,5 @@
'use strict';
throw new Error(
'react-dom/client is not supported in React Server Components.'
);
@@ -0,0 +1,73 @@
import { createNullObject } from "../utils.js";
import { Node } from "./node.js";
//#region src/router/reg-exp-router/trie.ts
var Trie = class {
#context = { varIndex: 0 };
#root = new Node();
#index = 0;
paths = createNullObject();
insert(path, isStatic) {
if (isStatic) {
this.#root.insert(path.split(""), 0, [], this.#context, true);
return;
}
const paramAssoc = [];
const groups = [];
let markedPath = path;
for (let i = 0;;) {
let replaced = false;
markedPath = markedPath.replace(/\{[^}]+\}/g, (m) => {
const mark = `@\\${i}`;
groups[i] = [mark, m];
i++;
replaced = true;
return mark;
});
if (!replaced) break;
}
/**
* - pattern (:label, :label{0-9]+}, ...)
* - /* wildcard
* - character
*/
const tokens = markedPath.match(/(?::[^\/]+)|(?:\/\*$)|./g) || [];
for (let i = groups.length - 1; i >= 0; i--) {
const [mark] = groups[i];
for (let j = tokens.length - 1; j >= 0; j--) if (tokens[j].indexOf(mark) !== -1) {
tokens[j] = tokens[j].replace(mark, groups[i][1]);
break;
}
}
this.#root.insert(tokens, this.#index, paramAssoc, this.#context, false);
this.paths[path] = [this.#index++, paramAssoc];
}
buildRegExp() {
let regexp = this.#root.buildRegExpStr();
if (regexp === "") return [
/^$/,
[],
[]
];
let captureIndex = 0;
const indexReplacementMap = [];
const paramReplacementMap = [];
regexp = regexp.replace(/#(\d+)|@(\d+)|\.\*\$/g, (_, handlerIndex, paramIndex) => {
if (handlerIndex !== void 0) {
indexReplacementMap[++captureIndex] = Number(handlerIndex);
return "$()";
}
if (paramIndex !== void 0) {
paramReplacementMap[Number(paramIndex)] = ++captureIndex;
return "";
}
return "";
});
return [
new RegExp(`^${regexp}`),
indexReplacementMap,
paramReplacementMap
];
}
};
//#endregion
export { Trie };
@@ -0,0 +1 @@
{"version":3,"file":"cfworker-provider.js","sourceRoot":"","sources":["../../../src/validation/cfworker-provider.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,uDAAkD;AAQlD;;;;;;;;;;;;;GAaG;AACH,MAAa,2BAA2B;IAIpC;;;;;;OAMG;IACH,YAAY,OAAiE;QACzE,IAAI,CAAC,YAAY,GAAG,OAAO,EAAE,YAAY,IAAI,IAAI,CAAC;QAClD,IAAI,CAAC,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,SAAS,CAAC;IAC7C,CAAC;IAED;;;;;;;OAOG;IACH,YAAY,CAAI,MAAsB;QAClC,mFAAmF;QACnF,MAAM,SAAS,GAAG,IAAI,uBAAS,CAAC,MAAoD,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QAErH,OAAO,CAAC,KAAc,EAAgC,EAAE;YACpD,MAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;YAEzC,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO;oBACH,KAAK,EAAE,IAAI;oBACX,IAAI,EAAE,KAAU;oBAChB,YAAY,EAAE,SAAS;iBAC1B,CAAC;YACN,CAAC;iBAAM,CAAC;gBACJ,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,IAAI,EAAE,SAAS;oBACf,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,gBAAgB,KAAK,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;iBAC7F,CAAC;YACN,CAAC;QACL,CAAC,CAAC;IACN,CAAC;CACJ;AA9CD,kEA8CC"}
@@ -0,0 +1,81 @@
import { isTag, isCDATA, isText, hasChildren, isComment, } from "domhandler";
import renderHTML from "dom-serializer";
import { ElementType } from "domelementtype";
/**
* @category Stringify
* @deprecated Use the `dom-serializer` module directly.
* @param node Node to get the outer HTML of.
* @param options Options for serialization.
* @returns `node`'s outer HTML.
*/
export function getOuterHTML(node, options) {
return renderHTML(node, options);
}
/**
* @category Stringify
* @deprecated Use the `dom-serializer` module directly.
* @param node Node to get the inner HTML of.
* @param options Options for serialization.
* @returns `node`'s inner HTML.
*/
export function getInnerHTML(node, options) {
return hasChildren(node)
? node.children.map((node) => getOuterHTML(node, options)).join("")
: "";
}
/**
* Get a node's inner text. Same as `textContent`, but inserts newlines for `<br>` tags. Ignores comments.
*
* @category Stringify
* @deprecated Use `textContent` instead.
* @param node Node to get the inner text of.
* @returns `node`'s inner text.
*/
export function getText(node) {
if (Array.isArray(node))
return node.map(getText).join("");
if (isTag(node))
return node.name === "br" ? "\n" : getText(node.children);
if (isCDATA(node))
return getText(node.children);
if (isText(node))
return node.data;
return "";
}
/**
* Get a node's text content. Ignores comments.
*
* @category Stringify
* @param node Node to get the text content of.
* @returns `node`'s text content.
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent}
*/
export function textContent(node) {
if (Array.isArray(node))
return node.map(textContent).join("");
if (hasChildren(node) && !isComment(node)) {
return textContent(node.children);
}
if (isText(node))
return node.data;
return "";
}
/**
* Get a node's inner text, ignoring `<script>` and `<style>` tags. Ignores comments.
*
* @category Stringify
* @param node Node to get the inner text of.
* @returns `node`'s inner text.
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Node/innerText}
*/
export function innerText(node) {
if (Array.isArray(node))
return node.map(innerText).join("");
if (hasChildren(node) && (node.type === ElementType.Tag || isCDATA(node))) {
return innerText(node.children);
}
if (isText(node))
return node.data;
return "";
}
//# sourceMappingURL=stringify.js.map
@@ -0,0 +1,18 @@
/**
* @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 TextQuote = createLucideIcon("TextQuote", [
["path", { d: "M17 6H3", key: "16j9eg" }],
["path", { d: "M21 12H8", key: "scolzb" }],
["path", { d: "M21 18H8", key: "1wfozv" }],
["path", { d: "M3 12v6", key: "fv4c87" }]
]);
export { TextQuote as default };
//# sourceMappingURL=text-quote.js.map
@@ -0,0 +1,16 @@
/**
* @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 Undo = createLucideIcon("Undo", [
["path", { d: "M3 7v6h6", key: "1v2h90" }],
["path", { d: "M21 17a9 9 0 0 0-9-9 9 9 0 0 0-6 2.3L3 13", key: "1r6uu6" }]
]);
export { Undo as default };
//# sourceMappingURL=undo.js.map
@@ -0,0 +1,617 @@
export default `flf2a$ 6 6 20 15 4
5lineobl.flf 11/94 pk6811s@acad.drake.edu, updated 1/95 syb3@ABER.AC.UK
Definitely a 5-line font.
Changes: 6/2001 Markus Gebhard markus@jave.de
Removed topmost line. It IS a 6 line font! Baseline is 6.
$$@
$$@
$$@
$$@
$$@
$$@@
$ @
$//$@
$//$ @
$//$ @
$ $ @
//$ @@
@
$| |$@
$$$ @
$$$ @
$$$ @
$$$ @@
@
$ __/__/_$@
$__/__/_$ @
$ / / $ @
@
@@
@
__//_ @
( // )$@
\\\\ @
(__//_)$ @
// @@
@
() //$@
// @
// @
// ()$@
@@
@
(( ))$@
\\\\ // @
$/\\\\/ $ @
// \\\\ @
((___\\\\$ @@
$$ @
$//$@
$$ @
$ @
$ @
@@
@
_ $@
// $ @
// $ @
// $ @
(( $ @@
@
))$@
//$ @
//$ @
//$ @
//$ @@
@
$ @
@
$_\\\\/_$@
$ //\\$ @
$ @@
@
@
$ $@
$_||_$@
$ || $@
$ $@@
@
$$ @
@
@
$$ @
$//$@@
$$$$ @
$$$$ @
$$$$ @
____ $@
$$$$ @
$$$$ @@
@
$ @
$ @
@
$$ @
() @@
@
@
//$@
// @
// @
//$ @@
@
___ @
// ) )$@
// / / @
// / / @
((___/ /$ @@
@
@
/_ /$ @
/ / @
/ / @
/ /$ @@
@
___ @
// ) )$@
___/ / @
/ ____/ @
/ /____$ @@
@
___ @
// ) )$@
__ / / @
) ) @
((___/ /$ @@
@
$@
//___/ / @
/____ / @
/ / @
/ /$ @@
@
____ $@
// @
//__ @
) ) @
((___/ /$ @@
@
____$ @
// @
//__ @
// ) ) @
((___/ /$ @@
@
___ $ @
// / / @
/ / @
/ / @
/ /$ @@
@
__ @
// ) )$@
((_ / / @
// ) ) @
((__/ /$ @@
@
___ @
// / /$ @
((___/ / @
/ / @
/ /$ @@
@
@
@
()$@
()$ @
@@
@
@
@
()$@
@
//$ @@
@
$$ @
//$@
<< @
\\\\$@
$$ @@
$ $@
$ $@
$ ___$@
$/__/$@
$/__/$@
$ $@@
@
$$ @
\\\\ $@
>>$@
// $@
$$ @@
@
__ @
(( ) )$@
/ / @
( / @
()$ @@
@
__ $ @
// ) )$ @
// / / $ @
\\\\ () ) )$@
\\\\__/ /$ @@
@
// | |$@
//__| | @
/ ___ | @
// | | @
// | |$@@
@
// ) )$@
//___/ / @
/ __ ( @
// ) ) @
//____/ /$ @@
@
// ) )$@
// @
// @
// @
((____/ /$ @@
@
// ) )$@
// / / @
// / / @
// / / @
//____/ /$ @@
@
// / /$@
//____ @
/ ____ @
// @
//____/ /$ @@
@
// / /$@
//___$ @
/ ___ $ @
// @
// @@
@
// ) )$@
// @
// ____$ @
// / / @
((____/ /$ @@
@
// / /$@
//___ / / @
/ ___ / @
// / / @
// / /$ @@
___ ___$@
/ / @
/ / @
/ / @
/ / @
__/ /___$ @@
@
/ /$@
/ / @
/ / @
/ / @
$((___/ /$ @@
@
// / /$@
//__ / / @
//__ /$ @
// \\ \\ @
// \\ \\$ @@
@
/ / $ @
/ / @
/ / @
/ / @
/ /____/ /$@@
@
/| //| |$@
//| // | | @
// | // | | @
// | // | | @
// |// | |$@@
@
/| / /$@
//| / / @
// | / / @
// | / / @
// |/ /$ @@
@
// ) )$@
// / / @
// / / @
// / / @
((___/ /$ @@
@
// ) )$@
//___/ / @
/ ____ /$ @
// @
// @@
@
// ) )$@
// / / @
// / / @
// \\ \\ / @
((____\\ \\$ @@
@
// ) )$@
//___/ / @
/ ___ ( $ @
// | | @
// | |$ @@
@
// ) )$@
(( @
\\\\ @
) )$ @
((___ / / @@
@
/__ ___/$@
/ / @
/ / @
/ / @
/ / $ @@
@
// / /$@
// / / @
// / / @
// / / @
((___/ /$ @@
@
|| / /$@
|| / / @
|| / / @
||/ / @
| /$ @@
@
|| / | / /$@
|| / | / / @
|| / /||/ / @
||/ / | / @
| / | /$ @@
@
\\\\ / /$@
\\ / @
/ / @
/ /\\\\ @
/ / \\\\$@@
@
\\\\ / /$@
\\\\ / / @
\\\\/ / @
/ / @
/ /$ @@
$___ $@
$ / /$@
/ / @
/ / @
$/ / @
/ /___$ @@
@
__$@
/ / @
/ / @
/ / @
/ /__$ @@
@
$ @
\\\\ $ @
\\\\ $ @
\\\\$ @
\\\\$@@
@
$___ $@
/ /$@
$/ /$ @
/ /$ @
__/ /$ @@
$@
/ |$@
//| |$@
$@
@
$ @@
$$$$$ @
$$$$$ @
$$$$$ @
$$$$$ @
$$$$$ @
_____$@@
$$ @
$@
\\\\$@
$@
@
$$ @@
@
@
___ @
// ) )$@
// / / @
((___( ($ @@
@
@
/ __ @
// ) )$@
// / / @
((___/ /$ @@
@
@
___ @
// ) )$@
// @
((____$ @@
@
$@
___ /$ @
// ) /$ @
// / /$ @
((___/ /$ @@
@
@
___ @
//___) )$@
// @
((____$ @@
@
// ) )$@
__//__ $ @
// $ @
// $ @
// $ @@
@
@
___ @
// ) )$@
((___/ / @
//__ $ @@
@
@
/ __ @
// ) )$@
// / / @
// / /$ @@
@
@
( )$ @
/ /$ @
/ / @
/ /$ @@
@
@
( )$ @
/ /$ @
/ / @
(( / /$ @@
@
@
/ ___$ @
//\\ \\ @
// \\ \\ @
// \\ \\$@@
@
$@
//$ @
//$ @
//$ @
//$ @@
@
@
_ __ @
// ) ) ) )$@
// / / / / @
// / / / /$ @@
@
@
__ @
// ) )$@
// / / @
// / /$ @@
@
@
___ @
// ) )$@
// / / @
((___/ /$ @@
@
@
___ @
// ) )$@
//___/ / @
// $ @@
@
@
___ @
// ) )$@
((___/ / @
( ($ @@
@
@
__ @
// ) )$@
// @
// $ @@
@
@
___ @
(( ) )$@
\\ \\ @
// ) )$ @@
@
@
__ ___$@
$/ / $ @
/ / @
/ / $ @@
@
@
@
// / /$@
// / / @
((___( ($ @@
@
@
@
|| / /$@
|| / / @
||/ /$ @@
@
@
@
// / / / /$@
// / / / / @
((__( (__/ /$ @@
@
@
@
\\\\ / /$@
\\/ / @
/ /\\$ @@
@
@
@
// / /$@
((___/ / @
/ /$ @@
@
@
$___ @
$ / /$ @
/ / @
/ /__$ @@
@
_$@
// $@
<< $ @
// $ @
((_$ @@
$@
$@
||$@
||$@
||$@
||$@@
@
_ $@
))$@
//$ @
>>$ @
// $ @@
@
_ _$@
// \\ \\_// $@
$$$ @
$$$ @
@@
_ _ @
@
// | |$@
//__| | @
/ ___ | @
// | |$@@
_ _ @
___ @
// ) )$@
// / / @
// / / @
((___/ /$ @@
_ _ @
@
// / /$@
// / / @
// / / @
((___/ /$ @@
@
_ _ @
___ @
// ) )$@
// / / @
((___( ($ @@
@
_ _ @
___ @
// ) )$@
// / / @
((___/ /$ @@
@
_ _ @
@
// / /$@
// / / @
((___/ /$ @@
@
// ) )$@
//__ / /$ @
/ __ ( @
//___ ) )$ @
// $ @@`
@@ -0,0 +1 @@
{"version":3,"file":"file-diff.js","sources":["../../../src/icons/file-diff.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileDiff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgMkg2YTIgMiAwIDAgMC0yIDJ2MTZhMiAyIDAgMCAwIDIgMmgxMmEyIDIgMCAwIDAgMi0yVjdaIiAvPgogIDxwYXRoIGQ9Ik05IDEwaDYiIC8+CiAgPHBhdGggZD0iTTEyIDEzVjciIC8+CiAgPHBhdGggZD0iTTkgMTdoNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file-diff\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 FileDiff = createLucideIcon('FileDiff', [\n ['path', { d: 'M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z', key: '1rqfz7' }],\n ['path', { d: 'M9 10h6', key: '9gxzsh' }],\n ['path', { d: 'M12 13V7', key: 'h0r20n' }],\n ['path', { d: 'M9 17h6', key: 'r8uit2' }],\n]);\n\nexport default FileDiff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC3F,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,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,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,382 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
/**
* The decorator context types provided to class element decorators.
*/
type ClassMemberDecoratorContext =
| ClassMethodDecoratorContext
| ClassGetterDecoratorContext
| ClassSetterDecoratorContext
| ClassFieldDecoratorContext
| ClassAccessorDecoratorContext;
/**
* The decorator context types provided to any decorator.
*/
type DecoratorContext =
| ClassDecoratorContext
| ClassMemberDecoratorContext;
type DecoratorMetadataObject = Record<PropertyKey, unknown> & object;
type DecoratorMetadata = typeof globalThis extends { Symbol: { readonly metadata: symbol; }; } ? DecoratorMetadataObject : DecoratorMetadataObject | undefined;
/**
* Context provided to a class decorator.
* @template Class The type of the decorated class associated with this context.
*/
interface ClassDecoratorContext<
Class extends abstract new (...args: any) => any = abstract new (...args: any) => any,
> {
/** The kind of element that was decorated. */
readonly kind: "class";
/** The name of the decorated class. */
readonly name: string | undefined;
/**
* Adds a callback to be invoked after the class definition has been finalized.
*
* @example
* ```ts
* function customElement(name: string): ClassDecoratorFunction {
* return (target, context) => {
* context.addInitializer(function () {
* customElements.define(name, this);
* });
* }
* }
*
* @customElement("my-element")
* class MyElement {}
* ```
*/
addInitializer(initializer: (this: Class) => void): void;
readonly metadata: DecoratorMetadata;
}
/**
* Context provided to a class method decorator.
* @template This The type on which the class element will be defined. For a static class element, this will be
* the type of the constructor. For a non-static class element, this will be the type of the instance.
* @template Value The type of the decorated class method.
*/
interface ClassMethodDecoratorContext<
This = unknown,
Value extends (this: This, ...args: any) => any = (this: This, ...args: any) => any,
> {
/** The kind of class element that was decorated. */
readonly kind: "method";
/** The name of the decorated class element. */
readonly name: string | symbol;
/** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
readonly static: boolean;
/** A value indicating whether the class element has a private name. */
readonly private: boolean;
/** An object that can be used to access the current value of the class element at runtime. */
readonly access: {
/**
* Determines whether an object has a property with the same name as the decorated element.
*/
has(object: This): boolean;
/**
* Gets the current value of the method from the provided object.
*
* @example
* let fn = context.access.get(instance);
*/
get(object: This): Value;
};
/**
* Adds a callback to be invoked either after static methods are defined but before
* static initializers are run (when decorating a `static` element), or before instance
* initializers are run (when decorating a non-`static` element).
*
* @example
* ```ts
* const bound: ClassMethodDecoratorFunction = (value, context) {
* if (context.private) throw new TypeError("Not supported on private methods.");
* context.addInitializer(function () {
* this[context.name] = this[context.name].bind(this);
* });
* }
*
* class C {
* message = "Hello";
*
* @bound
* m() {
* console.log(this.message);
* }
* }
* ```
*/
addInitializer(initializer: (this: This) => void): void;
readonly metadata: DecoratorMetadata;
}
/**
* Context provided to a class getter decorator.
* @template This The type on which the class element will be defined. For a static class element, this will be
* the type of the constructor. For a non-static class element, this will be the type of the instance.
* @template Value The property type of the decorated class getter.
*/
interface ClassGetterDecoratorContext<
This = unknown,
Value = unknown,
> {
/** The kind of class element that was decorated. */
readonly kind: "getter";
/** The name of the decorated class element. */
readonly name: string | symbol;
/** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
readonly static: boolean;
/** A value indicating whether the class element has a private name. */
readonly private: boolean;
/** An object that can be used to access the current value of the class element at runtime. */
readonly access: {
/**
* Determines whether an object has a property with the same name as the decorated element.
*/
has(object: This): boolean;
/**
* Invokes the getter on the provided object.
*
* @example
* let value = context.access.get(instance);
*/
get(object: This): Value;
};
/**
* Adds a callback to be invoked either after static methods are defined but before
* static initializers are run (when decorating a `static` element), or before instance
* initializers are run (when decorating a non-`static` element).
*/
addInitializer(initializer: (this: This) => void): void;
readonly metadata: DecoratorMetadata;
}
/**
* Context provided to a class setter decorator.
* @template This The type on which the class element will be defined. For a static class element, this will be
* the type of the constructor. For a non-static class element, this will be the type of the instance.
* @template Value The type of the decorated class setter.
*/
interface ClassSetterDecoratorContext<
This = unknown,
Value = unknown,
> {
/** The kind of class element that was decorated. */
readonly kind: "setter";
/** The name of the decorated class element. */
readonly name: string | symbol;
/** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
readonly static: boolean;
/** A value indicating whether the class element has a private name. */
readonly private: boolean;
/** An object that can be used to access the current value of the class element at runtime. */
readonly access: {
/**
* Determines whether an object has a property with the same name as the decorated element.
*/
has(object: This): boolean;
/**
* Invokes the setter on the provided object.
*
* @example
* context.access.set(instance, value);
*/
set(object: This, value: Value): void;
};
/**
* Adds a callback to be invoked either after static methods are defined but before
* static initializers are run (when decorating a `static` element), or before instance
* initializers are run (when decorating a non-`static` element).
*/
addInitializer(initializer: (this: This) => void): void;
readonly metadata: DecoratorMetadata;
}
/**
* Context provided to a class `accessor` field decorator.
* @template This The type on which the class element will be defined. For a static class element, this will be
* the type of the constructor. For a non-static class element, this will be the type of the instance.
* @template Value The type of decorated class field.
*/
interface ClassAccessorDecoratorContext<
This = unknown,
Value = unknown,
> {
/** The kind of class element that was decorated. */
readonly kind: "accessor";
/** The name of the decorated class element. */
readonly name: string | symbol;
/** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
readonly static: boolean;
/** A value indicating whether the class element has a private name. */
readonly private: boolean;
/** An object that can be used to access the current value of the class element at runtime. */
readonly access: {
/**
* Determines whether an object has a property with the same name as the decorated element.
*/
has(object: This): boolean;
/**
* Invokes the getter on the provided object.
*
* @example
* let value = context.access.get(instance);
*/
get(object: This): Value;
/**
* Invokes the setter on the provided object.
*
* @example
* context.access.set(instance, value);
*/
set(object: This, value: Value): void;
};
/**
* Adds a callback to be invoked immediately after the auto `accessor` being
* decorated is initialized (regardless if the `accessor` is `static` or not).
*/
addInitializer(initializer: (this: This) => void): void;
readonly metadata: DecoratorMetadata;
}
/**
* Describes the target provided to class `accessor` field decorators.
* @template This The `this` type to which the target applies.
* @template Value The property type for the class `accessor` field.
*/
interface ClassAccessorDecoratorTarget<This, Value> {
/**
* Invokes the getter that was defined prior to decorator application.
*
* @example
* let value = target.get.call(instance);
*/
get(this: This): Value;
/**
* Invokes the setter that was defined prior to decorator application.
*
* @example
* target.set.call(instance, value);
*/
set(this: This, value: Value): void;
}
/**
* Describes the allowed return value from a class `accessor` field decorator.
* @template This The `this` type to which the target applies.
* @template Value The property type for the class `accessor` field.
*/
interface ClassAccessorDecoratorResult<This, Value> {
/**
* An optional replacement getter function. If not provided, the existing getter function is used instead.
*/
get?(this: This): Value;
/**
* An optional replacement setter function. If not provided, the existing setter function is used instead.
*/
set?(this: This, value: Value): void;
/**
* An optional initializer mutator that is invoked when the underlying field initializer is evaluated.
* @param value The incoming initializer value.
* @returns The replacement initializer value.
*/
init?(this: This, value: Value): Value;
}
/**
* Context provided to a class field decorator.
* @template This The type on which the class element will be defined. For a static class element, this will be
* the type of the constructor. For a non-static class element, this will be the type of the instance.
* @template Value The type of the decorated class field.
*/
interface ClassFieldDecoratorContext<
This = unknown,
Value = unknown,
> {
/** The kind of class element that was decorated. */
readonly kind: "field";
/** The name of the decorated class element. */
readonly name: string | symbol;
/** A value indicating whether the class element is a static (`true`) or instance (`false`) element. */
readonly static: boolean;
/** A value indicating whether the class element has a private name. */
readonly private: boolean;
/** An object that can be used to access the current value of the class element at runtime. */
readonly access: {
/**
* Determines whether an object has a property with the same name as the decorated element.
*/
has(object: This): boolean;
/**
* Gets the value of the field on the provided object.
*/
get(object: This): Value;
/**
* Sets the value of the field on the provided object.
*/
set(object: This, value: Value): void;
};
/**
* Adds a callback to be invoked immediately after the field being decorated
* is initialized (regardless if the field is `static` or not).
*/
addInitializer(initializer: (this: This) => void): void;
readonly metadata: DecoratorMetadata;
}
@@ -0,0 +1,228 @@
// zod-compat.ts
// ----------------------------------------------------
// Unified types + helpers to accept Zod v3 and v4 (Mini)
// ----------------------------------------------------
import * as z3rt from 'zod/v3';
import * as z4mini from 'zod/v4-mini';
// --- Runtime detection ---
export function isZ4Schema(s) {
// Present on Zod 4 (Classic & Mini) schemas; absent on Zod 3
const schema = s;
return !!schema._zod;
}
// --- Schema construction ---
export function objectFromShape(shape) {
const values = Object.values(shape);
if (values.length === 0)
return z4mini.object({}); // default to v4 Mini
const allV4 = values.every(isZ4Schema);
const allV3 = values.every(s => !isZ4Schema(s));
if (allV4)
return z4mini.object(shape);
if (allV3)
return z3rt.object(shape);
throw new Error('Mixed Zod versions detected in object shape.');
}
// --- Unified parsing ---
export function safeParse(schema, data) {
if (isZ4Schema(schema)) {
// Mini exposes top-level safeParse
const result = z4mini.safeParse(schema, data);
return result;
}
const v3Schema = schema;
const result = v3Schema.safeParse(data);
return result;
}
export async function safeParseAsync(schema, data) {
if (isZ4Schema(schema)) {
// Mini exposes top-level safeParseAsync
const result = await z4mini.safeParseAsync(schema, data);
return result;
}
const v3Schema = schema;
const result = await v3Schema.safeParseAsync(data);
return result;
}
// --- Shape extraction ---
export function getObjectShape(schema) {
if (!schema)
return undefined;
// Zod v3 exposes `.shape`; Zod v4 keeps the shape on `_zod.def.shape`
let rawShape;
if (isZ4Schema(schema)) {
const v4Schema = schema;
rawShape = v4Schema._zod?.def?.shape;
}
else {
const v3Schema = schema;
rawShape = v3Schema.shape;
}
if (!rawShape)
return undefined;
if (typeof rawShape === 'function') {
try {
return rawShape();
}
catch {
return undefined;
}
}
return rawShape;
}
// --- Schema normalization ---
/**
* Normalizes a schema to an object schema. Handles both:
* - Already-constructed object schemas (v3 or v4)
* - Raw shapes that need to be wrapped into object schemas
*/
export function normalizeObjectSchema(schema) {
if (!schema)
return undefined;
// First check if it's a raw shape (Record<string, AnySchema>)
// Raw shapes don't have _def or _zod properties and aren't schemas themselves
if (typeof schema === 'object') {
// Check if it's actually a ZodRawShapeCompat (not a schema instance)
// by checking if it lacks schema-like internal properties
const asV3 = schema;
const asV4 = schema;
// If it's not a schema instance (no _def or _zod), it might be a raw shape
if (!asV3._def && !asV4._zod) {
// Check if all values are schemas (heuristic to confirm it's a raw shape)
const values = Object.values(schema);
if (values.length > 0 &&
values.every(v => typeof v === 'object' &&
v !== null &&
(v._def !== undefined ||
v._zod !== undefined ||
typeof v.parse === 'function'))) {
return objectFromShape(schema);
}
}
}
// If we get here, it should be an AnySchema (not a raw shape)
// Check if it's already an object schema
if (isZ4Schema(schema)) {
// Check if it's a v4 object
const v4Schema = schema;
const def = v4Schema._zod?.def;
if (def && (def.type === 'object' || def.shape !== undefined)) {
return schema;
}
}
else {
// Check if it's a v3 object
const v3Schema = schema;
if (v3Schema.shape !== undefined) {
return schema;
}
}
return undefined;
}
function getDotPath(path) {
if (path.length === 0) {
return 'object root';
}
return path.reduce((acc, seg, index) => {
if (index === 0) {
return String(seg);
}
if (typeof seg === 'number') {
return `${acc}[${seg}]`;
}
return `${acc}.${seg}`;
}, '');
}
// --- Error message extraction ---
/**
* Safely extracts an error message from a parse result error.
* Zod errors can have different structures, so we handle various cases.
*/
export function getParseErrorMessage(error) {
if (error && typeof error === 'object') {
// When present, prioritize zod issues and format as a message and path
if ('issues' in error && Array.isArray(error.issues) && error.issues.length > 0) {
return error.issues
.map((i) => {
if (!i.path?.length) {
return i.message;
}
return `${i.message} at ${getDotPath(i.path)}`;
})
.join('\n');
}
// Try common error structures
if ('message' in error && typeof error.message === 'string') {
return error.message;
}
// Fallback: try to stringify the error
try {
return JSON.stringify(error);
}
catch {
return String(error);
}
}
return String(error);
}
// --- Schema metadata access ---
/**
* Gets the description from a schema, if available.
* Works with both Zod v3 and v4.
*
* Both versions expose a `.description` getter that returns the description
* from their respective internal storage (v3: _def, v4: globalRegistry).
*/
export function getSchemaDescription(schema) {
return schema.description;
}
/**
* Checks if a schema is optional.
* Works with both Zod v3 and v4.
*/
export function isSchemaOptional(schema) {
if (isZ4Schema(schema)) {
const v4Schema = schema;
return v4Schema._zod?.def?.type === 'optional';
}
const v3Schema = schema;
// v3 has isOptional() method
if (typeof schema.isOptional === 'function') {
return schema.isOptional();
}
return v3Schema._def?.typeName === 'ZodOptional';
}
/**
* Gets the literal value from a schema, if it's a literal schema.
* Works with both Zod v3 and v4.
* Returns undefined if the schema is not a literal or the value cannot be determined.
*/
export function getLiteralValue(schema) {
if (isZ4Schema(schema)) {
const v4Schema = schema;
const def = v4Schema._zod?.def;
if (def) {
// Try various ways to get the literal value
if (def.value !== undefined)
return def.value;
if (Array.isArray(def.values) && def.values.length > 0) {
return def.values[0];
}
}
}
const v3Schema = schema;
const def = v3Schema._def;
if (def) {
if (def.value !== undefined)
return def.value;
if (Array.isArray(def.values) && def.values.length > 0) {
return def.values[0];
}
}
// Fallback: check for direct value property (some Zod versions)
const directValue = schema.value;
if (directValue !== undefined)
return directValue;
return undefined;
}
//# sourceMappingURL=zod-compat.js.map
@@ -0,0 +1,14 @@
import Range = require("../classes/range");
import semver = require("../index");
/**
* Return a "simplified" range that matches the same items in `versions` list as the range specified.
* Note that it does *not* guarantee that it would match the same versions in all cases,
* only for the set of versions provided.
* This is useful when generating ranges by joining together multiple versions with `||` programmatically,
* to provide the user with something a bit more ergonomic.
* If the provided range is shorter in string-length than the generated range, then that is returned.
*/
declare function simplify(ranges: string[], range: string | Range, options?: semver.Options): string | Range;
export = simplify;
@@ -0,0 +1,54 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}
{{
var $currentBaseId = $it.baseId
, $prevValid = 'prevValid' + $lvl
, $passingSchemas = 'passingSchemas' + $lvl;
}}
var {{=$errs}} = errors
, {{=$prevValid}} = false
, {{=$valid}} = false
, {{=$passingSchemas}} = null;
{{# def.setCompositeRule }}
{{~ $schema:$sch:$i }}
{{? {{# def.nonEmptySchema:$sch }} }}
{{
$it.schema = $sch;
$it.schemaPath = $schemaPath + '[' + $i + ']';
$it.errSchemaPath = $errSchemaPath + '/' + $i;
}}
{{# def.insertSubschemaCode }}
{{??}}
var {{=$nextValid}} = true;
{{?}}
{{? $i }}
if ({{=$nextValid}} && {{=$prevValid}}) {
{{=$valid}} = false;
{{=$passingSchemas}} = [{{=$passingSchemas}}, {{=$i}}];
} else {
{{ $closingBraces += '}'; }}
{{?}}
if ({{=$nextValid}}) {
{{=$valid}} = {{=$prevValid}} = true;
{{=$passingSchemas}} = {{=$i}};
}
{{~}}
{{# def.resetCompositeRule }}
{{= $closingBraces }}
if (!{{=$valid}}) {
{{# def.extraError:'oneOf' }}
} else {
{{# def.resetErrors }}
{{? it.opts.allErrors }} } {{?}}
@@ -0,0 +1,9 @@
import { Parser, Printer } from "../index.js";
export declare const parsers: {
yaml: Parser;
};
export declare const printers: {
yaml: Printer;
};
@@ -0,0 +1,29 @@
/**
* @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 PointerOff = createLucideIcon("PointerOff", [
["path", { d: "M10 4.5V4a2 2 0 0 0-2.41-1.957", key: "jsi14n" }],
["path", { d: "M13.9 8.4a2 2 0 0 0-1.26-1.295", key: "hirc7f" }],
[
"path",
{ d: "M21.7 16.2A8 8 0 0 0 22 14v-3a2 2 0 1 0-4 0v-1a2 2 0 0 0-3.63-1.158", key: "1jxb2e" }
],
[
"path",
{
d: "m7 15-1.8-1.8a2 2 0 0 0-2.79 2.86L6 19.7a7.74 7.74 0 0 0 6 2.3h2a8 8 0 0 0 5.657-2.343",
key: "10r7hm"
}
],
["path", { d: "M6 6v8", key: "tv5xkp" }],
["path", { d: "m2 2 20 20", key: "1ooewy" }]
]);
export { PointerOff as default };
//# sourceMappingURL=pointer-off.js.map
@@ -0,0 +1,18 @@
/**
* @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 UserX = createLucideIcon("UserX", [
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
["line", { x1: "17", x2: "22", y1: "8", y2: "13", key: "3nzzx3" }],
["line", { x1: "22", x2: "17", y1: "8", y2: "13", key: "1swrse" }]
]);
export { UserX as default };
//# sourceMappingURL=user-x.js.map
@@ -0,0 +1,2 @@
#!/usr/bin/env node
"use strict";const{getCompatibleVersions:e}=require("./index.cjs"),a=process.argv.slice(2),s={};for(let e=0;e<a.length;e++){const r=a[e];r&&("-h"===r||"--help"===r?s.help=!0:"--include-downstream-browsers"===r?s["include-downstream-browsers"]=!0:"--list-all-compatible-versions"===r?s["list-all-compatible-versions"]=!0:"--include-kaios"===r?s["include-kaios"]=!0:"--suppress-warnings"===r?s["suppress-warnings"]=!0:r.startsWith("--target-year=")?s["target-year"]=r.substring(14):"--target-year"===r?s["target-year"]=a[++e]:r.startsWith("--widely-available-on-date=")?s["widely-available-on-date"]=r.substring(27):"--widely-available-on-date"===r?s["widely-available-on-date"]=a[++e]:r.startsWith("--override-last-updated=")?s["override-last-updated"]=r.substring(24):"--override-last-updated"===r?s["override-last-updated"]=a[++e]:(console.error(`Unknown argument: ${r}`),process.exit(1)))}s.help&&(console.log("\nGet Baseline Widely available browser versions or Baseline year browser versions.\n\nUsage: baseline-browser-mapping [options]\n\nOptions:\n --target-year Pass a year between 2015 and the current year to get browser versions compatible \n with all Newly Available features as of the end of the year specified.\n --widely-available-on-date Pass a date in the format 'YYYY-MM-DD' to get versions compatible with Widely \n available on the specified date.\n --include-downstream-browsers Whether to include browsers that use the same engines as a core Baseline browser.\n --include-kaios Whether to include KaiOS in downstream browsers. Requires --include-downstream-browsers.\n --list-all-compatible-versions Whether to include only the minimum compatible browser versions or all compatible versions.\n --suppress-warnings Supress potential warnings about data staleness when using a very recent feature cut off date.\n --override-last-updated Override the last updated date for the baseline data for debugging purposes.\n -h, --help Show help\n\nExamples:\n npx baseline-browser-mapping --target-year 2020\n npx baseline-browser-mapping --widely-available-on-date 2023-04-05\n npx baseline-browser-mapping --include-downstream-browsers\n npx baseline-browser-mapping --list-all-compatible-versions\n".trim()),process.exit(0)),console.log(e({targetYear:s["target-year"]?Number.parseInt(s["target-year"]):void 0,widelyAvailableOnDate:s["widely-available-on-date"],includeDownstreamBrowsers:s["include-downstream-browsers"],listAllCompatibleVersions:s["list-all-compatible-versions"],includeKaiOS:s["include-kaios"],suppressWarnings:s["suppress-warnings"],overrideLastUpdated:s["override-last-updated"]?Number.parseInt(s["override-last-updated"]):void 0}));
@@ -0,0 +1,5 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_adapter_lambda_edge_conninfo = require("./conninfo.js");
const require_adapter_lambda_edge_handler = require("./handler.js");
exports.getConnInfo = require_adapter_lambda_edge_conninfo.getConnInfo;
exports.handle = require_adapter_lambda_edge_handler.handle;
@@ -0,0 +1 @@
{"version":3,"file":"test.mjs","sources":["../../../../src/value/types/test.ts"],"sourcesContent":["import { ValueType } from \"./types\"\n\n/**\n * Tests a provided value against a ValueType\n */\nexport const testValueType = (v: any) => (type: ValueType) => type.test(v)\n"],"names":[],"mappings":"AAEA;;AAEG;MACU,aAAa,GAAG,CAAC,CAAM,KAAK,CAAC,IAAe,KAAK,IAAI,CAAC,IAAI,CAAC,CAAC;;;;"}
@@ -0,0 +1,130 @@
import { decodeBase64Url, encodeBase64Url } from "../encode.js";
import { AlgorithmTypes } from "./jwa.js";
import { JwtAlgorithmMismatch, JwtAlgorithmNotAllowed, JwtAlgorithmRequired, JwtHeaderInvalid, JwtHeaderRequiresKid, JwtPayloadRequiresAud, JwtSymmetricAlgorithmNotAllowed, JwtTokenAudience, JwtTokenExpired, JwtTokenInvalid, JwtTokenIssuedAt, JwtTokenIssuer, JwtTokenNotBefore, JwtTokenSignatureMismatched } from "./types.js";
import { utf8Decoder, utf8Encoder } from "./utf8.js";
import { signing, verifying } from "./jws.js";
//#region src/utils/jwt/jwt.ts
/**
* @module
* JSON Web Token (JWT)
* https://datatracker.ietf.org/doc/html/rfc7519
*/
const encodeJwtPart = (part) => encodeBase64Url(utf8Encoder.encode(JSON.stringify(part)).buffer).replace(/=/g, "");
const encodeSignaturePart = (buf) => encodeBase64Url(buf).replace(/=/g, "");
const decodeJwtPart = (part) => JSON.parse(utf8Decoder.decode(decodeBase64Url(part)));
function isTokenHeader(obj) {
if (typeof obj === "object" && obj !== null) {
const objWithAlg = obj;
return "alg" in objWithAlg && Object.values(AlgorithmTypes).includes(objWithAlg.alg) && (!("typ" in objWithAlg) || objWithAlg.typ === "JWT");
}
return false;
}
const sign = async (payload, privateKey, alg = "HS256") => {
const encodedPayload = encodeJwtPart(payload);
let encodedHeader;
if (typeof privateKey === "object" && "alg" in privateKey) {
alg = privateKey.alg;
encodedHeader = encodeJwtPart({
alg,
typ: "JWT",
kid: privateKey.kid
});
} else encodedHeader = encodeJwtPart({
alg,
typ: "JWT"
});
const partialToken = `${encodedHeader}.${encodedPayload}`;
const signaturePart = await signing(privateKey, alg, utf8Encoder.encode(partialToken));
return `${partialToken}.${encodeSignaturePart(signaturePart)}`;
};
const verify = async (token, publicKey, algOrOptions) => {
if (!algOrOptions) throw new JwtAlgorithmRequired();
const { alg, iss, nbf = true, exp = true, iat = true, aud } = typeof algOrOptions === "string" ? { alg: algOrOptions } : algOrOptions;
if (!alg) throw new JwtAlgorithmRequired();
const tokenParts = token.split(".");
if (tokenParts.length !== 3) throw new JwtTokenInvalid(token);
const { header, payload } = decode(token);
if (!isTokenHeader(header)) throw new JwtHeaderInvalid(header);
if (header.alg !== alg) throw new JwtAlgorithmMismatch(alg, header.alg);
const now = Math.floor(Date.now() / 1e3);
if (nbf && payload.nbf !== void 0) {
if (typeof payload.nbf !== "number" || !Number.isFinite(payload.nbf) || payload.nbf > now) throw new JwtTokenNotBefore(token);
}
if (exp && payload.exp !== void 0) {
if (typeof payload.exp !== "number" || !Number.isFinite(payload.exp) || payload.exp <= now) throw new JwtTokenExpired(token);
}
if (iat && payload.iat !== void 0) {
if (typeof payload.iat !== "number" || !Number.isFinite(payload.iat) || now < payload.iat) throw new JwtTokenIssuedAt(now, payload.iat);
}
if (iss) {
if (!payload.iss) throw new JwtTokenIssuer(iss, null);
if (typeof iss === "string" && payload.iss !== iss) throw new JwtTokenIssuer(iss, payload.iss);
if (iss instanceof RegExp && !iss.test(payload.iss)) throw new JwtTokenIssuer(iss, payload.iss);
}
if (aud) {
if (!payload.aud) throw new JwtPayloadRequiresAud(payload);
if (!(Array.isArray(payload.aud) ? payload.aud : [payload.aud]).some((payloadAud) => aud instanceof RegExp ? aud.test(payloadAud) : typeof aud === "string" ? payloadAud === aud : Array.isArray(aud) && aud.includes(payloadAud))) throw new JwtTokenAudience(aud, payload.aud);
}
const headerPayload = token.substring(0, token.lastIndexOf("."));
let signature;
try {
signature = decodeBase64Url(tokenParts[2]);
} catch {
throw new JwtTokenInvalid(token);
}
if (!await verifying(publicKey, alg, signature, utf8Encoder.encode(headerPayload))) throw new JwtTokenSignatureMismatched(token);
return payload;
};
const symmetricAlgorithms = [
"HS256",
"HS384",
"HS512"
];
const verifyWithJwks = async (token, options, init) => {
const verifyOpts = options.verification || {};
const header = decodeHeader(token);
if (!isTokenHeader(header)) throw new JwtHeaderInvalid(header);
if (!header.kid) throw new JwtHeaderRequiresKid(header);
if (symmetricAlgorithms.includes(header.alg)) throw new JwtSymmetricAlgorithmNotAllowed(header.alg);
if (!options.allowedAlgorithms.includes(header.alg)) throw new JwtAlgorithmNotAllowed(header.alg, options.allowedAlgorithms);
let verifyKeys = options.keys ? [...options.keys] : void 0;
if (options.jwks_uri) {
const response = await fetch(options.jwks_uri, init);
if (!response.ok) throw new Error(`failed to fetch JWKS from ${options.jwks_uri}`);
const data = await response.json();
if (!data.keys) throw new Error("invalid JWKS response. \"keys\" field is missing");
if (!Array.isArray(data.keys)) throw new Error("invalid JWKS response. \"keys\" field is not an array");
verifyKeys ??= [];
verifyKeys.push(...data.keys);
} else if (!verifyKeys) throw new Error("verifyWithJwks requires options for either \"keys\" or \"jwks_uri\" or both");
const matchingKey = verifyKeys.find((key) => key.kid === header.kid);
if (!matchingKey) throw new JwtTokenInvalid(token);
if (matchingKey.alg && matchingKey.alg !== header.alg) throw new JwtAlgorithmMismatch(matchingKey.alg, header.alg);
return await verify(token, matchingKey, {
alg: header.alg,
...verifyOpts
});
};
const decode = (token) => {
const parts = token.split(".");
if (parts.length !== 3) throw new JwtTokenInvalid(token);
try {
return {
header: decodeJwtPart(parts[0]),
payload: decodeJwtPart(parts[1])
};
} catch {
throw new JwtTokenInvalid(token);
}
};
const decodeHeader = (token) => {
const parts = token.split(".");
if (parts.length !== 3) throw new JwtTokenInvalid(token);
try {
return decodeJwtPart(parts[0]);
} catch {
throw new JwtTokenInvalid(token);
}
};
//#endregion
export { decode, decodeHeader, isTokenHeader, sign, verify, verifyWithJwks };
@@ -0,0 +1 @@
{"version":3,"names":["_t","require","_index","isFor","isIfStatement","isStatement","WithStatement","node","word","space","token","print","object","printBlock","body","IfStatement","test","needsBlock","alternate","getLastStatement","consequent","newline","indent","printAndIndentOnComments","dedent","endsWith","statement","ForStatement","tokenContext","TokenContext","forInitHead","forInOrInitHeadAccumulate","init","normal","tokenChar","update","WhileStatement","ForInStatement","noIndentInnerCommentsHere","forInHead","left","right","ForOfStatement","await","forOfHead","DoWhileStatement","semicolon","printStatementAfterKeyword","printer","printTerminatorless","BreakStatement","label","ContinueStatement","ReturnStatement","argument","ThrowStatement","LabeledStatement","TryStatement","block","handlers","handler","finalizer","CatchClause","param","typeAnnotation","SwitchStatement","discriminant","printSequence","cases","rightBrace","SwitchCase","length","DebuggerStatement","commaSeparatorWithNewline","occurrenceCount","VariableDeclaration","parent","declare","kind","hasInits","declar","declarations","printList","undefined","type","VariableDeclarator","id","definite"],"sources":["../../src/generators/statements.ts"],"sourcesContent":["import type Printer from \"../printer.ts\";\nimport { isFor, isIfStatement, isStatement } from \"@babel/types\";\nimport type * as t from \"@babel/types\";\n\n// We inline this package\n// eslint-disable-next-line import/no-extraneous-dependencies\nimport * as charCodes from \"charcodes\";\nimport { TokenContext } from \"../node/index.ts\";\n\nexport function WithStatement(this: Printer, node: t.WithStatement) {\n this.word(\"with\");\n this.space();\n this.token(\"(\");\n this.print(node.object);\n this.token(\")\");\n this.printBlock(node.body);\n}\n\nexport function IfStatement(this: Printer, node: t.IfStatement) {\n this.word(\"if\");\n this.space();\n this.token(\"(\");\n this.print(node.test);\n this.token(\")\");\n this.space();\n\n const needsBlock =\n node.alternate && isIfStatement(getLastStatement(node.consequent));\n if (needsBlock) {\n this.token(\"{\");\n this.newline();\n this.indent();\n }\n\n this.printAndIndentOnComments(node.consequent);\n\n if (needsBlock) {\n this.dedent();\n this.newline();\n this.token(\"}\");\n }\n\n if (node.alternate) {\n if (this.endsWith(charCodes.rightCurlyBrace)) this.space();\n this.word(\"else\");\n this.space();\n this.printAndIndentOnComments(node.alternate);\n }\n}\n\n// Recursively get the last statement.\nfunction getLastStatement(statement: t.Statement): t.Statement {\n // @ts-expect-error: If statement.body is empty or not a Node, isStatement will return false\n const { body } = statement;\n if (isStatement(body) === false) {\n return statement;\n }\n\n return getLastStatement(body);\n}\n\nexport function ForStatement(this: Printer, node: t.ForStatement) {\n this.word(\"for\");\n this.space();\n this.token(\"(\");\n\n this.tokenContext |=\n TokenContext.forInitHead | TokenContext.forInOrInitHeadAccumulate;\n this.print(node.init);\n this.tokenContext = TokenContext.normal;\n\n this.token(\";\");\n\n if (node.test) {\n this.space();\n this.print(node.test);\n }\n this.tokenChar(charCodes.semicolon, 1);\n\n if (node.update) {\n this.space();\n this.print(node.update);\n }\n\n this.token(\")\");\n this.printBlock(node.body);\n}\n\nexport function WhileStatement(this: Printer, node: t.WhileStatement) {\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test);\n this.token(\")\");\n this.printBlock(node.body);\n}\n\nexport function ForInStatement(this: Printer, node: t.ForInStatement) {\n this.word(\"for\");\n this.space();\n this.noIndentInnerCommentsHere();\n this.token(\"(\");\n this.tokenContext |=\n TokenContext.forInHead | TokenContext.forInOrInitHeadAccumulate;\n this.print(node.left);\n this.tokenContext = TokenContext.normal;\n this.space();\n this.word(\"in\");\n this.space();\n this.print(node.right);\n this.token(\")\");\n this.printBlock(node.body);\n}\n\nexport function ForOfStatement(this: Printer, node: t.ForOfStatement) {\n this.word(\"for\");\n this.space();\n if (node.await) {\n this.word(\"await\");\n this.space();\n }\n this.noIndentInnerCommentsHere();\n this.token(\"(\");\n this.tokenContext |= TokenContext.forOfHead;\n this.print(node.left);\n this.space();\n this.word(\"of\");\n this.space();\n this.print(node.right);\n this.token(\")\");\n this.printBlock(node.body);\n}\n\nexport function DoWhileStatement(this: Printer, node: t.DoWhileStatement) {\n this.word(\"do\");\n this.space();\n this.print(node.body);\n this.space();\n this.word(\"while\");\n this.space();\n this.token(\"(\");\n this.print(node.test);\n this.token(\")\");\n this.semicolon();\n}\n\nfunction printStatementAfterKeyword(\n printer: Printer,\n node: t.Node | null | undeLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../src/client/auth.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,uBA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;AACH,SAAS,uBAAuB,CAAgC,MAA4B,EAAE,MAAc;IACxG,iFAAiF;IACjF,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,iEAAiE;IACjE,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QAAQ;QAAE,OAAO,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAChH,OAAO,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACpE,CAAC;AAED,gHAAgH;AAChH,MAAM,mBAAmB,GAAG,iBAAiB,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AACrE,MAAM,0BAA0B,GAAG,gCAAgC,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAE3F,SAAS,mBAAmB,CAAC,MAA2B,EAAE,MAAc;IACpE,OAAO,IAAI,KAAK,CACZ,6DAA6D,MAAM,CAAC,MAAM,4BAA4B,MAAM,IAAI;QAC5G,0GAALine truncated
@@ -0,0 +1,546 @@
# minimatch
A glob matching utility.
This is the matching library used internally by
[node-glob](https://npm.im/node-glob).
It works by splitting glob expressions on `/`, and testing each
path portion with a `Matcher` from
[@isaacs/nonrecursive-glob-match](http://npm.im/@isaacs/nonrecursive-glob-match).
## Why Not Regular Expressions?
Regular Expressions are very powerful, and for many applications,
extremely fast.
However, in JavaScript, they are subject to
[ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS)
in certain cases. Libraries that assemble Regular Expressions
from arbitrary input are thus vulnerable to patterns that cause
pathological behavior. For example, patterns like
`a*a*a*a*a*a*a*a*a*a*a` when matched against a string like
`'a'.repeat(50) + 'b'` would have to repeatedly backtrack through
every failure.
Most other glob matchers in JavaScript (including versions up
through v10 of this library) convert the glob pattern to Regular
Expressions, and then use that to test the string. This is fine
for trusted input, but can fall over badly in cases that cause
recursive backtracking.
## Important Security Consideration!
Though this library is _not_ vulnerable to ReDOS, _any_ library
that performs pattern matching based on arbitrary input will
potentially have edge cases where it performs suboptimally.
To be extremely clear:
> [!WARNING]
> **If you create a system where you take user input, and use
> that input as the source of a pattern matcher, in this or any
> extant glob matcher in JavaScript, you may be pwned.**
The pattern matching library that Minimatch uses in v11 and above
will not be backported to earlier versions. It is a much too deep
of a change to do so.
## Usage
```ts
// hybrid module, load with require() or import
import { minimatch } from 'minimatch'
// or:
// const { minimatch } = require('minimatch')
minimatch('bar.foo', '*.foo') // true!
minimatch('bar.foo', '*.bar') // false!
minimatch('bar.foo', '*.+(bar|foo)') // true!
```
## Features
Supports these glob features:
- Brace Expansion
- Extended glob matching
- "Globstar" `**` matching
- [Posix character
classes](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html),
like `[[:alpha:]]`, supporting the full range of Unicode
characters. For example, `[[:alpha:]]` will match against
`'é'`, though `[a-zA-Z]` will not. Collating symbol and set
matching is not supported, so `[[=e=]]` will _not_ match `'é'`
and `[[.ch.]]` will not match `'ch'` in locales where `ch` is
considered a single character.
See:
- `man sh`
- `man bash` [Pattern
Matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html)
- `man 3 fnmatch`
- `man 5 gitignore`
## Windows
**Please only use forward-slashes in glob expressions.**
Though windows uses either `/` or `\` as its path separator, only `/`
characters are used by this glob implementation. You must use
forward-slashes **only** in glob expressions. Back-slashes in patterns
will always be interpreted as escape characters, not path separators.
Note that `\` or `/` _will_ be interpreted as path separators in paths on
Windows, and will match against `/` in glob expressions.
So just always use `/` in patterns.
### UNC Paths
On Windows, UNC paths like `//?/c:/...` or
`//ComputerName/Share/...` are handled specially.
- Patterns starting with a double-slash followed by some
non-slash characters will preserve their double-slash. As a
result, a pattern like `//*` will match `//x`, but not `/x`.
- Patterns staring with `//?/<drive letter>:` will _not_ treat
the `?` as a wildcard character. Instead, it will be treated
as a normal string.
- Patterns starting with `//?/<drive letter>:/...` will match
file paths starting with `<drive letter>:/...`, and vice versa,
as if the `//?/` was not present. This behavior only is
present when the drive letters are a case-insensitive match to
one another. The remaining portions of the path/pattern are
compared case sensitively, unless `nocase:true` is set.
- The host and share of a pattern starting with
`//<host>/<share>/...` are compared case-insensitively with
those of the file path, if neither has magic. For example,
`//host/share/*` matches `//HOST/SHARE/x`.
- Patterns starting with `//?/UNC/<host>/<share>/...` will match
file paths starting with `//<host>/<share>/...`, and vice
versa, the same as `//?/<drive letter>:`. The `?` is not a
wildcard character.
Note that specifying a UNC path using `\` characters as path
separators is always allowed in the file path argument, but only
allowed in the pattern argument when `windowsPathsNoEscape: true`
is set in the options.
## Minimatch Class
Create a minimatch object by instantiating the `minimatch.Minimatch` class.
```javascript
import { Minimatch } from 'minimatch'
const mm = new Minimatch(pattern, options)
```
### Properties
- `pattern` The original pattern the minimatch object represents.
- `options` The options supplied to the constructor.
- `set` A 2-dimensional array of `Matcher` or string expressions.
Each row in the
array corresponds to a brace-expanded pattern. Each item in the row
corresponds to a single path-part. For example, the pattern
`{a,b/c}/d` would expand to a set of patterns like:
[ [ a, d ]
, [ b, c, d ] ]
If a portion of the pattern doesn't have any "magic" in it
(that is, it's something like `"foo"` rather than `fo*o?`), then it
will be left as a string rather than converted to a `Matcher`.
- `negate` True if the pattern is negated.
- `comment` True if the pattern is a comment.
- `empty` True if the pattern is `""`.
### Methods
- `match(fname)` Return true if the filename matches the pattern, or
false otherwise.
- `hasMagic()` Returns true if the parsed pattern contains any
magic characters. Returns false if all comparator parts are
string literals. If the `magicalBraces` option is set on the
constructor, then it will consider brace expansions which are
not otherwise magical to be magic. If not set, then a pattern
like `a{b,c}d` will return `false`, because neither `abd` nor
`acd` contain any special glob characters.
This does **not** mean that the pattern string can be used as a
literal filename, as it may contain magic glob characters that
are escaped. For example, the pattern `\\*` or `[*]` would not
be considered to have magic, as the matching portion parses to
the literal string `'*'` and would match a path named `'*'`,
not `'\\*'` or `'[*]'`. The `minimatch.unescape()` method may
be used to remove escape characters.
All other methods are internal, and will be called as necessary.
### minimatch(path, pattern, options)
Main export. Tests a path against the pattern using the options.
```javascript
const isJS = minimatch(file, '*.js', { matchBase: true })
```
It keeps the 256 `Minimatch` objects that it used most recently,
so a pattern that it tests again with the same options is not
compiled again. To test many paths against one pattern, a
`Minimatch` object or `minimatch.filter()` is still a bit faster.
### minimatch.filter(pattern, options)
Returns a function that tests its
supplied argument, suitable for use with `Array.filter`. Example:
```javascript
const javascripts = fileList.filter(
minimatch.filter('*.js', { matchBase: true }),
)
```
### minimatch.escape(pattern, options = {})
Escape all magic characters in a glob pattern, so that it will
only ever match literal strings.
If the `windowsPathsNoEscape` option is used, then characters are
escaped by wrapping in `[]`, because a magic character wrapped in
a character class can only be satisfied by that exact character.
Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot
be escaped or unescaped.
### minimatch.unescape(pattern, options = {})
Un-escape a glob string that may contain some escaped characters.
If the `windowsPathsNoEscape` option is used, then square-brace
escapes are removed, but not backslash escapes. For example, it
will turn the string `'[*]'` into `*`, but it will not turn
`'\\*'` into `'*'`, because `\` is a path separator in
`windowsPathsNoEscape` mode.
When `windowsPathsNoEscape` is not set, then both brace escapes
and backslash escapes are removed.
Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot
be escaped or unescaped.
### minimatch.match(list, pattern, options)
Match against the list of
files, in the style of fnmatch or glob. If nothing is matched, and
options.nonull is set, then return a list containing the pattern itself.
```javascript
const javascripts = minimatch.match(fileList, '*.js', { matchBase: true })
```
## Options
All options are `false` by default.
### nobrace
Do not expand `{a,b}` and `{1..3}` brace sets.
### noglobstar
Disable `**` matching against multiple folder names.
### dot
Allow patterns to match filenames starting with a period, even if
the pattern does not explicitly have a period in that spot.
Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`
is set.
### noext
Disable "extglob" style patterns like `+(a|b)`.
### nocase
Perform a case-insensitive match. Case is folded one code point at
a time, with Unicode simple case folding. See [Comparisons to other
fnmatch/glob
implementations](#comparisons-to-other-fnmatchglob-implementations).
### nocaseMagicOnly
When used with `{nocase: true}`, create matchers that
are case-insensitive, but leave string match portions untouched.
Has no effect when used without `{nocase: true}`.
Useful when some other form of case-insensitive matching is used,
or if the original string representation is useful in some other
way.
### normalize
Normalize unicode in the pattern, and in each portion of the tested
path, with this form: `'NFC'`, `'NFD'`, `'NFKC'`, or `'NFKD'`. `true`
means `'NFC'`.
A char such as `é` can be one code point, or `e` followed by a
combining accent. Some file systems, such as on macOS, can give file
names in the second form. Without this option, the two forms do not
match.
- The path is split on `/` before it is normalized. So with NFKC, a
full width `/` normalizes to `/`, but it does not split the path.
It is a char in its portion.
- The syntax of the pattern is parsed before it is normalized. So
with NFKC, a full width `*` is a literal, which matches `*`, and
not a wildcard.
- With `nocase`, the strings are normalized, and then case is folded.
See [@isaacs/nonrecursive-glob-match](http://npm.im/@isaacs/nonrecursive-glob-match#unicode-normalization)
for how classes and combining marks after wildcards are normalized.
### nonull
When a match is not found by `minimatch.match`, return a list containing
the pattern itself if this option is set. When not set, an empty list
is returned if there are no matches.
### magicalBraces
This only affects the results of the `Minimatch.hasMagic` method.
If the pattern contains brace expansions, such as `a{b,c}d`, but
no other magic characters, then the `Minimatch.hasMagic()` method
will return `false` by default. When this option set, it will
return `true` for brace expansion as well as other magic glob
characters.
### matchBase
If set, then patterns without slashes will be matched
against the basename of the path if it contains slashes. For example,
`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.
### nocomment
Suppress the behavior of treating `#` at the start of a pattern as a
comment.
### nonegate
Suppress the behavior of treating a leading `!` character as negation.
### flipNegate
Returns from negate expressions the same as if they were not negated.
(Ie, true on a hit, false on a miss.)
### partial
Compare a partial path to a pattern. As long as the parts of the path that
are present are not contradicted by the pattern, it will be treated as a
match. This is useful in applications where you're walking through a
folder structure, and don't yet have the full path, but want to ensure that
you do not walk down paths that can never be a match.
For example,
```js
minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d
minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d
minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a
```
### windowsPathsNoEscape
Use `\\` as a path separator _only_, and _never_ as an escape
character. If set, all `\\` characters are replaced with `/` in
the pattern. Note that this makes it **impossible** to match
against paths containing literal glob pattern characters, but
allows matching with patterns constructed using `path.join()` and
`path.resolve()` on Windows platforms, mimicking the (buggy!)
behavior of earlier versions on Windows. Please use with
caution, and be mindful of [the caveat about Windows
paths](#windows).
For legacy reasons, this is also set if
`options.allowWindowsEscape` is set to the exact value `false`.
### windowsNoMagicRoot
When a pattern starts with a UNC path or drive letter, and in
`nocase:true` mode, do not convert the root portions of the
pattern into a case-insensitive matchers, and instead
leave them as strings.
This is the default when the platform is `win32` and
`nocase:true` is set.
### preserveMultipleSlashes
By default, multiple `/` characters (other than the leading `//`
in a UNC path, see "UNC Paths" above) are treated as a single
`/`.
That is, a pattern like `a///b` will match the file path `a/b`.
Set `preserveMultipleSlashes: true` to suppress this behavior.
### optimizationLevel
A number indicating the level of optimization that should be done
to the pattern prior to parsing and using it for matches.
Globstar parts `**` are always converted to `*` when `noglobstar`
is set, and multiple adjacent `**` parts are converted into a
single `**` (ie, `a/**/**/b` will be treated as `a/**/b`, as this
is equivalent in all cases).
- `0` - Make no further changes. In this mode, `.` and `..` are
maintained in the pattern, meaning that they must also appear
in the same position in the test path string. Eg, a pattern
like `a/*/../c` will match the string `a/b/../c` but not the
string `a/c`.
- `1` - (default) Remove cases where a double-dot `..` follows a
pattern portion that is not `**`, `.`, `..`, or empty `''`. For
example, the pattern `./a/b/../*` is converted to `./a/*`, and
so it will match the path string `./a/c`, but not the path
string `./a/b/../c`. Dots and empty path portions in the
pattern are preserved. On Windows, a `..` never removes the
drive letter or the UNC host and share at the start of a
pattern, the same as it never removes the `/` at the start of
a posix pattern. So `C:/a/../../x` is converted to `C:/../x`.
- `2` (or higher) - Much more aggressive optimizations, suitable
for use with file-walking cases:
- Remove cases where a double-dot `..` follows a pattern
portion that is not `**`, `.`, or empty `''`, or a Windows
root as above. Remove empty
and `.` portions of the pattern, where safe to do so (ie,
anywhere other than the last position, the first position, or
the second position in a pattern starting with `/`, as this
may indicate a UNC path on Windows).
- Convert patterns containing `<pre>/**/../<p>/<rest>` into the
equivalent `<pre>/{..,**}/<p>/<rest>`, where `<p>` is a
a pattern portion other than `.`, `..`, `**`, or empty
`''`. This stops when there are `braceExpandMax`
patterns.
- Dedupe patterns where a `**` portion is present in one and
omitted in another, and it is not the final path portion, and
they are otherwise equivalent. So `{a/**/b,a/b}` becomes
`a/**/b`, because `**` matches against an empty path portion.
- Dedupe patterns where a `*` portion is present in one, and a
non-dot pattern other than `**`, `.`, `..`, or `''` is in the
same position in the other. So `a/{*,x}/b` becomes `a/*/b`,
because `*` can match against `x`.
- Dedupe only sets of 1000 patterns or fewer, because each
pattern is compared to each other one.
While these optimizations improve the performance of
file-walking use cases such as [glob](http://npm.im/glob) (ie,
the reason this module exists), there are cases where it will
fail to match a literal string that would have been matched in
optimization level 1 or 0.
### platform
When set to `win32`, this will trigger all windows-specific
behaviors (special handling for UNC paths, and treating `\` as
separators in file paths for comparison.)
Defaults to the value of `process.platform`.
### maxGlobstarRecursion
Max number of non-adjacent `**` patterns to recursively walk
down.
The default of `200` is almost certainly high enough for most
purposes, and can handle absurdly excessive patterns.
If the limit is exceeded (which would require very excessively
long patterns and paths containing lots of `**` patterns!), then
it is treated as non-matching, even if the path would normally
match the pattern provided.
That is, this is an intentional false negative, deemed an
acceptable break in correctness for security and performance.
## Comparisons to other fnmatch/glob implementations
While strict compliance with the existing standards is a
worthwhile goal, some discrepancies exist between minimatch and
other implementations. Some are intentional, and some are
unavoidable.
If the pattern starts with a `!` character, then it is negated. Set the
`nonegate` flag to suppress this behavior, and treat leading `!`
characters normally. This is perhaps relevant if you wish to start the
pattern with a negative extglob pattern like `!(a|B)`. Multiple `!`
characters at the start of a pattern will negate the pattern multiple
times.
If a pattern starts with `#`, then it is treated as a comment, and
will not match anything. Use `\#` to match a literal `#` at the
start of a line, or set the `nocomment` flag to suppress this behavior.
The double-star character `**` is supported by default, unless the
`noglobstar` flag is set. This is supported in the manner of bsdglob
and bash 4.1, where `**` only has special significance if it is the only
thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
`a/**b` will not.
If an escaped pattern has no matches, and the `nonull` flag is set,
then minimatch.match returns the pattern as-provided, rather than
interpreting the character escapes. For example,
`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
`"*a?"`. This is like bash with the `nullglob` option off (the
default), except that bash also removes the escapes.
If brace expansion is not disabled, then it is performed before any
other interpretation of the glob pattern. Thus, a pattern like
`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
checked for validity. Since those two are valid, matching proceeds.
Each portion of a pattern between `/` characters is matched with
[@isaacs/nonrecursive-glob-match](http://npm.im/@isaacs/nonrecursive-glob-match),
which uses Bash 5 as its reference, and does not use regular
expressions. So negated extglobs such as `<start>!(<pattern>*|)*`
match the same strings as in Bash. These are the known
differences:
- If `dot` is not set, a portion that starts with `.` only matches
if a literal `.` in the pattern matches that first character.
Extglobs before that `.` can match the empty string, so the
pattern can still match. For example, with `nonegate`,
`!(.a|js)@(.*)` matches `.a`, `.a.js`, and `.js`, because
`!(.a|js)` matches the empty string. Bash does not match these
dotfiles.
- If an extglob such as `?(a` is not closed, Bash matches the
whole pattern as a literal string. In this library, only the
`?(` is literal, and the rest of the pattern is still matched
as a glob. So `a?(b*` matches `a?(bcc` here, but not in Bash.
- A pattern is split into portions on every `/`, including a `/`
inside an extglob. So `@(a|b/c)/*` becomes the portions
`@(a|b`, `c)`, and `*`, and its extglob is not closed. Bash
keeps the extglob whole, and drops each alternative with a `/`
in it, as no portion can contain a `/`. So in Bash, `@(a|b/c)/*`
is the same as `@(a)/*`. Leave out the alternatives with a `/`
to get the same result here.
- With `nocase`, case is folded one code point at a time with
Unicode simple case folding, the same as a JavaScript RegExp
with the `iu` flags. Bash uses the case functions of the C
library for the current locale, so its results can change with
the locale.
Note that `fnmatch(3)` in libc is an extremely naive string comparison
matcher, which does not do anything special for slashes. This library is
designed to be used in glob searching and file walkers, and so it does do
special things with `/`. Thus, `foo*` will not match `foo/bar` in this
library, even though it would in `fnmatch(3)`.
@@ -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 Navigation2Off = createLucideIcon("Navigation2Off", [
["path", { d: "M9.31 9.31 5 21l7-4 7 4-1.17-3.17", key: "qoq2o2" }],
["path", { d: "M14.53 8.88 12 2l-1.17 3.17", key: "k3sjzy" }],
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
]);
export { Navigation2Off as default };
//# sourceMappingURL=navigation-2-off.js.map
@@ -0,0 +1 @@
{"version":3,"file":"swords.js","sources":["../../../src/icons/swords.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Swords\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIxNC41IDE3LjUgMyA2IDMgMyA2IDMgMTcuNSAxNC41IiAvPgogIDxsaW5lIHgxPSIxMyIgeDI9IjE5IiB5MT0iMTkiIHkyPSIxMyIgLz4KICA8bGluZSB4MT0iMTYiIHgyPSIyMCIgeTE9IjE2IiB5Mj0iMjAiIC8+CiAgPGxpbmUgeDE9IjE5IiB4Mj0iMjEiIHkxPSIyMSIgeTI9IjE5IiAvPgogIDxwb2x5bGluZSBwb2ludHM9IjE0LjUgNi41IDE4IDMgMjEgMyAyMSA2IDE3LjUgOS41IiAvPgogIDxsaW5lIHgxPSI1IiB4Mj0iOSIgeTE9IjE0IiB5Mj0iMTgiIC8+CiAgPGxpbmUgeDE9IjciIHgyPSI0IiB5MT0iMTciIHkyPSIyMCIgLz4KICA8bGluZSB4MT0iMyIgeDI9IjUiIHkxPSIxOSIgeTI9IjIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/swords\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 Swords = createLucideIcon('Swords', [\n ['polyline', { points: '14.5 17.5 3 6 3 3 6 3 17.5 14.5', key: '1hfsw2' }],\n ['line', { x1: '13', x2: '19', y1: '19', y2: '13', key: '1vrmhu' }],\n ['line', { x1: '16', x2: '20', y1: '16', y2: '20', key: '1bron3' }],\n ['line', { x1: '19', x2: '21', y1: '21', y2: '19', key: '13pww6' }],\n ['polyline', { points: '14.5 6.5 18 3 21 3 21 6 17.5 9.5', key: 'hbey2j' }],\n ['line', { x1: '5', x2: '9', y1: '14', y2: '18', key: '1hf58s' }],\n ['line', { x1: '7', x2: '4', y1: '17', y2: '20', key: 'pidxm4' }],\n ['line', { x1: '3', x2: '5', y1: '19', y2: '21', key: '1pehsh' }],\n]);\n\nexport default Swords;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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AAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAChE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAClE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,329 @@
import { millisecondsToSeconds, clamp, secondsToMilliseconds, warning } from 'motion-utils';
import { generateLinearEasing } from '../waapi/utils/linear.mjs';
import { calcGeneratorDuration, maxGeneratorDuration } from './utils/calc-duration.mjs';
import { createGeneratorEasing } from './utils/create-generator-easing.mjs';
const springDefaults = {
// Default spring physics
stiffness: 100,
damping: 10,
mass: 1.0,
velocity: 0.0,
// Default duration/bounce-based options
duration: 800, // in ms
bounce: 0.3,
visualDuration: 0.3, // in seconds
// Rest thresholds
restSpeed: {
granular: 0.01,
default: 2,
},
restDelta: {
granular: 0.005,
default: 0.5,
},
// Limits
minDuration: 0.01, // in seconds
maxDuration: 10.0, // in seconds
minDamping: 0.05,
maxDamping: 1,
};
function calcAngularFreq(undampedFreq, dampingRatio) {
return undampedFreq * Math.sqrt(1 - dampingRatio * dampingRatio);
}
const rootIterations = 12;
function approximateRoot(envelope, derivative, initialGuess) {
let result = initialGuess;
for (let i = 1; i < rootIterations; i++) {
result = result - envelope(result) / derivative(result);
}
return result;
}
/**
* This is ported from the Framer implementation of duration-based spring resolution.
*/
const safeMin = 0.001;
function findSpring({ duration = springDefaults.duration, bounce = springDefaults.bounce, velocity = springDefaults.velocity, mass = springDefaults.mass, }) {
let envelope;
let derivative;
warning(duration <= secondsToMilliseconds(springDefaults.maxDuration), "Spring duration must be 10 seconds or less", "spring-duration-limit");
let dampingRatio = 1 - bounce;
/**
* Restrict dampingRatio and duration to within acceptable ranges.
*/
dampingRatio = clamp(springDefaults.minDamping, springDefaults.maxDamping, dampingRatio);
duration = clamp(springDefaults.minDuration, springDefaults.maxDuration, millisecondsToSeconds(duration));
if (dampingRatio < 1) {
/**
* Underdamped spring
*/
envelope = (undampedFreq) => {
const exponentialDecay = undampedFreq * dampingRatio;
const delta = exponentialDecay * duration;
const a = exponentialDecay - velocity;
const b = calcAngularFreq(undampedFreq, dampingRatio);
const c = Math.exp(-delta);
return safeMin - (a / b) * c;
};
derivative = (undampedFreq) => {
const exponentialDecay = undampedFreq * dampingRatio;
const delta = exponentialDecay * duration;
const d = delta * velocity + velocity;
const e = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq, 2) * duration;
const f = Math.exp(-delta);
const g = calcAngularFreq(Math.pow(undampedFreq, 2), dampingRatio);
const factor = -envelope(undampedFreq) + safeMin > 0 ? -1 : 1;
return (factor * ((d - e) * f)) / g;
};
}
else {
/**
* Critically-damped spring
*/
envelope = (undampedFreq) => {
const a = Math.exp(-undampedFreq * duration);
const b = (undampedFreq - velocity) * duration + 1;
return -safeMin + a * b;
};
derivative = (undampedFreq) => {
const a = Math.exp(-undampedFreq * duration);
const b = (velocity - undampedFreq) * (duration * duration);
return a * b;
};
}
const initialGuess = 5 / duration;
const undampedFreq = approximateRoot(envelope, derivative, initialGuess);
duration = secondsToMilliseconds(duration);
if (isNaN(undampedFreq)) {
return {
stiffness: springDefaults.stiffness,
damping: springDefaults.damping,
duration,
};
}
else {
const stiffness = Math.pow(undampedFreq, 2) * mass;
return {
stiffness,
damping: dampingRatio * 2 * Math.sqrt(mass * stiffness),
duration,
};
}
}
const durationKeys = ["duration", "bounce"];
const physicsKeys = ["stiffness", "damping", "mass"];
function isSpringType(options, keys) {
return keys.some((key) => options[key] !== undefined);
}
function getSpringOptions(options) {
let springOptions = {
velocity: springDefaults.velocity,
stiffness: springDefaults.stiffness,
damping: springDefaults.damping,
mass: springDefaults.mass,
isResolvedFromDuration: false,
...options,
};
// stiffness/damping/mass overrides duration/bounce
if (!isSpringType(options, physicsKeys) &&
isSpringType(options, durationKeys)) {
// Time-defined springs should ignore inherited velocity.
// Velocity from interrupted animations can cause findSpring()
// to compute wildly different spring parameters, leading to
// massive oscillation on small-range animations.
springOptions.velocity = 0;
if (options.visualDuration) {
const visualDuration = options.visualDuration;
const root = (2 * Math.PI) / (visualDuration * 1.2);
const stiffness = root * root;
const damping = 2 *
clamp(0.05, 1, 1 - (options.bounce || 0)) *
Math.sqrt(stiffness);
springOptions = {
...springOptions,
mass: springDefaults.mass,
stiffness,
damping,
};
}
else {
const derived = findSpring({ ...options, velocity: 0 });
springOptions = {
...springOptions,
...derived,
mass: springDefaults.mass,
};
springOptions.isResolvedFromDuration = true;
}
}
return springOptions;
}
function spring(optionsOrVisualDuration = springDefaults.visualDuration, bounce = springDefaults.bounce) {
const options = typeof optionsOrVisualDuration !== "object"
? {
visualDuration: optionsOrVisualDuration,
keyframes: [0, 1],
bounce,
}
: optionsOrVisualDuration;
let { restSpeed, restDelta } = options;
const origin = options.keyframes[0];
const target = options.keyframes[options.keyframes.length - 1];
/**
* This is the Iterator-spec return value. We ensure it's mutable rather than using a generator
* to reduce GC during animation.
*/
const state = { done: false, value: origin };
const { stiffness, damping, mass, duration, velocity, isResolvedFromDuration, } = getSpringOptions({
...options,
velocity: -millisecondsToSeconds(options.velocity || 0),
});
const initialVelocity = velocity || 0.0;
const dampingRatio = damping / (2 * Math.sqrt(stiffness * mass));
const initialDelta = target - origin;
const undampedAngularFreq = millisecondsToSeconds(Math.sqrt(stiffness / mass));
/**
* If we're working on a granular scale, use smaller defaults for determining
* when the spring is finished.
*
* These defaults have been selected emprically based on what strikes a good
* ratio between feeling good and finishing as soon as changes are imperceptible.
*/
const isGranularScale = Math.abs(initialDelta) < 5;
restSpeed || (restSpeed = isGranularScale
? springDefaults.restSpeed.granular
: springDefaults.restSpeed.default);
restDelta || (restDelta = isGranularScale
? springDefaults.restDelta.granular
: springDefaults.restDelta.default);
let resolveSpring;
let resolveVelocity;
// Underdamped coefficients, hoisted for use in the inlined next() hot path
let angularFreq;
let A;
let sinCoeff;
let cosCoeff;
if (dampingRatio < 1) {
angularFreq = calcAngularFreq(undampedAngularFreq, dampingRatio);
A =
(initialVelocity +
dampingRatio * undampedAngularFreq * initialDelta) /
angularFreq;
// Underdamped spring
resolveSpring = (t) => {
const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
return (target -
envelope *
(A * Math.sin(angularFreq * t) +
initialDelta * Math.cos(angularFreq * t)));
};
// Analytical derivative of underdamped spring (px/ms)
sinCoeff =
dampingRatio * undampedAngularFreq * A + initialDelta * angularFreq;
cosCoeff =
dampingRatio * undampedAngularFreq * initialDelta - A * angularFreq;
resolveVelocity = (t) => {
const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
return envelope *
(sinCoeff * Math.sin(angularFreq * t) +
cosCoeff * Math.cos(angularFreq * t));
};
}
else if (dampingRatio === 1) {
// Critically damped spring
resolveSpring = (t) => target -
Math.exp(-undampedAngularFreq * t) *
(initialDelta +
(initialVelocity + undampedAngularFreq * initialDelta) * t);
// Analytical derivative of critically damped spring (px/ms)
const C = initialVelocity + undampedAngularFreq * initialDelta;
resolveVelocity = (t) => Math.exp(-undampedAngularFreq * t) *
(undampedAngularFreq * C * t - initialVelocity);
}
else {
// Overdamped spring
const dampedAngularFreq = undampedAngularFreq * Math.sqrt(dampingRatio * dampingRatio - 1);
resolveSpring = (t) => {
const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
// When performing sinh or cosh values can hit Infinity so we cap them here
const freqForT = Math.min(dampedAngularFreq * t, 300);
return (target -
(envelope *
((initialVelocity +
dampingRatio * undampedAngularFreq * initialDelta) *
Math.sinh(freqForT) +
dampedAngularFreq *
initialDelta *
Math.cosh(freqForT))) /
dampedAngularFreq);
};
// Analytical derivative of overdamped spring (px/ms)
const P = (initialVelocity +
dampingRatio * undampedAngularFreq * initialDelta) /
dampedAngularFreq;
const sinhCoeff = dampingRatio * undampedAngularFreq * P - initialDelta * dampedAngularFreq;
const coshCoeff = dampingRatio * undampedAngularFreq * initialDelta - P * dampedAngularFreq;
resolveVelocity = (t) => {
const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
const freqForT = Math.min(dampedAngularFreq * t, 300);
return envelope *
(sinhCoeff * Math.sinh(freqForT) +
coshCoeff * Math.cosh(freqForT));
};
}
const generator = {
calculatedDuration: isResolvedFromDuration ? duration || null : null,
velocity: (t) => secondsToMilliseconds(resolveVelocity(t)),
next: (t) => {
/**
* For underdamped physics springs we need both position and
* velocity each tick. Compute shared trig values once to avoid
* duplicate Math.exp/sin/cos calls on the hot path.
*/
if (!isResolvedFromDuration && dampingRatio < 1) {
const envelope = Math.exp(-dampingRatio * undampedAngularFreq * t);
const sin = Math.sin(angularFreq * t);
const cos = Math.cos(angularFreq * t);
const current = target -
envelope *
(A * sin + initialDelta * cos);
const currentVelocity = secondsToMilliseconds(envelope *
(sinCoeff * sin + cosCoeff * cos));
state.done =
Math.abs(currentVelocity) <= restSpeed &&
Math.abs(target - current) <= restDelta;
state.value = state.done ? target : current;
return state;
}
const current = resolveSpring(t);
if (!isResolvedFromDuration) {
const currentVelocity = secondsToMilliseconds(resolveVelocity(t));
state.done =
Math.abs(currentVelocity) <= restSpeed &&
Math.abs(target - current) <= restDelta;
}
else {
state.done = t >= duration;
}
state.value = state.done ? target : current;
return state;
},
toString: () => {
const calculatedDuration = Math.min(calcGeneratorDuration(generator), maxGeneratorDuration);
const easing = generateLinearEasing((progress) => generator.next(calculatedDuration * progress).value, calculatedDuration, 30);
return calculatedDuration + "ms " + easing;
},
toTransition: () => { },
};
return generator;
}
spring.applyToOptions = (options) => {
const generatorOptions = createGeneratorEasing(options, 100, spring);
options.ease = generatorOptions.ease;
options.duration = secondsToMilliseconds(generatorOptions.duration);
options.type = "keyframes";
return options;
};
export { spring };
//# sourceMappingURL=spring.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"nut-off.js","sources":["../../../src/icons/nut-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name NutOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgNFYyIiAvPgogIDxwYXRoIGQ9Ik01IDEwdjRhNy4wMDQgNy4wMDQgMCAwIDAgNS4yNzcgNi43ODdjLjQxMi4xMDQuODAyLjI5MiAxLjEwMi41OTJMMTIgMjJsLjYyMS0uNjIxYy4zLS4zLjY5LS40ODggMS4xMDItLjU5MmE3LjAxIDcuMDEgMCAwIDAgNC4xMjUtMi45MzkiIC8+CiAgPHBhdGggZD0iTTE5IDEwdjMuMzQzIiAvPgogIDxwYXRoIGQ9Ik0xMiAxMmMtMS4zNDktLjU3My0xLjkwNS0xLjAwNS0yLjUtMi0uNTQ2LjkwMi0xLjA0OCAxLjM1My0yLjUgMi0xLjAxOC0uNjQ0LTEuNDYtMS4wOC0yLTItMS4wMjguNzEtMS42OS45MTgtMyAxIDEuMDgxLTEuMDQ4IDEuNzU3LTIuMDMgMi0zIC4xOTQtLjc3Ni44NC0xLjU1MSAxLjc5LTIuMjFtMTEuNjU0IDUuOTk3Yy44ODctLjQ1NyAxLjI4LS44OTEgMS41NTYtMS43ODcgMS4wMzIuOTE2IDEuNjgzIDEuMTU3IDMgMS0xLjI5Ny0xLjAzNi0xLjc1OC0yLjAzLTItMy0uNS0yLTQtNC04LTQtLjc0IDAtMS40NjEuMDY4LTIuMTUuMTkyIiAvPgogIDxsaW5lIHgxPSIyIiB4Mj0iMjIiIHkxPSIyIiB5Mj0iMjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/nut-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 NutOff = createLucideIcon('NutOff', [\n ['path', { d: 'M12 4V2', key: '1k5q1u' }],\n [\n 'path',\n {\n d: 'M5 10v4a7.004 7.004 0 0 0 5.277 6.787c.412.104.802.292 1.102.592L12 22l.621-.621c.3-.3.69-.488 1.102-.592a7.01 7.01 0 0 0 4.125-2.939',\n key: '1xcvy9',\n },\n ],\n ['path', { d: 'M19 10v3.343', key: '163tfc' }],\n [\n 'path',\n {\n d: 'M12 12c-1.349-.573-1.905-1.005-2.5-2-.546.902-1.048 1.353-2.5 2-1.018-.644-1.46-1.08-2-2-1.028.71-1.69.918-3 1 1.081-1.048 1.757-2.03 2-3 .194-.776.84-1.551 1.79-2.21m11.654 5.997c.887-.457 1.28-.891 1.556-1.787 1.032.916 1.683 1.157 3 1-1.297-1.036-1.758-2.03-2-3-.5-2-4-4-8-4-.74 0-1.461.068-2.15.192',\n key: '17914v',\n },\n ],\n ['line', { x1: '2', x2: '22', y1: '2', y2: '22', key: 'a6p6uj' }],\n]);\n\nexport default NutOff;\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,CAA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AA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CLine truncated
@@ -0,0 +1,28 @@
const CoverageProviderMap = {
v8: "@vitest/coverage-v8",
istanbul: "@vitest/coverage-istanbul"
};
async function resolveCoverageProviderModule(options, loader) {
if (!options?.enabled || !options.provider) return null;
const provider = options.provider;
if (provider === "v8" || provider === "istanbul") {
let builtInModule = CoverageProviderMap[provider];
if (provider === "v8" && loader.isBrowser) builtInModule += "/browser";
const { default: coverageModule } = loader.isBrowser ? await loader.import(builtInModule) : await import(
/* @vite-ignore */
builtInModule
);
if (!coverageModule) throw new Error(`Failed to load ${CoverageProviderMap[provider]}. Default export is missing.`);
return coverageModule;
}
let customProviderModule;
try {
customProviderModule = await loader.import(options.customProviderModule);
} catch (error) {
throw new Error(`Failed to load custom CoverageProviderModule from ${options.customProviderModule}`, { cause: error });
}
if (customProviderModule.default == null) throw new Error(`Custom CoverageProviderModule loaded from ${options.customProviderModule} was not the default export`);
return customProviderModule.default;
}
export { CoverageProviderMap as C, resolveCoverageProviderModule as r };
@@ -0,0 +1 @@
module.exports={C:{"52":0.00486,"68":0.00486,"78":0.00486,"115":0.07774,"120":0.00486,"121":0.00972,"123":0.00972,"124":0.00972,"125":0.00486,"127":0.00486,"132":0.00486,"133":0.00486,"134":0.00486,"136":0.00972,"140":0.04859,"141":0.00486,"143":0.00486,"145":0.00486,"146":0.00486,"147":0.00486,"148":0.00972,"149":0.00972,"150":0.00972,"151":0.00486,"152":0.02915,"153":0.05831,"154":0.2721,"155":0.84547,"156":0.80659,"157":0.01944,_:"2 3 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 45 46 47 48 49 50 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 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 116 117 118 119 122 126 128 129 130 131 135 137 138 139 142 144 158 159 160 3.5 3.6"},D:{"39":0.03401,"40":0.02915,"41":0.03401,"42":0.03401,"43":0.03401,"44":0.03401,"45":0.03401,"46":0.03401,"47":0.03401,"48":0.03401,"49":0.03887,"50":0.03401,"51":0.03401,"52":0.03401,"53":0.03401,"54":0.03401,"55":0.02915,"56":0.03401,"57":0.03401,"58":0.03401,"59":0.03401,"60":0.03401,"65":0.00486,"70":0.00972,"87":0.00972,"88":0.00972,"89":0.00486,"99":0.00486,"101":0.00486,"103":0.05345,"104":0.01458,"105":0.00972,"106":0.00972,"107":0.00972,"108":0.01458,"109":0.26239,"110":0.00972,"111":0.01944,"112":0.01458,"114":0.00486,"116":0.11176,"117":0.00972,"118":0.0243,"119":0.0243,"120":0.03887,"121":0.00972,"122":0.03401,"123":0.03401,"124":0.02915,"125":0.01458,"126":0.0243,"127":0.00972,"128":0.05831,"129":0.00486,"130":0.00972,"131":0.06317,"132":0.01458,"133":0.08746,"134":0.06803,"135":0.07774,"136":0.07289,"137":0.07774,"138":0.20408,"139":0.07774,"140":0.09718,"141":0.0826,"142":0.25267,"143":0.05345,"144":0.04859,"145":0.06317,"146":0.07289,"147":0.10204,"148":0.20894,"149":0.27696,"150":0.87462,"151":2.52668,"152":10.0144,"153":8.43037,"154":1.99219,"155":0.0243,"156":0.00486,_:"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 61 62 63 64 66 67 68 69 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 90 91 92 93 94 95 96 97 98 100 102 113 115 157"},F:{"46":0.00486,"95":0.00486,"101":0.00972,"106":0.00486,"109":0.00486,"133":0.01944,"134":0.14577,"135":0.62195,_:"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 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 102 103 104 105 107 108 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"109":0.07289,"119":0.00486,"120":0.00972,"122":0.00972,"123":0.00486,"126":0.00486,"130":0.00486,"131":0.00486,"134":0.00486,"135":0.00486,"136":0.00486,"137":0.00486,"138":0.00486,"139":0.00486,"140":0.00486,"141":0.00486,"142":0.01944,"143":0.00972,"144":0.00486,"145":0.00972,"146":0.01458,"147":0.01458,"148":0.01944,"149":0.0243,"150":0.11176,"151":0.41787,"152":3.19722,"153":3.6151,"154":0.86976,_:"12 13 14 15 16 17 18 79 80 81 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 110 111 112 113 114 115 116 117 118 121 124 125 127 128 129 132 133"},E:{"13":0.00486,"14":0.00972,"27":0.22351,_:"4 5 6 7 8 9 10 11 12 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 27.1 TP","11.1":0.00486,"12.1":0.02915,"13.1":0.05831,"14.1":0.03401,"15.1":0.00486,"15.2-15.3":0.00486,"15.4":0.00486,"15.5":0.01944,"15.6":0.16035,"16.0":0.00486,"16.1":0.0243,"16.2":0.00972,"16.3":0.0243,"16.4":0.00972,"16.5":0.01458,"16.6":0.26725,"17.0":0.00486,"17.1":0.2964,"17.2":0.01458,"17.3":0.01944,"17.4":0.03887,"17.5":0.05345,"17.6":0.20894,"18.0":0.01458,"18.1":0.03401,"18.2":0.0243,"18.3":0.06317,"18.4":0.0243,"18.5-18.7":0.08746,"26.0":0.02915,"26.1":0.03401,"26.2":0.11662,"26.3":0.15549,"26.4":0.09718,"26.5":0.64625,"26.6":3.3187,"27.2":0.00486},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00257,"5.0-5.1":0.00257,"6.0-6.1":0,"7.0-7.1":0.00514,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.02569,"11.0-11.2":0.00257,"11.3-11.4":0.00514,"12.0-12.1":0,"12.2-12.5":0.06679,"13.0-13.1":0,"13.2":0.01284,"13.3":0,"13.4-13.7":0.00257,"14.0-14.4":0.01028,"14.5-14.8":0.01541,"15.0-15.1":0.01541,"15.2-15.3":0.01028,"15.4":0.01284,"15.5":0.01541,"15.6-15.8":0.33396,"16.0":0.02569,"16.1":0.04624,"16.2":0.02569,"16.3":0.05652,"16.4":0.01284,"16.5":0.02055,"16.6-16.7":0.46498,"17.0":0.01798,"17.1":0.02569,"17.2":0.02569,"17.3":0.03853,"17.4":0.05395,"17.5":0.10533,"17.6-17.7":0.27231,"18.0":0.05652,"18.1":0.11303,"18.2":0.15414,"18.3":0.26717,"18.4":0.16698,"18.5-18.7":3.45011,"26.0":0.16698,"26.1":0.16955,"26.2":0.44186,"26.3":0.47783,"26.4":0.34938,"26.5":2.34032,"26.6":14.44011,"27.0":1.10722,"27.1":0,"27.2":0.02826},P:{"21":0.00915,"22":0.00915,"23":0.00915,"24":0.0183,"25":0.00915,"26":0.0183,"27":0.0183,"28":0.04574,"29":0.11893,"30":2.68964,_:"4 20 5.0-5.4 Line truncated
@@ -0,0 +1,13 @@
'use strict'
const Range = require('../classes/range')
const validRange = (range, options) => {
try {
// Return '*' instead of '' so that truthiness works.
// This will throw if it's invalid anyway
return new Range(range, options).range || '*'
} catch (er) {
return null
}
}
module.exports = validRange
@@ -0,0 +1,89 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_utils_cookie = require("../../utils/cookie.js");
//#region src/helper/cookie/index.ts
const getCookie = (c, key, prefix) => {
const cookie = c.req.raw.headers.get("Cookie");
if (typeof key === "string") {
if (!cookie) return;
let finalKey = key;
if (prefix === "secure") finalKey = "__Secure-" + key;
else if (prefix === "host") finalKey = "__Host-" + key;
return require_utils_cookie.parse(cookie, finalKey)[finalKey];
}
if (!cookie) return {};
return require_utils_cookie.parse(cookie);
};
const getSignedCookie = async (c, secret, key, prefix) => {
const cookie = c.req.raw.headers.get("Cookie");
if (typeof key === "string") {
if (!cookie) return;
let finalKey = key;
if (prefix === "secure") finalKey = "__Secure-" + key;
else if (prefix === "host") finalKey = "__Host-" + key;
return (await require_utils_cookie.parseSigned(cookie, secret, finalKey))[finalKey];
}
if (!cookie) return {};
return await require_utils_cookie.parseSigned(cookie, secret);
};
const generateCookie = (name, value, opt) => {
let cookie;
if (opt?.prefix === "secure") cookie = require_utils_cookie.serialize("__Secure-" + name, value, {
path: "/",
...opt,
secure: true
});
else if (opt?.prefix === "host") cookie = require_utils_cookie.serialize("__Host-" + name, value, {
...opt,
path: "/",
secure: true,
domain: void 0
});
else cookie = require_utils_cookie.serialize(name, value, {
path: "/",
...opt
});
return cookie;
};
const setCookie = (c, name, value, opt) => {
const cookie = generateCookie(name, value, opt);
c.header("Set-Cookie", cookie, { append: true });
};
const generateSignedCookie = async (name, value, secret, opt) => {
let cookie;
if (opt?.prefix === "secure") cookie = await require_utils_cookie.serializeSigned("__Secure-" + name, value, secret, {
path: "/",
...opt,
secure: true
});
else if (opt?.prefix === "host") cookie = await require_utils_cookie.serializeSigned("__Host-" + name, value, secret, {
...opt,
path: "/",
secure: true,
domain: void 0
});
else cookie = await require_utils_cookie.serializeSigned(name, value, secret, {
path: "/",
...opt
});
return cookie;
};
const setSignedCookie = async (c, name, value, secret, opt) => {
const cookie = await generateSignedCookie(name, value, secret, opt);
c.header("set-cookie", cookie, { append: true });
};
const deleteCookie = (c, name, opt) => {
const deletedCookie = getCookie(c, name, opt?.prefix);
setCookie(c, name, "", {
...opt,
maxAge: 0
});
return deletedCookie;
};
//#endregion
exports.deleteCookie = deleteCookie;
exports.generateCookie = generateCookie;
exports.generateSignedCookie = generateSignedCookie;
exports.getCookie = getCookie;
exports.getSignedCookie = getSignedCookie;
exports.setCookie = setCookie;
exports.setSignedCookie = setSignedCookie;
@@ -0,0 +1,8 @@
// Generated using scripts/write-decode-map.ts
export const xmlDecodeTree: Uint16Array = /* #__PURE__ */ new Uint16Array(
// prettier-ignore
/* #__PURE__ */ "\u0200aglq\t\x15\x18\x1b\u026d\x0f\0\0\x12p;\u4026os;\u4027t;\u403et;\u403cuot;\u4022"
.split("")
.map((c) => c.charCodeAt(0)),
);
@@ -0,0 +1,60 @@
{
"name": "@radix-ui/react-focus-guards",
"version": "1.1.3",
"license": "MIT",
"source": "./src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"files": [
"dist",
"README.md"
],
"sideEffects": false,
"devDependencies": {
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"eslint": "^9.18.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"typescript": "^5.7.3",
"@repo/builder": "0.0.0",
"@repo/typescript-config": "0.0.0",
"@repo/eslint-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"
},
"bugs": {
"url": "https://github.com/radix-ui/primitives/issues"
},
"scripts": {
"lint": "eslint --max-warnings 0 src",
"clean": "rm -rf dist",
"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,69 @@
#ifndef BSER_H
#define BSER_H
#include <string>
#include <sstream>
#include <vector>
#include <unordered_map>
#include <memory>
enum BSERType {
BSER_ARRAY = 0x00,
BSER_OBJECT = 0x01,
BSER_STRING = 0x02,
BSER_INT8 = 0x03,
BSER_INT16 = 0x04,
BSER_INT32 = 0x05,
BSER_INT64 = 0x06,
BSER_REAL = 0x07,
BSER_BOOL_TRUE = 0x08,
BSER_BOOL_FALSE = 0x09,
BSER_NULL = 0x0a,
BSER_TEMPLATE = 0x0b
};
class BSERValue;
class BSER {
public:
typedef std::vector<BSER> Array;
typedef std::unordered_map<std::string, BSER> Object;
BSER();
BSER(BSER::Array value);
BSER(BSER::Object value);
BSER(std::string value);
BSER(const char *value);
BSER(int64_t value);
BSER(double value);
BSER(bool value);
BSER(std::istream &iss);
BSER::Array arrayValue();
BSER::Object objectValue();
std::string stringValue();
int64_t intValue();
double doubleValue();
bool boolValue();
void encode(std::ostream &oss);
static int64_t decodeLength(std::istream &iss);
std::string encode();
private:
std::shared_ptr<BSERValue> m_ptr;
};
class BSERValue {
protected:
friend class BSER;
virtual BSER::Array arrayValue() { return BSER::Array(); }
virtual BSER::Object objectValue() { return BSER::Object(); }
virtual std::string stringValue() { return std::string(); }
virtual int64_t intValue() { return 0; }
virtual double doubleValue() { return 0; }
virtual bool boolValue() { return false; }
virtual void encode(std::ostream &oss) {}
virtual ~BSERValue() {}
};
#endif
@@ -0,0 +1,25 @@
/**
* @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 Palette = createLucideIcon("Palette", [
["circle", { cx: "13.5", cy: "6.5", r: ".5", fill: "currentColor", key: "1okk4w" }],
["circle", { cx: "17.5", cy: "10.5", r: ".5", fill: "currentColor", key: "f64h9f" }],
["circle", { cx: "8.5", cy: "7.5", r: ".5", fill: "currentColor", key: "fotxhn" }],
["circle", { cx: "6.5", cy: "12.5", r: ".5", fill: "currentColor", key: "qy21gx" }],
[
"path",
{
d: "M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",
key: "12rzf8"
}
]
]);
export { Palette as default };
//# sourceMappingURL=palette.js.map
@@ -0,0 +1,373 @@
flf2a$ 1 1 11 -1 12 0
hex.flf by Karlton Wirsing based on
binary.flf (C) 1994 by Victor Parada (vparada@inf.utfsm.cl) 94/12/05
figlet 2.1 font, includes ISO Latin-1, excludes "-D" option chars.
Spaces are not shown as binary. If this is required, change "$@" below
to "20 @". Change to "@" to remove the hardspace between words.
Note that figlet always removes spaces when it moves words to a new line.
Try option "-m 0" to remove the space between letters (octets).
$@
21 @
22 @
23 @
24 @
25 @
26 @
27 @
28 @
29 @
2A @
2B @
2C @
2D @
2E @
2F @
30 @
31 @
32 @
33 @
34 @
35 @
36 @
37 @
38 @
39 @
3A @
3B @
3C @
3D @
3E @
3F @
40 @
41 @
42 @
43 @
44 @
45 @
46 @
47 @
48 @
49 @
4A @
4B @
4C @
4D @
4E @
4F @
50 @
51 @
52 @
53 @
54 @
55 @
56 @
57 @
58 @
59 @
5A @
5B @
5C @
5D @
5E @
5F @
60 @
61 @
62 @
63 @
64 @
65 @
66 @
67 @
68 @
69 @
6A @
6B @
6C @
6D @
6E @
6F @
70 @
71 @
72 @
73 @
74 @
75 @
76 @
77 @
78 @
79 @
7A @
7B @
7C @
7D @
7E @
@
@
@
@
@
@
@
127
7F @
128
80 @
129
81 @
130
82 @
131
83 @
132
84 @
133
85 @
134
86 @
135
87 @
136
88 @
137
89 @
138
8A @
139
8B @
140
8C @
141
8D @
142
8E @
143
8F @
144
90 @
145
91 @
146
92 @
147
93 @
148
94 @
149
95 @
150
96 @
151
97 @
152
98 @
153
99 @
154
9A @
155
9B @
156
9C @
157
9D @
158
9E @
159
9F @
160
A0 @
161
A1 @
162
A2 @
163
A3 @
164
A4 @
165
A5 @
166
A6 @
167
A7 @
168
A8 @
169
A9 @
170
AA @
171
AB @
172
AC @
173
AD @
174
AE @
175
AF @
176
B0 @
177
B1 @
178
B2 @
179
B3 @
180
B4 @
181
B5 @
182
B6 @
183
B7 @
184
B8 @
185
B9 @
186
BA @
187
BB @
188
BC @
189
BD @
190
BE @
191
BF @
192
C0 @
193
C1 @
194
C2 @
195
C3 @
196
C4 @
197
C5 @
198
C6 @
199
C7 @
200
C8 @
201
C9 @
202
CA @
203
CB @
204
CC @
205
CD @
206
CE @
207
CF @
208
D0 @
209
D1 @
210
D2 @
211
D3 @
212
D4 @
213
D5 @
214
D6 @
215
D7 @
216
D8 @
217
D9 @
218
DA @
219
DB @
220
DC @
221
DD @
222
DE @
223
DF @
224
E0 @
225
E1 @
226
E2 @
227
E3 @
228
E4 @
229
E5 @
230
E6 @
231
E7 @
232
E8 @
233
E9 @
234
EA @
235
EB @
236
EC @
237
ED @
238
EE @
239
EF @
240
F0 @
241
F1 @
242
F2 @
243
F3 @
244
F4 @
245
F5 @
246
F6 @
247
F7 @
248
F8 @
249
F9 @
250
FA @
251
FB @
252
FC @
253
FD @
254
FE @
255
FF @
@@ -0,0 +1,75 @@
/**
* Filters out Vite plugins that have `apply: 'serve'` set.
*
* Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
* are intended only for Vite's dev server and should be excluded from the build process.
*
* @param plugins - Array of plugins (can include nested arrays)
* @returns Filtered array with serve-only plugins removed
*
* @example
* ```ts
* import { defineConfig } from 'rolldown';
* import { filterVitePlugins } from '@rolldown/pluginutils';
* import viteReact from '@vitejs/plugin-react';
*
* export default defineConfig({
* plugins: filterVitePlugins([
* viteReact(),
* {
* name: 'dev-only',
* apply: 'serve', // This will be filtered out
* // ...
* }
* ])
* });
* ```
*/
export function filterVitePlugins(plugins) {
if (!plugins) {
return [];
}
const pluginArray = Array.isArray(plugins) ? plugins : [plugins];
const result = [];
for (const plugin of pluginArray) {
// Skip falsy values
if (!plugin) {
continue;
}
// Handle nested arrays recursively
if (Array.isArray(plugin)) {
result.push(...filterVitePlugins(plugin));
continue;
}
// Check if plugin has apply property
const pluginWithApply = plugin;
if ('apply' in pluginWithApply) {
const applyValue = pluginWithApply.apply;
// If apply is a function, call it with build mode
if (typeof applyValue === 'function') {
try {
const shouldApply = applyValue({}, // config object
{ command: 'build', mode: 'production' });
if (shouldApply) {
result.push(plugin);
}
}
catch {
// If function throws, include the plugin to be safe
result.push(plugin);
}
} // If apply is 'serve', skip this plugin
else if (applyValue === 'serve') {
continue;
} // If apply is 'build' or anything else, include it
else {
result.push(plugin);
}
}
else {
// No apply property, include the plugin
result.push(plugin);
}
}
return result;
}
@@ -0,0 +1,13 @@
//#region src/adapter/cloudflare-workers/utils.d.ts
/**
* @deprecated `hono/cloudflare-workers` will be removed in v5. Install `@hono/cloudflare-workers` and import from there instead.
*/
export type KVAssetOptions = {
manifest?: object | string;
namespace?: unknown;
};
/**
* @deprecated `hono/cloudflare-workers` will be removed in v5. Install `@hono/cloudflare-workers` and import from there instead.
*/
export declare const getContentFromKVAsset: (path: string, options?: KVAssetOptions) => Promise<ReadableStream | null>;
//#endregion
@@ -0,0 +1,21 @@
/**
* @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 Building2 = createLucideIcon("Building2", [
["path", { d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z", key: "1b4qmf" }],
["path", { d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2", key: "i71pzd" }],
["path", { d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2", key: "10jefs" }],
["path", { d: "M10 6h4", key: "1itunk" }],
["path", { d: "M10 10h4", key: "tcdvrf" }],
["path", { d: "M10 14h4", key: "kelpxr" }],
["path", { d: "M10 18h4", key: "1ulq68" }]
]);
export { Building2 as default };
//# sourceMappingURL=building-2.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_8R","2":"_WS"},D:{"1":"_TI","2":"_9J"},E:{"1":"_PD","2":"_CI"},F:{"1":"_6G","2":"_QK"},G:{"1":"_kG","2":"_AI"},H:{"2":"1D"},I:{"1":"_YD","2":"_wG"},J:{"2":"_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:2,C:"CSS all property",D:true};
@@ -0,0 +1,6 @@
import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export type ConstError = ErrorObject<"const", {
allowedValue: any;
}>;
declare const def: CodeKeywordDefinition;
export default def;
@@ -0,0 +1,159 @@
# Client Lifecycle
<!--type=misc-->
A {Client} can be understood as a state machine. As requests are dispatched,
processed, and drained, the client moves through a well-defined set of states
until it is eventually destroyed. This document describes those states and the
transitions between them.
The {Client} class is not literally implemented as a state machine, so the
actual execution may deviate slightly from what is described here. Treat this
guide as a conceptual model for reasoning about a client's behavior rather than
as a formal specification.
## State transition overview
* A {Client} begins in the **idle** state with no socket connection and no
queued requests.
* The *connect* transition moves the {Client} to the **pending** state, where
requests can be queued before they are processed.
* Calling [`client.close()`][] or [`client.destroy()`][] moves the {Client}
to the **destroyed** state. Because there are no queued requests in this
state, *close* transitions straight to **destroyed**.
* The **pending** state indicates that the underlying socket connection has been
established and that requests are queueing.
* The *process* transition moves the {Client} to the **processing** state,
where requests are processed.
* If requests are queued, *close* transitions to **processing**; otherwise it
transitions to **destroyed**.
* The *destroy* transition moves the {Client} to **destroyed**.
* The **processing** state initializes to the **processing.running** sub-state.
* If the current request body requires draining, *needDrain* moves the
{Client} into the **processing.busy** sub-state, which returns to
**processing.running** once *drainComplete* fires.
* After all queued requests complete, *keepalive* moves the {Client} back to
the **pending** state. If no requests are queued before the socket times
out, the {Client} transitions to **idle**.
* If *close* is fired while the {Client} still has queued requests, the
{Client} transitions to **processing.closing**, where it completes all
outstanding requests before firing *done*.
* The *done* transition moves the {Client} gracefully to **destroyed**.
* At any time, *destroy* moves the {Client} from **processing** to
**destroyed**, aborting any queued requests.
* The **destroyed** state is final; the {Client} is no longer functional.
A state diagram representing a {Client} instance:
```mermaid
stateDiagram-v2
[*] --> idle
idle --> pending : connect
idle --> destroyed : destroy/close
pending --> idle : timeout
pending --> destroyed : destroy
state close_fork <<fork>>
pending --> close_fork : close
close_fork --> processing
close_fork --> destroyed
pending --> processing : process
processing --> pending : keepalive
processing --> destroyed : done
processing --> destroyed : destroy
destroyed --> [*]
state processing {
[*] --> running
running --> closing : close
running --> busy : needDrain
busy --> running : drainComplete
running --> [*] : keepalive
closing --> [*] : done
}
```
## State details
### idle
**idle** is the initial state of a {Client} instance. Although an `origin` is
required to construct a {Client}, the underlying socket connection is not
established until a request is queued through [`client.dispatch()`][]. Calling
`client.dispatch()` directly, or through one of its higher-level wrappers
([`client.connect()`][], [`client.pipeline()`][], [`client.request()`][],
[`client.stream()`][], or [`client.upgrade()`][]), moves the {Client} from
**idle** to **pending**, and then usually directly on to **processing**.
Calling [`client.close()`][] or [`client.destroy()`][] in this state moves the
{Client} straight to **destroyed**, since there are no queued requests.
### pending
**pending** signifies a connected but non-processing {Client}. On entering this
state, the {Client} establishes a socket connection and emits the
[`'connect'`][] event, signalling that a connection to the `origin` supplied at
construction time has been established. The internal queue starts empty, and
requests can begin queueing.
Calling [`client.close()`][] with queued requests moves the {Client} to the
**processing** state; without queued requests it moves to **destroyed**.
Calling [`client.destroy()`][] moves the {Client} directly to **destroyed**,
regardless of any queued requests.
### processing
**processing** is itself a sub-state machine that initializes to the
**processing.running** sub-state. [`client.dispatch()`][], [`client.close()`][],
and [`client.destroy()`][] can all be called while the {Client} is in this
state. `client.dispatch()` queues additional requests while existing ones
continue to be processed, `client.close()` moves the {Client} to the
**processing.closing** sub-state, and `client.destroy()` moves it to
**destroyed**.
#### running
In **processing.running**, queued requests are processed in FIFO order. If a
request body requires draining, *needDrain* moves the {Client} to the
**processing.busy** sub-state. The *close* transition moves the {Client} to the
**processing.closing** sub-state. When all queued requests have completed and
neither [`client.close()`][] nor [`client.destroy()`][] has been called, the
*keepalive* transition moves the {Client} back to the **pending** state. There
the {Client} waits for the socket connection to time out; once it does, the
{Client} returns to the **idle** state.
#### busy
This sub-state is entered only when a request body is a {stream.Readable} that
requires draining. The {Client} cannot process additional requests while in
this state and waits until the current request body has been fully drained
before returning to **processing.running**.
#### closing
This sub-state is entered only when a {Client} has queued requests and
[`client.close()`][] is called. The {Client} continues to process requests as
usual, except that no additional requests may be queued. Once all queued
requests have been processed, *done* fires and the {Client} moves gracefully to
**destroyed** without an error.
### destroyed
**destroyed** is the final state of a {Client} instance. Once in this state, the
{Client} is no longer functional, and calling any further {Client} method
rejects or fails with a {ClientDestroyedError}.
[`'connect'`]: Client.md#event-connect
[`client.close()`]: Client.md#clientclosecallback
[`client.connect()`]: Client.md#clientconnectoptions-callback
[`client.destroy()`]: Client.md#clientdestroyerror-callback
[`client.dispatch()`]: Client.md#clientdispatchoptions-handlers
[`client.pipeline()`]: Client.md#clientpipelineoptions-handler
[`client.request()`]: Client.md#clientrequestoptions-callback
[`client.stream()`]: Client.md#clientstreamoptions-factory-callback
[`client.upgrade()`]: Client.md#clientupgradeoptions-callback
@@ -0,0 +1,26 @@
{
'defines': [ 'NODE_ADDON_API_DISABLE_CPP_EXCEPTIONS' ],
'cflags': [ '-fno-exceptions' ],
'cflags_cc': [ '-fno-exceptions' ],
'conditions': [
["OS=='win'", {
# _HAS_EXCEPTIONS is already defined and set to 0 in common.gypi
#"defines": [
# "_HAS_EXCEPTIONS=0"
#],
"msvs_settings": {
"VCCLCompilerTool": {
'ExceptionHandling': 0,
'EnablePREfast': 'true',
},
},
}],
["OS=='mac'", {
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
'GCC_ENABLE_CPP_EXCEPTIONS': 'NO',
},
}],
],
}
@@ -0,0 +1,738 @@
import {
BaseRootRoute,
BaseRoute,
BaseRouteApi,
notFound,
} from '@tanstack/router-core'
import React from 'react'
import { useLoaderData } from './useLoaderData'
import { useLoaderDeps } from './useLoaderDeps'
import { useParams } from './useParams'
import { useSearch } from './useSearch'
import { useNavigate } from './useNavigate'
import { useMatch } from './useMatch'
import { useRouteContext } from './useRouteContext'
import { useRouter } from './useRouter'
import { Link } from './link'
import type {
AnyContext,
AnyRoute,
AnyRouter,
ConstrainLiteral,
ErrorComponentProps,
NotFoundError,
NotFoundRouteProps,
Register,
RegisteredRouter,
ResolveFullPath,
ResolveId,
ResolveParams,
RootRoute as RootRouteCore,
RootRouteId,
RootRouteOptions,
RouteConstraints,
Route as RouteCore,
RouteIds,
RouteMask,
RouteOptions,
RouteTypesById,
RouterCore,
ToMaskOptions,
UseNavigateResult,
} from '@tanstack/router-core'
import type { UseLoaderDataRoute } from './useLoaderData'
import type { UseMatchRoute } from './useMatch'
import type { UseLoaderDepsRoute } from './useLoaderDeps'
import type { UseParamsRoute } from './useParams'
import type { UseSearchRoute } from './useSearch'
import type { UseRouteContextRoute } from './useRouteContext'
import type { LinkComponentRoute } from './link'
declare module '@tanstack/router-core' {
export interface UpdatableRouteOptionsExtensions {
component?: RouteComponent
errorComponent?: false | null | undefined | ErrorRouteComponent
notFoundComponent?: NotFoundRouteComponent
pendingComponent?: RouteComponent
}
export interface RootRouteOptionsExtensions {
shellComponent?: ({
children,
}: {
children: React.ReactNode
}) => React.ReactNode
}
export interface RouteExtensions<
in out TId extends string,
in out TFullPath extends string,
> {
useMatch: UseMatchRoute<TId>
useRouteContext: UseRouteContextRoute<TId>
useSearch: UseSearchRoute<TId>
useParams: UseParamsRoute<TId>
useLoaderDeps: UseLoaderDepsRoute<TId>
useLoaderData: UseLoaderDataRoute<TId>
useNavigate: () => UseNavigateResult<TFullPath>
Link: LinkComponentRoute<TFullPath>
}
}
/**
* Returns a route-specific API that exposes type-safe hooks pre-bound
* to a single route ID. Useful for consuming a route's APIs from files
* where the route object isn't directly imported (e.g. code-split files).
*
* @param id Route ID string literal for the target route.
* @returns A `RouteApi` instance bound to the given route ID.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/getRouteApiFunction
*/
export function getRouteApi<
const TId,
TRouter extends AnyRouter = RegisteredRouter,
>(id: ConstrainLiteral<TId, RouteIds<TRouter['routeTree']>>) {
return new RouteApi<TId, TRouter>({ id })
}
export class RouteApi<
TId,
TRouter extends AnyRouter = RegisteredRouter,
> extends BaseRouteApi<TId, TRouter> {
/**
* @deprecated Use the `getRouteApi` function instead.
*/
constructor({ id }: { id: TId }) {
super({ id })
}
useMatch: UseMatchRoute<TId> = (opts) => {
return useMatch({
select: opts?.select,
from: this.id,
structuralSharing: opts?.structuralSharing,
} as any) as any
}
useRouteContext: UseRouteContextRoute<TId> = (opts) => {
return useRouteContext({ ...(opts as any), from: this.id as any })
}
useSearch: UseSearchRoute<TId> = (opts) => {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
return useSearch({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.id,
} as any) as any
}
useParams: UseParamsRoute<TId> = (opts) => {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
return useParams({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.id,
} as any) as any
}
useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {
return useLoaderDeps({ ...opts, from: this.id, strict: false } as any)
}
useLoaderData: UseLoaderDataRoute<TId> = (opts) => {
return useLoaderData({ ...opts, from: this.id, strict: false } as any)
}
useNavigate = (): UseNavigateResult<
RouteTypesById<TRouter, TId>['fullPath']
> => {
const router = useRouter()
return useNavigate({ from: router.routesById[this.id as string].fullPath })
}
notFound = (opts?: NotFoundError) => {
return notFound({ routeId: this.id as string, ...opts })
}
Link: LinkComponentRoute<RouteTypesById<TRouter, TId>['fullPath']> =
React.forwardRef((props, ref: React.ForwardedRef<HTMLAnchorElement>) => {
const router = useRouter()
const fullPath = router.routesById[this.id as string].fullPath
return <Link ref={ref} from={fullPath as never} {...props} />
}) as unknown as LinkComponentRoute<
RouteTypesById<TRouter, TId>['fullPath']
>
}
export class Route<
in out TRegister = unknown,
in out TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,
in out TPath extends RouteConstraints['TPath'] = '/',
in out TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<
TParentRoute,
TPath
>,
in out TCustomId extends RouteConstraints['TCustomId'] = string,
in out TId extends RouteConstraints['TId'] = ResolveId<
TParentRoute,
TCustomId,
TPath
>,
in out TSearchValidator = undefined,
in out TParams = ResolveParams<TPath>,
in out TRouterContext = AnyContext,
in out TRouteContextFn = AnyContext,
in out TBeforeLoadFn = AnyContext,
in out TLoaderDeps extends Record<string, any> = {},
in out TLoaderFn = undefined,
in out TChildren = unknown,
in out TFileRouteTypes = unknown,
in out TSSR = unknown,
in out TServerMiddlewares = unknown,
in out THandlers = undefined,
>
extends BaseRoute<
TRegister,
TParentRoute,
TPath,
TFullPath,
TCustomId,
TId,
TSearchValidator,
TParams,
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
TChildren,
TFileRouteTypes,
TSSR,
TServerMiddlewares,
THandlers
>
implements
RouteCore<
TRegister,
TParentRoute,
TPath,
TFullPath,
TCustomId,
TId,
TSearchValidator,
TParams,
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
TChildren,
TFileRouteTypes,
TSSR,
TServerMiddlewares,
THandlers
>
{
/**
* @deprecated Use the `createRoute` function instead.
*/
constructor(
options?: RouteOptions<
TRegister,
TParentRoute,
TId,
TCustomId,
TFullPath,
TPath,
TSearchValidator,
TParams,
TLoaderDeps,
TLoaderFn,
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TSSR,
TServerMiddlewares,
THandlers
>,
) {
super(options)
}
useMatch: UseMatchRoute<TId> = (opts) => {
return useMatch({
select: opts?.select,
from: this.id,
structuralSharing: opts?.structuralSharing,
} as any) as any
}
useRouteContext: UseRouteContextRoute<TId> = (opts?) => {
return useRouteContext({ ...(opts as any), from: this.id })
}
useSearch: UseSearchRoute<TId> = (opts) => {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
return useSearch({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.id,
} as any) as any
}
useParams: UseParamsRoute<TId> = (opts) => {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
return useParams({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.id,
} as any) as any
}
useLoaderDeps: UseLoaderDepsRoute<TId> = (opts) => {
return useLoaderDeps({ ...opts, from: this.id } as any)
}
useLoaderData: UseLoaderDataRoute<TId> = (opts) => {
return useLoaderData({ ...opts, from: this.id } as any)
}
useNavigate = (): UseNavigateResult<TFullPath> => {
return useNavigate({ from: this.fullPath })
}
Link: LinkComponentRoute<TFullPath> = React.forwardRef(
(props, ref: React.ForwardedRef<HTMLAnchorElement>) => {
return <Link ref={ref} from={this.fullPath as never} {...props} />
},
) as unknown as LinkComponentRoute<TFullPath>
}
/**
* Creates a non-root Route instance for code-based routing.
*
* Use this to define a route that will be composed into a route tree
* (typically via a parent route's `addChildren`). If you're using file-based
* routing, prefer `createFileRoute`.
*
* @param options Route options (path, component, loader, context, etc.).
* @returns A Route instance to be attached to the route tree.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouteFunction
*/
export function createRoute<
TRegister = unknown,
TParentRoute extends RouteConstraints['TParentRoute'] = AnyRoute,
TPath extends RouteConstraints['TPath'] = '/',
TFullPath extends RouteConstraints['TFullPath'] = ResolveFullPath<
TParentRoute,
TPath
>,
TCustomId extends RouteConstraints['TCustomId'] = string,
TId extends RouteConstraints['TId'] = ResolveId<
TParentRoute,
TCustomId,
TPath
>,
TSearchValidator = undefined,
TParams = ResolveParams<TPath>,
TRouteContextFn = AnyContext,
TBeforeLoadFn = AnyContext,
TLoaderDeps extends Record<string, any> = {},
TLoaderFn = undefined,
TChildren = unknown,
TSSR = unknown,
const TServerMiddlewares = unknown,
>(
options: RouteOptions<
TRegister,
TParentRoute,
TId,
TCustomId,
TFullPath,
TPath,
TSearchValidator,
TParams,
TLoaderDeps,
TLoaderFn,
AnyContext,
TRouteContextFn,
TBeforeLoadFn,
TSSR,
TServerMiddlewares
>,
): Route<
TRegister,
TParentRoute,
TPath,
TFullPath,
TCustomId,
TId,
TSearchValidator,
TParams,
AnyContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
TChildren,
TSSR,
TServerMiddlewares
> {
return new Route<
TRegister,
TParentRoute,
TPath,
TFullPath,
TCustomId,
TId,
TSearchValidator,
TParams,
AnyContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
TChildren,
TSSR,
TServerMiddlewares
>(
// TODO: Help us TypeChris, you're our only hope!
options as any,
)
}
export type AnyRootRoute = RootRoute<
any,
any,
any,
any,
any,
any,
any,
any,
any,
any,
any
>
/**
* Creates a root route factory that requires a router context type.
*
* Use when your root route expects `context` to be provided to `createRouter`.
* The returned function behaves like `createRootRoute` but enforces a context type.
*
* @returns A factory function to configure and return a root route.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteWithContextFunction
*/
export function createRootRouteWithContext<TRouterContext extends {}>() {
return <
TRegister = Register,
TRouteContextFn = AnyContext,
TBeforeLoadFn = AnyContext,
TSearchValidator = undefined,
TLoaderDeps extends Record<string, any> = {},
TLoaderFn = undefined,
TSSR = unknown,
TServerMiddlewares = unknown,
>(
options?: RootRouteOptions<
TRegister,
TSearchValidator,
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
TSSR,
TServerMiddlewares
>,
) => {
return createRootRoute<
TRegister,
TSearchValidator,
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
TSSR,
TServerMiddlewares
>(options)
}
}
/**
* @deprecated Use the `createRootRouteWithContext` function instead.
*/
export const rootRouteWithContext = createRootRouteWithContext
export class RootRoute<
in out TRegister = unknown,
in out TSearchValidator = undefined,
in out TRouterContext = {},
in out TRouteContextFn = AnyContext,
in out TBeforeLoadFn = AnyContext,
in out TLoaderDeps extends Record<string, any> = {},
in out TLoaderFn = undefined,
in out TChildren = unknown,
in out TFileRouteTypes = unknown,
in out TSSR = unknown,
in out TServerMiddlewares = unknown,
in out THandlers = undefined,
>
extends BaseRootRoute<
TRegister,
TSearchValidator,
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
TChildren,
TFileRouteTypes,
TSSR,
TServerMiddlewares,
THandlers
>
implements
RootRouteCore<
TRegister,
TSearchValidator,
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
TChildren,
TFileRouteTypes,
TSSR,
TServerMiddlewares,
THandlers
>
{
/**
* @deprecated `RootRoute` is now an internal implementation detail. Use `createRootRoute()` instead.
*/
constructor(
options?: RootRouteOptions<
TRegister,
TSearchValidator,
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
TSSR,
TServerMiddlewares,
THandlers
>,
) {
super(options)
}
useMatch: UseMatchRoute<RootRouteId> = (opts) => {
return useMatch({
select: opts?.select,
from: this.id,
structuralSharing: opts?.structuralSharing,
} as any) as any
}
useRouteContext: UseRouteContextRoute<RootRouteId> = (opts) => {
return useRouteContext({ ...(opts as any), from: this.id })
}
useSearch: UseSearchRoute<RootRouteId> = (opts) => {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
return useSearch({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.id,
} as any) as any
}
useParams: UseParamsRoute<RootRouteId> = (opts) => {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
return useParams({
select: opts?.select,
structuralSharing: opts?.structuralSharing,
from: this.id,
} as any) as any
}
useLoaderDeps: UseLoaderDepsRoute<RootRouteId> = (opts) => {
return useLoaderDeps({ ...opts, from: this.id } as any)
}
useLoaderData: UseLoaderDataRoute<RootRouteId> = (opts) => {
return useLoaderData({ ...opts, from: this.id } as any)
}
useNavigate = (): UseNavigateResult<'/'> => {
return useNavigate({ from: this.fullPath })
}
Link: LinkComponentRoute<'/'> = React.forwardRef(
(props, ref: React.ForwardedRef<HTMLAnchorElement>) => {
return <Link ref={ref} from={this.fullPath} {...props} />
},
) as unknown as LinkComponentRoute<'/'>
}
/**
* Creates a root Route instance used to build your route tree.
*
* Typically paired with `createRouter({ routeTree })`. If you need to require
* a typed router context, use `createRootRouteWithContext` instead.
*
* @param options Root route options (component, error, pending, etc.).
* @returns A root route instance.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRootRouteFunction
*/
export function createRootRoute<
TRegister = Register,
TSearchValidator = undefined,
TRouterContext = {},
TRouteContextFn = AnyContext,
TBeforeLoadFn = AnyContext,
TLoaderDeps extends Record<string, any> = {},
TLoaderFn = undefined,
TSSR = unknown,
const TServerMiddlewares = unknown,
THandlers = undefined,
>(
options?: RootRouteOptions<
TRegister,
TSearchValidator,
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
TSSR,
TServerMiddlewares,
THandlers
>,
): RootRoute<
TRegister,
TSearchValidator,
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
unknown,
unknown,
TSSR,
TServerMiddlewares,
THandlers
> {
return new RootRoute<
TRegister,
TSearchValidator,
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
unknown,
unknown,
TSSR,
TServerMiddlewares,
THandlers
>(options)
}
export function createRouteMask<
TRouteTree extends AnyRoute,
TFrom extends string,
TTo extends string,
>(
opts: {
routeTree: TRouteTree
} & ToMaskOptions<RouterCore<TRouteTree, 'never', boolean>, TFrom, TTo>,
): RouteMask<TRouteTree> {
return opts as any
}
export interface DefaultRouteTypes<TProps> {
component:
| ((props: TProps) => any)
| React.LazyExoticComponent<(props: TProps) => any>
}
export interface RouteTypes<TProps> extends DefaultRouteTypes<TProps> {}
export type AsyncRouteComponent<TProps> = RouteTypes<TProps>['component'] & {
preload?: () => Promise<void>
}
export type RouteComponent = AsyncRouteComponent<{}>
export type ErrorRouteComponent = AsyncRouteComponent<ErrorComponentProps>
export type NotFoundRouteComponent = RouteTypes<NotFoundRouteProps>['component']
export class NotFoundRoute<
TRegister,
TParentRoute extends AnyRootRoute,
TRouterContext = AnyContext,
TRouteContextFn = AnyContext,
TBeforeLoadFn = AnyContext,
TSearchValidator = undefined,
TLoaderDeps extends Record<string, any> = {},
TLoaderFn = undefined,
TChildren = unknown,
TSSR = unknown,
TServerMiddlewares = unknown,
> extends Route<
TRegister,
TParentRoute,
'/404',
'/404',
'404',
'404',
TSearchValidator,
{},
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TLoaderDeps,
TLoaderFn,
TChildren,
TSSR,
TServerMiddlewares
> {
constructor(
options: Omit<
RouteOptions<
TRegister,
TParentRoute,
string,
string,
string,
string,
TSearchValidator,
{},
TLoaderDeps,
TLoaderFn,
TRouterContext,
TRouteContextFn,
TBeforeLoadFn,
TSSR,
TServerMiddlewares
>,
| 'caseSensitive'
| 'parseParams'
| 'stringifyParams'
| 'path'
| 'id'
| 'params'
>,
) {
super({
...(options as any),
id: '404',
})
}
}
@@ -0,0 +1,6 @@
export * as ASTUtils from './ast-utils';
export * as ESLintUtils from './eslint-utils';
export * as JSONSchema from './json-schema';
export * as TSESLint from './ts-eslint';
export * from './ts-estree';
export * as TSUtils from './ts-utils';
@@ -0,0 +1 @@
{"version":3,"file":"trees.js","sources":["../../../src/icons/trees.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Trees\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTAgMTB2LjJBMyAzIDAgMCAxIDguOSAxNkg1YTMgMyAwIDAgMS0xLTUuOFYxMGEzIDMgMCAwIDEgNiAwWiIgLz4KICA8cGF0aCBkPSJNNyAxNnY2IiAvPgogIDxwYXRoIGQ9Ik0xMyAxOXYzIiAvPgogIDxwYXRoIGQ9Ik0xMiAxOWg4LjNhMSAxIDAgMCAwIC43LTEuN0wxOCAxNGguM2ExIDEgMCAwIDAgLjctMS43TDE2IDloLjJhMSAxIDAgMCAwIC44LTEuN0wxMyAzbC0xLjQgMS41IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/trees\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 Trees = createLucideIcon('Trees', [\n ['path', { d: 'M10 10v.2A3 3 0 0 1 8.9 16H5a3 3 0 0 1-1-5.8V10a3 3 0 0 1 6 0Z', key: '1l6gj6' }],\n ['path', { d: 'M7 16v6', key: '1a82de' }],\n ['path', { d: 'M13 19v3', key: '13sx9i' }],\n [\n 'path',\n {\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AA,CAAK,UAAU,CAAA,CAAA;AAAA,CACzC,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;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,269 @@
import CAC from "./CAC.ts";
import Option, { OptionConfig } from "./Option.ts";
import { removeBrackets, findAllBrackets, findLongest, padRight, CACError } from "./utils.ts";
import { platformInfo } from "./deno.ts";
interface CommandArg {
required: boolean;
value: string;
variadic: boolean;
}
interface HelpSection {
title?: string;
body: string;
}
interface CommandConfig {
allowUnknownOptions?: boolean;
ignoreOptionDefaultValue?: boolean;
}
type HelpCallback = (sections: HelpSection[]) => void | HelpSection[];
type CommandExample = ((bin: string) => string) | string;
class Command {
options: Option[];
aliasNames: string[];
/* Parsed command name */
name: string;
args: CommandArg[];
commandAction?: (...args: any[]) => any;
usageText?: string;
versionNumber?: string;
examples: CommandExample[];
helpCallback?: HelpCallback;
globalCommand?: GlobalCommand;
constructor(public rawName: string, public description: string, public config: CommandConfig = {}, public cli: CAC) {
this.options = [];
this.aliasNames = [];
this.name = removeBrackets(rawName);
this.args = findAllBrackets(rawName);
this.examples = [];
}
usage(text: string) {
this.usageText = text;
return this;
}
allowUnknownOptions() {
this.config.allowUnknownOptions = true;
return this;
}
ignoreOptionDefaultValue() {
this.config.ignoreOptionDefaultValue = true;
return this;
}
version(version: string, customFlags = '-v, --version') {
this.versionNumber = version;
this.option(customFlags, 'Display version number');
return this;
}
example(example: CommandExample) {
this.examples.push(example);
return this;
}
/**
* Add a option for this command
* @param rawName Raw option name(s)
* @param description Option description
* @param config Option config
*/
option(rawName: string, description: string, config?: OptionConfig) {
const option = new Option(rawName, description, config);
this.options.push(option);
return this;
}
alias(name: string) {
this.aliasNames.push(name);
return this;
}
action(callback: (...args: any[]) => any) {
this.commandAction = callback;
return this;
}
/**
* Check if a command name is matched by this command
* @param name Command name
*/
isMatched(name: string) {
return this.name === name || this.aliasNames.includes(name);
}
get isDefaultCommand() {
return this.name === '' || this.aliasNames.includes('!');
}
get isGlobalCommand(): boolean {
return this instanceof GlobalCommand;
}
/**
* Check if an option is registered in this command
* @param name Option name
*/
hasOption(name: string) {
name = name.split('.')[0];
return this.options.find(option => {
return option.names.includes(name);
});
}
outputHelp() {
const {
name,
commands
} = this.cli;
const {
versionNumber,
options: globalOptions,
helpCallback
} = this.cli.globalCommand;
let sections: HelpSection[] = [{
body: `${name}${versionNumber ? `/${versionNumber}` : ''}`
}];
sections.push({
title: 'Usage',
body: ` $ ${name} ${this.usageText || this.rawName}`
});
const showCommands = (this.isGlobalCommand || this.isDefaultCommand) && commands.length > 0;
if (showCommands) {
const longestCommandName = findLongest(commands.map(command => command.rawName));
sections.push({
title: 'Commands',
body: commands.map(command => {
return ` ${padRight(command.rawName, longestCommandName.length)} ${command.description}`;
}).join('\n')
});
sections.push({
title: `For more info, run any command with the \`--help\` flag`,
body: commands.map(command => ` $ ${name}${command.name === '' ? '' : ` ${command.name}`} --help`).join('\n')
});
}
let options = this.isGlobalCommand ? globalOptions : [...this.options, ...(globalOptions || [])];
if (!this.isGlobalCommand && !this.isDefaultCommand) {
options = options.filter(option => option.name !== 'version');
}
if (options.length > 0) {
const longestOptionName = findLongest(options.map(option => option.rawName));
sections.push({
title: 'Options',
body: options.map(option => {
return ` ${padRight(option.rawName, longestOptionName.length)} ${option.description} ${option.config.default === undefined ? '' : `(default: ${option.config.default})`}`;
}).join('\n')
});
}
if (this.examples.length > 0) {
sections.push({
title: 'Examples',
body: this.examples.map(example => {
if (typeof example === 'function') {
return example(name);
}
return example;
}).join('\n')
});
}
if (helpCallback) {
sections = helpCallback(sections) || sections;
}
console.log(sections.map(section => {
return section.title ? `${section.title}:\n${section.body}` : section.body;
}).join('\n\n'));
}
outputVersion() {
const {
name
} = this.cli;
const {
versionNumber
} = this.cli.globalCommand;
if (versionNumber) {
console.log(`${name}/${versionNumber} ${platformInfo}`);
}
}
checkRequiredArgs() {
const minimalArgsCount = this.args.filter(arg => arg.required).length;
if (this.cli.args.length < minimalArgsCount) {
throw new CACError(`missing required args for command \`${this.rawName}\``);
}
}
/**
* Check if the parsed options contain any unknown options
*
* Exit and output error when true
*/
checkUnknownOptions() {
const {
options,
globalCommand
} = this.cli;
if (!this.config.allowUnknownOptions) {
for (const name of Object.keys(options)) {
if (name !== '--' && !this.hasOption(name) && !globalCommand.hasOption(name)) {
throw new CACError(`Unknown option \`${name.length > 1 ? `--${name}` : `-${name}`}\``);
}
}
}
}
/**
* Check if the required string-type options exist
*/
checkOptionValue() {
const {
options: parsedOptions,
globalCommand
} = this.cli;
const options = [...globalCommand.options, ...this.options];
for (const option of options) {
const value = parsedOptions[option.name.split('.')[0]]; // Check required option value
if (option.required) {
const hasNegated = options.some(o => o.negated && o.names.includes(option.name));
if (value === true || value === false && !hasNegated) {
throw new CACError(`option \`${option.rawName}\` value is missing`);
}
}
}
}
}
class GlobalCommand extends Command {
constructor(cli: CAC) {
super('@@global@@', '', {}, cli);
}
}
export type { HelpCallback, CommandExample, CommandConfig };
export { GlobalCommand };
export default Command;
@@ -0,0 +1,15 @@
import { Context } from "../../context.js";
import { StreamingApi } from "../../utils/stream.js";
//#region src/helper/streaming/sse.d.ts
export interface SSEMessage {
data: string | Promise<string>;
event?: string;
id?: string;
retry?: number;
}
export declare class SSEStreamingApi extends StreamingApi {
constructor(writable: WritableStream, readable: ReadableStream);
writeSSE(message: SSEMessage): Promise<void>;
}
export declare const streamSSE: (c: Context, cb: (stream: SSEStreamingApi) => Promise<void>, onError?: (e: Error, stream: SSEStreamingApi) => Promise<void>) => Response;
//#endregion
@@ -0,0 +1 @@
{"version":3,"file":"monitor-stop.js","sources":["../../../src/icons/monitor-stop.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MonitorStop\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTd2NCIgLz4KICA8cGF0aCBkPSJNOCAyMWg4IiAvPgogIDxyZWN0IHg9IjIiIHk9IjMiIHdpZHRoPSIyMCIgaGVpZ2h0PSIxNCIgcng9IjIiIC8+CiAgPHJlY3QgeD0iOSIgeT0iNyIgd2lkdGg9IjYiIGhlaWdodD0iNiIgcng9IjEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/monitor-stop\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 MonitorStop = createLucideIcon('MonitorStop', [\n ['path', { d: 'M12 17v4', key: '1riwvh' }],\n ['path', { d: 'M8 21h8', key: '1ev6f3' }],\n ['rect', { x: '2', y: '3', width: '20', height: '14', rx: '2', key: 'x3v2xh' }],\n ['rect', { x: '9', y: '7', width: '6', height: '6', rx: '1', key: '5m2oou' }],\n]);\n\nexport default MonitorStop;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,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,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,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAG,KAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,QAAQ,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAG,KAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAQ,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC9E,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,17 @@
/**
* A utility type for choosing between synchronous and asynchronous return
* values.
*
* This is used as the return value for plugins like {@link CustomFunction},
* {@link Importer}, and {@link FileImporter} so that TypeScript enforces that
* asynchronous plugins are only passed to {@link compileAsync} and {@link
* compileStringAsync}, not {@link compile} or {@link compileString}.
*
* @typeParam sync - If this is `'sync'`, this can only be a `T`. If it's
* `'async'`, this can be either a `T` or a `Promise<T>`.
*
* @category Other
*/
export type PromiseOr<T, sync extends 'sync' | 'async'> = sync extends 'async'
? T | Promise<T>
: T;
@@ -0,0 +1,242 @@
/**
* @fileoverview Rule to require newlines before `return` statement
* @author Kai Cataldo
* @deprecated in ESLint v4.0.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "layout",
docs: {
description: "Require an empty line before `return` statements",
recommended: false,
url: "https://eslint.org/docs/latest/rules/newline-before-return",
},
fixable: "whitespace",
schema: [],
messages: {
expected: "Expected newline before return statement.",
},
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;
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Tests whether node is preceded by supplied tokens
* @param {ASTNode} node node to check
* @param {Array} testTokens array of tokens to test against
* @returns {boolean} Whether or not the node is preceded by one of the supplied tokens
* @private
*/
function isPrecededByTokens(node, testTokens) {
const tokenBefore = sourceCode.getTokenBefore(node);
return testTokens.includes(tokenBefore.value);
}
/**
* Checks whether node is the first node after statement or in block
* @param {ASTNode} node node to check
* @returns {boolean} Whether or not the node is the first node after statement or in block
* @private
*/
function isFirstNode(node) {
const parentType = node.parent.type;
if (node.parent.body) {
return Array.isArray(node.parent.body)
? node.parent.body[0] === node
: node.parent.body === node;
}
if (parentType === "IfStatement") {
return isPrecededByTokens(node, ["else", ")"]);
}
if (parentType === "DoWhileStatement") {
return isPrecededByTokens(node, ["do"]);
}
if (parentType === "SwitchCase") {
return isPrecededByTokens(node, [":"]);
}
return isPrecededByTokens(node, [")"]);
}
/**
* Returns the number of lines of comments that precede the node
* @param {ASTNode} node node to check for overlapping comments
* @param {number} lineNumTokenBefore line number of previous token, to check for overlapping comments
* @returns {number} Number of lines of comments that precede the node
* @private
*/
function calcCommentLines(node, lineNumTokenBefore) {
const comments = sourceCode.getCommentsBefore(node);
let numLinesComments = 0;
if (!comments.length) {
return numLinesComments;
}
comments.forEach(comment => {
numLinesComments++;
if (comment.type === "Block") {
numLinesComments +=
comment.loc.end.line - comment.loc.start.line;
}
// avoid counting lines with inline comments twice
if (comment.loc.start.line === lineNumTokenBefore) {
numLinesComments--;
}
if (comment.loc.end.line === node.loc.start.line) {
numLinesComments--;
}
});
return numLinesComments;
}
/**
* Returns the line number of the token before the node that is passed in as an argument
* @param {ASTNode} node The node to use as the start of the calculation
* @returns {number} Line number of the token before `node`
* @private
*/
function getLineNumberOfTokenBefore(node) {
const tokenBefore = sourceCode.getTokenBefore(node);
let lineNumTokenBefore;
/**
* Global return (at the beginning of a script) is a special case.
* If there is no token before `return`, then we expect no line
* break before the return. Comments are allowed to occupy lines
* before the global return, just no blank lines.
* Setting lineNumTokenBefore to zero in that case results in the
* desired behavior.
*/
if (tokenBefore) {
lineNumTokenBefore = tokenBefore.loc.end.line;
} else {
lineNumTokenBefore = 0; // global return at beginning of script
}
return lineNumTokenBefore;
}
/**
* Checks whether node is preceded by a newline
* @param {ASTNode} node node to check
* @returns {boolean} Whether or not the node is preceded by a newline
* @private
*/
function hasNewlineBefore(node) {
const lineNumNode = node.loc.start.line;
const lineNumTokenBefore = getLineNumberOfTokenBefore(node);
const commentLines = calcCommentLines(node, lineNumTokenBefore);
return lineNumNode - lineNumTokenBefore - commentLines > 1;
}
/**
* Checks whether it is safe to apply a fix to a given return statement.
*
* The fix is not considered safe if the given return statement has leading comments,
* as we cannot safely determine if the newline should be added before or after the comments.
* For more information, see: https://github.com/eslint/eslint/issues/5958#issuecomment-222767211
* @param {ASTNode} node The return statement node to check.
* @returns {boolean} `true` if it can fix the node.
* @private
*/
function canFix(node) {
const leadingComments = sourceCode.getCommentsBefore(node);
const lastLeadingComment = leadingComments.at(-1);
const tokenBefore = sourceCode.getTokenBefore(node);
if (leadingComments.length === 0) {
return true;
}
/*
* if the last leading comment ends in the same line as the previous token and
* does not share a line with the `return` node, we can consider it safe to fix.
* Example:
* function a() {
* var b; //comment
* return;
* }
*/
if (
lastLeadingComment.loc.end.line === tokenBefore.loc.end.line &&
lastLeadingComment.loc.end.line !== node.loc.start.line
) {
return true;
}
return false;
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
ReturnStatement(node) {
if (!isFirstNode(node) && !hasNewlineBefore(node)) {
context.report({
node,
messageId: "expected",
fix(fixer) {
if (canFix(node)) {
const tokenBefore =
sourceCode.getTokenBefore(node);
const newlines =
node.loc.start.line ===
tokenBefore.loc.end.line
? "\n\n"
: "\n";
return fixer.insertTextBefore(node, newlines);
}
return null;
},
});
}
},
};
},
};
@@ -0,0 +1 @@
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("motion-utils")):"function"==typeof define&&define.amd?define(["exports","motion-utils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).MotionDom={},t.MotionUtils)}(this,function(t,e){"use strict";const i=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],n={value:null,addProjectionMetrics:null};function s(t,s){let o=!1,r=!0;const a={delta:0,timestamp:0,isProcessing:!1},l=()=>o=!0,c=i.reduce((t,e)=>(t[e]=function(t,e){let i=new Set,s=new Set,o=!1,r=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(e){a.has(e)&&(h.schedule(e),t()),c++,e(l)}const h={schedule:(t,e=!1,n=!1)=>{const r=n&&o?i:s;return e&&a.add(t),r.add(t),t},cancel:t=>{s.delete(t),a.delete(t)},process:t=>{if(l=t,o)return void(r=!0);o=!0;const a=i;i=s,s=a,i.forEach(u),e&&n.value&&n.value.frameloop[e].push(c),c=0,i.clear(),o=!1,r&&(r=!1,h.process(t))}};return h}(l,s?e:void 0),t),{}),{setup:u,read:h,resolveKeyframes:d,preUpdate:p,update:m,preRender:f,render:y,postRender:g}=c,v=()=>{const i=e.MotionGlobalConfig.useManualTiming,n=i?a.timestamp:performance.now();o=!1,i||(a.delta=r?1e3/60:Math.max(Math.min(n-a.timestamp,40),1)),a.timestamp=n,a.isProcessing=!0,u.process(a),h.process(a),d.process(a),p.process(a),m.process(a),f.process(a),y.process(a),g.process(a),a.isProcessing=!1,o&&s&&(r=!1,t(v))};return{schedule:i.reduce((e,i)=>{const n=c[i];return e[i]=(e,i=!1,s=!1)=>(o||(o=!0,r=!0,a.isProcessing||t(v)),n.schedule(e,i,s)),e},{}),cancel:t=>{for(let e=0;e<i.length;e++)c[i[e]].cancel(t)},state:a,steps:c}}const{schedule:o,cancel:r,state:a,steps:l}=s("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e.noop,!0);let c;function u(){c=void 0}const h={now:()=>(void 0===c&&h.set(a.isProcessing||e.MotionGlobalConfig.useManualTiming?a.timestamp:performance.now()),c),set:t=>{c=t,queueMicrotask(u)}},d={layout:0,mainThread:0,waapi:0},p=t=>e=>"string"==typeof e&&e.startsWith(t),m=p("--"),f=p("var(--"),y=t=>!!f(t)&&g.test(t.split("/*")[0].trim()),g=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function v(t){return"string"==typeof t&&t.split("/*")[0].includes("var(--")}const x={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},T={...x,transform:t=>e.clamp(0,1,t)},w={...x,default:1},b=t=>Math.round(1e5*t)/1e5,S=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const V=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,A=(t,e)=>i=>Boolean("string"==typeof i&&V.test(i)&&i.startsWith(t)||e&&!function(t){return null==t}(i)&&Object.prototype.hasOwnProperty.call(i,e)),P=(t,e,i)=>n=>{if("string"!=typeof n)return n;const[s,o,r,a]=n.match(S);return{[t]:parseFloat(s),[e]:parseFloat(o),[i]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},M={...x,transform:t=>Math.round((t=>e.clamp(0,255,t))(t))},E={test:A("rgb","red"),parse:P("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:n=1})=>"rgba("+M.transform(t)+", "+M.transform(e)+", "+M.transform(i)+", "+b(T.transform(n))+")"};const k={test:A("#"),parse:function(t){let e="",i="",n="",s="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),n=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),n=t.substring(3,4),s=t.substring(4,5),e+=e,i+=i,n+=n,s+=s),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}},transform:E.transform},D=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),R=D("deg"),B=D("%"),C=D("px"),j=D("vh"),L=D("vw"),F=(()=>({...B,parse:t=>B.parse(t)/100,transform:t=>B.transform(100*t)}))(),O={test:A("hsl","hue"),parse:P("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:n=1})=>"hsla("+Math.round(t)+", "+B.transform(b(e))+", "+B.transform(b(i))+", "+b(T.transform(n))+")"},I={test:t=>E.test(t)||k.test(t)||O.test(t),parse:t=>E.test(t)?E.parse(t):O.test(t)?O.parse(t):k.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?E.transform(t):O.transform(t),getAnimatableNone:t=>{const e=I.parse(t);return e.alpha=0,I.transform(e)}},U=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const N="number",W="color",$=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function z(t){const e=t.toString(),i=[],n={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace($,t=>(I.test(t)?(n.color.push(o),s.push(W),i.push(I.parse(t))):t.startsWith("var(")?(n.var.push(o),s.push("var"),i.push(t)):(n.number.push(o),s.push(N),i.push(parseFloat(t))),++o,"${}")).split("${}");return{values:i,split:r,indexes:n,types:s}}function K({split:t,types:e}){const i=t.lengLine truncated