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,10 @@
import type { ErrorObject } from "../../types";
export declare enum DiscrError {
Tag = "tag",
Mapping = "mapping"
}
export type DiscrErrorObj<E extends DiscrError> = ErrorObject<"discriminator", {
error: E;
tag: string;
tagValue: unknown;
}, string>;
@@ -0,0 +1,55 @@
'use strict';
var dateSplits = require('./dateSplits.cjs');
const DATE_MAX_YEAR = 2050;
const DATE_MIN_YEAR = 1000;
const DATE_SPLITS = dateSplits;
const BRUTEFORCE_CARDINALITY = 10;
const MIN_GUESSES_BEFORE_GROWING_SEQUENCE = 10000;
const MIN_SUBMATCH_GUESSES_SINGLE_CHAR = 10;
const MIN_SUBMATCH_GUESSES_MULTI_CHAR = 50;
const MIN_YEAR_SPACE = 21;
// \xbf-\xdf is a range for almost all special uppercase letter like Ä and so on
const START_UPPER = /^[A-Z\xbf-\xdf][^A-Z\xbf-\xdf]+$/;
const END_UPPER = /^[^A-Z\xbf-\xdf]+[A-Z\xbf-\xdf]$/;
// \xdf-\xff is a range for almost all special lowercase letter like ä and so on
const ALL_UPPER = /^[A-Z\xbf-\xdf]+$/;
const ALL_UPPER_INVERTED = /^[^a-z\xdf-\xff]+$/;
const ALL_LOWER = /^[a-z\xdf-\xff]+$/;
const ALL_LOWER_INVERTED = /^[^A-Z\xbf-\xdf]+$/;
const ONE_LOWER = /[a-z\xdf-\xff]/;
const ONE_UPPER = /[A-Z\xbf-\xdf]/;
const ALPHA_INVERTED = /[^A-Za-z\xbf-\xdf]/gi;
const ALL_DIGIT = /^\d+$/;
const REFERENCE_YEAR = new Date().getFullYear();
const REGEXEN = {
recentYear: /19\d\d|200\d|201\d|202\d/g
};
/* Separators */
const SEPERATOR_CHARS = [' ', ',', ';', ':', '|', '/', '\\', '_', '.', '-'];
const SEPERATOR_CHAR_COUNT = SEPERATOR_CHARS.length;
exports.ALL_DIGIT = ALL_DIGIT;
exports.ALL_LOWER = ALL_LOWER;
exports.ALL_LOWER_INVERTED = ALL_LOWER_INVERTED;
exports.ALL_UPPER = ALL_UPPER;
exports.ALL_UPPER_INVERTED = ALL_UPPER_INVERTED;
exports.ALPHA_INVERTED = ALPHA_INVERTED;
exports.BRUTEFORCE_CARDINALITY = BRUTEFORCE_CARDINALITY;
exports.DATE_MAX_YEAR = DATE_MAX_YEAR;
exports.DATE_MIN_YEAR = DATE_MIN_YEAR;
exports.DATE_SPLITS = DATE_SPLITS;
exports.END_UPPER = END_UPPER;
exports.MIN_GUESSES_BEFORE_GROWING_SEQUENCE = MIN_GUESSES_BEFORE_GROWING_SEQUENCE;
exports.MIN_SUBMATCH_GUESSES_MULTI_CHAR = MIN_SUBMATCH_GUESSES_MULTI_CHAR;
exports.MIN_SUBMATCH_GUESSES_SINGLE_CHAR = MIN_SUBMATCH_GUESSES_SINGLE_CHAR;
exports.MIN_YEAR_SPACE = MIN_YEAR_SPACE;
exports.ONE_LOWER = ONE_LOWER;
exports.ONE_UPPER = ONE_UPPER;
exports.REFERENCE_YEAR = REFERENCE_YEAR;
exports.REGEXEN = REGEXEN;
exports.SEPERATOR_CHARS = SEPERATOR_CHARS;
exports.SEPERATOR_CHAR_COUNT = SEPERATOR_CHAR_COUNT;
exports.START_UPPER = START_UPPER;
//# sourceMappingURL=const.cjs.map
@@ -0,0 +1 @@
{"version":3,"file":"box-select.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"linkedin.js","sources":["../../../src/icons/linkedin.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Linkedin\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTYgOGE2IDYgMCAwIDEgNiA2djdoLTR2LTdhMiAyIDAgMCAwLTItMiAyIDIgMCAwIDAtMiAydjdoLTR2LTdhNiA2IDAgMCAxIDYtNnoiIC8+CiAgPHJlY3Qgd2lkdGg9IjQiIGhlaWdodD0iMTIiIHg9IjIiIHk9IjkiIC8+CiAgPGNpcmNsZSBjeD0iNCIgY3k9IjQiIHI9IjIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/linkedin\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 * @deprecated Brand icons have been deprecated and are due to be removed, please refer to https://github.com/lucide-icons/lucide/issues/670. We recommend using https://simpleicons.org/?q=linkedin instead. This icon will be removed in v1.0\n */\nconst Linkedin = createLucideIcon('Linkedin', [\n [\n 'path',\n {\n d: 'M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z',\n key: 'c2jq9f',\n },\n ],\n ['rect', { width: '4', height: '12', x: '2', y: '9', key: 'mk3on5' }],\n ['circle', { cx: '4', cy: '4', r: '2', key: 'bt5ra8' }],\n]);\n\nexport default Linkedin;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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AA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACpE,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,EAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AACxD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
export { _lt as lt, _lte as lte, _lte as maximum, _gt as gt, _gte as gte, _gte as minimum, _positive as positive, _negative as negative, _nonpositive as nonpositive, _nonnegative as nonnegative, _multipleOf as multipleOf, _maxSize as maxSize, _minSize as minSize, _size as size, _maxLength as maxLength, _minLength as minLength, _length as length, _regex as regex, _lowercase as lowercase, _uppercase as uppercase, _includes as includes, _startsWith as startsWith, _endsWith as endsWith, _property as property, _properties as properties, _mime as mime, _overwrite as overwrite, _normalize as normalize, _trim as trim, _toLowerCase as toLowerCase, _toUpperCase as toUpperCase, } from "../core/index.cjs";
@@ -0,0 +1,19 @@
export * from "./core.cjs";
export * from "./parse.cjs";
export * from "./errors.cjs";
export * from "./schemas.cjs";
export * from "./memoizer.cjs";
export * from "./checks.cjs";
export * from "./versions.cjs";
export * as util from "./util.cjs";
export { toZod } from "./util.cjs";
export * as regexes from "./regexes.cjs";
export * as locales from "../locales/index.cjs";
export * from "./registries.cjs";
export * from "./doc.cjs";
export * from "./compile.cjs";
export * from "./api.cjs";
export * from "./to-json-schema.cjs";
export { toJSONSchema } from "./json-schema-processors.cjs";
export { JSONSchemaGenerator } from "./json-schema-generator.cjs";
export * as JSONSchema from "./json-schema.cjs";
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","names":["recordedIssuer: string","currentIssuer: string","url: URL","resourceMetadata: OAuthProtectedResourceMetadata | undefined","authorizationServerUrl: string | URL","metadata: AuthorizationServerMetadata | undefined","freshDiscoveryState: OAuthDiscoveryState | undefined","infoCtx: OAuthClientInformationContext","resource: string | URL | undefined","tokens","newTokens: OAuthTokens | undefined","resourceMetadataUrl: URL | undefined","urlsToTry: { url: URL; type: 'oauth' | 'oidc' }[]","authorizationServerUrl: string | undefined","authorizationUrl: URL","json: unknown","tokenRequestParams: URLSearchParams | undefined","registrationUrl: URL","submittedMetadata: OAuthClientMetadata","key: unknown","CAP_EXEMPT_METHODS: ReadonlySet<string>","_store: ResponseCacheStore","_isUserSupplied: boolean","_reportError: (error: unknown) => void","_cachePartition: string","_now: () => number","parsed: unknown","json: string | undefined","parsed: unknown","DEFAULT_VERSION_NEGOTIATION_MODE: VersionNegotiationMode","_transport: Transport","verdict: ProbeVerdict","result: NegotiationResult","signalClosed: (() => void) | undefined","LIST_CHANGED_EVICTIONS: Readonly<Record<string, readonly string[]>>","_clientInfo: Implementation","result: Awaited<ReturnType<typeof negotiateEra>>","effective: ListChangedHandlers","filter: SubscriptionFilter","scope: CacheScope","state: 'opening' | 'open' | 'closed'","ackTimer: ReturnType<typeof setTimeout> | undefined","onCallerAbort: (() => void) | undefined","resolveOpening!: (honored: SubscriptionFilter) => void","rejectOpening!: (error: Error) => void","resolveClosed!: (cause: 'local' | 'graceful' | 'remote') => void","jsonrpcRequest: JSONRPCRequest","scan: XMcpHeaderScanResult | undefined","result: CallToolResult","parseResult","DEFAULT_DPOP_ALG: DpopAlg","keyPair: DpopKeyPair","payload: Record<string, unknown>","defaultLogger: RequestLogger","code: number | undefined","event: ErrorEvent","token: string | undefined","redirect: string | undefined","error","message: JSONRPCMessage","DEFAULT_STREAMABLE_HTTP_RECONNECTION_OPTIONS: StreamableHTTPReconnectionOptions","RESERVED_REQUEST_HEADER_NAMES: ReadonlySet<string>","token: string | undefined","lastEventId: string | undefined","error","_defaultValidator: jsonSchemaValidator | undefined","coreFromJsonSchema"],"sources":["../src/client/authErrors.ts","../src/client/auth.ts","../src/client/authExtensions.ts","../src/client/responseCache.ts","../src/client/authSeam.ts","../src/client/probeClassifier.ts","../src/client/versionNegotiation.ts","../src/client/client.ts","../src/client/crossAppAccess.ts","../src/client/dpop.ts","../src/client/middleware.ts","../src/client/sse.ts","../src/client/streamableHttp.ts","../src/fromJsonSchema.ts"],"sourcesContent":["/**\n * Error classes thrown by the OAuth client flow ({@linkcode auth} and helpers).\n *\n * Each behavior change in the 2026-07-28 authorization requirements adds its\n * dedicated error class to this module so callers can `instanceof`-dispatch on\n * the failure mode without string-matching messages.\n */\n\nimport type { OAuthClientMetadata } from '@modelcontextprotocol/core-internal';\nimport { brandedHasInstance, stampErrorBrands } from '@modelcontextprotocol/core-internal';\n\n/**\n * Base class for the OAuth-client-flow error family. Concrete subclasses are\n * added to this module alongside the SEP-2468/837/2207/2350/2352 behavior\n * changes that throw them, so callers can catch the whole family with a single\n * `instanceof OAuthClientFlowError` guard once those land.\n *\n * @remarks Nothing in the SDK throws this base class directly. In the release\n * that introduces it no subclass exists yet — the guard is a forward-compat\n * hook and will not match anything until the first behavior change ships.\n */\nexport class OAuthClientFlowError extends Error {\n static {\n Object.defineProperty(this, 'mcpBrand', { value: 'mcp.OAuthClientFlowError' });\n }\n\n static override [Symbol.hasInstance](value: unknown): boolean {\n return brandedHasInstance(this, value);\n }\n\n /**\n * Brand-based type guard: equivalent to `value instanceof this`, as an\n * explicit static predicate (the axios/AWS-SDK `isInstance` style). Reads\n * the caller's own brand via `this`, so every branded subclass gets a\n * correctly-scoped guard by inheritance. Must be invoked on the class —\n * in callback position write `v => SdkError.isInstance(v)`, not\n * `.filter(SdkError.isInstance)` (detached calls throw rather than\n * silently matching nothing).\n */\n static isInstance<T extends abstract new (...args: never[]) => unknown>(this: T, value: unknown): value is InstanceType<T> {\n if (typeof this !== 'function') {\n throw new TypeError(\n 'isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`'\n );\Line truncated
@@ -0,0 +1 @@
{"version":3,"names":["_codeFrame","require","_index","_index2","_cache","_modification","_parser","_t","_context","FUNCTION_TYPES","arrowFunctionExpression","assignmentExpression","awaitExpression","blockStatement","buildUndefinedNode","callExpression","cloneNode","conditionalExpression","expressionStatement","getBindingIdentifiers","identifier","inheritLeadingComments","inheritTrailingComments","inheritsComments","isBlockStatement","isEmptyStatement","isExpression","isExpressionStatement","isIfStatement","isProgram","isStatement","isVariableDeclaration","removeComments","returnStatement","sequenceExpression","validate","yieldExpression","replaceWithMultiple","nodes","_getCachedPaths","resync","call","verifiedNodes","_verifyNodeList","node","length","getCachedPaths","delete","container","key","paths","insertAfter","requeue","remove","replaceWithSourceString","replacement","ast","parse","err","loc","message","codeFrameColumns","start","line","column","code","expressionAST","program","body","expression","traverse","removeProperties","replaceWith","replacementPath","removed","Error","NodePath","Array","isArray","nodePath","isNodeType","canHaveVariableDeclarationOrExpression","canSwapBetweenExpressionAndStatement","parentPath","isExportDefaultDeclaration","replaceExpressionWithStatements","oldNode","_replaceWith","type","setScope","get","_getCachedPaths2","ReferenceError","inList","parent","debug","set","declars","nodesAsSingleExpression","gatherSequenceExpressions","id","scope","push","functionParent","getFunctionParent","isParentAsync","async","isParentGenerator","generator","callee","hoistVariables","completionRecords","getCompletionRecords","path","loop","findParent","isLoop","uid","getData","generateDeclaredUidIdentifier","pushContainer","setData","name","arrowFunctionToExpression","newCallee","needToAwaitFunction","hasType","needToYieldFunction","exprs","ensureLastUndefined","kind","declar","declarations","bindings","Object","keys","init","consequent","alternate","test","indexOf","replaceInline","_containerInsertAfter"],"sources":["../../src/path/replacement.ts"],"sourcesContent":["// This file contains methods responsible for replacing a node with another.\n\nimport { codeFrameColumns } from \"@babel/code-frame\";\nimport traverse from \"../index.ts\";\nimport NodePath from \"./index.ts\";\nimport { getCachedPaths } from \"../cache.ts\";\nimport { _verifyNodeList, _containerInsertAfter } from \"./modification.ts\";\nimport { parse } from \"@babel/parser\";\nimport {\n FUNCTION_TYPES,\n arrowFunctionExpression,\n assignmentExpression,\n awaitExpression,\n blockStatement,\n buildUndefinedNode,\n callExpression,\n cloneNode,\n conditionalExpression,\n expressionStatement,\n getBindingIdentifiers,\n identifier,\n inheritLeadingComments,\n inheritTrailingComments,\n inheritsComments,\n isBlockStatement,\n isEmptyStatement,\n isExpression,\n isExpressionStatement,\n isIfStatement,\n isProgram,\n isStatement,\n isVariableDeclaration,\n removeComments,\n returnStatement,\n sequenceExpression,\n validate,\n yieldExpression,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport { resync, setScope } from \"./context.ts\";\n\n/**\n * Replace a node with an array of multiple. This method performs the following steps:\n *\n * - Inherit the comments of first provided node with that of the current node.\n * - Insert the provided nodes after the current node.\n * - Remove the current node.\n */\n\nimport type { NodeOrNodeList, NodePaths } from \"./index.ts\";\n\nexport function replaceWithMultiple<Nodes extends NodeOrNodeList<t.Node>>(\n this: NodePath,\n nodes: Nodes,\n): NodePaths<Nodes> {\n resync.call(this);\n\n const verifiedNodes = _verifyNodeList.call(this, nodes);\n inheritLeadingComments(verifiedNodes[0], this.node);\n inheritTrailingComments(verifiedNodes[verifiedNodes.length - 1], this.node);\n getCachedPaths(this)?.delete(this.node);\n // @ts-expect-error TODO: better types\n this.node =\n // @ts-expect-error this.key must present in this.container\n this.container[this.key] = null;\n const paths = this.insertAfter(nodes);\n\n if (this.node) {\n this.requeue();\n } else {\n this.remove();\n }\n return paths;\n}\n\n/**\n * Parse a string as an expression and replace the current node with the result.\n *\n * NOTE: This is typically not a good idea to use. Building source strings when\n * transforming ASTs is an antipattern and SHOULD NOT be encouraged. Even if it's\n * easier to use, your transforms will be extremely brittle.\n */\n\nexport function replaceWithSourceString(this: NodePath, replacement: string) {\n resync.call(this);\n let ast: t.File;\n\n try {\n replacement = `(${replacement})`;\n ast = parse(replacement);\n } catch (err) {\n const loc = err.loc;\n if (loc) {\n err.message +=\n \" - make sure this is an expression.\\n\" +\n codeFrameColumns(replacement, {\n start: {\n Line truncated
@@ -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 Cone = createLucideIcon("Cone", [
["path", { d: "m20.9 18.55-8-15.98a1 1 0 0 0-1.8 0l-8 15.98", key: "53pte7" }],
["ellipse", { cx: "12", cy: "19", rx: "9", ry: "3", key: "1ji25f" }]
]);
export { Cone as default };
//# sourceMappingURL=cone.js.map
@@ -0,0 +1,6 @@
import { RankedDictionaries, UserInputsOptions } from '../types';
declare const _default: (optionsRankedDictionaries: RankedDictionaries, optionsRankedDictionariesMaxWordSize: Record<string, number>, userInputsOptions?: UserInputsOptions) => {
rankedDictionaries: RankedDictionaries;
rankedDictionariesMaxWordSize: Record<string, number>;
};
export default _default;
@@ -0,0 +1,54 @@
import { describe, expect, expectTypeOf, test } from "vitest";
import * as z from "zod/mini";
describe("mini deepPartial", () => {
test("makes a ZodMiniObject's fields optional recursively", () => {
const schema = z.object({
name: z.string(),
profile: z.object({ bio: z.string(), age: z.number() }),
});
const partial = z.deepPartial(schema);
expectTypeOf(partial).toExtend<z.ZodMiniObject>();
expect(partial.parse({})).toEqual({});
expect(partial.parse({ profile: {} })).toEqual({ profile: {} });
expect(partial.parse({ name: "x", profile: { bio: "b" } })).toEqual({
name: "x",
profile: { bio: "b" },
});
});
test("preserves ZodMiniObject structural type (shape accessible)", () => {
const schema = z.object({ a: z.string(), nested: z.object({ b: z.number() }) });
const partial = z.deepPartial(schema);
expectTypeOf(partial.shape.a).toExtend<z.ZodMiniOptional<z.ZodMiniString>>();
expectTypeOf(partial.shape.nested).toExtend<z.ZodMiniOptional<z.ZodMiniObject>>();
});
test("tuple elements stay required", () => {
const schema = z.tuple([z.object({ a: z.string() }), z.string()]);
const partial = z.deepPartial(schema);
expect(() => partial.parse([{}])).toThrow();
expect(partial.parse([{}, "x"])).toEqual([{}, "x"]);
});
test("ZodMiniCodec preserved through deepPartial", () => {
const schema = z.codec(z.object({ a: z.string() }), z.object({ a: z.string() }), {
decode: (v) => v,
encode: (v) => v,
});
const partial = z.deepPartial(schema);
expectTypeOf(partial).toExtend<z.ZodMiniCodec>();
});
test("recursive getter-based object is typeable", () => {
const Category = z.object({
name: z.string(),
get subcategories() {
return z.optional(z.array(Category));
},
});
const partial = z.deepPartial(Category);
expectTypeOf(partial).toExtend<z.ZodMiniObject>();
expect(partial.parse({ subcategories: [{}] })).toEqual({ subcategories: [{}] });
});
});
@@ -0,0 +1,162 @@
'use strict';
var l33t = require('../dictionary/variants/matching/l33t.cjs');
var reverse = require('../dictionary/variants/matching/reverse.cjs');
var matching = require('../dictionary/matching.cjs');
var types = require('../../types.cjs');
/*
*-------------------------------------------------------------------------------
* word sequences (oneTwoThree, fourFiveSix) ------------------------------
*-------------------------------------------------------------------------------
*/
class MatchWordSequence extends types.MatcherBaseClass {
constructor(options) {
super(options);
this.dictionary = new matching(this.options, true);
this.dictionaryL33t = new l33t(this.options, true);
this.dictionaryReverse = new reverse(this.options, true);
}
match(matchOptions) {
const {
password
} = matchOptions;
// Get all dictionary matches first
const dictionaryMatches = this.dictionary.match(matchOptions);
const dictionaryL33tMatches = this.dictionaryL33t.match(matchOptions);
const dictionaryReverseMatches = this.dictionaryReverse.match(matchOptions);
const filteredDictionaryMatches = this.filterDictionaryMatches([...dictionaryMatches, ...dictionaryL33tMatches, ...dictionaryReverseMatches]);
// Convert dictionary matches to our internal format
const wordMatches = this.convertToWordMatches(filteredDictionaryMatches);
// Find sequences of consecutive words
return this.findWordSequences(wordMatches, password);
}
filterDictionaryMatches(matches) {
// sort by start index, then by end index
return [...matches].sort((a, b) => {
if (a.i !== b.i) return a.i - b.i;
if (a.j !== b.j) return a.j - b.j;
// prefer forward over reversed
if (a.reversed !== b.reversed) return a.reversed ? 1 : -1;
// prefer non-l33t
if (a.l33t !== b.l33t) return a.l33t ? 1 : -1;
// prefer better rank
return a.rank - b.rank;
})
// Keep only non-overlapping matches, favoring earlier ones
.reduce((acc, match) => {
const last = acc[acc.length - 1];
if (!last || match.i > last.j) {
acc.push(match);
}
return acc;
}, []);
}
convertToWordMatches(dictionaryMatches) {
return dictionaryMatches.map(match => ({
word: match.matchedWord,
i: match.i,
j: match.j,
rank: match.rank,
dictionaryName: match.dictionaryName
}));
}
findWordSequences(wordMatches, password) {
const sequences = [];
if (wordMatches.length === 0) {
return sequences;
}
// Sort matches by start position
const sortedMatches = [...wordMatches].sort((a, b) => a.i - b.i);
// Find all possible sequences
for (let startIdx = 0; startIdx < sortedMatches.length; startIdx += 1) {
const sequencesFromStart = this.findSequencesFromStart(sortedMatches, startIdx, password);
sequences.push(...sequencesFromStart);
}
return sequences;
}
// eslint-disable-next-line max-statements
findSequencesFromStart(sortedMatches, startIdx, password) {
const sequences = [];
const startMatch = sortedMatches[startIdx];
// Start with single word sequence
let currentSequence = [startMatch];
let currentEnd = startMatch.j;
// Try to extend the sequence
for (let nextIdx = startIdx + 1; nextIdx < sortedMatches.length; nextIdx += 1) {
const nextMatch = sortedMatches[nextIdx];
// Only extend if the next word can form a valid sequence
if (this.isValidWordSequence(currentSequence, nextMatch, password)) {
currentSequence.push(nextMatch);
currentEnd = nextMatch.j;
} else if (nextMatch.i > currentEnd) {
// Gap found, save current sequence and start new one
if (currentSequence.length > 1) {
sequences.push(this.createWordSequenceMatch(currentSequence, password));
}
currentSequence = [nextMatch];
currentEnd = nextMatch.j;
}
// If nextMatch.i <= currentEnd, it overlaps, so we skip it
}
// Don't forget the last sequence
if (currentSequence.length > 1) {
sequences.push(this.createWordSequenceMatch(currentSequence, password));
}
return sequences;
}
isValidWordSequence(currentSequence, nextMatch, password) {
// Get the text between the last word and the next word
const lastWord = currentSequence[currentSequence.length - 1];
const textBetween = password.slice(lastWord.j + 1, nextMatch.i);
// Check for common word separators
const separators = ['', ' ', '-', '_', '.', ''];
// For simple concatenation (no separator)
const isSimpleConcat = textBetween === '';
// For snake_case or kebab-case, check for separators
const hasValidSeparator = separators.some(sep => textBetween === sep);
// For camelCase, we need to check if the next word starts with uppercase
// and there's no separator (or just a single character that could be uppercase)
const isCamelCase = textBetween.length === 1 && textBetween === textBetween.toUpperCase() && textBetween !== textBetween.toLowerCase();
return hasValidSeparator || isSimpleConcat || isCamelCase;
}
createWordSequenceMatch(sequence, password) {
const firstMatch = sequence[0];
const lastMatch = sequence[sequence.length - 1];
const words = sequence.map(match => match.word);
// Determine if sequence is ascending (by rank)
const ranks = sequence.map(match => match.rank);
const ascending = ranks.every((rank, i) => i === 0 || rank >= ranks[i - 1]);
// Use the most common dictionary name, or the first one
const dictionaryNames = sequence.map(match => match.dictionaryName);
const dictionaryName = this.getMostCommon(dictionaryNames) || firstMatch.dictionaryName;
return {
pattern: 'wordSequence',
i: firstMatch.i,
j: lastMatch.j,
token: password.slice(firstMatch.i, lastMatch.j + 1),
words,
wordCount: words.length,
dictionaryName,
ascending
};
}
getMostCommon(array) {
if (array.length === 0) return null;
const counts = new Map();
let maxCount = 0;
let mostCommon = null;
array.forEach(item => {
const count = (counts.get(item) || 0) + 1;
counts.set(item, count);
if (count > maxCount) {
maxCount = count;
mostCommon = item;
}
});
return mostCommon;
}
}
module.exports = MatchWordSequence;
//# sourceMappingURL=matching.cjs.map
@@ -0,0 +1,263 @@
/**
* In-memory implementations of TaskStore and TaskMessageQueue.
* WARNING: These APIs are experimental and may change without notice.
*
* @experimental
*/
import { isTerminal } from '../interfaces.js';
import { randomBytes } from 'node:crypto';
/**
* A simple in-memory implementation of TaskStore for demonstration purposes.
*
* This implementation stores all tasks in memory and provides automatic cleanup
* based on the ttl duration specified in the task creation parameters.
*
* A task created with a sessionId belongs to that session: calls that pass a different
* sessionId treat the task as not found, and listTasks with a sessionId returns that
* session's tasks and the tasks created without a sessionId. Calls that pass no sessionId
* are not restricted.
*
* Note: This is not suitable for production use as all data is lost on restart.
* For production, consider implementing TaskStore with a database or distributed cache.
*
* @experimental
*/
export class InMemoryTaskStore {
constructor() {
this.tasks = new Map();
this.cleanupTimers = new Map();
}
/**
* Generates a unique task ID.
* Uses 16 bytes of random data encoded as hex (32 characters).
*/
generateTaskId() {
return randomBytes(16).toString('hex');
}
/**
* Returns the stored task unless it belongs to a different session than the caller's.
*/
lookup(taskId, sessionId) {
const stored = this.tasks.get(taskId);
if (stored && sessionId !== undefined && stored.sessionId !== undefined && stored.sessionId !== sessionId) {
return undefined;
}
return stored;
}
async createTask(taskParams, requestId, request, sessionId) {
// Generate a unique task ID
const taskId = this.generateTaskId();
// Ensure uniqueness
if (this.tasks.has(taskId)) {
throw new Error(`Task with ID ${taskId} already exists`);
}
const actualTtl = taskParams.ttl ?? null;
// Create task with generated ID and timestamps
const createdAt = new Date().toISOString();
const task = {
taskId,
status: 'working',
ttl: actualTtl,
createdAt,
lastUpdatedAt: createdAt,
pollInterval: taskParams.pollInterval ?? 1000
};
this.tasks.set(taskId, {
task,
request,
requestId,
sessionId
});
// Schedule cleanup if ttl is specified
// Cleanup occurs regardless of task status
if (actualTtl) {
const timer = setTimeout(() => {
this.tasks.delete(taskId);
this.cleanupTimers.delete(taskId);
}, actualTtl);
this.cleanupTimers.set(taskId, timer);
}
return task;
}
async getTask(taskId, sessionId) {
const stored = this.lookup(taskId, sessionId);
return stored ? { ...stored.task } : null;
}
async storeTaskResult(taskId, status, result, sessionId) {
const stored = this.lookup(taskId, sessionId);
if (!stored) {
throw new Error(`Task with ID ${taskId} not found`);
}
// Don't allow storing results for tasks already in terminal state
if (isTerminal(stored.task.status)) {
throw new Error(`Cannot store result for task ${taskId} in terminal status '${stored.task.status}'. Task results can only be stored once.`);
}
stored.result = result;
stored.task.status = status;
stored.task.lastUpdatedAt = new Date().toISOString();
// Reset cleanup timer to start from now (if ttl is set)
if (stored.task.ttl) {
const existingTimer = this.cleanupTimers.get(taskId);
if (existingTimer) {
clearTimeout(existingTimer);
}
const timer = setTimeout(() => {
this.tasks.delete(taskId);
this.cleanupTimers.delete(taskId);
}, stored.task.ttl);
this.cleanupTimers.set(taskId, timer);
}
}
async getTaskResult(taskId, sessionId) {
const stored = this.lookup(taskId, sessionId);
if (!stored) {
throw new Error(`Task with ID ${taskId} not found`);
}
if (!stored.result) {
throw new Error(`Task ${taskId} has no result stored`);
}
return stored.result;
}
async updateTaskStatus(taskId, status, statusMessage, sessionId) {
const stored = this.lookup(taskId, sessionId);
if (!stored) {
throw new Error(`Task with ID ${taskId} not found`);
}
// Don't allow transitions from terminal states
if (isTerminal(stored.task.status)) {
throw new Error(`Cannot update task ${taskId} from terminal status '${stored.task.status}' to '${status}'. Terminal states (completed, failed, cancelled) cannot transition to other states.`);
}
stored.task.status = status;
if (statusMessage) {
stored.task.statusMessage = statusMessage;
}
stored.task.lastUpdatedAt = new Date().toISOString();
// If task is in a terminal state and has ttl, start cleanup timer
if (isTerminal(status) && stored.task.ttl) {
const existingTimer = this.cleanupTimers.get(taskId);
if (existingTimer) {
clearTimeout(existingTimer);
}
const timer = setTimeout(() => {
this.tasks.delete(taskId);
this.cleanupTimers.delete(taskId);
}, stored.task.ttl);
this.cleanupTimers.set(taskId, timer);
}
}
async listTasks(cursor, sessionId) {
const PAGE_SIZE = 10;
// Page over the tasks the caller can look up, so listTasks follows the same rule as getTask.
const allTaskIds = Array.from(this.tasks.keys()).filter(taskId => this.lookup(taskId, sessionId));
let startIndex = 0;
if (cursor) {
const cursorIndex = allTaskIds.indexOf(cursor);
if (cursorIndex >= 0) {
startIndex = cursorIndex + 1;
}
else {
// Invalid cursor - throw error
throw new Error(`Invalid cursor: ${cursor}`);
}
}
const pageTaskIds = allTaskIds.slice(startIndex, startIndex + PAGE_SIZE);
const tasks = pageTaskIds.map(taskId => {
const stored = this.tasks.get(taskId);
return { ...stored.task };
});
const nextCursor = startIndex + PAGE_SIZE < allTaskIds.length ? pageTaskIds[pageTaskIds.length - 1] : undefined;
return { tasks, nextCursor };
}
/**
* Cleanup all timers (useful for testing or graceful shutdown)
*/
cleanup() {
for (const timer of this.cleanupTimers.values()) {
clearTimeout(timer);
}
this.cleanupTimers.clear();
this.tasks.clear();
}
/**
* Get all tasks of all sessions (useful for debugging)
*/
getAllTasks() {
return Array.from(this.tasks.values()).map(stored => ({ ...stored.task }));
}
}
/**
* A simple in-memory implementation of TaskMessageQueue for demonstration purposes.
*
* This implementation stores messages in memory, organized by task ID and optional session ID.
* Messages are stored in FIFO queues per task.
*
* Note: This is not suitable for production use in distributed systems.
* For production, consider implementing TaskMessageQueue with Redis or other distributed queues.
*
* @experimental
*/
export class InMemoryTaskMessageQueue {
constructor() {
this.queues = new Map();
}
/**
* Generates a queue key from taskId.
* SessionId is intentionally ignored because taskIds are globally unique
* and the task store decides which session a task is found for.
*/
getQueueKey(taskId, _sessionId) {
return taskId;
}
/**
* Gets or creates a queue for the given task and session.
*/
getQueue(taskId, sessionId) {
const key = this.getQueueKey(taskId, sessionId);
let queue = this.queues.get(key);
if (!queue) {
queue = [];
this.queues.set(key, queue);
}
return queue;
}
/**
* Adds a message to the end of the queue for a specific task.
* Atomically checks queue size and throws if maxSize would be exceeded.
* @param taskId The task identifier
* @param message The message to enqueue
* @param sessionId Optional session ID for binding the operation to a specific session
* @param maxSize Optional maximum queue size - if specified and queue is full, throws an error
* @throws Error if maxSize is specified and would be exceeded
*/
async enqueue(taskId, message, sessionId, maxSize) {
const queue = this.getQueue(taskId, sessionId);
// Atomically check size and enqueue
if (maxSize !== undefined && queue.length >= maxSize) {
throw new Error(`Task message queue overflow: queue size (${queue.length}) exceeds maximum (${maxSize})`);
}
queue.push(message);
}
/**
* Removes and returns the first message from the queue for a specific task.
* @param taskId The task identifier
* @param sessionId Optional session ID for binding the query to a specific session
* @returns The first message, or undefined if the queue is empty
*/
async dequeue(taskId, sessionId) {
const queue = this.getQueue(taskId, sessionId);
return queue.shift();
}
/**
* Removes and returns all messages from the queue for a specific task.
* @param taskId The task identifier
* @param sessionId Optional session ID for binding the query to a specific session
* @returns Array of all messages that were in the queue
*/
async dequeueAll(taskId, sessionId) {
const key = this.getQueueKey(taskId, sessionId);
const queue = this.queues.get(key) ?? [];
this.queues.delete(key);
return queue;
}
}
//# sourceMappingURL=in-memory.js.map
@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function fullJitter(delay) {
var jitteredDelay = Math.random() * delay;
return Math.round(jitteredDelay);
}
exports.fullJitter = fullJitter;
//# sourceMappingURL=full.jitter.js.map
@@ -0,0 +1,142 @@
/**
* @fileoverview Rule to forbid control characters from regular expressions.
* @author Nicholas C. Zakas
*/
"use strict";
const RegExpValidator = require("@eslint-community/regexpp").RegExpValidator;
const collector = new (class {
constructor() {
this._source = "";
this._controlChars = [];
this._validator = new RegExpValidator(this);
}
onPatternEnter() {
/*
* `RegExpValidator` may parse the pattern twice in one `validatePattern`.
* So `this._controlChars` should be cleared here as well.
*
* For example, the `/(?<a>\x1f)/` regex will parse the pattern twice.
* This is based on the content described in Annex B.
* If the regex contains a `GroupName` and the `u` flag is not used, `ParseText` will be called twice.
* See https://tc39.es/ecma262/2023/multipage/additional-ecmascript-features-for-web-browsers.html#sec-parsepattern-annexb
*/
this._controlChars = [];
}
onCharacter(start, end, cp) {
if (
cp >= 0x00 &&
cp <= 0x1f &&
(this._source.codePointAt(start) === cp ||
this._source.slice(start, end).startsWith("\\x") ||
this._source.slice(start, end).startsWith("\\u"))
) {
this._controlChars.push(`\\x${`0${cp.toString(16)}`.slice(-2)}`);
}
}
collectControlChars(regexpStr, flags) {
const uFlag = typeof flags === "string" && flags.includes("u");
const vFlag = typeof flags === "string" && flags.includes("v");
this._controlChars = [];
this._source = regexpStr;
try {
this._validator.validatePattern(regexpStr, void 0, void 0, {
unicode: uFlag,
unicodeSets: vFlag,
}); // Call onCharacter hook
} catch {
// Ignore syntax errors in RegExp.
}
return this._controlChars;
}
})();
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "problem",
docs: {
description: "Disallow control characters in regular expressions",
recommended: true,
url: "https://eslint.org/docs/latest/rules/no-control-regex",
},
schema: [],
messages: {
unexpected:
"Unexpected control character(s) in regular expression: {{controlChars}}.",
},
},
create(context) {
/**
* Get the regex expression
* @param {ASTNode} node `Literal` node to evaluate
* @returns {{ pattern: string, flags: string | null } | null} Regex if found (the given node is either a regex literal
* or a string literal that is the pattern argument of a RegExp constructor call). Otherwise `null`. If flags cannot be determined,
* the `flags` property will be `null`.
* @private
*/
function getRegExp(node) {
if (node.regex) {
return node.regex;
}
if (
typeof node.value === "string" &&
(node.parent.type === "NewExpression" ||
node.parent.type === "CallExpression") &&
node.parent.callee.type === "Identifier" &&
node.parent.callee.name === "RegExp" &&
node.parent.arguments[0] === node
) {
const pattern = node.value;
const flags =
node.parent.arguments.length > 1 &&
node.parent.arguments[1].type === "Literal" &&
typeof node.parent.arguments[1].value === "string"
? node.parent.arguments[1].value
: null;
return { pattern, flags };
}
return null;
}
return {
Literal(node) {
const regExp = getRegExp(node);
if (regExp) {
const { pattern, flags } = regExp;
const controlCharacters = collector.collectControlChars(
pattern,
flags,
);
if (controlCharacters.length > 0) {
context.report({
node,
messageId: "unexpected",
data: {
controlChars: controlCharacters.join(", "),
},
});
}
}
},
};
},
};
@@ -0,0 +1,60 @@
# Crawling
<!--type=misc-->
[RFC 9309](https://datatracker.ietf.org/doc/html/rfc9309) defines crawlers as automated clients.
Some web servers may reject requests that omit the `User-Agent` header or that use common defaults such as `'curl/7.79.1'`.
In **undici**, the default user agent is `'undici'`. Since undici is integrated into Node.js core as the implementation of `fetch()`, requests made via `fetch()` use `'node'` as the default user agent.
It is recommended to specify a **custom `User-Agent` header** when implementing crawlers. Providing a descriptive user agent allows servers to correctly identify the client and reduces the likelihood of requests being denied.
A user agent string should include sufficient detail to identify the crawler and provide contact information. For example:
```text
AcmeCo Crawler - acme.co - contact@acme.co
```
When adding contact details, avoid using personal identifiers such as your own name or a private email address—especially in a professional or employment context. Instead, use a role-based or organizational contact (e.g., crawler-team@company.com) to protect individual privacy while still enabling communication.
If a crawler behaves unexpectedly—for example, due to misconfiguration or implementation errors—server administrators can use the information in the user agent to contact the operator and coordinate an appropriate resolution.
The `User-Agent` header can be set on individual requests or applied globally by configuring a custom dispatcher.
**Example: setting a `User-Agent` per request**
```js
import { fetch } from 'undici'
const headers = {
'User-Agent': 'AcmeCo Crawler - acme.co - contact@acme.co'
}
const res = await fetch('https://example.com', { headers })
```
## Best Practices for Crawlers
When developing a crawler, the following practices are recommended in addition to setting a descriptive `User-Agent` header:
* **Respect `robots.txt`**
Follow the directives defined in the target site’s `robots.txt` file, including disallowed paths and optional crawl-delay settings (see [W3C guidelines](https://www.w3.org/wiki/Write_Web_Crawler)).
* **Rate limiting**
Regulate request frequency to avoid imposing excessive load on servers. Introduce delays between requests or limit the number of concurrent requests. The W3C suggests at least one second between requests.
* **Error handling**
Implement retry logic with exponential backoff for transient failures, and stop requests when persistent errors occur (e.g., HTTP 403 or 429).
* **Monitoring and logging**
Track request volume, response codes, and error rates to detect misbehavior and address issues proactively.
* **Contact information**
Always include valid and current contact details in the `User-Agent` string so that administrators can reach the crawler operator if necessary.
## References and Further Reading
* [RFC 9309: The Robots Exclusion Protocol](https://datatracker.ietf.org/doc/html/rfc9309)
* [W3C Wiki: Write Web Crawler](https://www.w3.org/wiki/Write_Web_Crawler)
* [Ethical Web Crawling (WWW 2010 Conference Paper)](https://archives.iw3c2.org/www2010/proceedings/www/p1101.pdf)
@@ -0,0 +1,24 @@
/**
* Check if the value is an iterable object.
*
* 校验是否是一个可迭代对象
*
* @example
* ```js
* import { isIterable } from 'is-what-type';
*
* isIterable([]); // true
* isIterable('string'); // true
* isIterable(new Map()); // true
* isIterable(new Set()); // true
* isIterable({}); // false
* isIterable(null); // false
* isIterable(undefined); // false
* isIterable(123); // false
* isIterable(function() {}); // false
* ```
*
* @param value - The value to check
* @returns `true` if the value is an iterable object, `false` otherwise
*/
export declare function isIterable<T = any>(value: unknown): value is Iterable<T>;
@@ -0,0 +1,11 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const dependencies_1 = require("./dependencies");
const def = {
keyword: "dependentSchemas",
type: "object",
schemaType: "object",
code: (cxt) => (0, dependencies_1.validateSchemaDeps)(cxt),
};
exports.default = def;
//# sourceMappingURL=dependentSchemas.js.map
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Clipboard = createLucideIcon("Clipboard", [
["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
[
"path",
{
d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",
key: "116196"
}
]
]);
export { Clipboard as default };
//# sourceMappingURL=clipboard.js.map
@@ -0,0 +1,172 @@
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
import re
from typing import FrozenSet, NewType, Tuple, Union, cast
from .tags import Tag, parse_tag
from .version import InvalidVersion, Version
BuildTag = Union[Tuple[()], Tuple[int, str]]
NormalizedName = NewType("NormalizedName", str)
class InvalidName(ValueError):
"""
An invalid distribution name; users should refer to the packaging user guide.
"""
class InvalidWheelFilename(ValueError):
"""
An invalid wheel filename was found, users should refer to PEP 427.
"""
class InvalidSdistFilename(ValueError):
"""
An invalid sdist filename was found, users should refer to the packaging user guide.
"""
# Core metadata spec for `Name`
_validate_regex = re.compile(
r"^([A-Z0-9]|[A-Z0-9][A-Z0-9._-]*[A-Z0-9])$", re.IGNORECASE
)
_canonicalize_regex = re.compile(r"[-_.]+")
_normalized_regex = re.compile(r"^([a-z0-9]|[a-z0-9]([a-z0-9-](?!--))*[a-z0-9])$")
# PEP 427: The build number must start with a digit.
_build_tag_regex = re.compile(r"(\d+)(.*)")
def canonicalize_name(name: str, *, validate: bool = False) -> NormalizedName:
if validate and not _validate_regex.match(name):
raise InvalidName(f"name is invalid: {name!r}")
# This is taken from PEP 503.
value = _canonicalize_regex.sub("-", name).lower()
return cast(NormalizedName, value)
def is_normalized_name(name: str) -> bool:
return _normalized_regex.match(name) is not None
def canonicalize_version(
version: Union[Version, str], *, strip_trailing_zero: bool = True
) -> str:
"""
This is very similar to Version.__str__, but has one subtle difference
with the way it handles the release segment.
"""
if isinstance(version, str):
try:
parsed = Version(version)
except InvalidVersion:
# Legacy versions cannot be normalized
return version
else:
parsed = version
parts = []
# Epoch
if parsed.epoch != 0:
parts.append(f"{parsed.epoch}!")
# Release segment
release_segment = ".".join(str(x) for x in parsed.release)
if strip_trailing_zero:
# NB: This strips trailing '.0's to normalize
release_segment = re.sub(r"(\.0)+$", "", release_segment)
parts.append(release_segment)
# Pre-release
if parsed.pre is not None:
parts.append("".join(str(x) for x in parsed.pre))
# Post-release
if parsed.post is not None:
parts.append(f".post{parsed.post}")
# Development release
if parsed.dev is not None:
parts.append(f".dev{parsed.dev}")
# Local version segment
if parsed.local is not None:
parts.append(f"+{parsed.local}")
return "".join(parts)
def parse_wheel_filename(
filename: str,
) -> Tuple[NormalizedName, Version, BuildTag, FrozenSet[Tag]]:
if not filename.endswith(".whl"):
raise InvalidWheelFilename(
f"Invalid wheel filename (extension must be '.whl'): {filename}"
)
filename = filename[:-4]
dashes = filename.count("-")
if dashes not in (4, 5):
raise InvalidWheelFilename(
f"Invalid wheel filename (wrong number of parts): {filename}"
)
parts = filename.split("-", dashes - 2)
name_part = parts[0]
# See PEP 427 for the rules on escaping the project name.
if "__" in name_part or re.match(r"^[\w\d._]*$", name_part, re.UNICODE) is None:
raise InvalidWheelFilename(f"Invalid project name: {filename}")
name = canonicalize_name(name_part)
try:
version = Version(parts[1])
except InvalidVersion as e:
raise InvalidWheelFilename(
f"Invalid wheel filename (invalid version): {filename}"
) from e
if dashes == 5:
build_part = parts[2]
build_match = _build_tag_regex.match(build_part)
if build_match is None:
raise InvalidWheelFilename(
f"Invalid build number: {build_part} in '{filename}'"
)
build = cast(BuildTag, (int(build_match.group(1)), build_match.group(2)))
else:
build = ()
tags = parse_tag(parts[-1])
return (name, version, build, tags)
def parse_sdist_filename(filename: str) -> Tuple[NormalizedName, Version]:
if filename.endswith(".tar.gz"):
file_stem = filename[: -len(".tar.gz")]
elif filename.endswith(".zip"):
file_stem = filename[: -len(".zip")]
else:
raise InvalidSdistFilename(
f"Invalid sdist filename (extension must be '.tar.gz' or '.zip'):"
f" {filename}"
)
# We are requiring a PEP 440 version, which cannot contain dashes,
# so we split on the last dash.
name_part, sep, version_part = file_stem.rpartition("-")
if not sep:
raise InvalidSdistFilename(f"Invalid sdist filename: {filename}")
name = canonicalize_name(name_part)
try:
version = Version(version_part)
except InvalidVersion as e:
raise InvalidSdistFilename(
f"Invalid sdist filename (invalid version): {filename}"
) from e
return (name, version)
@@ -0,0 +1,15 @@
'use strict';
var repeatMatcher = (options, match) => {
let warning = options.translations.warnings.extendedRepeat;
if (match.baseToken.length === 1) {
warning = options.translations.warnings.simpleRepeat;
}
return {
warning,
suggestions: [options.translations.suggestions.repeated]
};
};
module.exports = repeatMatcher;
//# sourceMappingURL=feedback.cjs.map
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_A","2":"_Z"},B:{"1":"_J"},C:{"1":"_w","2":"_f"},D:{"1":"_ZD","16":"_Y"},E:{"1":"_nB","2":"_k"},F:{"1":"_a","16":"_mB","132":"_6Q"},G:{"1":"_t","2":"_d"},H:{"132":"1D"},I:{"1":"_SB","16":"_m"},J:{"1":"_B"},K:{"1":"H","132":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"1":"_F"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:5,C:":optional CSS pseudo-class",D:true};
@@ -0,0 +1,133 @@
/*! *****************************************************************************
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.
***************************************************************************** */
/// <reference lib="es2015.symbol" />
/// <reference lib="es2015.symbol.wellknown" />
interface SharedArrayBuffer {
/**
* Read-only. The length of the ArrayBuffer (in bytes).
*/
readonly byteLength: number;
/**
* Returns a section of an SharedArrayBuffer.
*/
slice(begin?: number, end?: number): SharedArrayBuffer;
readonly [Symbol.toStringTag]: "SharedArrayBuffer";
}
interface SharedArrayBufferConstructor {
readonly prototype: SharedArrayBuffer;
new (byteLength?: number): SharedArrayBuffer;
readonly [Symbol.species]: SharedArrayBufferConstructor;
}
declare var SharedArrayBuffer: SharedArrayBufferConstructor;
interface ArrayBufferTypes {
SharedArrayBuffer: SharedArrayBuffer;
}
interface Atomics {
/**
* Adds a value to the value at the given position in the array, returning the original value.
* Until this atomic operation completes, any other read or write operation against the array
* will block.
*/
add(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;
/**
* Stores the bitwise AND of a value with the value at the given position in the array,
* returning the original value. Until this atomic operation completes, any other read or
* write operation against the array will block.
*/
and(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;
/**
* Replaces the value at the given position in the array if the original value equals the given
* expected value, returning the original value. Until this atomic operation completes, any
* other read or write operation against the array will block.
*/
compareExchange(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, expectedValue: number, replacementValue: number): number;
/**
* Replaces the value at the given position in the array, returning the original value. Until
* this atomic operation completes, any other read or write operation against the array will
* block.
*/
exchange(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;
/**
* Returns a value indicating whether high-performance algorithms can use atomic operations
* (`true`) or must use locks (`false`) for the given number of bytes-per-element of a typed
* array.
*/
isLockFree(size: number): boolean;
/**
* Returns the value at the given position in the array. Until this atomic operation completes,
* any other read or write operation against the array will block.
*/
load(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number): number;
/**
* Stores the bitwise OR of a value with the value at the given position in the array,
* returning the original value. Until this atomic operation completes, any other read or write
* operation against the array will block.
*/
or(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;
/**
* Stores a value at the given position in the array, returning the new value. Until this
* atomic operation completes, any other read or write operation against the array will block.
*/
store(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;
/**
* Subtracts a value from the value at the given position in the array, returning the original
* value. Until this atomic operation completes, any other read or write operation against the
* array will block.
*/
sub(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;
/**
* If the value at the given position in the array is equal to the provided value, the current
* agent is put to sleep causing execution to suspend until the timeout expires (returning
* `"timed-out"`) or until the agent is awoken (returning `"ok"`); otherwise, returns
* `"not-equal"`.
*/
wait(typedArray: Int32Array<ArrayBufferLike>, index: number, value: number, timeout?: number): "ok" | "not-equal" | "timed-out";
/**
* Wakes up sleeping agents that are waiting on the given index of the array, returning the
* number of agents that were awoken.
* @param typedArray A shared Int32Array<ArrayBufferLike>.
* @param index The position in the typedArray to wake up on.
* @param count The number of sleeping agents to notify. Defaults to +Infinity.
*/
notify(typedArray: Int32Array<ArrayBufferLike>, index: number, count?: number): number;
/**
* Stores the bitwise XOR of a value with the value at the given position in the array,
* returning the original value. Until this atomic operation completes, any other read or write
* operation against the array will block.
*/
xor(typedArray: Int8Array<ArrayBufferLike> | Uint8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike>, index: number, value: number): number;
readonly [Symbol.toStringTag]: "Atomics";
}
declare var Atomics: Atomics;
@@ -0,0 +1,38 @@
/**
* types.ts 12.6.0
* Copyright (c) 2021-2025 Alain Dumesny - see GridStack root license
*/
/**
* Default values for grid options - used during initialization and when saving out grid configuration.
* These values are applied when options are not explicitly provided.
*/
export const gridDefaults = {
alwaysShowResizeHandle: 'mobile',
animate: true,
auto: true,
cellHeight: 'auto',
cellHeightThrottle: 100,
cellHeightUnit: 'px',
column: 12,
draggable: { handle: '.grid-stack-item-content', appendTo: 'body', scroll: true },
handle: '.grid-stack-item-content',
itemClass: 'grid-stack-item',
margin: 10,
marginUnit: 'px',
maxRow: 0,
minRow: 0,
placeholderClass: 'grid-stack-placeholder',
placeholderText: '',
removableOptions: { accept: 'grid-stack-item', decline: 'grid-stack-non-removable' },
resizable: { handles: 'se' },
rtl: 'auto',
// **** same as not being set ****
// disableDrag: false,
// disableResize: false,
// float: false,
// handleClass: null,
// removable: false,
// staticGrid: false,
//removable
};
//# sourceMappingURL=types.js.map
@@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (c) 2017 [Node.js API collaborators](https://github.com/nodejs/node-addon-api#collaborators)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,563 @@
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
"""
.. testsetup::
from packaging.version import parse, Version
"""
import itertools
import re
from typing import Any, Callable, NamedTuple, Optional, SupportsInt, Tuple, Union
from ._structures import Infinity, InfinityType, NegativeInfinity, NegativeInfinityType
__all__ = ["VERSION_PATTERN", "parse", "Version", "InvalidVersion"]
LocalType = Tuple[Union[int, str], ...]
CmpPrePostDevType = Union[InfinityType, NegativeInfinityType, Tuple[str, int]]
CmpLocalType = Union[
NegativeInfinityType,
Tuple[Union[Tuple[int, str], Tuple[NegativeInfinityType, Union[int, str]]], ...],
]
CmpKey = Tuple[
int,
Tuple[int, ...],
CmpPrePostDevType,
CmpPrePostDevType,
CmpPrePostDevType,
CmpLocalType,
]
VersionComparisonMethod = Callable[[CmpKey, CmpKey], bool]
class _Version(NamedTuple):
epoch: int
release: Tuple[int, ...]
dev: Optional[Tuple[str, int]]
pre: Optional[Tuple[str, int]]
post: Optional[Tuple[str, int]]
local: Optional[LocalType]
def parse(version: str) -> "Version":
"""Parse the given version string.
>>> parse('1.0.dev1')
<Version('1.0.dev1')>
:param version: The version string to parse.
:raises InvalidVersion: When the version string is not a valid version.
"""
return Version(version)
class InvalidVersion(ValueError):
"""Raised when a version string is not a valid version.
>>> Version("invalid")
Traceback (most recent call last):
...
packaging.version.InvalidVersion: Invalid version: 'invalid'
"""
class _BaseVersion:
_key: Tuple[Any, ...]
def __hash__(self) -> int:
return hash(self._key)
# Please keep the duplicated `isinstance` check
# in the six comparisons hereunder
# unless you find a way to avoid adding overhead function calls.
def __lt__(self, other: "_BaseVersion") -> bool:
if not isinstance(other, _BaseVersion):
return NotImplemented
return self._key < other._key
def __le__(self, other: "_BaseVersion") -> bool:
if not isinstance(other, _BaseVersion):
return NotImplemented
return self._key <= other._key
def __eq__(self, other: object) -> bool:
if not isinstance(other, _BaseVersion):
return NotImplemented
return self._key == other._key
def __ge__(self, other: "_BaseVersion") -> bool:
if not isinstance(other, _BaseVersion):
return NotImplemented
return self._key >= other._key
def __gt__(self, other: "_BaseVersion") -> bool:
if not isinstance(other, _BaseVersion):
return NotImplemented
return self._key > other._key
def __ne__(self, other: object) -> bool:
if not isinstance(other, _BaseVersion):
return NotImplemented
return self._key != other._key
# Deliberately not anchored to the start and end of the string, to make it
# easier for 3rd party code to reuse
_VERSION_PATTERN = r"""
v?
(?:
(?:(?P<epoch>[0-9]+)!)? # epoch
(?P<release>[0-9]+(?:\.[0-9]+)*) # release segment
(?P<pre> # pre-release
[-_\.]?
(?P<pre_l>alpha|a|beta|b|preview|pre|c|rc)
[-_\.]?
(?P<pre_n>[0-9]+)?
)?
(?P<post> # post release
(?:-(?P<post_n1>[0-9]+))
|
(?:
[-_\.]?
(?P<post_l>post|rev|r)
[-_\.]?
(?P<post_n2>[0-9]+)?
)
)?
(?P<dev> # dev release
[-_\.]?
(?P<dev_l>dev)
[-_\.]?
(?P<dev_n>[0-9]+)?
)?
)
(?:\+(?P<local>[a-z0-9]+(?:[-_\.][a-z0-9]+)*))? # local version
"""
VERSION_PATTERN = _VERSION_PATTERN
"""
A string containing the regular expression used to match a valid version.
The pattern is not anchored at either end, and is intended for embedding in larger
expressions (for example, matching a version number as part of a file name). The
regular expression should be compiled with the ``re.VERBOSE`` and ``re.IGNORECASE``
flags set.
:meta hide-value:
"""
class Version(_BaseVersion):
"""This class abstracts handling of a project's versions.
A :class:`Version` instance is comparison aware and can be compared and
sorted using the standard Python interfaces.
>>> v1 = Version("1.0a5")
>>> v2 = Version("1.0")
>>> v1
<Version('1.0a5')>
>>> v2
<Version('1.0')>
>>> v1 < v2
True
>>> v1 == v2
False
>>> v1 > v2
False
>>> v1 >= v2
False
>>> v1 <= v2
True
"""
_regex = re.compile(r"^\s*" + VERSION_PATTERN + r"\s*$", re.VERBOSE | re.IGNORECASE)
_key: CmpKey
def __init__(self, version: str) -> None:
"""Initialize a Version object.
:param version:
The string representation of a version which will be parsed and normalized
before use.
:raises InvalidVersion:
If the ``version`` does not conform to PEP 440 in any way then this
exception will be raised.
"""
# Validate the version and parse it into pieces
match = self._regex.search(version)
if not match:
raise InvalidVersion(f"Invalid version: '{version}'")
# Store the parsed out pieces of the version
self._version = _Version(
epoch=int(match.group("epoch")) if match.group("epoch") else 0,
release=tuple(int(i) for i in match.group("release").split(".")),
pre=_parse_letter_version(match.group("pre_l"), match.group("pre_n")),
post=_parse_letter_version(
match.group("post_l"), match.group("post_n1") or match.group("post_n2")
),
dev=_parse_letter_version(match.group("dev_l"), match.group("dev_n")),
local=_parse_local_version(match.group("local")),
)
# Generate a key which will be used for sorting
self._key = _cmpkey(
self._version.epoch,
self._version.release,
self._version.pre,
self._version.post,
self._version.dev,
self._version.local,
)
def __repr__(self) -> str:
"""A representation of the Version that shows all internal state.
>>> Version('1.0.0')
<Version('1.0.0')>
"""
return f"<Version('{self}')>"
def __str__(self) -> str:
"""A string representation of the version that can be rounded-tripped.
>>> str(Version("1.0a5"))
'1.0a5'
"""
parts = []
# Epoch
if self.epoch != 0:
parts.append(f"{self.epoch}!")
# Release segment
parts.append(".".join(str(x) for x in self.release))
# Pre-release
if self.pre is not None:
parts.append("".join(str(x) for x in self.pre))
# Post-release
if self.post is not None:
parts.append(f".post{self.post}")
# Development release
if self.dev is not None:
parts.append(f".dev{self.dev}")
# Local version segment
if self.local is not None:
parts.append(f"+{self.local}")
return "".join(parts)
@property
def epoch(self) -> int:
"""The epoch of the version.
>>> Version("2.0.0").epoch
0
>>> Version("1!2.0.0").epoch
1
"""
return self._version.epoch
@property
def release(self) -> Tuple[int, ...]:
"""The components of the "release" segment of the version.
>>> Version("1.2.3").release
(1, 2, 3)
>>> Version("2.0.0").release
(2, 0, 0)
>>> Version("1!2.0.0.post0").release
(2, 0, 0)
Includes trailing zeroes but not the epoch or any pre-release / development /
post-release suffixes.
"""
return self._version.release
@property
def pre(self) -> Optional[Tuple[str, int]]:
"""The pre-release segment of the version.
>>> print(Version("1.2.3").pre)
None
>>> Version("1.2.3a1").pre
('a', 1)
>>> Version("1.2.3b1").pre
('b', 1)
>>> Version("1.2.3rc1").pre
('rc', 1)
"""
return self._version.pre
@property
def post(self) -> Optional[int]:
"""The post-release number of the version.
>>> print(Version("1.2.3").post)
None
>>> Version("1.2.3.post1").post
1
"""
return self._version.post[1] if self._version.post else None
@property
def dev(self) -> Optional[int]:
"""The development number of the version.
>>> print(Version("1.2.3").dev)
None
>>> Version("1.2.3.dev1").dev
1
"""
return self._version.dev[1] if self._version.dev else None
@property
def local(self) -> Optional[str]:
"""The local version segment of the version.
>>> print(Version("1.2.3").local)
None
>>> Version("1.2.3+abc").local
'abc'
"""
if self._version.local:
return ".".join(str(x) for x in self._version.local)
else:
return None
@property
def public(self) -> str:
"""The public portion of the version.
>>> Version("1.2.3").public
'1.2.3'
>>> Version("1.2.3+abc").public
'1.2.3'
>>> Version("1.2.3+abc.dev1").public
'1.2.3'
"""
return str(self).split("+", 1)[0]
@property
def base_version(self) -> str:
"""The "base version" of the version.
>>> Version("1.2.3").base_version
'1.2.3'
>>> Version("1.2.3+abc").base_version
'1.2.3'
>>> Version("1!1.2.3+abc.dev1").base_version
'1!1.2.3'
The "base version" is the public version of the project without any pre or post
release markers.
"""
parts = []
# Epoch
if self.epoch != 0:
parts.append(f"{self.epoch}!")
# Release segment
parts.append(".".join(str(x) for x in self.release))
return "".join(parts)
@property
def is_prerelease(self) -> bool:
"""Whether this version is a pre-release.
>>> Version("1.2.3").is_prerelease
False
>>> Version("1.2.3a1").is_prerelease
True
>>> Version("1.2.3b1").is_prerelease
True
>>> Version("1.2.3rc1").is_prerelease
True
>>> Version("1.2.3dev1").is_prerelease
True
"""
return self.dev is not None or self.pre is not None
@property
def is_postrelease(self) -> bool:
"""Whether this version is a post-release.
>>> Version("1.2.3").is_postrelease
False
>>> Version("1.2.3.post1").is_postrelease
True
"""
return self.post is not None
@property
def is_devrelease(self) -> bool:
"""Whether this version is a development release.
>>> Version("1.2.3").is_devrelease
False
>>> Version("1.2.3.dev1").is_devrelease
True
"""
return self.dev is not None
@property
def major(self) -> int:
"""The first item of :attr:`release` or ``0`` if unavailable.
>>> Version("1.2.3").major
1
"""
return self.release[0] if len(self.release) >= 1 else 0
@property
def minor(self) -> int:
"""The second item of :attr:`release` or ``0`` if unavailable.
>>> Version("1.2.3").minor
2
>>> Version("1").minor
0
"""
return self.release[1] if len(self.release) >= 2 else 0
@property
def micro(self) -> int:
"""The third item of :attr:`release` or ``0`` if unavailable.
>>> Version("1.2.3").micro
3
>>> Version("1").micro
0
"""
return self.release[2] if len(self.release) >= 3 else 0
def _parse_letter_version(
letter: Optional[str], number: Union[str, bytes, SupportsInt, None]
) -> Optional[Tuple[str, int]]:
if letter:
# We consider there to be an implicit 0 in a pre-release if there is
# not a numeral associated with it.
if number is None:
number = 0
# We normalize any letters to their lower case form
letter = letter.lower()
# We consider some words to be alternate spellings of other words and
# in those cases we want to normalize the spellings to our preferred
# spelling.
if letter == "alpha":
letter = "a"
elif letter == "beta":
letter = "b"
elif letter in ["c", "pre", "preview"]:
letter = "rc"
elif letter in ["rev", "r"]:
letter = "post"
return letter, int(number)
if not letter and number:
# We assume if we are given a number, but we are not given a letter
# then this is using the implicit post release syntax (e.g. 1.0-1)
letter = "post"
return letter, int(number)
return None
_local_version_separators = re.compile(r"[\._-]")
def _parse_local_version(local: Optional[str]) -> Optional[LocalType]:
"""
Takes a string like abc.1.twelve and turns it into ("abc", 1, "twelve").
"""
if local is not None:
return tuple(
part.lower() if not part.isdigit() else int(part)
for part in _local_version_separators.split(local)
)
return None
def _cmpkey(
epoch: int,
release: Tuple[int, ...],
pre: Optional[Tuple[str, int]],
post: Optional[Tuple[str, int]],
dev: Optional[Tuple[str, int]],
local: Optional[LocalType],
) -> CmpKey:
# When we compare a release version, we want to compare it with all of the
# trailing zeros removed. So we'll use a reverse the list, drop all the now
# leading zeros until we come to something non zero, then take the rest
# re-reverse it back into the correct order and make it a tuple and use
# that for our sorting key.
_release = tuple(
reversed(list(itertools.dropwhile(lambda x: x == 0, reversed(release))))
)
# We need to "trick" the sorting algorithm to put 1.0.dev0 before 1.0a0.
# We'll do this by abusing the pre segment, but we _only_ want to do this
# if there is not a pre or a post segment. If we have one of those then
# the normal sorting rules will handle this case correctly.
if pre is None and post is None and dev is not None:
_pre: CmpPrePostDevType = NegativeInfinity
# Versions without a pre-release (except as noted above) should sort after
# those with one.
elif pre is None:
_pre = Infinity
else:
_pre = pre
# Versions without a post segment should sort before those with one.
if post is None:
_post: CmpPrePostDevType = NegativeInfinity
else:
_post = post
# Versions without a development segment should sort after those with one.
if dev is None:
_dev: CmpPrePostDevType = Infinity
else:
_dev = dev
if local is None:
# Versions without a local segment should sort before those with one.
_local: CmpLocalType = NegativeInfinity
else:
# Versions with a local segment need that segment parsed to implement
# the sorting rules in PEP440.
# - Alpha numeric segments sort before numeric segments
# - Alpha numeric segments sort lexicographically
# - Numeric segments sort numerically
# - Shorter versions sort before longer versions when the prefixes
# match exactly
_local = tuple(
(i, "") if isinstance(i, int) else (NegativeInfinity, i) for i in local
)
return epoch, _release, _pre, _post, _dev, _local
@@ -0,0 +1 @@
{"version":3,"file":"arrow-down-from-line.js","sources":["../../../src/icons/arrow-down-from-line.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowDownFromLine\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTkgM0g1IiAvPgogIDxwYXRoIGQ9Ik0xMiAyMVY3IiAvPgogIDxwYXRoIGQ9Im02IDE1IDYgNiA2LTYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/arrow-down-from-line\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 ArrowDownFromLine = createLucideIcon('ArrowDownFromLine', [\n ['path', { d: 'M19 3H5', key: '1236rx' }],\n ['path', { d: 'M12 21V7', key: 'gj6g52' }],\n ['path', { d: 'm6 15 6 6 6-6', key: 'h15q88' }],\n]);\n\nexport default ArrowDownFromLine;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB,iBAAiB,mBAAqB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,36 @@
export type Procedure = (...args: any[]) => void
/**
* @link https://davidwalsh.name/javascript-debounce-function
* @param func needs to implement a function which is debounced
* @param wait how long do you want to wait till the previous declared function is executed
* @param isImmediate defines if you want to execute the function on the first execution or the last execution inside the time window. `true` for first and `false` for last.
*/
export default <F extends Procedure>(
func: F,
wait: number,
isImmediate?: boolean,
): ((this: ThisParameterType<F>, ...args: Parameters<F>) => void) => {
let timeout: ReturnType<typeof setTimeout> | undefined
return function debounce(this: ThisParameterType<F>, ...args: Parameters<F>) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const context = this
const later = () => {
timeout = undefined
if (!isImmediate) {
func.apply(context, args)
}
}
const shouldCallNow = isImmediate && !timeout
if (timeout !== undefined) {
clearTimeout(timeout)
}
timeout = setTimeout(later, wait)
if (shouldCallNow) {
func.apply(context, args)
return
}
return undefined
}
}
@@ -0,0 +1,20 @@
/**
* Experimental task features for MCP SDK.
* WARNING: These APIs are experimental and may change without notice.
*
* @experimental
*/
// Re-export spec types for convenience
export * from './types.js';
// SDK implementation interfaces
export * from './interfaces.js';
// Assertion helpers
export * from './helpers.js';
// Wrapper classes
export * from './client.js';
export * from './server.js';
export * from './mcp-server.js';
// Store implementations
export * from './stores/in-memory.js';
export { takeResult, toArrayAsync } from '../../shared/responseMessage.js';
//# sourceMappingURL=index.js.map
@@ -0,0 +1,22 @@
import { ConsolaInstance, ConsolaOptions } from './core.mjs';
export { ConfirmPromptOptions, Consola, ConsolaReporter, FormatOptions, InputLogObject, LogLevel, LogLevels, LogObject, LogType, LogTypes, MultiSelectOptions, PromptOptions, SelectPromptOptions, TextPromptOptions } from './core.mjs';
/**
* Factory function to create a new Consola instance tailored for use in different environments.
* It automatically adjusts logging levels based on environment variables and execution context.
*
* @param {Partial<ConsolaOptions & { fancy: boolean }>} [options={}] - Optional configuration options. See {@link ConsolaOptions}.
* @returns {ConsolaInstance} A new Consola instance with configurations based on the given options and the execution environment.
*/
declare function createConsola(options?: Partial<ConsolaOptions & {
fancy: boolean;
}>): ConsolaInstance;
/**
* A default instance of Consola, created and configured for immediate use.
* This instance is configured based on the execution environment and the options provided.
*
* @type {ConsolaInstance} consola - The default Consola instance, ready to use.
*/
declare const consola: ConsolaInstance;
export { ConsolaInstance, ConsolaOptions, consola, createConsola, consola as default };
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2020_full: LibDefinition;
@@ -0,0 +1,204 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
function helpers() {
const data = require("@babel/helpers");
helpers = function () {
return data;
};
return data;
}
function _traverse() {
const data = require("@babel/traverse");
_traverse = function () {
return data;
};
return data;
}
function _codeFrame() {
const data = require("@babel/code-frame");
_codeFrame = function () {
return data;
};
return data;
}
function _t() {
const data = require("@babel/types");
_t = function () {
return data;
};
return data;
}
function _semver() {
const data = require("semver");
_semver = function () {
return data;
};
return data;
}
var _babel7Helpers = require("./babel-7-helpers.cjs");
const {
cloneNode,
interpreterDirective,
traverseFast
} = _t();
class File {
constructor(options, {
code,
ast,
inputMap
}) {
this._map = new Map();
this.opts = void 0;
this.declarations = {};
this.path = void 0;
this.ast = void 0;
this.scope = void 0;
this.metadata = {};
this.code = "";
this.inputMap = void 0;
this.hub = {
file: this,
getCode: () => this.code,
getScope: () => this.scope,
addHelper: this.addHelper.bind(this),
buildError: this.buildCodeFrameError.bind(this)
};
this.opts = options;
this.code = code;
this.ast = ast;
this.inputMap = inputMap;
this.path = _traverse().NodePath.get({
hub: this.hub,
parentPath: null,
parent: this.ast,
container: this.ast,
key: "program"
}).setContext();
this.scope = this.path.scope;
}
get shebang() {
const {
interpreter
} = this.path.node;
return interpreter ? interpreter.value : "";
}
set shebang(value) {
if (value) {
this.path.get("interpreter").replaceWith(interpreterDirective(value));
} else {
this.path.get("interpreter").remove();
}
}
set(key, val) {
if (key === "helpersNamespace") {
throw new Error("Babel 7.0.0-beta.56 has dropped support for the 'helpersNamespace' utility." + "If you are using @babel/plugin-external-helpers you will need to use a newer " + "version than the one you currently have installed. " + "If you have your own implementation, you'll want to explore using 'helperGenerator' " + "alongside 'file.availableHelper()'.");
}
this._map.set(key, val);
}
get(key) {
return this._map.get(key);
}
has(key) {
return this._map.has(key);
}
availableHelper(name, versionRange) {
if (helpers().isInternal(name)) return false;
let minVersion;
try {
minVersion = helpers().minVersion(name);
} catch (err) {
if (err.code !== "BABEL_HELPER_UNKNOWN") throw err;
return false;
}
if (typeof versionRange !== "string") return true;
if (_semver().valid(versionRange)) versionRange = `^${versionRange}`;
return !_semver().intersects(`<${minVersion}`, versionRange) && !_semver().intersects(`>=8.0.0`, versionRange);
}
addHelper(name) {
if (helpers().isInternal(name)) {
throw new Error("Cannot use internal helper " + name);
}
return this._addHelper(name);
}
_addHelper(name) {
const declar = this.declarations[name];
if (declar) return cloneNode(declar);
const generator = this.get("helperGenerator");
if (generator) {
const res = generator(name);
if (res) return res;
}
helpers().minVersion(name);
const uid = this.declarations[name] = this.scope.generateUidIdentifier(name);
const dependencies = {};
for (const dep of helpers().getDependencies(name)) {
dependencies[dep] = this._addHelper(dep);
}
const {
nodes,
globals
} = helpers().get(name, dep => dependencies[dep], uid.name, Object.keys(this.scope.getAllBindings()));
globals.forEach(name => {
if (this.path.scope.hasBinding(name, true)) {
this.path.scope.rename(name);
}
});
nodes.forEach(node => {
node._compact = true;
});
const added = this.path.unshiftContainer("body", nodes);
for (const path of added) {
if (path.isVariableDeclaration()) this.scope.registerDeclaration(path);
}
return uid;
}
buildCodeFrameError(node, msg, _Error = SyntaxError) {
let loc = node == null ? void 0 : node.loc;
if (!loc && node) {
traverseFast(node, function (node) {
if (node.loc) {
loc = node.loc;
return traverseFast.stop;
}
});
let txt = "This is an error on an internal node. Probably an internal error.";
if (loc) txt += " Location has been estimated.";
msg += ` (${txt})`;
}
if (loc) {
const {
highlightCode = true
} = this.opts;
msg += "\n" + (0, _codeFrame().codeFrameColumns)(this.code, {
start: {
line: loc.start.line,
column: loc.start.column + 1
},
end: loc.end && loc.start.line === loc.end.line ? {
line: loc.end.line,
column: loc.end.column + 1
} : undefined
}, {
highlightCode
});
}
return new _Error(msg);
}
}
exports.default = File;
File.prototype.addImport = function addImport() {
throw new Error("This API has been removed. If you're looking for this " + "functionality in Babel 7, you should import the " + "'@babel/helper-module-imports' module and use the functions exposed " + " from that module, such as 'addNamed' or 'addDefault'.");
};
File.prototype.addTemplateObject = function addTemplateObject() {
throw new Error("This function has been moved into the template literal transform itself.");
};
File.prototype.getModuleName = function getModuleName() {
return _babel7Helpers.getModuleName()(this.opts, this.opts);
};
0 && 0;
//# sourceMappingURL=file.js.map
@@ -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 Plane = createLucideIcon("Plane", [
[
"path",
{
d: "M17.8 19.2 16 11l3.5-3.5C21 6 21.5 4 21 3c-1-.5-3 0-4.5 1.5L13 8 4.8 6.2c-.5-.1-.9.1-1.1.5l-.3.5c-.2.5-.1 1 .3 1.3L9 12l-2 3H4l-1 1 3 2 2 3 1-1v-3l3-2 3.5 5.3c.3.4.8.5 1.3.3l.5-.2c.4-.3.6-.7.5-1.2z",
key: "1v9wt8"
}
]
]);
export { Plane as default };
//# sourceMappingURL=plane.js.map
@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _taggedTemplateLiteralLoose;
function _taggedTemplateLiteralLoose(strings, raw) {
if (!raw) {
raw = strings.slice(0);
}
strings.raw = raw;
return strings;
}
//# sourceMappingURL=taggedTemplateLiteralLoose.js.map
@@ -0,0 +1,382 @@
---
name: router-core/path-params
description: >-
Dynamic path segments ($paramName), splat routes ($ / _splat),
optional params ({-$paramName}), prefix/suffix patterns ({$param}.ext),
useParams, params.parse/stringify, pathParamsAllowedCharacters,
i18n locale patterns.
type: sub-skill
library: tanstack-router
library_version: '1.166.2'
requires:
- router-core
sources:
- TanStack/router:docs/router/guide/path-params.md
- TanStack/router:docs/router/routing/routing-concepts.md
- TanStack/router:docs/router/guide/internationalization-i18n.md
---
# Path Params
Path params capture dynamic URL segments into named variables. They are defined with a `$` prefix in the route path.
> **CRITICAL**: Never interpolate params into the `to` string. Always use the `params` prop. This is the most common agent mistake for path params.
> **CRITICAL**: Types are fully inferred. Never annotate the return of `useParams()`.
## Dynamic Segments
A segment prefixed with `$` captures text until the next `/`.
```tsx
// src/routes/posts.$postId.tsx
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/posts/$postId')({
loader: async ({ params }) => {
// params.postId is string — fully inferred, do not annotate
return fetchPost(params.postId)
},
component: PostComponent,
})
function PostComponent() {
const { postId } = Route.useParams()
const data = Route.useLoaderData()
return (
<h1>
Post {postId}: {data.title}
</h1>
)
}
```
Multiple dynamic segments work across path levels:
```tsx
// src/routes/teams.$teamId.members.$memberId.tsx
export const Route = createFileRoute('/teams/$teamId/members/$memberId')({
component: MemberComponent,
})
function MemberComponent() {
const { teamId, memberId } = Route.useParams()
return (
<div>
Team {teamId}, Member {memberId}
</div>
)
}
```
## Splat / Catch-All Routes
A route with a path ending in `$` (bare dollar sign) captures everything after it. The value is available under the `_splat` key.
```tsx
// src/routes/files.$.tsx
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/files/$')({
component: FileViewer,
})
function FileViewer() {
const { _splat } = Route.useParams()
// URL: /files/documents/report.pdf → _splat = "documents/report.pdf"
return <div>File path: {_splat}</div>
}
```
## Optional Params
Optional params use `{-$paramName}` syntax. The segment may or may not be present. When absent, the value is `undefined`.
```tsx
// src/routes/posts.{-$category}.tsx
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/posts/{-$category}')({
component: PostsComponent,
})
function PostsComponent() {
const { category } = Route.useParams()
// URL: /posts → category is undefined
// URL: /posts/tech → category is "tech"
return <div>{category ? `Posts in ${category}` : 'All Posts'}</div>
}
```
Multiple optional params:
```tsx
// Matches: /posts, /posts/tech, /posts/tech/hello-world
export const Route = createFileRoute('/posts/{-$category}/{-$slug}')({
component: PostComponent,
})
```
### i18n with Optional Locale
```tsx
// src/routes/{-$locale}/about.tsx
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/{-$locale}/about')({
component: AboutComponent,
})
function AboutComponent() {
const { locale } = Route.useParams()
const currentLocale = locale || 'en'
return <h1>{currentLocale === 'fr' ? 'À Propos' : 'About Us'}</h1>
}
// Matches: /about, /en/about, /fr/about
```
## Prefix and Suffix Patterns
Curly braces `{}` around `$paramName` allow text before or after the dynamic part within a single segment.
### Prefix
```tsx
// src/routes/posts/post-{$postId}.tsx
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/posts/post-{$postId}')({
component: PostComponent,
})
function PostComponent() {
const { postId } = Route.useParams()
// URL: /posts/post-123 → postId = "123"
return <div>Post ID: {postId}</div>
}
```
### Suffix
```tsx
// src/routes/files/{$fileName}[.]txt.tsx
import { createFileRoute } from '@tanstack/react-router'
export const Route = createFileRoute('/files/{$fileName}.txt')({
component: FileComponent,
})
function FileComponent() {
const { fileName } = Route.useParams()
// URL: /files/readme.txt → fileName = "readme"
return <div>File: {fileName}.txt</div>
}
```
### Combined Prefix + Suffix
```tsx
// URL: /users/user-456.json → userId = "456"
export const Route = createFileRoute('/users/user-{$userId}.json')({
component: UserComponent,
})
function UserComponent() {
const { userId } = Route.useParams()
return <div>User: {userId}</div>
}
```
## Navigating with Path Params
### Object Form
```tsx
import { Link } from '@tanstack/react-router'
function PostLink({ postId }: { postId: string }) {
return (
<Link to="/posts/$postId" params={{ postId }}>
View Post
</Link>
)
}
```
### Function Form (Preserves Other Params)
```tsx
function PostLink({ postId }: { postId: string }) {
return (
<Link to="/posts/$postId" params={(prev) => ({ ...prev, postId })}>
View Post
</Link>
)
}
```
### Programmatic Navigation
```tsx
import { useNavigate } from '@tanstack/react-router'
function GoToPost({ postId }: { postId: string }) {
const navigate = useNavigate()
return (
<button
onClick={() => {
navigate({ to: '/posts/$postId', params: { postId } })
}}
>
Go to Post
</button>
)
}
```
### Navigating with Optional Params
```tsx
// Include the optional param
<Link to="/posts/{-$category}" params={{ category: 'tech' }}>
Tech Posts
</Link>
// Omit the optional param (renders /posts)
<Link to="/posts/{-$category}" params={{ category: undefined }}>
All Posts
</Link>
```
## Reading Params Outside Route Components
### `useParams` with `from`
```tsx
import { useParams } from '@tanstack/react-router'
function PostHeader() {
const { postId } = useParams({ from: '/posts/$postId' })
return <h2>Post {postId}</h2>
}
```
### `useParams` with `strict: false`
```tsx
function GenericBreadcrumb() {
const params = useParams({ strict: false })
// params is a union of all possible route params
return <span>{params.postId ?? 'Home'}</span>
}
```
## Params in Loaders and `beforeLoad`
```tsx
export const Route = createFileRoute('/posts/$postId')({
beforeLoad: async ({ params }) => {
// params.postId available here
const canView = await checkPermission(params.postId)
if (!canView) throw redirect({ to: '/unauthorized' })
},
loader: async ({ params }) => {
return fetchPost(params.postId)
},
})
```
## Allowed Characters
By default, params are encoded with `encodeURIComponent`. Allow extra characters via router config:
```tsx
import { createRouter } from '@tanstack/react-router'
const router = createRouter({
routeTree,
pathParamsAllowedCharacters: ['@', '+'],
})
```
Allowed characters: `;`, `:`, `@`, `&`, `=`, `+`, `$`, `,`.
## Common Mistakes
### 1. CRITICAL (cross-skill): Interpolating path params into `to` string
```tsx
// WRONG — breaks type safety and param encoding
<Link to={`/posts/${postId}`}>Post</Link>
// CORRECT — use params prop
<Link to="/posts/$postId" params={{ postId }}>Post</Link>
```
### 2. MEDIUM: Using `*` for splat routes instead of `$`
TanStack Router uses `$` for splat routes. The captured value is under `_splat`, not `*`.
```tsx
// WRONG (React Router / other frameworks)
// <Route path="/files/*" />
// CORRECT (TanStack Router)
// File: src/routes/files.$.tsx
export const Route = createFileRoute('/files/$')({
component: () => {
const { _splat } = Route.useParams()
return <div>{_splat}</div>
},
})
```
> Note: `*` works in v1 for backwards compatibility but will be removed in v2. Always use `_splat`.
### 3. MEDIUM: Using curly braces for basic dynamic segments
Curly braces are ONLY for prefix/suffix patterns and optional params. Basic dynamic segments use bare `$`.
```tsx
// WRONG — braces not needed for basic params
createFileRoute('/posts/{$postId}')
// CORRECT — bare $ for basic dynamic segments
createFileRoute('/posts/$postId')
// CORRECT — braces for prefix pattern
createFileRoute('/posts/post-{$postId}')
// CORRECT — braces for optional param
createFileRoute('/posts/{-$category}')
```
### 4. Params are always strings
Path params are always parsed as strings. If you need a number, parse in the loader or component:
```tsx
export const Route = createFileRoute('/posts/$postId')({
loader: async ({ params }) => {
const id = parseInt(params.postId, 10)
if (isNaN(id)) throw notFound()
return fetchPost(id)
},
})
```
You can also use `params.parse` and `params.stringify` on the route for bidirectional transformation:
```tsx
export const Route = createFileRoute('/posts/$postId')({
params: {
parse: (raw) => ({ postId: parseInt(raw.postId, 10) }),
stringify: (parsed) => ({ postId: String(parsed.postId) }),
},
loader: async ({ params }) => {
// params.postId is now number
return fetchPost(params.postId)
},
})
```
@@ -0,0 +1,2 @@
import { t as figlet } from "./figlet-DPpovuyG.js";
export { figlet as default };
@@ -0,0 +1,824 @@
flf2a$ 8 7 20 -1 7
COINSTAK by Ron Fritz 8/94
Figlet Release 2/0
---
Font modified June 17, 2007 by patorjk
This was to widen the space character.
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@
$ $@@
O))@
O))@
O))@
O) @
O) @
@
O))@
@@
O) O)@
O) O)@
@
@
@
@
@
@@
@
O)) O)) @
O)))))) O))))@
O)) O)) @
O)) O)) @
O)))))) O))))@
O)) O)) @
@@
O)) @
O) O))@
O)) @
O)) @
O)) @
O)) O))@
O)) @
@@
@
O)) O)) @
O)) @
O)) @
O)) @
O)) @
O)) O)) @
@@
O) @
O)) O))@
O)) @
O))) @
O)) @
O)) O))@
O) @
@@
O))@
O)@
@
@
@
@
@
@@
O))@
O)) @
O)) @
O)) @
O)) @
O)) @
O))@
@@
O)) @
O)) @
O))@
O))@
O))@
O)) @
O)) @
@@
O)) @
O)) O)) O))@
O) O) O)) @
O)))) O)))))))@
O) O) O)) @
O)) O)) O))@
O)) @
@@
@
O)) @
O)) @
O))) O)))))@
O)) @
O)) @
@
@@
@
@
@
@
@
@
O))@
O)@@
@
@
@
O)))))@
@
@
@
@@
@
@
@
@
@
@
O))@
@@
O))@
O)) @
O)) @
O)) @
O)) @
O)) @
O)) @
@@
@
O)) @
O)) O)) @
O)) O)) @
O)) O))@
O)) O)) @
O))) @
@@
@
O)) @
O)) @
O)) @
O)) @
O)) @
O))))@
@@
@
O) O)) @
O) O))@
O)) @
O)) @
O)) @
O))))))))@
@@
@
O)) O)) @
O)) @
O)) @
O)) @
O))@
O))))) @
@@
@
O)) @
O O)) @
O) O)) @
O)) O)) @
O)))) O) O))@
O)) @
@@
@
O)) O))) @
O)) @
O))) @
O)) @
O))@
O))) O)) @
@@
@
O)) @
O)) @
O)) @
O) O)) @
O)) O))@
O)) O)) @
@@
@
O))))) O))@
O)) @
O)) @
O)) @
O)) @
O)) @
@@
@
O) @
O)) O)) @
O)) O)@
O)) O) @
O)) O)@
O)))) @
@@
@
O) O)) @
O)) O))@
O) O))@
O)) O)) @
O)) @
O)) @
@@
@
@
@
@
O))@
@
O))@
@@
@
@
@
@
O))@
@
O))@
O)@@
O))@
O)) @
O)) @
O)) @
O)) @
O)) @
O))@
@@
@
@
O))))))@
@
O))))))@
@
@
@@
O)) @
O)) @
O)) @
O))@
O)) @
O)) @
O)) @
@@
O))) @
O)) @
O))@
O)) @
O)) @
@
O)) @
@@
@
O))) @
O) O)) @
O) O)) O))@
O)) O))O O))@
O)) ``` @
O)) @
@@
O) @
O) )) @
O) O)) @
O)) O)) @
O)))))) O)) @
O)) O)) @
O)) O))@
@@
O)) O)) @
O) O)) @
O) O))@
O))) O) @
O) O))@
O) O)@
O)))) O)) @
@@
O)) @
O)) O))@
O)) @
O)) @
O)) @
O)) O))@
O)))) @
@@
O))))) @
O)) O)) @
O)) O))@
O)) O))@
O)) O))@
O)) O)) @
O))))) @
@@
O))))))))@
O)) @
O)) @
O)))))) @
O)) @
O)) @
O))))))))@
@@
O))))))))@
O)) @
O)) @
O)))))) @
O)) @
O)) @
O)) @
@@
O)))) @
O) O)) @
O)) @
O)) @
O)) O))))@
O)) O) @
O))))) @
@@
O)) O))@
O)) O))@
O)) O))@
O)))))) O))@
O)) O))@
O)) O))@
O)) O))@
@@
O))@
O))@
O))@
O))@
O))@
O))@
O))@
@@
O))@
O))@
O))@
O))@
O))@
O) O))@
O)))) @
@@
O)) O)) @
O)) O)) @
O)) O)) @
O) O) @
O)) O)) @
O)) O)) @
O)) O))@
@@
O)) @
O)) @
O)) @
O)) @
O)) @
O)) @
O))))))))@
@@
O)) O))@
O) O)) O)))@
O)) O)) O O))@
O)) O)) O))@
O)) O) O))@
O)) O))@
O)) O))@
@@
O))) O))@
O) O)) O))@
O)) O)) O))@
O)) O)) O))@
O)) O) O))@
O)) O) ))@
O)) O))@
@@
O)))) @
O)) O)) @
O)) O))@
O)) O))@
O)) O))@
O)) O)) @
O)))) @
@@
O))))))) @
O)) O))@
O)) O))@
O))))))) @
O)) @
O)) @
O)) @
@@
O)))) @
O)) O)) @
O)) O))@
O)) O))@
O)) O))@
O)) O) O)) @
O)) )) @
O) @@
O))))))) @
O)) O)) @
O)) O)) @
O) O)) @
O)) O)) @
O)) O)) @
O)) O))@
@@
O)) O) @
O)) O))@
O)) @
O)) @
O)) @
O)) O))@
O)) O) @
@@
O))) O))))))@
O)) @
O)) @
O)) @
O)) @
O)) @
O)) @
@@
O)) O))@
O)) O))@
O)) O))@
O)) O))@
O)) O))@
O)) O))@
O))))) @
@@
O)) O))@
O)) O)) @
O)) O)) @
O)) O)) @
O)) O)) @
O)))) @
O)) @
@@
O)) O))@
O)) O))@
O)) O) O))@
O)) O)) O))@
O)) O) O)) O))@
O) O) O))))@
O)) O))@
@@
O)) O))@
O)) O)) @
O)) O)) @
O)) @
O)) O)) @
O)) O)) @
O)) O))@
@@
O)) O))@
O)) O)) @
O)) O)) @
O)) @
O)) @
O)) @
O)) @
@@
O))))))) O))@
O)) @
O)) @
O)) @
O)) @
O)) @
O)))))))))))@
@@
O))))@
O)) @
O)) @
O)) @
O)) @
O)) @
O))))@
@@
O)) @
O)) @
O)) @
O)) @
O)) @
O)) @
O))@
@@
O))))@
O))@
O))@
O))@
O))@
O))@
O))))@
@@
O)) @
O)) O)) @
O)) O))@
@
@
@
@
@@
@
@
@
@
@
@
@
O)))))@@
O))@
O) @
@
@
@
@
@
@@
@
@
O)) @
O)) O)) @
O)) O)) @
O)) O)) @
O)) O)))@
@@
O)) @
O)) @
O)) @
O)) O)) @
O)) O))@
O)) O))@
O)) O)) @
@@
@
@
O)))@
O)) @
O)) @
O)) @
O)))@
@@
O))@
O))@
O))@
O)) O))@
O) O))@
O) O))@
O)) O))@
@@
@
@
O)) @
O) O)) @
O))))) O))@
O) @
O)))) @
@@
O))@
O) @
O)O) O)@
O)) @
O)) @
O)) @
O)) @
@@
@
@
O)) @
O)) O))@
O)) O))@
O)) O))@
O)) @
O)) @@
@
O)) @
O)) @
O) O) @
O)) O))@
O) O))@
O)) O))@
@@
@
O)@
@
O))@
O))@
O))@
O))@
@@
@
O))@
@
O))@
O))@
O))@
O))@
O))) @@
O)) @
O)) @
O)) O))@
O)) O)) @
O)O)) @
O)) O)) @
O)) O))@
@@
O))@
O))@
O))@
O))@
O))@
O))@
O)))@
@@
@
@
O))) O)) O)) @
O)) O) O))@
O)) O) O))@
O)) O) O))@
O))) O) O))@
@@
@
@
O)) O)) @
O)) O))@
O)) O))@
O)) O))@
O))) O))@
@@
@
@
O)) @
O)) O)) @
O)) O))@
O)) O)) @
O)) @
@@
@
@
O) O)) @
O) O)) @
O) O))@
O)) O)) @
O)) @
O)) @@
@
@
O)) @
O) O)) @
O) O)) @
O))O)) @
O)) @
O)))@@
@
@
O) O)))@
O)) @
O)) @
O)) @
O))) @
@@
@
@
O)))) @
O)) @
O))) @
O))@
O)) O))@
@@
O)) @
O)) @
O)O) O)@
O)) @
O)) @
O)) @
O)) @
@@
@
@
O)) O))@
O)) O))@
O)) O))@
O)) O))@
O))O))@
@@
@
@
O)) O))@
O)) O)) @
O)) O)) @
O)O)) @
O)) @
@@
@
@
O)) O)))@
O)) ) O))@
O)) O) O))@
O) O) O)O))@
O))) O)))@
@@
@
@
O)) O))@
O) O)) @
O) @
O) O)) @
O)) O))@
@@
@
@
O)) O))@
O)) O)) @
O))) @
O)) @
O)) @
O)) @@
@
@
O)))) O))@
O)) @
O)) @
O)) @
O))))))))@
@@
O))@
O)) @
O)) @
O)) @
O)) @
O)) @
O))@
@@
O)@
O)@
O)@
@
O)@
O)@
O)@
@@
O)) @
O)) @
O)) @
O))@
O)) @
O)) @
O)) @
@@
O)) O) @
O) O))@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@
@
@
@
@
@
@
@@
@@ -0,0 +1,5 @@
"use strict";
function isValid(date) {
return date.toString() !== "Invalid Date";
}
module.exports = isValid;
@@ -0,0 +1 @@
{"version":3,"file":"octagon.js","sources":["../../../src/icons/octagon.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Octagon\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMi41ODYgMTYuNzI2QTIgMiAwIDAgMSAyIDE1LjMxMlY4LjY4OGEyIDIgMCAwIDEgLjU4Ni0xLjQxNGw0LjY4OC00LjY4OEEyIDIgMCAwIDEgOC42ODggMmg2LjYyNGEyIDIgMCAwIDEgMS40MTQuNTg2bDQuNjg4IDQuNjg4QTIgMiAwIDAgMSAyMiA4LjY4OHY2LjYyNGEyIDIgMCAwIDEtLjU4NiAxLjQxNGwtNC42ODggNC42ODhhMiAyIDAgMCAxLTEuNDE0LjU4Nkg4LjY4OGEyIDIgMCAwIDEtMS40MTQtLjU4NnoiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/octagon\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 Octagon = createLucideIcon('Octagon', [\n [\n 'path',\n {\n d: 'M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z',\n key: '2d38gg',\n },\n ],\n]);\n\nexport default Octagon;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAC1C,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,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ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Radar\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTkuMDcgNC45M0ExMCAxMCAwIDAgMCA2Ljk5IDMuMzQiIC8+CiAgPHBhdGggZD0iTTQgNmguMDEiIC8+CiAgPHBhdGggZD0iTTIuMjkgOS42MkExMCAxMCAwIDEgMCAyMS4zMSA4LjM1IiAvPgogIDxwYXRoIGQ9Ik0xNi4yNCA3Ljc2QTYgNiAwIDEgMCA4LjIzIDE2LjY3IiAvPgogIDxwYXRoIGQ9Ik0xMiAxOGguMDEiIC8+CiAgPHBhdGggZD0iTTE3Ljk5IDExLjY2QTYgNiAwIDAgMSAxNS43NyAxNi42NyIgLz4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIyIiAvPgogIDxwYXRoIGQ9Im0xMy40MSAxMC41OSA1LjY2LTUuNjYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/radar\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 Radar = createLucideIcon('Radar', [\n ['path', { d: 'M19.07 4.93A10 10 0 0 0 6.99 3.34', key: 'z3du51' }],\n ['path', { d: 'M4 6h.01', key: 'oypzma' }],\n ['path', { d: 'M2.29 9.62A10 10 0 1 0 21.31 8.35', key: 'qzzz0' }],\n ['path', { d: 'M16.24 7.76A6 6 0 1 0 8.23 16.67', key: '1yjesh' }],\n ['path', { d: 'M12 18h.01', key: 'mhygvu' }],\n ['path', { d: 'M17.99 11.66A6 6 0 0 1 15.77 16.67', key: '1u2y91' }],\n ['circle', { cx: '12', cy: '12', r: '2', key: '1c9p78' }],\n ['path', { d: 'm13.41 10.59 5.66-5.66', key: 'mhq4k0' }],\n]);\n\nexport default Radar;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAClE,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,CAAqC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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A,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0B,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACzD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,6 @@
//#region src/ssr/tsrScript.ts?script-string
var tsrScript_default = "self.$_TSR={h(){this.hydrated=!0,this.c()},e(){this.streamEnded=!0,this.c()},c(){this.hydrated&&this.streamEnded&&(delete self.$_TSR,delete self.$R.tsr)},p(e){this.initialized?e():this.buffer.push(e)},buffer:[]}";
//#endregion
export { tsrScript_default as default };
//# sourceMappingURL=tsrScript.js.map
@@ -0,0 +1,189 @@
flf2a$ 1 1 30 -1 40
Morse by Glenn Chappell <ggc@uiuc.edu> 10/95
Based on info from "Morse Code and the Phonetic Alphabets"
URL: http://www.soton.ac.uk/~scp93ch/refer/alphabet.html
Includes some ISO Latin-1 characters
Permission is hereby given to modify this font, as long as the
modifier's name is placed on a comment line.
Use of this font allows figlet to convert ASCII to International Morse
Code.
The following substitutions have been made, i.e., if figlet receives a
character on the left as input, it will print the Morse Code for the
character on the right:
! -> .
; -> :
[]{} -> ()
German s-z -> ss
Latin-1 "prime" -> '
# -> <Delete last word>
* -> Ch
Except as noted above, characters not available in Morse Code will print
as "?".
Inter-word spaces have been enlarged to improve readability. To conform
to the standards for automatic transmission of Morse Code, use smushmode
zero ("figlet -f morse -m0"); wait the duration of a dot for each blank
in the output, as well as between any two output characters (dots,
dashes or blanks).
Explanation of first line:
flf2 - "magic number" for file identification
a - should always be `a', for now
$ - the "hardblank" -- prints as a blank, but can't be smushed
1 - height of a character
1 - height of a character, not including descenders
30 - max line length (excluding comment lines) + a fudge factor
-1 - default smushmode for this font
40 - number of comment lines
$@
.-.-.-$@
.-..-.$@
........$@
?$#
?$#
?$#
.----.$@
-.--.-$@
-.--.-$@
----$@
?$#
--..--$@
-....-$@
.-.-.-$@
-..-.$@
-----$@
.----$@
..---$@
...--$@
....-$@
.....$@
-....$@
--...$@
---..$@
----.$@
---...$@
---...$@
?$#
?$#
?$#
..--..$@
?$#
.-$@
-...$@
-.-.$@
-..$@
.$@
..-.$@
--.$@
....$@
..$@
.---$@
-.-$@
.-..$@
--$@
-.$@
---$@
.--.$@
--.-$@
.-.$@
...$@
-$@
..-$@
...-$@
.--$@
-..-$@
-.--$@
--..$@
-.--.-$@
?$#
-.--.-$@
?$#
?$#
?$#
.-$@
-...$@
-.-.$@
-..$@
.$@
..-.$@
--.$@
....$@
..$@
.---$@
-.-$@
.-..$@
--$@
-.$@
---$@
.--.$@
--.-$@
.-.$@
...$@
-$@
..-$@
...-$@
.--$@
-..-$@
-.--$@
--..$@
-.--.-$@
?$#
-.--.-$@
?$#
.-.-$@
---.$@
..--$@
.-.-$@
---.$@
..--$@
...$...$@
0
?$#
160
$@
171
.-..-.$@
180
.----.$@
187
.-..-.$@
188
.----$-..-.$....-$@
189
.----$-..-.$..---$@
190
...--$-..-.$....-$@
193
.--.-$@
196
.-.-$@
197
.--.-$@
201
..-..$@
209
--.--$@
214
---.$@
220
..--$@
223
...$...$@
225
.--.-$@
228
.-.-$@
229
.--.-$@
233
..-..$@
241
--.--$@
246
---.$@
252
..--$@
@@ -0,0 +1,53 @@
import { removeItem } from 'motion-utils';
import { microtask } from '../frameloop/microtask.mjs';
import { startViewAnimation } from './start.mjs';
let builders = [];
let current = null;
function next() {
current = null;
const [nextBuilder] = builders;
if (nextBuilder)
start(nextBuilder);
}
function start(builder) {
removeItem(builders, builder);
current = builder;
startViewAnimation(builder).then((animation) => {
builder.notifyReady(animation);
animation.finished.finally(next);
});
}
function processQueue() {
/**
* Iterate backwards over the builders array. We can ignore the
* "wait" animations. If we have an interrupting animation in the
* queue then we need to batch all preceeding animations into it.
* Currently this only batches the update functions but will also
* need to batch the targets.
*/
for (let i = builders.length - 1; i >= 0; i--) {
const builder = builders[i];
const { interrupt } = builder.options;
if (interrupt === "immediate") {
const batchedUpdates = builders.slice(0, i + 1).map((b) => b.update);
const remaining = builders.slice(i + 1);
builder.update = () => {
batchedUpdates.forEach((update) => update());
};
// Put the current builder at the front, followed by any "wait" builders
builders = [builder, ...remaining];
break;
}
}
if (!current || builders[0]?.options.interrupt === "immediate") {
next();
}
}
function addToQueue(builder) {
builders.push(builder);
microtask.render(processQueue);
}
export { addToQueue };
//# sourceMappingURL=queue.mjs.map
@@ -0,0 +1,8 @@
import { createDomVisualElement } from '../../dom/create-visual-element.mjs';
import { createMotionProxy } from '../create-proxy.mjs';
import { featureBundle } from './feature-bundle.mjs';
const motion = /*@__PURE__*/ createMotionProxy(featureBundle, createDomVisualElement);
export { motion };
//# sourceMappingURL=proxy.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"redo-2.js","sources":["../../../src/icons/redo-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Redo2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTUgMTQgNS01LTUtNSIgLz4KICA8cGF0aCBkPSJNMjAgOUg5LjVBNS41IDUuNSAwIDAgMCA0IDE0LjVBNS41IDUuNSAwIDAgMCA5LjUgMjBIMTMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/redo-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Redo2 = createLucideIcon('Redo2', [\n ['path', { d: 'm15 14 5-5-5-5', key: '12vg1m' }],\n ['path', { d: 'M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13', key: '6uklza' }],\n]);\n\nexport default Redo2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CAAA,CACtC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA0D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACzF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,338 @@
/**
* @fileoverview Rule to require function names to match the name of the variable or property to which they are assigned.
* @author Annie Zhang, Pavel Strashkin
*/
"use strict";
//--------------------------------------------------------------------------
// Requirements
//--------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
const esutils = require("esutils");
//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
/**
* Determines if a pattern is `module.exports` or `module["exports"]`
* @param {ASTNode} pattern The left side of the AssignmentExpression
* @returns {boolean} True if the pattern is `module.exports` or `module["exports"]`
*/
function isModuleExports(pattern) {
if (
pattern.type === "MemberExpression" &&
pattern.object.type === "Identifier" &&
pattern.object.name === "module"
) {
// module.exports
if (
pattern.property.type === "Identifier" &&
pattern.property.name === "exports"
) {
return true;
}
// module["exports"]
if (
pattern.property.type === "Literal" &&
pattern.property.value === "exports"
) {
return true;
}
}
return false;
}
/**
* Determines if a string name is a valid identifier
* @param {string} name The string to be checked
* @param {number} ecmaVersion The ECMAScript version if specified in the parserOptions config
* @returns {boolean} True if the string is a valid identifier
*/
function isIdentifier(name, ecmaVersion) {
if (ecmaVersion >= 2015) {
return esutils.keyword.isIdentifierES6(name);
}
return esutils.keyword.isIdentifierES5(name);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
const alwaysOrNever = { enum: ["always", "never"] };
const optionsObject = {
type: "object",
properties: {
considerPropertyDescriptor: {
type: "boolean",
},
includeCommonJSModuleExports: {
type: "boolean",
},
},
additionalProperties: false,
};
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description:
"Require function names to match the name of the variable or property to which they are assigned",
recommended: false,
frozen: true,
url: "https://eslint.org/docs/latest/rules/func-name-matching",
},
schema: {
anyOf: [
{
type: "array",
additionalItems: false,
items: [alwaysOrNever, optionsObject],
},
{
type: "array",
additionalItems: false,
items: [optionsObject],
},
],
},
messages: {
matchProperty:
"Function name `{{funcName}}` should match property name `{{name}}`.",
matchVariable:
"Function name `{{funcName}}` should match variable name `{{name}}`.",
notMatchProperty:
"Function name `{{funcName}}` should not match property name `{{name}}`.",
notMatchVariable:
"Function name `{{funcName}}` should not match variable name `{{name}}`.",
},
},
create(context) {
const options =
(typeof context.options[0] === "object"
? context.options[0]
: context.options[1]) || {};
const nameMatches =
typeof context.options[0] === "string"
? context.options[0]
: "always";
const considerPropertyDescriptor = options.considerPropertyDescriptor;
const includeModuleExports = options.includeCommonJSModuleExports;
const ecmaVersion = context.languageOptions.ecmaVersion;
/**
* Check whether node is a certain CallExpression.
* @param {string} objName object name
* @param {string} funcName function name
* @param {ASTNode} node The node to check
* @returns {boolean} `true` if node matches CallExpression
*/
function isPropertyCall(objName, funcName, node) {
if (!node) {
return false;
}
return (
node.type === "CallExpression" &&
astUtils.isSpecificMemberAccess(node.callee, objName, funcName)
);
}
/**
* Compares identifiers based on the nameMatches option
* @param {string} x the first identifier
* @param {string} y the second identifier
* @returns {boolean} whether the two identifiers should warn.
*/
function shouldWarn(x, y) {
return (
(nameMatches === "always" && x !== y) ||
(nameMatches === "never" && x === y)
);
}
/**
* Reports
* @param {ASTNode} node The node to report
* @param {string} name The variable or property name
* @param {string} funcName The function name
* @param {boolean} isProp True if the reported node is a property assignment
* @returns {void}
*/
function report(node, name, funcName, isProp) {
let messageId;
if (nameMatches === "always" && isProp) {
messageId = "matchProperty";
} else if (nameMatches === "always") {
messageId = "matchVariable";
} else if (isProp) {
messageId = "notMatchProperty";
} else {
messageId = "notMatchVariable";
}
context.report({
node,
messageId,
data: {
name,
funcName,
},
});
}
/**
* Determines whether a given node is a string literal
* @param {ASTNode} node The node to check
* @returns {boolean} `true` if the node is a string literal
*/
function isStringLiteral(node) {
return node.type === "Literal" && typeof node.value === "string";
}
//--------------------------------------------------------------------------
// Public
//--------------------------------------------------------------------------
return {
VariableDeclarator(node) {
if (
!node.init ||
node.init.type !== "FunctionExpression" ||
node.id.type !== "Identifier"
) {
return;
}
if (
node.init.id &&
shouldWarn(node.id.name, node.init.id.name)
) {
report(node, node.id.name, node.init.id.name, false);
}
},
AssignmentExpression(node) {
if (
node.right.type !== "FunctionExpression" ||
(node.left.computed &&
node.left.property.type !== "Literal") ||
(!includeModuleExports && isModuleExports(node.left)) ||
(node.left.type !== "Identifier" &&
node.left.type !== "MemberExpression")
) {
return;
}
const isProp = node.left.type === "MemberExpression";
const name = isProp
? astUtils.getStaticPropertyName(node.left)
: node.left.name;
if (
node.right.id &&
name &&
isIdentifier(name) &&
shouldWarn(name, node.right.id.name)
) {
report(node, name, node.right.id.name, isProp);
}
},
"Property, PropertyDefinition[value]"(node) {
if (
!(node.value.type === "FunctionExpression" && node.value.id)
) {
return;
}
if (node.key.type === "Identifier" && !node.computed) {
const functionName = node.value.id.name;
let propertyName = node.key.name;
if (
considerPropertyDescriptor &&
propertyName === "value" &&
node.parent.type === "ObjectExpression"
) {
if (
isPropertyCall(
"Object",
"defineProperty",
node.parent.parent,
) ||
isPropertyCall(
"Reflect",
"defineProperty",
node.parent.parent,
)
) {
const property = node.parent.parent.arguments[1];
if (
isStringLiteral(property) &&
shouldWarn(property.value, functionName)
) {
report(
node,
property.value,
functionName,
true,
);
}
} else if (
isPropertyCall(
"Object",
"defineProperties",
node.parent.parent.parent.parent,
)
) {
propertyName = node.parent.parent.key.name;
if (
!node.parent.parent.computed &&
shouldWarn(propertyName, functionName)
) {
report(node, propertyName, functionName, true);
}
} else if (
isPropertyCall(
"Object",
"create",
node.parent.parent.parent.parent,
)
) {
propertyName = node.parent.parent.key.name;
if (
!node.parent.parent.computed &&
shouldWarn(propertyName, functionName)
) {
report(node, propertyName, functionName, true);
}
} else if (shouldWarn(propertyName, functionName)) {
report(node, propertyName, functionName, true);
}
} else if (shouldWarn(propertyName, functionName)) {
report(node, propertyName, functionName, true);
}
return;
}
if (
isStringLiteral(node.key) &&
isIdentifier(node.key.value, ecmaVersion) &&
shouldWarn(node.key.value, node.value.id.name)
) {
report(node, node.key.value, node.value.id.name, true);
}
},
};
},
};
@@ -0,0 +1,39 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveRequest} ResolveRequest */
/**
* @param {Resolver} resolver resolver
* @param {ResolveRequest} request string
* @returns {string} inner request
*/
module.exports = function getInnerRequest(resolver, request) {
if (
typeof request.__innerRequest === "string" &&
request.__innerRequest_request === request.request &&
request.__innerRequest_relativePath === request.relativePath
) {
return request.__innerRequest;
}
/** @type {string | undefined} */
let innerRequest;
if (request.request) {
innerRequest = request.request;
if (/^\.\.?(?:\/|$)/.test(innerRequest) && request.relativePath) {
innerRequest = resolver.join(request.relativePath, innerRequest);
}
} else {
innerRequest = request.relativePath;
}
// eslint-disable-next-line camelcase
request.__innerRequest_request = request.request;
// eslint-disable-next-line camelcase
request.__innerRequest_relativePath = request.relativePath;
return (request.__innerRequest = /** @type {string} */ (innerRequest));
};
@@ -0,0 +1 @@
{"version":3,"file":"star-half.js","sources":["../../../src/icons/star-half.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name StarHalf\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMTguMzM4YTIuMSAyLjEgMCAwIDAtLjk4Ny4yNDRMNi4zOTYgMjEuMDFhLjUzLjUzIDAgMCAxLS43Ny0uNTZsLjg4MS01LjEzOWEyLjEyIDIuMTIgMCAwIDAtLjYxMS0xLjg3OUwyLjE2IDkuNzk1YS41My41MyAwIDAgMSAuMjk0LS45MDZsNS4xNjUtLjc1NWEyLjEyIDIuMTIgMCAwIDAgMS41OTctMS4xNmwyLjMwOS00LjY3OUEuNTMuNTMgMCAwIDEgMTIgMiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/star-half\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 StarHalf = createLucideIcon('StarHalf', [\n [\n 'path',\n {\n d: 'M12 18.338a2.1 2.1 0 0 0-.987.244L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.12 2.12 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.12 2.12 0 0 0 1.597-1.16l2.309-4.679A.53.53 0 0 1 12 2',\n key: '2ksp49',\n },\n ],\n]);\n\nexport default StarHalf;\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,CAC5C,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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A,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,80 @@
import { SourceMapConsumer } from 'source-map-js'
import { ProcessOptions } from './postcss.js'
declare namespace PreviousMap {
export { PreviousMap_ as default }
}
/**
* Source map information from input CSS.
* For example, source map after Sass compiler.
*
* This class will automatically find source map in input CSS or in file system
* near input file (according `from` option).
*
* ```js
* const root = parse(css, { from: 'a.sass.css' })
* root.input.map //=> PreviousMap
* ```
*/
declare class PreviousMap_ {
/**
* `sourceMappingURL` content.
*/
annotation?: string
/**
* The CSS source identifier. Contains `Input#file` if the user
* set the `from` option, or `Input#id` if they did not.
*/
file?: string
/**
* Was source map inlined by data-uri to input CSS.
*/
inline: boolean
/**
* Path to source map file.
*/
mapFile?: string
/**
* The directory with source map file, if source map is in separated file.
*/
root?: string
/**
* Source map file content.
*/
text?: string
/**
* @param css Input CSS source.
* @param opts Process options.
*/
constructor(css: string, opts?: ProcessOptions)
/**
* Create a instance of `SourceMapGenerator` class
* from the `source-map` library to work with source map information.
*
* It is lazy method, so it will create object only on first call
* and then it will use cache.
*
* @return Object with source map information.
*/
consumer(): SourceMapConsumer
/**
* Does source map contains `sourcesContent` with input source text.
*
* @return Is `sourcesContent` present.
*/
withContent(): boolean
}
declare class PreviousMap extends PreviousMap_ {}
export = PreviousMap
@@ -0,0 +1,30 @@
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}
{{
var $i = 'i' + $lvl
, $vSchema = 'schema' + $lvl;
}}
{{? !$isData }}
var {{=$vSchema}} = validate.schema{{=$schemaPath}};
{{?}}
var {{=$valid}};
{{?$isData}}{{# def.check$dataIsArray }}{{?}}
{{=$valid}} = false;
for (var {{=$i}}=0; {{=$i}}<{{=$vSchema}}.length; {{=$i}}++)
if (equal({{=$data}}, {{=$vSchema}}[{{=$i}}])) {
{{=$valid}} = true;
break;
}
{{? $isData }} } {{?}}
{{# def.checkError:'enum' }}
{{? $breakOnError }} else { {{?}}
@@ -0,0 +1,8 @@
import type {Vocabulary} from "../types"
import dependentRequired from "./validation/dependentRequired"
import dependentSchemas from "./applicator/dependentSchemas"
import limitContains from "./validation/limitContains"
const next: Vocabulary = [dependentRequired, dependentSchemas, limitContains]
export default next
@@ -0,0 +1,14 @@
import { n as normalizeUnit } from "./normalizeUnit-bp5SODxw.mjs";
import endOf from "./endOf.mjs";
import parse from "./parse.mjs";
function isBefore(date, input, unit) {
unit = normalizeUnit(unit);
const inputMs = +parse(input);
if (!unit) {
return +date < inputMs;
}
return +endOf(new Date(date), unit) < inputMs;
}
export {
isBefore as default
};
@@ -0,0 +1,125 @@
{
"sidebar": [
{
"groupName": "Documentation",
"items": [
{ "link": "/", "label": "Home" },
{ "link": "/getting-started", "label": "Getting Started" }
]
},
{
"groupName": "API",
"items": [
{
"label": "Core",
"items": [
{ "link": "/api/Dispatcher", "label": "Dispatcher" },
{ "link": "/api/Client", "label": "Client" },
{ "link": "/api/H2CClient", "label": "H2CClient" },
{ "link": "/api/Pool", "label": "Pool" },
{ "link": "/api/BalancedPool", "label": "BalancedPool" },
{ "link": "/api/RoundRobinPool", "label": "RoundRobinPool" },
{ "link": "/api/Agent", "label": "Agent" },
{ "link": "/api/PoolStats", "label": "PoolStats" },
{ "link": "/api/Connector", "label": "Connector" }
]
},
{
"label": "Proxy & Agents",
"items": [
{ "link": "/api/ProxyAgent", "label": "ProxyAgent" },
{
"link": "/api/EnvHttpProxyAgent",
"label": "EnvHttpProxyAgent"
},
{ "link": "/api/Socks5ProxyAgent", "label": "Socks5ProxyAgent" },
{ "link": "/api/RetryAgent", "label": "RetryAgent" }
]
},
{
"label": "Web Standards",
"items": [
{ "link": "/api/Fetch", "label": "Fetch" },
{ "link": "/api/EventSource", "label": "EventSource" },
{ "link": "/api/WebSocket", "label": "WebSocket" },
{ "link": "/api/Cookies", "label": "Cookies" },
{ "link": "/api/CacheStorage", "label": "CacheStorage" },
{ "link": "/api/ContentType", "label": "MIME Type Parsing" }
]
},
{
"label": "Mocking",
"items": [
{ "link": "/api/MockClient", "label": "MockClient" },
{ "link": "/api/MockPool", "label": "MockPool" },
{ "link": "/api/MockAgent", "label": "MockAgent" },
{ "link": "/api/SnapshotAgent", "label": "SnapshotAgent" },
{ "link": "/api/MockCallHistory", "label": "MockCallHistory" },
{
"link": "/api/MockCallHistoryLog",
"label": "MockCallHistoryLog"
},
{ "link": "/api/MockErrors", "label": "MockErrors" }
]
},
{
"label": "Interceptors",
"items": [
{ "link": "/api/Interceptors", "label": "Interceptors" }
]
},
{
"label": "Handlers",
"items": [
{ "link": "/api/RedirectHandler", "label": "RedirectHandler" },
{ "link": "/api/RetryHandler", "label": "RetryHandler" }
]
},
{
"label": "Diagnostics & Utilities",
"items": [
{ "link": "/api/Errors", "label": "Errors" },
{
"link": "/api/DiagnosticsChannel",
"label": "Diagnostics Channel Support"
},
{ "link": "/api/Debug", "label": "Debug" },
{ "link": "/api/Util", "label": "Util" },
{
"link": "/api/GlobalInstallation",
"label": "Global Installation"
},
{ "link": "/api/api-lifecycle", "label": "API Lifecycle" }
]
}
]
},
{
"groupName": "Best Practices",
"items": [
{
"link": "/best-practices/undici-vs-builtin-fetch",
"label": "Undici vs. Built-in Fetch"
},
{
"link": "/best-practices/migrating-from-v7-to-v8",
"label": "Migrating from Undici 7 to 8"
},
{ "link": "/best-practices/proxy", "label": "Proxy" },
{
"link": "/best-practices/client-certificate",
"label": "Client Certificate"
},
{
"link": "/best-practices/writing-tests",
"label": "Writing Tests"
},
{
"link": "/best-practices/mocking-request",
"label": "Mocking Request"
},
{ "link": "/best-practices/crawling", "label": "Crawling" }
]
}
]
}
@@ -0,0 +1,23 @@
import { AnyRouter, RegisteredRouter, RouterOptions } from '@tanstack/router-core';
import * as React from 'react';
/**
* Low-level provider that places the router into React context and optionally
* updates router options from props. Most apps should use `RouterProvider`.
*/
export declare function RouterContextProvider<TRouter extends AnyRouter = RegisteredRouter, TDehydrated extends Record<string, any> = Record<string, any>>({ router, children, ...rest }: RouterProps<TRouter, TDehydrated> & {
children: React.ReactNode;
}): import("react/jsx-runtime").JSX.Element;
/**
* Top-level component that renders the active route matches and provides the
* router to the React tree via context.
*
* Accepts the same options as `createRouter` via props to update the router
* instance after creation.
*
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/createRouterFunction
*/
export declare function RouterProvider<TRouter extends AnyRouter = RegisteredRouter, TDehydrated extends Record<string, any> = Record<string, any>>({ router, ...rest }: RouterProps<TRouter, TDehydrated>): import("react/jsx-runtime").JSX.Element;
export type RouterProps<TRouter extends AnyRouter = RegisteredRouter, TDehydrated extends Record<string, any> = Record<string, any>> = Omit<RouterOptions<TRouter['routeTree'], NonNullable<TRouter['options']['trailingSlash']>, NonNullable<TRouter['options']['defaultStructuralSharing']>, TRouter['history'], TDehydrated>, 'context'> & {
router: TRouter;
context?: Partial<RouterOptions<TRouter['routeTree'], NonNullable<TRouter['options']['trailingSlash']>, NonNullable<TRouter['options']['defaultStructuralSharing']>, TRouter['history'], TDehydrated>['context']>;
};
@@ -0,0 +1,6 @@
//#region src/link.ts
const preloadWarning = "Error preloading route! ☝️";
//#endregion
export { preloadWarning };
//# sourceMappingURL=link.js.map
@@ -0,0 +1,35 @@
import { c as MS_IN_SECOND, b as MS_IN_MINUTE, a as MS_IN_HOUR } from "./constants-BuFquuHl.mjs";
import { n as normalizeUnit } from "./normalizeUnit-bp5SODxw.mjs";
import { s as startOfDate, a as startOfTime } from "./startOfTime-B-McK1mQ.mjs";
import units from "./units.mjs";
const { DATE, DAY, HOUR, MINUTE, MONTH, SECOND, YEAR } = units;
function startOf(date, unit) {
unit = normalizeUnit(unit);
let time = 0;
switch (unit) {
case YEAR:
time = startOfDate(date, void 0, 0, 1);
break;
case MONTH:
time = startOfDate(date, void 0, void 0, 1);
break;
case DATE:
case DAY:
time = startOfDate(date);
break;
case HOUR:
time = startOfTime(date, MS_IN_HOUR);
break;
case MINUTE:
time = startOfTime(date, MS_IN_MINUTE);
break;
case SECOND:
time = startOfTime(date, MS_IN_SECOND);
break;
}
time && date.setTime(time);
return date;
}
export {
startOf as default
};
@@ -0,0 +1,29 @@
{
"name": "ee-first",
"description": "return the first event in a set of ee/event pairs",
"version": "1.1.1",
"author": {
"name": "Jonathan Ong",
"email": "me@jongleberry.com",
"url": "http://jongleberry.com",
"twitter": "https://twitter.com/jongleberry"
},
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>"
],
"license": "MIT",
"repository": "jonathanong/ee-first",
"devDependencies": {
"istanbul": "0.3.9",
"mocha": "2.2.5"
},
"files": [
"index.js",
"LICENSE"
],
"scripts": {
"test": "mocha --reporter spec --bail --check-leaks test/",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
}
}
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './panel-right-dashed.js';
//# sourceMappingURL=panel-right-inactive.js.map
@@ -0,0 +1,873 @@
import { globalConfig } from "./core.js";
// functions
export function assertEqual(val) {
return val;
}
export function assertNotEqual(val) {
return val;
}
export function toZod() {
return (schema) => schema;
}
export function assertIs(_arg) { }
export function assertNever(_x) {
throw new Error("Unexpected value in exhaustive check");
}
export function assert(_) { }
export function getEnumValues(entries) {
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
const values = Object.entries(entries)
.filter(([k, _]) => numericValues.indexOf(+k) === -1)
.map(([_, v]) => v);
return values;
}
export function joinValues(array, separator = "|") {
return array.map((val) => stringifyPrimitive(val)).join(separator);
}
export function jsonStringifyReplacer(_, value) {
if (typeof value === "bigint")
return value.toString();
return value;
}
// the accessor lives on a shared prototype: an own accessor makes every box a dictionary-mode object (~360 B and a slow load per read against ~100 B and an inlined getter here)
class Cached {
constructor(getter) {
this._getter = getter;
this._value = undefined;
}
get value() {
const getter = this._getter;
if (getter !== undefined) {
this._value = getter();
this._getter = undefined;
}
return this._value;
}
}
export function cached(getter) {
return new Cached(getter);
}
export function nullish(input) {
return input === null || input === undefined;
}
export function cleanRegex(source) {
const start = source.startsWith("^") ? 1 : 0;
const end = source.endsWith("$") ? source.length - 1 : source.length;
return source.slice(start, end);
}
export function floatSafeRemainder(val, step) {
const ratio = val / step;
const roundedRatio = Math.round(ratio);
// `val` and `step` each round to a double before the division rounds again, so a true decimal multiple's quotient can sit up to 1.5 of these scaled epsilons from the integer. A 1x tolerance therefore rejected 2.03 as a multiple of 0.07; 4x covers the worst case with margin.
const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
if (Math.abs(ratio - roundedRatio) < tolerance)
return 0;
return ratio - roundedRatio;
}
const EVALUATING = /* @__PURE__*/ Symbol("evaluating");
export function defineLazy(object, key, getter) {
let value = undefined;
Object.defineProperty(object, key, {
get() {
if (value === EVALUATING) {
// Circular reference detected, return undefined to break the cycle
return undefined;
}
if (value === undefined) {
value = EVALUATING;
value = getter();
}
return value;
},
set(v) {
Object.defineProperty(object, key, {
value: v,
// configurable: true,
});
// object[key] = v;
},
configurable: true,
});
}
export function objectClone(obj) {
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
}
export function assignProp(target, prop, value) {
Object.defineProperty(target, prop, {
value,
writable: true,
enumerable: true,
configurable: true,
});
}
/**
* Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.
*
* Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.
*/
export function rawShape(def) {
const desc = Object.getOwnPropertyDescriptor(def, "shape");
return desc?.get ? desc.get.raw : desc?.value;
}
// where a builder reads its source's keys and descriptors, resolving only a shape a def answers for itself. A shape resolves by object spread, so only its enumerable keys are ever part of it.
function sourceShape(schema) {
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
}
// a key whose value is not settled yet, self-caching so every read after the first gets the same one
function deferProp(target, key, getter) {
Object.defineProperty(target, key, {
get() {
const value = getter();
assignProp(this, key, value);
return value;
},
enumerable: true,
configurable: true,
});
}
// Writes a settled key. A plain assignment is much cheaper than `defineProperty` and produces the same descriptor, but it runs whatever setter already answers to the key — an accessor this shape deferred, or an inherited one, which `__proto__` has on every object and prototype pollution can add for any name.
function putProp(target, key, value) {
if (key in target)
assignProp(target, key, value);
else
target[key] = value;
}
/**
* Copies `keys` of `source`'s shape onto `target`, each value passed through `wrap`.
*
* A key the source has resolved is copied through now, so the derived shape states it outright and nothing has to resolve it to learn what it holds. A key the source still defers stays deferred, and reads back through the source's own `shape`, so it resolves once and both shapes get that one schema.
*/
function mirrorShape(target, source, keys, wrap) {
const raw = sourceShape(source);
for (const key of keys) {
const desc = Object.getOwnPropertyDescriptor(raw, key);
if (!desc.enumerable)
continue;
if (desc.get) {
deferProp(target, key, () => {
const value = source._zod.def.shape[key];
return wrap ? wrap(value, key) : value;
});
}
else
putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
}
}
// same, for a plain shape a caller passed rather than a schema's
function mirrorProps(target, source) {
for (const key of Reflect.ownKeys(source)) {
const desc = Object.getOwnPropertyDescriptor(source, key);
if (!desc.enumerable)
continue;
if (desc.get)
deferProp(target, key, () => source[key]);
else
putProp(target, key, desc.value);
}
}
export function mergeDefs(...defs) {
const mergedDescriptors = {};
for (const def of defs) {
const descriptors = Object.getOwnPropertyDescriptors(def);
Object.assign(mergedDescriptors, descriptors);
}
return Object.defineProperties({}, mergedDescriptors);
}
export function cloneDef(schema) {
return mergeDefs(schema._zod.def);
}
export function getElementAtPath(obj, path) {
if (!path)
return obj;
return path.reduce((acc, key) => acc?.[key], obj);
}
export function promiseAllObject(promisesObj) {
const keys = Object.keys(promisesObj);
const promises = keys.map((key) => promisesObj[key]);
return Promise.all(promises).then((results) => {
const resolvedObj = {};
for (let i = 0; i < keys.length; i++) {
resolvedObj[keys[i]] = results[i];
}
return resolvedObj;
});
}
export function randomString(length = 10) {
const chars = "abcdefghijklmnopqrstuvwxyz";
let str = "";
for (let i = 0; i < length; i++) {
str += chars[Math.floor(Math.random() * chars.length)];
}
return str;
}
export function esc(str) {
return JSON.stringify(str);
}
export function slugify(input) {
return input
.toLowerCase()
.trim()
.replace(/[^\w\s-]/g, "")
.replace(/[\s_-]+/g, "-")
.replace(/^-+|-+$/g, "");
}
export const captureStackTrace = ("captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => { });
export function isObject(data) {
return typeof data === "object" && data !== null && !Array.isArray(data);
}
export const allowsEval = /* @__PURE__*/ cached(() => {
// Skip the probe under `jitless`: strict CSPs report the caught `new Function` as a `securitypolicyviolation` even though the throw is swallowed.
if (globalConfig.jitless) {
return false;
}
// @ts-ignore
if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
return false;
}
try {
const F = Function;
new F("");
return true;
}
catch (_) {
return false;
}
});
export function isPlainObject(o) {
if (isObject(o) === false)
return false;
// modified constructor
const ctor = o.constructor;
if (ctor === undefined)
return true;
if (typeof ctor !== "function")
return true;
// modified prototype
const prot = ctor.prototype;
if (isObject(prot) === false)
return false;
// ctor doesn't have static `isPrototypeOf`
if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) {
return false;
}
return true;
}
export function shallowClone(o) {
if (isPlainObject(o))
return { ...o };
if (Array.isArray(o))
return [...o];
if (o instanceof Map)
return new Map(o);
if (o instanceof Set)
return new Set(o);
return o;
}
export function numKeys(data) {
let keyCount = 0;
for (const key in data) {
if (Object.prototype.hasOwnProperty.call(data, key)) {
keyCount++;
}
}
return keyCount;
}
export const getParsedType = (data) => {
const t = typeof data;
switch (t) {
case "undefined":
return "undefined";
case "string":
return "string";
case "number":
return Number.isNaN(data) ? "nan" : "number";
case "boolean":
return "boolean";
case "function":
return "function";
case "bigint":
return "bigint";
case "symbol":
return "symbol";
case "object":
if (Array.isArray(data)) {
return "array";
}
if (data === null) {
return "null";
}
if (data.then && typeof data.then === "function" && data.catch && typeof data.catch === "function") {
return "promise";
}
if (typeof Map !== "undefined" && data instanceof Map) {
return "map";
}
if (typeof Set !== "undefined" && data instanceof Set) {
return "set";
}
if (typeof Date !== "undefined" && data instanceof Date) {
return "date";
}
// @ts-ignore
if (typeof File !== "undefined" && data instanceof File) {
return "file";
}
return "object";
default:
throw new Error(`Unknown data type: ${t}`);
}
};
export const propertyKeyTypes = /* @__PURE__*/ new Set(["string", "number", "symbol"]);
export const primitiveTypes = /* @__PURE__*/ new Set([
"string",
"number",
"bigint",
"boolean",
"symbol",
"undefined",
]);
export function escapeRegex(str) {
return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
// zod-specific utils
export function clone(inst, def, params) {
const cl = new inst._zod.constr(def ?? inst._zod.def);
if (!def || params?.parent)
cl._zod.parent = inst;
return cl;
}
export function normalizeParams(_params) {
const params = _params;
if (!params)
return {};
if (typeof params === "string")
return { error: () => params };
if (params?.message !== undefined) {
if (params?.error !== undefined)
throw new Error("Cannot specify both `message` and `error` params");
params.error = params.message;
}
delete params.message;
if (typeof params.error === "string")
return { ...params, error: () => params.error };
return params;
}
export function createTransparentProxy(getter) {
let target;
return new Proxy({}, {
get(_, prop, receiver) {
target ?? (target = getter());
return Reflect.get(target, prop, receiver);
},
set(_, prop, value, receiver) {
target ?? (target = getter());
return Reflect.set(target, prop, value, receiver);
},
has(_, prop) {
target ?? (target = getter());
return Reflect.has(target, prop);
},
deleteProperty(_, prop) {
target ?? (target = getter());
return Reflect.deleteProperty(target, prop);
},
ownKeys(_) {
target ?? (target = getter());
return Reflect.ownKeys(target);
},
getOwnPropertyDescriptor(_, prop) {
target ?? (target = getter());
return Reflect.getOwnPropertyDescriptor(target, prop);
},
defineProperty(_, prop, descriptor) {
target ?? (target = getter());
return Reflect.defineProperty(target, prop, descriptor);
},
});
}
export function stringifyPrimitive(value) {
if (typeof value === "bigint")
return value.toString() + "n";
if (typeof value === "string")
return `"${value}"`;
return `${value}`;
}
export function optionalKeys(shape) {
return Object.keys(shape).filter((k) => {
return shape[k]._zod.optin !== undefined && shape[k]._zod.optout === "optional";
});
}
// Wrapped in a `@__PURE__` IIFE: esbuild never tree-shakes a top-level initializer that contains a member access on `Number`, so the bare object literal survived into every bundle.
export const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({
safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
int32: [-2147483648, 2147483647],
uint32: [0, 4294967295],
float32: [-3.4028234663852886e38, 3.4028234663852886e38],
float64: [-Number.MAX_VALUE, Number.MAX_VALUE],
}))();
export const BIGINT_FORMAT_RANGES = {
int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")],
};
export function pick(schema, mask) {
const currDef = schema._zod.def;
const checks = currDef.checks;
const hasChecks = checks && checks.length > 0;
if (hasChecks) {
throw new Error(".pick() cannot be used on object schemas containing refinements");
}
const newShape = {};
mirrorShape(newShape, schema, maskedKeys(schema, mask));
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
}
// the mask keys that select something, checked against the source's shape without resolving it
function maskedKeys(schema, mask) {
const raw = sourceShape(schema);
const keys = [];
// `for...in` skips symbols, so a symbol in the mask would select nothing
for (const key of Reflect.ownKeys(mask)) {
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) {
throw new Error(`Unrecognized key: "${String(key)}"`);
}
if (mask[key])
keys.push(key);
}
return keys;
}
export function omit(schema, mask) {
const currDef = schema._zod.def;
const checks = currDef.checks;
const hasChecks = checks && checks.length > 0;
if (hasChecks) {
throw new Error(".omit() cannot be used on object schemas containing refinements");
}
const omitted = new Set(maskedKeys(schema, mask));
const newShape = {};
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
return clone(schema, mergeDefs(currDef, { shape: newShape, checks: [] }));
}
export function extend(schema, shape) {
if (!isPlainObject(shape)) {
throw new Error("Invalid input to extend: expected a plain object");
}
const checks = schema._zod.def.checks;
const hasChecks = checks && checks.length > 0;
if (hasChecks) {
// Only throw if new shape overlaps with existing shape. Use getOwnPropertyDescriptor to check key existence without accessing values
const existingShape = sourceShape(schema);
for (const key of Reflect.ownKeys(shape)) {
if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {
throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
}
}
}
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
}
// the source's keys, then the caller's overlaid on top
function extended(schema, shape) {
const newShape = {};
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
mirrorProps(newShape, shape);
return newShape;
}
export function safeExtend(schema, shape) {
if (!isPlainObject(shape)) {
throw new Error("Invalid input to safeExtend: expected a plain object");
}
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
}
export function merge(a, b) {
if (!b?._zod?.def) {
throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
}
if (a._zod.def.checks?.length) {
throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
}
const newShape = {};
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
const def = mergeDefs(a._zod.def, {
shape: newShape,
get catchall() {
return b._zod.def.catchall;
},
checks: b._zod.def.checks ?? [],
});
return clone(a, def);
}
export function partial(Class, schema, mask, name = "partial") {
const currDef = schema._zod.def;
const checks = currDef.checks;
const hasChecks = checks && checks.length > 0;
if (hasChecks) {
throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
}
const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
const newShape = {};
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class &&
((value, key) => (selected && !selected.has(key) ? value : new Class({ type: "optional", innerType: value }))));
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape, checks: [] }));
}
export function required(Class, schema, mask) {
const selected = mask ? new Set(maskedKeys(schema, mask)) : undefined;
const newShape = {};
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) =>
// overwrite with non-optional
selected && !selected.has(key) ? value : new Class({ type: "nonoptional", innerType: value }));
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
}
// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom
export function aborted(x, startIndex = 0) {
if (x.aborted === true)
return true;
for (let i = startIndex; i < x.issues.length; i++) {
if (x.issues[i]?.continue !== true) {
return true;
}
}
return false;
}
// Checks for explicit abort (continue === false), as opposed to implicit abort (continue === undefined). Used to respect `abort: true` in .refine() even for checks that have a `when` function.
export function explicitlyAborted(x, startIndex = 0) {
if (x.aborted === true)
return true;
for (let i = startIndex; i < x.issues.length; i++) {
if (x.issues[i]?.continue === false) {
return true;
}
}
return false;
}
export function prefixIssues(path, issues) {
return issues.map((iss) => {
var _a;
(_a = iss).path ?? (_a.path = []);
iss.path.unshift(path);
return iss;
});
}
export function unwrapMessage(message) {
return typeof message === "string" ? message : message?.message;
}
/* A check holds no link back to the schema it is attached to — the same check instance is shared by every clone of that schema — so the owner is stamped onto the issues a check just raised, at the only point where both are in scope. Runs on the failure path only; `start` is the issue count from before the check ran. */
/** The leading size checks of `defChecks` that set an upper bound, each paired with it. */
export function sizeCaps(defChecks) {
const caps = [];
for (const ch of defChecks ?? []) {
const d = ch._zod.def;
// a later check may rewrite the value
if (!/_(length|size)$|_equals$/.test(d.check))
break;
const max = d.maximum ?? d.length ?? d.size;
if (max >= 0)
caps.push([max, ch]);
}
return caps;
}
export function attachSchema(issues, start, inst) {
var _a;
for (let i = start; i < issues.length; i++) {
(_a = issues[i]).schema ?? (_a.schema = inst);
}
}
export function finalizeIssue(iss, ctx, config) {
var _a;
// A schema that raised an issue itself owns it outright, and outranks any stamp an enclosing check left in `attachSchema`. String formats and z.custom() are schema and check at once, so when they act as a check they defer to that stamp instead.
const traits = iss.inst?._zod?.traits;
if (traits?.has("$ZodType")) {
if (traits.has("$ZodCheck"))
(_a = iss).schema ?? (_a.schema = iss.inst);
else
iss.schema = iss.inst;
}
// Decreasing specificity, first map to return a message wins. `inst` is whatever raised the issue, so a check's own map outranks the owning schema's.
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;
const message = iss.message
? iss.message
: (unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??
unwrapMessage(schemaError?.(iss)) ??
unwrapMessage(ctx?.error?.(iss)) ??
unwrapMessage(config.customError?.(iss)) ??
unwrapMessage(config.localeError?.(iss)) ??
"Invalid input");
// an explicit own-key copy beats object rest with excluded keys, which v8 routes through a generic runtime call; Object.keys rather than for-in so an issue pushed with a prototype does not leak inherited keys, and an own __proto__ key is dropped rather than assigned through the setter
const full = {};
for (const k of Object.keys(iss)) {
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__")
continue;
full[k] = iss[k];
}
full.path ?? (full.path = []);
full.message = message;
if (ctx?.reportInput) {
full.input = iss.input;
}
return full;
}
export function getSizableOrigin(input) {
if (input instanceof Set)
return "set";
if (input instanceof Map)
return "map";
// @ts-ignore
if (input instanceof File)
return "file";
return "unknown";
}
const highSurrogate = /[\uD800-\uDBFF]/;
// Code points in `str`: a surrogate pair counts once, a lone surrogate as itself. Hand-rolled because the string iterator allocates and runs ~250x slower on this path; the regex probe exits ~50x quicker for a string with no astral characters.
export function codePointLength(str) {
const units = str.length;
if (!highSurrogate.test(str))
return units;
let count = units;
for (let i = 0; i < units - 1; i++) {
if ((str.charCodeAt(i) & 0xfc00) === 0xd800 && (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {
count--;
i++;
}
}
return count;
}
export function getLengthableOrigin(input) {
if (Array.isArray(input))
return "array";
if (typeof input === "string")
return "string";
return "unknown";
}
export function parsedType(data) {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "nan" : "number";
}
case "object": {
if (data === null) {
return "null";
}
if (Array.isArray(data)) {
return "array";
}
const obj = data;
if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) {
return obj.constructor.name;
}
}
}
return t;
}
export function issue(...args) {
const [iss, input, inst] = args;
if (typeof iss === "string") {
return {
message: iss,
code: "custom",
input,
inst,
};
}
return { ...iss };
}
export function cleanEnum(obj) {
return Object.entries(obj)
.filter(([k, _]) => {
// return true if NaN, meaning it's not a number, thus a string key
return Number.isNaN(Number.parseInt(k, 10));
})
.map((el) => el[1]);
}
// Codec utility functions
export function base64ToUint8Array(base64) {
const binaryString = atob(base64);
const bytes = new Uint8Array(binaryString.length);
for (let i = 0; i < binaryString.length; i++) {
bytes[i] = binaryString.charCodeAt(i);
}
return bytes;
}
export function uint8ArrayToBase64(bytes) {
let binaryString = "";
for (let i = 0; i < bytes.length; i++) {
binaryString += String.fromCharCode(bytes[i]);
}
return btoa(binaryString);
}
export function base64urlToUint8Array(base64url) {
const base64 = base64url.replace(/-/g, "+").replace(/_/g, "/");
const padding = "=".repeat((4 - (base64.length % 4)) % 4);
return base64ToUint8Array(base64 + padding);
}
export function uint8ArrayToBase64url(bytes) {
return uint8ArrayToBase64(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
}
export function hexToUint8Array(hex) {
const cleanHex = hex.replace(/^0x/, "");
if (cleanHex.length % 2 !== 0) {
throw new Error("Invalid hex string length");
}
const bytes = new Uint8Array(cleanHex.length / 2);
for (let i = 0; i < cleanHex.length; i += 2) {
bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);
}
return bytes;
}
export function uint8ArrayToHex(bytes) {
return Array.from(bytes)
.map((b) => b.toString(16).padStart(2, "0"))
.join("");
}
// instanceof
export class Class {
constructor(..._args) { }
}
////////// PROTOTYPE INSTALLERS //////////
//
// Members live on the prototype and materialize per instance on first read, which keeps own-property count under the step where V8 stops using inline slots. Changing anything here means re-measuring runtime, memory and bundle size together — see "The three axes" in AGENTS.md.
/**
* Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.
*
* Call this from a `proto` initializer, which runs once per prototype — never per instance.
*/
export function members(proto, table) {
for (const key in table) {
const desc = Object.getOwnPropertyDescriptor(table, key);
// a getter installs as written, so it stays live: `description` reads through to the registry on every access. not enumerable: an object literal's is, and a prototype member never was
if (desc.get)
Object.defineProperty(proto, key, { ...desc, enumerable: false });
// a method materializes bound on first read, which is what keeps a detached member working: `const opt = schema.optional; opt()`
else
defineBound(proto, key, desc.value);
}
}
/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
export function own(inst, key, value, enumerable = true) {
Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });
return value;
}
/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */
export function hide(inst, key, value) {
return own(inst, key, value, false);
}
/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
export /*@__NO_SIDE_EFFECTS__*/ function derived(computes, table) {
for (const key in computes) {
const compute = computes[key];
// an object literal's accessor is configurable and enumerable, and `members` copies the descriptor as written
Object.defineProperty(table, key, {
configurable: true,
enumerable: true,
get() {
return own(this, key, compute(this));
},
set(value) {
own(this, key, value);
},
});
}
return table;
}
function defineBound(proto, key, fn) {
Object.defineProperty(proto, key, {
configurable: true,
get() {
// vitest's spyOn calls a prototype getter bare to find the function it wraps, so a nullish receiver answers the raw method
return this == null ? fn : own(this, key, fn.bind(this));
},
set(value) {
own(this, key, value);
},
});
}
/** Returns the prototype to install on, or `undefined` if this group is already installed on it. */
function claim(inst, sentinel) {
const proto = Object.getPrototypeOf(inst);
// Runs on every construction, so `in` rather than the costlier `hasOwnProperty.call`. Sentinels are keys the group itself defines.
return sentinel in proto ? undefined : proto;
}
// The internals whose init chain is installing. A second call for the same one is a derived constructor overriding its base, so it must not construct another schema in between or the override is dropped.
let installing;
// Set while a getter is running, so a value that resolved through a recursion break is not memoized. One shared descriptor shadows the key for the duration, which costs no per-key allocation.
let broke = false;
const breaker = {
configurable: true,
get() {
broke = true;
return undefined;
},
};
/**
* Installs a lazily-derived internal on the `_zod` prototype of `inst`'s
* constructor, computed from the internals object itself and cached there on
* first read. One accessor per constructor rather than one per instance.
*/
export function defineLazyInternal(inst, key, compute) {
const proto = Object.getPrototypeOf(inst._zod);
if (key in proto && installing !== inst._zod) {
// A repeat construction: everything is installed already. Cleared here so the reference is not held past the first construction of every type.
installing = undefined;
return;
}
installing = inst._zod;
Object.defineProperty(proto, key, {
configurable: true,
get() {
// Shadowed before computing so a re-entrant read from a recursive schema resolves to undefined instead of running the getter again.
Object.defineProperty(this, key, breaker);
const outer = broke;
broke = false;
try {
const value = compute(this);
// A result that resolved through a recursion break is recomputed once the graph is complete; everything else memoizes, undefined included.
if (broke)
delete this[key];
else
Object.defineProperty(this, key, { configurable: true, writable: true, value });
broke = broke || outer;
return value;
}
catch (err) {
// A compute that threw memoizes nothing, so a later read runs it again and fails the same way. The shadow goes with it, since leaving it installed would answer undefined for every later read.
delete this[key];
broke = broke || outer;
throw err;
}
},
set(value) {
Object.defineProperty(this, key, { configurable: true, writable: true, value });
},
});
}
/**
* Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own
* data property. One accessor per constructor rather than one per instance, because an own accessor
* puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.
*/
export function installLazyProp(inst, key, make, enumerable) {
const proto = claim(inst, key);
if (!proto)
return;
Object.defineProperty(proto, key, {
configurable: true,
get() {
// Shadowed before computing, so a re-entrant read from a self-referential shape resolves to undefined instead of running the getter again. A data property rather than an accessor: an own accessor is the dictionary-mode transition this exists to avoid.
const desc = { configurable: true, writable: true, enumerable, value: undefined };
Object.defineProperty(this, key, desc);
// a compute that throws leaves the shadow behind, so later reads answer undefined instead of re-throwing; `defineLazy` did the same, and `defineLazyInternal`'s delete-on-catch would cost bytes in every bundle for a case only a throwing user getter reaches
desc.value = make(this);
Object.defineProperty(this, key, desc);
return desc.value;
},
set(value) {
Object.defineProperty(this, key, { configurable: true, writable: true, enumerable, value });
},
});
}
/** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */
export const CONSTANT_CATCH = "~constantCatch";
/** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */
export function constantCatch(value) {
const fn = () => value;
fn[CONSTANT_CATCH] = true;
return fn;
}
@@ -0,0 +1,30 @@
import { serveStatic as serveStatic$1 } from "../../middleware/serve-static/index.js";
import { stat } from "node:fs/promises";
import { join } from "node:path";
//#region src/adapter/bun/serve-static.ts
/**
* @deprecated `hono/bun` will be removed in v5. Install `@hono/bun` and import from there instead.
*/
const serveStatic = (options = {}) => {
return async function serveStatic(c, next) {
const getContent = async (path) => {
const file = Bun.file(path);
return await file.exists() ? file : null;
};
const isDir = async (path) => {
let isDir;
try {
isDir = (await stat(path)).isDirectory();
} catch {}
return isDir;
};
return serveStatic$1({
...options,
getContent,
join,
isDir
})(c, next);
};
};
//#endregion
export { serveStatic };
@@ -0,0 +1,6 @@
import type {Vocabulary} from "../../types"
import formatKeyword from "./format"
const format: Vocabulary = [formatKeyword]
export default format
@@ -0,0 +1 @@
{"version":3,"file":"re2.js","sourceRoot":"","sources":["../../lib/runtime/re2.ts"],"names":[],"mappings":";;AAAA,2BAA0B;AAGxB,GAAW,CAAC,IAAI,GAAG,yCAAyC,CAAA;AAE9D,kBAAe,GAAU,CAAA"}
@@ -0,0 +1,736 @@
import { last } from "./utils.js";
import { invariant } from "./invariant.js";
import { createLRUCache } from "./lru-cache.js";
const SEGMENT_TYPE_INDEX = 4;
const SEGMENT_TYPE_PATHLESS = 5;
function getOpenAndCloseBraces(part) {
const openBrace = part.indexOf("{");
if (openBrace === -1) return null;
const closeBrace = part.indexOf("}", openBrace);
if (closeBrace === -1) return null;
if (openBrace + 1 >= part.length) return null;
return [openBrace, closeBrace];
}
/**
* Populates the `output` array with the parsed representation of the given `segment` string.
*
* Usage:
* ```ts
* let output
* let cursor = 0
* while (cursor < path.length) {
* output = parseSegment(path, cursor, output)
* const end = output[5]
* cursor = end + 1
* ```
*
* `output` is stored outside to avoid allocations during repeated calls. It doesn't need to be typed
* or initialized, it will be done automatically.
*/
function parseSegment(path, start, output = new Uint16Array(6)) {
const next = path.indexOf("/", start);
const end = next === -1 ? path.length : next;
const part = path.substring(start, end);
if (!part || !part.includes("$")) {
output[0] = 0;
output[1] = start;
output[2] = start;
output[3] = end;
output[4] = end;
output[5] = end;
return output;
}
if (part === "$") {
const total = path.length;
output[0] = 2;
output[1] = start;
output[2] = start;
output[3] = total;
output[4] = total;
output[5] = total;
return output;
}
if (part.charCodeAt(0) === 36) {
output[0] = 1;
output[1] = start;
output[2] = start + 1;
output[3] = end;
output[4] = end;
output[5] = end;
return output;
}
const braces = getOpenAndCloseBraces(part);
if (braces) {
const [openBrace, closeBrace] = braces;
const firstChar = part.charCodeAt(openBrace + 1);
if (firstChar === 45) {
if (openBrace + 2 < part.length && part.charCodeAt(openBrace + 2) === 36) {
const paramStart = openBrace + 3;
const paramEnd = closeBrace;
if (paramStart < paramEnd) {
output[0] = 3;
output[1] = start + openBrace;
output[2] = start + paramStart;
output[3] = start + paramEnd;
output[4] = start + closeBrace + 1;
output[5] = end;
return output;
}
}
} else if (firstChar === 36) {
const dollarPos = openBrace + 1;
const afterDollar = openBrace + 2;
if (afterDollar === closeBrace) {
output[0] = 2;
output[1] = start + openBrace;
output[2] = start + dollarPos;
output[3] = start + afterDollar;
output[4] = start + closeBrace + 1;
output[5] = path.length;
return output;
}
output[0] = 1;
output[1] = start + openBrace;
output[2] = start + afterDollar;
output[3] = start + closeBrace;
output[4] = start + closeBrace + 1;
output[5] = end;
return output;
}
}
output[0] = 0;
output[1] = start;
output[2] = start;
output[3] = end;
output[4] = end;
output[5] = end;
return output;
}
/**
* Recursively parses the segments of the given route tree and populates a segment trie.
*
* @param data A reusable Uint16Array for parsing segments. (non important, we're just avoiding allocations)
* @param route The current route to parse.
* @param start The starting index for parsing within the route's full path.
* @param node The current segment node in the trie to populate.
* @param onRoute Callback invoked for each route processed.
*/
function parseSegments(defaultCaseSensitive, data, route, start, node, depth, onRoute) {
onRoute?.(route);
let cursor = start;
{
const path = route.fullPath ?? route.from;
const length = path.length;
const caseSensitive = route.options?.caseSensitive ?? defaultCaseSensitive;
const parseParams = route.options?.params?.parse ?? route.options?.parseParams;
while (cursor < length) {
const segment = parseSegment(path, cursor, data);
let nextNode;
const start = cursor;
const end = segment[5];
cursor = end + 1;
depth++;
switch (segment[0]) {
case 0: {
const value = path.substring(segment[2], segment[3]);
if (caseSensitive) {
const existingNode = node.static?.get(value);
if (existingNode) nextNode = existingNode;
else {
node.static ??= /* @__PURE__ */ new Map();
const next = createStaticNode(route.fullPath ?? route.from);
next.parent = node;
next.depth = depth;
nextNode = next;
node.static.set(value, next);
}
} else {
const name = value.toLowerCase();
const existingNode = node.staticInsensitive?.get(name);
if (existingNode) nextNode = existingNode;
else {
node.staticInsensitive ??= /* @__PURE__ */ new Map();
const next = createStaticNode(route.fullPath ?? route.from);
next.parent = node;
next.depth = depth;
nextNode = next;
node.staticInsensitive.set(name, next);
}
}
break;
}
case 1: {
const prefix_raw = path.substring(start, segment[1]);
const suffix_raw = path.substring(segment[4], end);
const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);
const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();
const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();
const existingNode = !parseParams && node.dynamic?.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);
if (existingNode) nextNode = existingNode;
else {
const next = createDynamicNode(1, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);
nextNode = next;
next.depth = depth;
next.parent = node;
node.dynamic ??= [];
node.dynamic.push(next);
}
break;
}
case 3: {
const prefix_raw = path.substring(start, segment[1]);
const suffix_raw = path.substring(segment[4], end);
const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);
const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();
const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();
const existingNode = !parseParams && node.optional?.find((s) => !s.parse && s.caseSensitive === actuallyCaseSensitive && s.prefix === prefix && s.suffix === suffix);
if (existingNode) nextNode = existingNode;
else {
const next = createDynamicNode(3, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);
nextNode = next;
next.parent = node;
next.depth = depth;
node.optional ??= [];
node.optional.push(next);
}
break;
}
case 2: {
const prefix_raw = path.substring(start, segment[1]);
const suffix_raw = path.substring(segment[4], end);
const actuallyCaseSensitive = caseSensitive && !!(prefix_raw || suffix_raw);
const prefix = !prefix_raw ? void 0 : actuallyCaseSensitive ? prefix_raw : prefix_raw.toLowerCase();
const suffix = !suffix_raw ? void 0 : actuallyCaseSensitive ? suffix_raw : suffix_raw.toLowerCase();
const next = createDynamicNode(2, route.fullPath ?? route.from, actuallyCaseSensitive, prefix, suffix);
nextNode = next;
next.parent = node;
next.depth = depth;
node.wildcard ??= [];
node.wildcard.push(next);
}
}
node = nextNode;
}
if (parseParams && route.children && !route.isRoot && route.id && route.id.charCodeAt(route.id.lastIndexOf("/") + 1) === 95) {
const pathlessNode = createStaticNode(route.fullPath ?? route.from);
pathlessNode.kind = SEGMENT_TYPE_PATHLESS;
pathlessNode.parent = node;
depth++;
pathlessNode.depth = depth;
node.pathless ??= [];
node.pathless.push(pathlessNode);
node = pathlessNode;
}
const isLeaf = (route.path || !route.children) && !route.isRoot;
if (isLeaf && path.endsWith("/")) {
const indexNode = createStaticNode(route.fullPath ?? route.from);
indexNode.kind = SEGMENT_TYPE_INDEX;
indexNode.parent = node;
depth++;
indexNode.depth = depth;
node.index = indexNode;
node = indexNode;
}
node.parse = parseParams ?? null;
if (isLeaf && !node.route) {
node.route = route;
node.fullPath = route.fullPath ?? route.from;
}
}
if (route.children) for (const child of route.children) parseSegments(defaultCaseSensitive, data, child, cursor, node, depth, onRoute);
}
function sortDynamic(a, b) {
if (a.parse && !b.parse) return -1;
if (!a.parse && b.parse) return 1;
if (a.prefix && b.prefix && a.prefix !== b.prefix) {
if (a.prefix.startsWith(b.prefix)) return -1;
if (b.prefix.startsWith(a.prefix)) return 1;
}
if (a.suffix && b.suffix && a.suffix !== b.suffix) {
if (a.suffix.endsWith(b.suffix)) return -1;
if (b.suffix.endsWith(a.suffix)) return 1;
}
if (a.prefix && !b.prefix) return -1;
if (!a.prefix && b.prefix) return 1;
if (a.suffix && !b.suffix) return -1;
if (!a.suffix && b.suffix) return 1;
if (a.caseSensitive && !b.caseSensitive) return -1;
if (!a.caseSensitive && b.caseSensitive) return 1;
return 0;
}
function sortTreeNodes(node) {
if (node.pathless) for (const child of node.pathless) sortTreeNodes(child);
if (node.static) for (const child of node.static.values()) sortTreeNodes(child);
if (node.staticInsensitive) for (const child of node.staticInsensitive.values()) sortTreeNodes(child);
if (node.dynamic?.length) {
node.dynamic.sort(sortDynamic);
for (const child of node.dynamic) sortTreeNodes(child);
}
if (node.optional?.length) {
node.optional.sort(sortDynamic);
for (const child of node.optional) sortTreeNodes(child);
}
if (node.wildcard?.length) {
node.wildcard.sort(sortDynamic);
for (const child of node.wildcard) sortTreeNodes(child);
}
}
function createStaticNode(fullPath) {
return {
kind: 0,
depth: 0,
pathless: null,
index: null,
static: null,
staticInsensitive: null,
dynamic: null,
optional: null,
wildcard: null,
route: null,
fullPath,
parent: null,
parse: null
};
}
/**
* Keys must be declared in the same order as in `SegmentNode` type,
* to ensure they are represented as the same object class in the engine.
*/
function createDynamicNode(kind, fullPath, caseSensitive, prefix, suffix) {
return {
kind,
depth: 0,
pathless: null,
index: null,
static: null,
staticInsensitive: null,
dynamic: null,
optional: null,
wildcard: null,
route: null,
fullPath,
parent: null,
parse: null,
caseSensitive,
prefix,
suffix
};
}
function processRouteMasks(routeList, processedTree) {
const segmentTree = createStaticNode("/");
const data = new Uint16Array(6);
for (const route of routeList) parseSegments(false, data, route, 1, segmentTree, 0);
sortTreeNodes(segmentTree);
processedTree.masksTree = segmentTree;
processedTree.flatCache = createLRUCache(1e3);
}
/**
* Take an arbitrary list of routes, create a tree from them (if it hasn't been created already), and match a path against it.
*/
function findFlatMatch(path, processedTree) {
path ||= "/";
const cached = processedTree.flatCache.get(path);
if (cached) return cached;
const result = findMatch(path, processedTree.masksTree);
processedTree.flatCache.set(path, result);
return result;
}
/**
* @deprecated keep until v2 so that `router.matchRoute` can keep not caring about the actual route tree
*/
function findSingleMatch(from, caseSensitive, fuzzy, path, processedTree) {
from ||= "/";
path ||= "/";
const key = caseSensitive ? `case\0${from}` : from;
let tree = processedTree.singleCache.get(key);
if (!tree) {
tree = createStaticNode("/");
parseSegments(caseSensitive, new Uint16Array(6), { from }, 1, tree, 0);
processedTree.singleCache.set(key, tree);
}
return findMatch(path, tree, fuzzy);
}
function findRouteMatch(path, processedTree, fuzzy = false) {
const key = fuzzy ? path : `nofuzz\0${path}`;
const cached = processedTree.matchCache.get(key);
if (cached !== void 0) return cached;
path ||= "/";
let result;
try {
result = findMatch(path, processedTree.segmentTree, fuzzy);
} catch (err) {
if (err instanceof URIError) result = null;
else throw err;
}
if (result) result.branch = buildRouteBranch(result.route);
processedTree.matchCache.set(key, result);
return result;
}
/** Trim trailing slashes (except preserving root '/'). */
function trimPathRight(path) {
return path === "/" ? path : path.replace(/\/{1,}$/, "");
}
/**
* Processes a route tree into a segment trie for efficient path matching.
* Also builds lookup maps for routes by ID and by trimmed full path.
*/
function processRouteTree(routeTree, caseSensitive = false, initRoute) {
const segmentTree = createStaticNode(routeTree.fullPath);
const data = new Uint16Array(6);
const routesById = {};
const routesByPath = {};
let index = 0;
parseSegments(caseSensitive, data, routeTree, 1, segmentTree, 0, (route) => {
initRoute?.(route, index);
if (route.id in routesById) {
if (process.env.NODE_ENV !== "production") throw new Error(`Invariant failed: Duplicate routes found with id: ${String(route.id)}`);
invariant();
}
routesById[route.id] = route;
if (index !== 0 && route.path) {
const trimmedFullPath = trimPathRight(route.fullPath);
if (!routesByPath[trimmedFullPath] || route.fullPath.endsWith("/")) routesByPath[trimmedFullPath] = route;
}
index++;
});
sortTreeNodes(segmentTree);
return {
processedTree: {
segmentTree,
singleCache: createLRUCache(1e3),
matchCache: createLRUCache(1e3),
flatCache: null,
masksTree: null
},
routesById,
routesByPath
};
}
function findMatch(path, segmentTree, fuzzy = false) {
const parts = path.split("/");
const leaf = getNodeMatch(path, parts, segmentTree, fuzzy);
if (!leaf) return null;
const [rawParams] = extractParams(path, parts, leaf);
return {
route: leaf.node.route,
rawParams
};
}
/**
* This function is "resumable":
* - the `leaf` input can contain `extract` and `rawParams` properties from a previous `extractParams` call
* - the returned `state` can be passed back as `extract` in a future call to continue extracting params from where we left off
*
* Inputs are *not* mutated.
*/
function extractParams(path, parts, leaf) {
const list = buildBranch(leaf.node);
let nodeParts = null;
const rawParams = Object.create(null);
/** which segment of the path we're currently processing */
let partIndex = leaf.extract?.part ?? 0;
/** which node of the route tree branch we're currently processing */
let nodeIndex = leaf.extract?.node ?? 0;
/** index of the 1st character of the segment we're processing in the path string */
let pathIndex = leaf.extract?.path ?? 0;
/** which fullPath segment we're currently processing */
let segmentCount = leaf.extract?.segment ?? 0;
for (; nodeIndex < list.length; partIndex++, nodeIndex++, pathIndex++, segmentCount++) {
const node = list[nodeIndex];
if (node.kind === SEGMENT_TYPE_INDEX) break;
if (node.kind === SEGMENT_TYPE_PATHLESS) {
segmentCount--;
partIndex--;
pathIndex--;
continue;
}
const part = parts[partIndex];
const currentPathIndex = pathIndex;
if (part) pathIndex += part.length;
if (node.kind === 1) {
nodeParts ??= leaf.node.fullPath.split("/");
const nodePart = nodeParts[segmentCount];
const preLength = node.prefix?.length ?? 0;
if (nodePart.charCodeAt(preLength) === 123) {
const sufLength = node.suffix?.length ?? 0;
const name = nodePart.substring(preLength + 2, nodePart.length - sufLength - 1);
const value = part.substring(preLength, part.length - sufLength);
rawParams[name] = decodeURIComponent(value);
} else {
const name = nodePart.substring(1);
rawParams[name] = decodeURIComponent(part);
}
} else if (node.kind === 3) {
if (leaf.skipped & 1 << nodeIndex) {
partIndex--;
pathIndex = currentPathIndex - 1;
continue;
}
nodeParts ??= leaf.node.fullPath.split("/");
const nodePart = nodeParts[segmentCount];
const preLength = node.prefix?.length ?? 0;
const sufLength = node.suffix?.length ?? 0;
const name = nodePart.substring(preLength + 3, nodePart.length - sufLength - 1);
const value = node.suffix || node.prefix ? part.substring(preLength, part.length - sufLength) : part;
if (value) rawParams[name] = decodeURIComponent(value);
} else if (node.kind === 2) {
const n = node;
const value = path.substring(currentPathIndex + (n.prefix?.length ?? 0), path.length - (n.suffix?.length ?? 0));
const splat = decodeURIComponent(value);
rawParams["*"] = splat;
rawParams._splat = splat;
break;
}
}
if (leaf.rawParams) Object.assign(rawParams, leaf.rawParams);
return [rawParams, {
part: partIndex,
node: nodeIndex,
path: pathIndex,
segment: segmentCount
}];
}
function buildRouteBranch(route) {
const list = [route];
while (route.parentRoute) {
route = route.parentRoute;
list.push(route);
}
list.reverse();
return list;
}
function buildBranch(node) {
const list = Array(node.depth + 1);
do {
list[node.depth] = node;
node = node.parent;
} while (node);
return list;
}
function getNodeMatch(path, parts, segmentTree, fuzzy) {
if (path === "/" && segmentTree.index) return {
node: segmentTree.index,
skipped: 0
};
const trailingSlash = !last(parts);
const pathIsIndex = trailingSlash && path !== "/";
const partsLength = parts.length - (trailingSlash ? 1 : 0);
const stack = [{
node: segmentTree,
index: 1,
skipped: 0,
depth: 1,
statics: 0,
dynamics: 0,
optionals: 0
}];
let bestFuzzy = null;
let bestMatch = null;
while (stack.length) {
const frame = stack.pop();
const { node, index, skipped, depth, statics, dynamics, optionals } = frame;
let { extract, rawParams } = frame;
if (node.kind === 2 && node.route && !isFrameMoreSpecific(bestMatch, frame)) continue;
if (node.parse) {
if (!validateParseParams(path, parts, frame)) continue;
rawParams = frame.rawParams;
extract = frame.extract;
}
if (fuzzy && node.route && node.kind !== SEGMENT_TYPE_INDEX && isFrameMoreSpecific(bestFuzzy, frame)) bestFuzzy = frame;
const isBeyondPath = index === partsLength;
if (isBeyondPath) {
if (node.route && (!pathIsIndex || node.kind === SEGMENT_TYPE_INDEX || node.kind === 2) && isFrameMoreSpecific(bestMatch, frame)) bestMatch = frame;
if (!node.optional && !node.wildcard && !node.index && !node.pathless) continue;
}
const part = isBeyondPath ? void 0 : parts[index];
let lowerPart;
if (isBeyondPath && node.index) {
const indexFrame = {
node: node.index,
index,
skipped,
depth: depth + 1,
statics,
dynamics,
optionals,
extract,
rawParams
};
let indexValid = true;
if (node.index.parse) {
if (!validateParseParams(path, parts, indexFrame)) indexValid = false;
}
if (indexValid) {
if (!dynamics && !optionals && !skipped && isPerfectStaticMatch(statics, partsLength)) return indexFrame;
if (isFrameMoreSpecific(bestMatch, indexFrame)) bestMatch = indexFrame;
}
}
if (node.wildcard) for (let i = node.wildcard.length - 1; i >= 0; i--) {
const segment = node.wildcard[i];
const { prefix, suffix } = segment;
if (prefix) {
if (isBeyondPath) continue;
if (!(segment.caseSensitive ? part : lowerPart ??= part.toLowerCase()).startsWith(prefix)) continue;
}
if (suffix) {
if (isBeyondPath) continue;
const end = parts.slice(index).join("/").slice(-suffix.length);
if ((segment.caseSensitive ? end : end.toLowerCase()) !== suffix) continue;
}
stack.push({
node: segment,
index: partsLength,
skipped,
depth: depth + 1,
statics,
dynamics,
optionals,
extract,
rawParams
});
}
if (node.optional) {
const nextSkipped = skipped | 1 << depth;
const nextDepth = depth + 1;
for (let i = node.optional.length - 1; i >= 0; i--) {
const segment = node.optional[i];
stack.push({
node: segment,
index,
skipped: nextSkipped,
depth: nextDepth,
statics,
dynamics,
optionals,
extract,
rawParams
});
}
if (!isBeyondPath) for (let i = node.optional.length - 1; i >= 0; i--) {
const segment = node.optional[i];
const { prefix, suffix } = segment;
if (prefix || suffix) {
const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();
if (prefix && !casePart.startsWith(prefix)) continue;
if (suffix && !casePart.endsWith(suffix)) continue;
}
stack.push({
node: segment,
index: index + 1,
skipped,
depth: nextDepth,
statics,
dynamics,
optionals: optionals + segmentScore(partsLength, index),
extract,
rawParams
});
}
}
if (!isBeyondPath && node.dynamic && part) for (let i = node.dynamic.length - 1; i >= 0; i--) {
const segment = node.dynamic[i];
const { prefix, suffix } = segment;
if (prefix || suffix) {
const casePart = segment.caseSensitive ? part : lowerPart ??= part.toLowerCase();
if (prefix && !casePart.startsWith(prefix)) continue;
if (suffix && !casePart.endsWith(suffix)) continue;
}
stack.push({
node: segment,
index: index + 1,
skipped,
depth: depth + 1,
statics,
dynamics: dynamics + segmentScore(partsLength, index),
optionals,
extract,
rawParams
});
}
if (!isBeyondPath && node.staticInsensitive) {
const match = node.staticInsensitive.get(lowerPart ??= part.toLowerCase());
if (match) stack.push({
node: match,
index: index + 1,
skipped,
depth: depth + 1,
statics: statics + segmentScore(partsLength, index),
dynamics,
optionals,
extract,
rawParams
});
}
if (!isBeyondPath && node.static) {
const match = node.static.get(part);
if (match) stack.push({
node: match,
index: index + 1,
skipped,
depth: depth + 1,
statics: statics + segmentScore(partsLength, index),
dynamics,
optionals,
extract,
rawParams
});
}
if (node.pathless) {
const nextDepth = depth + 1;
for (let i = node.pathless.length - 1; i >= 0; i--) {
const segment = node.pathless[i];
stack.push({
node: segment,
index,
skipped,
depth: nextDepth,
statics,
dynamics,
optionals,
extract,
rawParams
});
}
}
}
if (bestMatch) return bestMatch;
if (fuzzy && bestFuzzy) {
let sliceIndex = bestFuzzy.index;
for (let i = 0; i < bestFuzzy.index; i++) sliceIndex += parts[i].length;
const splat = sliceIndex === path.length ? "/" : path.slice(sliceIndex);
bestFuzzy.rawParams ??= Object.create(null);
bestFuzzy.rawParams["**"] = decodeURIComponent(splat);
return bestFuzzy;
}
return null;
}
function segmentScore(partsLength, index) {
return 2 ** (partsLength - index - 1);
}
function isPerfectStaticMatch(statics, partsLength) {
return statics === 2 ** (partsLength - 1) - 1;
}
function validateParseParams(path, parts, frame) {
let rawParams;
let state;
try {
[rawParams, state] = extractParams(path, parts, frame);
} catch {
return null;
}
frame.rawParams = rawParams;
frame.extract = state;
if (!frame.node.parse) return true;
try {
if (frame.node.parse(rawParams) === false) return null;
} catch {}
return true;
}
function isFrameMoreSpecific(prev, next) {
if (!prev) return true;
return next.statics > prev.statics || next.statics === prev.statics && (next.dynamics > prev.dynamics || next.dynamics === prev.dynamics && (next.optionals > prev.optionals || next.optionals === prev.optionals && ((next.node.kind === SEGMENT_TYPE_INDEX) > (prev.node.kind === SEGMENT_TYPE_INDEX) || next.node.kind === SEGMENT_TYPE_INDEX === (prev.node.kind === SEGMENT_TYPE_INDEX) && next.depth > prev.depth)));
}
//#endregion
export { buildRouteBranch, findFlatMatch, findRouteMatch, findSingleMatch, parseSegment, processRouteMasks, processRouteTree };
//# sourceMappingURL=new-process-route-tree.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":";;;AAoHA,oEAgBC;AApID,uDAA+G;AAG/G,0CAiDqB;AACrB,mEAAuE;AAEvE,2DAAoH;AAEpH,+DAA0E;AAC1E,iEAAoH;AAEpH;;;;;GAKG;AACH,SAAS,wBAAwB,CAA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CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,IAAW,EAAE,IAAY,EAAE,OAAqB,EAAE,EAAE,CACrE,IAAI,CAAC,MAAM,EAAE,IAAI,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA","sourcesContent":["/**\n * This is the Windows implementation of isexe, which uses the file\n * extension and PATHEXT setting.\n *\n * @module\n */\n\nimport { Stats, statSync } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { IsexeOptions } from './options.js'\nimport { delimiter } from 'node:path'\n\n/**\n * Determine whether a path is executable based on the file extension\n * and PATHEXT environment variable (or specified pathExt option)\n */\nexport const isexe = async (\n path: string,\n options: IsexeOptions = {},\n): Promise<boolean> => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(await stat(path), path, options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\n/**\n * Synchronously determine whether a path is executable based on the file\n * extension and PATHEXT environment variable (or specified pathExt option)\n */\nexport const sync = (\n path: string,\n options: IsexeOptions = {},\n): boolean => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(statSync(path), path, options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\nconst checkPathExt = (path: string, options: IsexeOptions) => {\n const { pathExt = process.env.PATHEXT || '' } = options\n const peSplit = pathExt.split(delimiter)\n if (peSplit.indexOf('') !== -1) {\n return true\n }\n\n for (const pes of peSplit) {\n const p = pes.toLowerCase()\n const ext = path.substring(path.length - p.length).toLowerCase()\n\n if (p && ext === p) {\n return true\n }\n }\n return false\n}\n\nconst checkStat = (stat: Stats, path: string, options: IsexeOptions) =>\n stat.isFile() && checkPathExt(path, options)\n"]}
@@ -0,0 +1,23 @@
//#region \0rolldown/runtime.js
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
key = keys[i];
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
get: ((k) => from[k]).bind(null, key),
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
});
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
value: mod,
enumerable: true
}) : target, mod));
//#endregion
exports.__toESM = __toESM;
@@ -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 Flower2 = createLucideIcon("Flower2", [
[
"path",
{
d: "M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1",
key: "3pnvol"
}
],
["circle", { cx: "12", cy: "8", r: "2", key: "1822b1" }],
["path", { d: "M12 10v12", key: "6ubwww" }],
["path", { d: "M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z", key: "9hd38g" }],
["path", { d: "M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z", key: "ufn41s" }]
]);
export { Flower2 as default };
//# sourceMappingURL=flower-2.js.map