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,101 @@
import { AddressInfo } from "node:net";
import { IncomingMessage, Server, ServerOptions, ServerResponse, createServer } from "node:http";
import { Http2SecureServer, Http2Server, Http2ServerRequest, Http2ServerResponse, SecureServerOptions, ServerOptions as ServerOptions$1, createSecureServer, createServer as createServer$1 } from "node:http2";
import { ServerOptions as ServerOptions$2, createServer as createServer$2 } from "node:https";
import { Duplex } from "node:stream";
import { UpgradeWebSocket } from "hono/ws";
//#region src/websocket-types.d.ts
type WSReadyState = 0 | 1 | 2 | 3;
type WebSocketData = string | ArrayBuffer | Uint8Array | readonly Uint8Array[];
type WebSocketSendOptions = {
compress?: boolean;
};
interface WebSocketLike {
protocol: string;
readyState: WSReadyState;
close(code?: number, reason?: string): void;
send(data: string | ArrayBuffer | ArrayBufferView, options?: WebSocketSendOptions): void;
on(event: 'message', listener: (data: WebSocketData, isBinary: boolean) => void): this;
on(event: 'close', listener: (code: number, reason: Uint8Array) => void): this;
on(event: 'error', listener: (error: unknown) => void): this;
off(event: 'message', listener: (data: WebSocketData, isBinary: boolean) => void): this;
}
interface WebSocketServerLike {
options: {
noServer?: boolean;
};
on(event: 'connection', listener: (ws: WebSocketLike, request: IncomingMessage) => void): this;
on(event: 'headers', listener: (headers: string[]) => void): this;
off(event: 'headers', listener: (headers: string[]) => void): this;
emit(event: 'connection', ws: WebSocketLike, request: IncomingMessage): boolean;
handleUpgrade(request: IncomingMessage, socket: Duplex, head: Buffer, callback: (ws: WebSocketLike) => void): void;
close(): void;
}
//#endregion
//#region src/types.d.ts
type HttpBindings = {
incoming: IncomingMessage;
outgoing: ServerResponse;
};
type Http2Bindings = {
incoming: Http2ServerRequest;
outgoing: Http2ServerResponse;
};
type FetchCallback = (request: Request, env: HttpBindings | Http2Bindings) => Promise<unknown> | unknown;
type ServerType = Server | Http2Server | Http2SecureServer;
type createHttpOptions = {
serverOptions?: ServerOptions;
createServer?: typeof createServer;
};
type createHttpsOptions = {
serverOptions?: ServerOptions$2;
createServer?: typeof createServer$2;
};
type createHttp2Options = {
serverOptions?: ServerOptions$1;
createServer?: typeof createServer$1;
};
type createSecureHttp2Options = {
serverOptions?: SecureServerOptions;
createServer?: typeof createSecureServer;
};
type ServerOptions$3 = createHttpOptions | createHttpsOptions | createHttp2Options | createSecureHttp2Options;
type Options = {
fetch: FetchCallback;
overrideGlobalObjects?: boolean;
autoCleanupIncoming?: boolean;
port?: number;
hostname?: string;
websocket?: {
server: WebSocketServerLike;
};
} & ServerOptions$3;
type CustomErrorHandler = (err: unknown) => void | Response | Promise<void | Response>;
//#endregion
//#region src/server.d.ts
declare const createAdaptorServer: (options: Options) => ServerType;
declare const serve: (options: Options, listeningListener?: (info: AddressInfo) => void) => ServerType;
//#endregion
//#region src/websocket.d.ts
type UpgradeWebSocketOptions = {
onError: (err: unknown) => void;
};
declare const upgradeWebSocket: UpgradeWebSocket<WebSocketLike, UpgradeWebSocketOptions>;
//#endregion
//#region src/listener.d.ts
declare const getRequestListener: (fetchCallback: FetchCallback, options?: {
hostname?: string;
errorHandler?: CustomErrorHandler;
overrideGlobalObjects?: boolean;
autoCleanupIncoming?: boolean;
}) => (incoming: IncomingMessage | Http2ServerRequest, outgoing: ServerResponse | Http2ServerResponse) => Promise<void>;
//#endregion
//#region src/error.d.ts
declare class RequestError extends Error {
constructor(message: string, options?: {
cause?: unknown;
});
}
//#endregion
export { type Http2Bindings, type HttpBindings, RequestError, type ServerType, type WebSocketData, type WebSocketLike, type WebSocketServerLike, createAdaptorServer, getRequestListener, serve, upgradeWebSocket };
@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const GitMerge = createLucideIcon("GitMerge", [
["circle", { cx: "18", cy: "18", r: "3", key: "1xkwt0" }],
["circle", { cx: "6", cy: "6", r: "3", key: "1lh9wr" }],
["path", { d: "M6 21V9a9 9 0 0 0 9 9", key: "7kw0sc" }]
]);
export { GitMerge as default };
//# sourceMappingURL=git-merge.js.map
@@ -0,0 +1,14 @@
"use strict";
const normalizeUnit = require("./normalizeUnit-Cn0hUyBC.js");
const endOf = require("./endOf.js");
const parse = require("./parse.js");
const startOf = require("./startOf.js");
function isSame(date, input, unit) {
unit = normalizeUnit.normalizeUnit(unit);
const inputMs = +parse(input);
if (!unit) {
return +date === inputMs;
}
return +startOf(new Date(date), unit) <= inputMs && inputMs <= +endOf(new Date(date), unit);
}
module.exports = isSame;
@@ -0,0 +1,45 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.parse = void 0;
exports.parseAsync = parseAsync;
exports.parseSync = parseSync;
function _gensync() {
const data = require("gensync");
_gensync = function () {
return data;
};
return data;
}
var _index = require("./config/index.js");
var _index2 = require("./parser/index.js");
var _normalizeOpts = require("./transformation/normalize-opts.js");
var _rewriteStackTrace = require("./errors/rewrite-stack-trace.js");
const parseRunner = _gensync()(function* parse(code, opts) {
const config = yield* (0, _index.default)(opts);
if (config === null) {
return null;
}
return yield* (0, _index2.default)(config.passes, (0, _normalizeOpts.default)(config), code);
});
const parse = exports.parse = function parse(code, opts, callback) {
if (typeof opts === "function") {
callback = opts;
opts = undefined;
}
if (callback === undefined) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(code, opts);
}
(0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.errback)(code, opts, callback);
};
function parseSync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.sync)(...args);
}
function parseAsync(...args) {
return (0, _rewriteStackTrace.beginHiddenCallStack)(parseRunner.async)(...args);
}
0 && 0;
//# sourceMappingURL=parse.js.map
@@ -0,0 +1,287 @@
/**
* @fileoverview Main Espree file that converts Acorn into Esprima output.
*
* This file contains code from the following MIT-licensed projects:
* 1. Acorn
* 2. Babylon
* 3. Babel-ESLint
*
* This file also contains code from Esprima, which is BSD licensed.
*
* Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS)
* Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS)
* Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie <sebmck@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import * as acorn from "acorn";
import jsx from "acorn-jsx";
import espree from "./lib/espree.js";
import { KEYS as VisitorKeys } from "eslint-visitor-keys";
import {
getLatestEcmaVersion,
getSupportedEcmaVersions,
} from "./lib/options.js";
/**
* @import { EspreeParserCtor, EspreeParserJsxCtor } from "./lib/types.js";
*/
// ----------------------------------------------------------------------------
// Types exported from file
// ----------------------------------------------------------------------------
/**
* @typedef {3|5|6|7|8|9|10|11|12|13|14|15|16|17|2015|2016|2017|2018|2019|2020|2021|2022|2023|2024|2025|2026|'latest'} EcmaVersion
*/
/**
* @typedef {{
* type: string;
* value: any;
* start?: number;
* end?: number;
* loc?: acorn.SourceLocation;
* range?: [number, number];
* regex?: {flags: string, pattern: string};
* }} EspreeToken
*/
/**
* @typedef {{
* type: "Block" | "Hashbang" | "Line",
* value: string,
* range?: [number, number],
* start?: number,
* end?: number,
* loc?: {
* start: acorn.Position | undefined,
* end: acorn.Position | undefined
* }
* }} EspreeComment
*/
/**
* @typedef {{
* comments?: EspreeComment[]
* } & EspreeToken[]} EspreeTokens
*/
/**
* `allowReserved` is as in `acorn.Options`
*
* `ecmaVersion` currently as in `acorn.Options` though optional
*
* `sourceType` as in `acorn.Options` but also allows `commonjs`
*
* `ecmaFeatures`, `range`, `loc`, `tokens` are not in `acorn.Options`
*
* `comment` is not in `acorn.Options` and doesn't err without it, but is used
*/
/**
* @typedef {{
* allowReserved?: boolean,
* ecmaVersion?: EcmaVersion,
* sourceType?: "script"|"module"|"commonjs",
* ecmaFeatures?: {
* jsx?: boolean,
* globalReturn?: boolean,
* impliedStrict?: boolean
* },
* range?: boolean,
* loc?: boolean,
* tokens?: boolean,
* comment?: boolean,
* }} Options
*/
// To initialize lazily.
const parsers = {
/** @type {EspreeParserCtor|null} */
_regular: null,
/** @type {EspreeParserJsxCtor|null} */
_jsx: null,
/**
* Returns regular Parser
* @returns {EspreeParserCtor} Regular Acorn parser
*/
get regular() {
if (this._regular === null) {
const espreeParserFactory = /** @type {unknown} */ (espree());
this._regular = /** @type {EspreeParserCtor} */ (
// Without conversion, types are incompatible, as
// acorn's has a protected constructor
/** @type {unknown} */
(
acorn.Parser.extend(
/**
* @type {(
* BaseParser: typeof acorn.Parser
* ) => typeof acorn.Parser}
*/ (espreeParserFactory),
)
)
);
}
return this._regular;
},
/**
* Returns JSX Parser
* @returns {EspreeParserJsxCtor} JSX Acorn parser
*/
get jsx() {
if (this._jsx === null) {
const espreeParserFactory = /** @type {unknown} */ (espree());
const jsxFactory = jsx();
this._jsx = /** @type {EspreeParserJsxCtor} */ (
// Without conversion, types are incompatible, as
// acorn's has a protected constructor
/** @type {unknown} */
(
acorn.Parser.extend(
jsxFactory,
/** @type {(BaseParser: typeof acorn.Parser) => typeof acorn.Parser} */
(espreeParserFactory),
)
)
);
}
return this._jsx;
},
/**
* Gets the parser object based on the supplied options.
* @param {Options} [options] The parser options.
* @returns {EspreeParserJsxCtor|EspreeParserCtor} Regular or JSX Acorn parser
*/
get(options) {
const useJsx = Boolean(
options && options.ecmaFeatures && options.ecmaFeatures.jsx,
);
return useJsx ? this.jsx : this.regular;
},
};
//------------------------------------------------------------------------------
// Tokenizer
//------------------------------------------------------------------------------
/**
* Tokenizes the given code.
* @param {string} code The code to tokenize.
* @param {Options} [options] Options defining how to tokenize.
* @returns {EspreeTokens} An array of tokens.
* @throws {EnhancedSyntaxError} If the input code is invalid.
* @private
*/
export function tokenize(code, options) {
const Parser = parsers.get(options);
// Ensure to collect tokens.
if (!options || options.tokens !== true) {
options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign -- stylistic choice
}
return /** @type {EspreeTokens} */ (new Parser(options, code).tokenize());
}
//------------------------------------------------------------------------------
// Parser
//------------------------------------------------------------------------------
/**
* Parses the given code.
* @param {string} code The code to tokenize.
* @param {Options} [options] Options defining how to tokenize.
* @returns {acorn.Program} The "Program" AST node.
* @throws {EnhancedSyntaxError} If the input code is invalid.
*/
export function parse(code, options) {
const Parser = parsers.get(options);
return new Parser(options, code).parse();
}
//------------------------------------------------------------------------------
// Public
//------------------------------------------------------------------------------
/** @type {string} */
export const version = "11.2.0"; // x-release-please-version
export const name = "espree";
// Derive node types from VisitorKeys
export const Syntax = /* #__PURE__ */ (function () {
let key,
/** @type {Record<string,string>} */
types = {};
if (typeof Object.create === "function") {
types = Object.create(null);
}
for (key in VisitorKeys) {
if (Object.hasOwn(VisitorKeys, key)) {
types[key] = key;
}
}
if (typeof Object.freeze === "function") {
Object.freeze(types);
}
return types;
})();
export const latestEcmaVersion = /* #__PURE__ */ getLatestEcmaVersion();
export const supportedEcmaVersions = /* #__PURE__ */ getSupportedEcmaVersions();
export { KEYS as VisitorKeys } from "eslint-visitor-keys";
@@ -0,0 +1 @@
{"version":3,"file":"uriTemplate.js","sourceRoot":"","sources":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CAAC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;YACpF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;gBAAE,OAAO,EAAE,CAAC;YACnC,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACpE,CAAC;QAED,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,EAAE,CAAC;QAEnC,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACtD,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;QAEpE,QAAQ,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpB,KAAK,EAAE;gBACH,OAAO,OAAO,CAAC,IAAI,CAAC,GLine truncated
@@ -0,0 +1 @@
{"version":3,"file":"letter-text.js","sources":["../../../src/icons/letter-text.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name LetterText\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgMTJoNiIgLz4KICA8cGF0aCBkPSJNMTUgNmg2IiAvPgogIDxwYXRoIGQ9Im0zIDEzIDMuNTUzLTcuNzI0YS41LjUgMCAwIDEgLjg5NCAwTDExIDEzIiAvPgogIDxwYXRoIGQ9Ik0zIDE4aDE4IiAvPgogIDxwYXRoIGQ9Ik00IDExaDYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/letter-text\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 LetterText = createLucideIcon('LetterText', [\n ['path', { d: 'M15 12h6', key: 'upa0zy' }],\n ['path', { d: 'M15 6h6', key: '1jlkvy' }],\n ['path', { d: 'm3 13 3.553-7.724a.5.5 0 0 1 .894 0L11 13', key: 'blevx4' }],\n ['path', { d: 'M3 18h18', key: '1h113x' }],\n ['path', { d: 'M4 11h6', key: 'olkgv1' }],\n]);\n\nexport default LetterText;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA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,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,GAAG,GAAG,CAAA;IAC7D,MAAM,IAAI,GACR,GAAG;QACH,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,GAAG,KAAK,GAAG,GAAG;YACjE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;gBACzB,CAAC,CAAC,KAAK,CAAC,CAAA;IAEV,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC,CAAA;AAC9D,CAAC,CAAA","sourcesContent":["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { <posix class>: [<translation>, negated]\nconst posixClasses: { [k: string]: [e: string, n?: boolean] } = {\n '[Line truncated
@@ -0,0 +1 @@
{"version":3,"sources":["../src/compress.ts"],"sourcesContent":["const isCompactDoubleQuotedString = (string: string) => {\n // eslint-disable-next-line no-control-regex\n return !string.match(/[\\x00-\\x1f\\u2028\\u2029\\\\\"]/)\n}\n\nconst compressWithPrefix = (parsed: string[]) => {\n if (!Array.isArray(parsed)) {\n return parsed\n }\n if (\n !parsed.every(\n (entry) =>\n typeof entry === 'string' && isCompactDoubleQuotedString(entry),\n )\n ) {\n // Should be rare enough, so don't bother escape them.\n return parsed\n }\n\n const deltas: string[] = []\n let last = ''\n parsed.forEach((entry) => {\n let prefixLen = 0\n const maxPrefixLen = Math.min(entry.length, last.length, 25)\n while (\n prefixLen < maxPrefixLen &&\n entry.charAt(prefixLen) === last.charAt(prefixLen)\n ) {\n prefixLen += 1\n }\n deltas.push(String.fromCharCode(65 + prefixLen) + entry.slice(prefixLen))\n last = entry\n })\n\n return deltas.join('')\n}\n\nexport default function compress(data: string[]) {\n return compressWithPrefix(data)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MAAM,8BAA8B,CAAC,WAAmB;AAEtD,SAAO,CAAC,OAAO,MAAM,4BAA4B;AACnD;AAEA,MAAM,qBAAqB,CAAC,WAAqB;AAC/C,MAAI,CAAC,MAAM,QAAQ,MAAM,GAAG;AAC1B,WAAO;AAAA,EACT;AACA,MACE,CAAC,OAAO;AAAA,IACN,CAAC,UACC,OAAO,UAAU,YAAY,4BAA4B,KAAK;AAAA,EAClE,GACA;AAEA,WAAO;AAAA,EACT;AAEA,QAAM,SAAmB,CAAC;AAC1B,MAAI,OAAO;AACX,SAAO,QAAQ,CAAC,UAAU;AACxB,QAAI,YAAY;AAChB,UAAM,eAAe,KAAK,IAAI,MAAM,QAAQ,KAAK,QAAQ,EAAE;AAC3D,WACE,YAAY,gBACZ,MAAM,OAAO,SAAS,MAAM,KAAK,OAAO,SAAS,GACjD;AACA,mBAAa;AAAA,IACf;AACA,WAAO,KAAK,OAAO,aAAa,KAAK,SAAS,IAAI,MAAM,MAAM,SAAS,CAAC;AACxE,WAAO;AAAA,EACT,CAAC;AAED,SAAO,OAAO,KAAK,EAAE;AACvB;AAEe,SAAR,SAA0B,MAAgB;AAC/C,SAAO,mBAAmB,IAAI;AAChC;","names":[]}
@@ -0,0 +1,100 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_utils = require("./utils.cjs");
const require_invariant = require("./invariant.cjs");
const require_path = require("./path.cjs");
const require_not_found = require("./not-found.cjs");
const require_scroll_restoration = require("./scroll-restoration.cjs");
const require_qss = require("./qss.cjs");
const require_searchParams = require("./searchParams.cjs");
const require_root = require("./root.cjs");
const require_redirect = require("./redirect.cjs");
const require_rewrite = require("./rewrite.cjs");
const require_stores = require("./stores.cjs");
const require_router = require("./router.cjs");
const require_defer = require("./defer.cjs");
const require_link = require("./link.cjs");
const require_manifest = require("./manifest.cjs");
const require_Matches = require("./Matches.cjs");
const require_route = require("./route.cjs");
const require_config = require("./config.cjs");
const require_searchMiddleware = require("./searchMiddleware.cjs");
const require_hash_scroll = require("./hash-scroll.cjs");
const require_transformer = require("./ssr/serializer/transformer.cjs");
const require_RawStream = require("./ssr/serializer/RawStream.cjs");
const require_seroval_plugins = require("./ssr/serializer/seroval-plugins.cjs");
exports.BaseRootRoute = require_route.BaseRootRoute;
exports.BaseRoute = require_route.BaseRoute;
exports.BaseRouteApi = require_route.BaseRouteApi;
exports.DEFAULT_PROTOCOL_ALLOWLIST = require_utils.DEFAULT_PROTOCOL_ALLOWLIST;
exports.PathParamError = require_router.PathParamError;
exports.RawStream = require_RawStream.RawStream;
exports.RouterCore = require_router.RouterCore;
exports.SearchParamError = require_router.SearchParamError;
exports.TSR_DEFERRED_PROMISE = require_defer.TSR_DEFERRED_PROMISE;
exports.buildDevStylesUrl = require_utils.buildDevStylesUrl;
exports.cleanPath = require_path.cleanPath;
exports.composeRewrites = require_rewrite.composeRewrites;
exports.createControlledPromise = require_utils.createControlledPromise;
exports.createInlineCssStyleAsset = require_manifest.createInlineCssStyleAsset;
exports.createNonReactiveMutableStore = require_stores.createNonReactiveMutableStore;
exports.createNonReactiveReadonlyStore = require_stores.createNonReactiveReadonlyStore;
exports.createRawStreamDeserializePlugin = require_RawStream.createRawStreamDeserializePlugin;
exports.createRawStreamRPCPlugin = require_RawStream.createRawStreamRPCPlugin;
exports.createRouterConfig = require_config.createRouterConfig;
exports.createSerializationAdapter = require_transformer.createSerializationAdapter;
exports.decode = require_qss.decode;
exports.deepEqual = require_utils.deepEqual;
exports.defaultGetScrollRestorationKey = require_scroll_restoration.defaultGetScrollRestorationKey;
exports.defaultParseSearch = require_searchParams.defaultParseSearch;
exports.defaultSerializeError = require_router.defaultSerializeError;
exports.defaultSerovalPlugins = require_seroval_plugins.defaultSerovalPlugins;
exports.defaultStringifySearch = require_searchParams.defaultStringifySearch;
exports.defer = require_defer.defer;
exports.encode = require_qss.encode;
exports.escapeHtml = require_utils.escapeHtml;
exports.exactPathTest = require_path.exactPathTest;
exports.executeRewriteInput = require_rewrite.executeRewriteInput;
exports.functionalUpdate = require_utils.functionalUpdate;
exports.getAssetCrossOrigin = require_manifest.getAssetCrossOrigin;
exports.getElementScrollRestorationEntry = require_scroll_restoration.getElementScrollRestorationEntry;
exports.getInitialRouterState = require_router.getInitialRouterState;
exports.getLocationChangeInfo = require_router.getLocationChangeInfo;
exports.getMatchedRoutes = require_router.getMatchedRoutes;
exports.getStylesheetHref = require_manifest.getStylesheetHref;
exports.handleHashScroll = require_hash_scroll.handleHashScroll;
exports.hasKeys = require_utils.hasKeys;
exports.interpolatePath = require_path.interpolatePath;
exports.invariant = require_invariant.invariant;
exports.isDangerousProtocol = require_utils.isDangerousProtocol;
exports.isInlinableStylesheet = require_manifest.isInlinableStylesheet;
exports.isMatch = require_Matches.isMatch;
exports.isModuleNotFoundError = require_utils.isModuleNotFoundError;
exports.isNotFound = require_not_found.isNotFound;
exports.isPlainArray = require_utils.isPlainArray;
exports.isPlainObject = require_utils.isPlainObject;
exports.isRedirect = require_redirect.isRedirect;
exports.isResolvedRedirect = require_redirect.isResolvedRedirect;
exports.joinPaths = require_path.joinPaths;
exports.lazyFn = require_router.lazyFn;
exports.makeSerovalPlugin = require_transformer.makeSerovalPlugin;
exports.makeSsrSerovalPlugin = require_transformer.makeSsrSerovalPlugin;
exports.notFound = require_not_found.notFound;
exports.parseRedirect = require_redirect.parseRedirect;
exports.parseSearchWith = require_searchParams.parseSearchWith;
exports.preloadWarning = require_link.preloadWarning;
exports.redirect = require_redirect.redirect;
exports.removeTrailingSlash = require_path.removeTrailingSlash;
exports.replaceEqualDeep = require_utils.replaceEqualDeep;
exports.resolveManifestAssetLink = require_manifest.resolveManifestAssetLink;
exports.resolvePath = require_path.resolvePath;
exports.retainSearchParams = require_searchMiddleware.retainSearchParams;
exports.rootRouteId = require_root.rootRouteId;
exports.scrollRestorationCache = require_scroll_restoration.scrollRestorationCache;
exports.setupScrollRestoration = require_scroll_restoration.setupScrollRestoration;
exports.storageKey = require_scroll_restoration.storageKey;
exports.stringifySearchWith = require_searchParams.stringifySearchWith;
exports.stripSearchParams = require_searchMiddleware.stripSearchParams;
exports.trailingSlashOptions = require_router.trailingSlashOptions;
exports.trimPath = require_path.trimPath;
exports.trimPathLeft = require_path.trimPathLeft;
exports.trimPathRight = require_path.trimPathRight;
@@ -0,0 +1 @@
{"version":3,"file":"square-x.js","sources":["../../../src/icons/square-x.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquareX\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiByeT0iMiIgLz4KICA8cGF0aCBkPSJtMTUgOS02IDYiIC8+CiAgPHBhdGggZD0ibTkgOSA2IDYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/square-x\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 SquareX = createLucideIcon('SquareX', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', ry: '2', key: '1m3agn' }],\n ['path', { d: 'm15 9-6 6', key: '1uzhvr' }],\n ['path', { d: 'm9 9 6 6', key: 'z0biqf' }],\n]);\n\nexport default SquareX;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,KAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,EAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,KAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAA,EAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAU,CAAA,CAAA;AAAA,CAAA,CACvF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,13 @@
/**
* @license React
* use-sync-external-store.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
"use strict";
var useSyncExternalStore = require("react").useSyncExternalStore;
exports.useSyncExternalStore = useSyncExternalStore;
@@ -0,0 +1 @@
{"version":3,"file":"bookmark-check.js","sources":["../../../src/icons/bookmark-check.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BookmarkCheck\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTkgMjEtNy00LTcgNFY1YTIgMiAwIDAgMSAyLTJoMTBhMiAyIDAgMCAxIDIgMloiIC8+CiAgPHBhdGggZD0ibTkgMTAgMiAyIDQtNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/bookmark-check\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 BookmarkCheck = createLucideIcon('BookmarkCheck', [\n ['path', { d: 'm19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2Z', key: '169p4p' }],\n ['path', { d: 'm9 10 2 2 4-4', key: '1gnqz4' }],\n]);\n\nexport default BookmarkCheck;\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,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACjF,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 @@
{"version":3,"file":"shield-off.js","sources":["../../../src/icons/shield-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ShieldOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMiAyIDIwIDIwIiAvPgogIDxwYXRoIGQ9Ik01IDVhMSAxIDAgMCAwLTEgMXY3YzAgNSAzLjUgNy41IDcuNjcgOC45NGExIDEgMCAwIDAgLjY3LjAxYzIuMzUtLjgyIDQuNDgtMS45NyA1LjktMy43MSIgLz4KICA8cGF0aCBkPSJNOS4zMDkgMy42NTJBMTIuMjUyIDEyLjI1MiAwIDAgMCAxMS4yNCAyLjI4YTEuMTcgMS4xNyAwIDAgMSAxLjUyIDBDMTQuNTEgMy44MSAxNyA1IDE5IDVhMSAxIDAgMCAxIDEgMXY3YTkuNzg0IDkuNzg0IDAgMCAxLS4wOCAxLjI2NCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/shield-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ShieldOff = createLucideIcon('ShieldOff', [\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n [\n 'path',\n {\n d: 'M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71',\n key: '1jlk70',\n },\n ],\n [\n 'path',\n {\n d: 'M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264',\n key: '18rp1v',\n },\n ],\n]);\n\nexport default ShieldOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAA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ljs/istanbul-lib-report.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/istanbuljs/istanbul-lib-report.svg?branch=master)](https://travis-ci.org/istanbuljs/istanbul-lib-report)
Core reporting utilities for istanbul.
## Example usage
```js
const libReport = require('istanbul-lib-report');
const reports = require('istanbul-reports');
// coverageMap, for instance, obtained from istanbul-lib-coverage
const coverageMap;
const configWatermarks = {
statements: [50, 80],
functions: [50, 80],
branches: [50, 80],
lines: [50, 80]
};
// create a context for report generation
const context = libReport.createContext({
dir: 'report/output/dir',
// The summarizer to default to (may be overridden by some reports)
// values can be nested/flat/pkg. Defaults to 'pkg'
defaultSummarizer: 'nested',
watermarks: configWatermarks,
coverageMap,
})
// create an instance of the relevant report class, passing the
// report name e.g. json/html/html-spa/text
const report = reports.create('json', {
skipEmpty: configSkipEmpty,
skipFull: configSkipFull
})
// call execute to synchronously create and write the report to disk
report.execute(context)
```
@@ -0,0 +1 @@
{"version":3,"file":"AnimateSharedLayout.mjs","sources":["../../../src/components/AnimateSharedLayout.tsx"],"sourcesContent":["\"use client\"\n\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { useConstant } from \"../utils/use-constant\"\nimport { LayoutGroup } from \"./LayoutGroup\"\n\nlet id = 0\nexport const AnimateSharedLayout: React.FunctionComponent<\n React.PropsWithChildren<unknown>\n> = ({ children }: React.PropsWithChildren<{}>) => {\n React.useEffect(() => {\n invariant(\n false,\n \"AnimateSharedLayout is deprecated: https://www.framer.com/docs/guide-upgrade/##shared-layout-animations\"\n )\n }, [])\n\n return (\n <LayoutGroup id={useConstant(() => `asl-${id++}`)}>\n {children}\n </LayoutGroup>\n )\n}\n"],"names":[],"mappings":";;;;;;;AAOA;;AAII;AACI;;;AAWR;;"}
@@ -0,0 +1,133 @@
import type { SerovalNode, Stream } from 'seroval';
import { createPlugin, createStream } from 'seroval';
const READABLE_STREAM_FACTORY = {};
const READABLE_STREAM_FACTORY_CONSTRUCTOR = (stream: Stream<unknown>) =>
new ReadableStream({
start: controller => {
stream.on({
next: value => {
try {
controller.enqueue(value);
} catch (_error) {
// no-op
}
},
throw: value => {
controller.error(value);
},
return: () => {
try {
controller.close();
} catch (_error) {
// no-op
}
},
});
},
});
const ReadableStreamFactoryPlugin = /* @__PURE__ */ createPlugin<object, {}>({
tag: 'seroval-plugins/web/ReadableStreamFactory',
test(value) {
return value === READABLE_STREAM_FACTORY;
},
parse: {
sync() {
return READABLE_STREAM_FACTORY;
},
async async() {
return await Promise.resolve(READABLE_STREAM_FACTORY);
},
stream() {
return READABLE_STREAM_FACTORY;
},
},
serialize() {
return READABLE_STREAM_FACTORY_CONSTRUCTOR.toString();
},
deserialize() {
return READABLE_STREAM_FACTORY;
},
});
function toStream<T>(value: ReadableStream<T>): Stream<T | undefined> {
const stream = createStream<T | undefined>();
const reader = value.getReader();
async function push(): Promise<void> {
try {
const result = await reader.read();
if (result.done) {
stream.return(result.value);
} else {
stream.next(result.value);
await push();
}
} catch (error) {
stream.throw(error);
}
}
push().catch(() => {
//
});
return stream;
}
type ReadableStreamNode = {
factory: SerovalNode;
stream: SerovalNode;
};
const ReadableStreamPlugin = /* @__PURE__ */ createPlugin<
ReadableStream,
ReadableStreamNode
>({
tag: 'seroval/plugins/web/ReadableStream',
extends: [ReadableStreamFactoryPlugin],
test(value) {
if (typeof ReadableStream === 'undefined') {
return false;
}
return value instanceof ReadableStream;
},
parse: {
sync(_value, ctx) {
return {
factory: ctx.parse(READABLE_STREAM_FACTORY),
stream: ctx.parse(createStream()),
};
},
async async(value, ctx) {
return {
factory: await ctx.parse(READABLE_STREAM_FACTORY),
stream: await ctx.parse(toStream(value)),
};
},
stream(value, ctx) {
return {
factory: ctx.parse(READABLE_STREAM_FACTORY),
stream: ctx.parse(toStream(value)),
};
},
},
serialize(node, ctx) {
return (
'(' +
ctx.serialize(node.factory) +
')(' +
ctx.serialize(node.stream) +
')'
);
},
deserialize(node, ctx) {
const stream = ctx.deserialize(node.stream) as Stream<any>;
return READABLE_STREAM_FACTORY_CONSTRUCTOR(stream);
},
});
export default ReadableStreamPlugin;
@@ -0,0 +1,16 @@
'use strict';
var $abs = require('./abs');
var $floor = require('./floor');
var $isNaN = require('./isNaN');
var $isFinite = require('./isFinite');
/** @type {import('./isInteger')} */
module.exports = function isInteger(argument) {
if (typeof argument !== 'number' || $isNaN(argument) || !$isFinite(argument)) {
return false;
}
var absValue = $abs(argument);
return $floor(absValue) === absValue;
};
@@ -0,0 +1,21 @@
The MIT License
Copyright JS Foundation and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: [ljharb]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: npm/function-bind
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,22 @@
import { dirname, resolve } from 'path';
import { readdir, stat } from 'fs';
import { promisify } from 'util';
const toStats = promisify(stat);
const toRead = promisify(readdir);
export default async function (start, callback) {
let dir = resolve('.', start);
let tmp, stats = await toStats(dir);
if (!stats.isDirectory()) {
dir = dirname(dir);
}
while (true) {
tmp = await callback(dir, await toRead(dir));
if (tmp) return resolve(dir, tmp);
dir = dirname(tmp = dir);
if (tmp === dir) break;
}
}
@@ -0,0 +1,125 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getChildren = getChildren;
exports.getParent = getParent;
exports.getSiblings = getSiblings;
exports.getAttributeValue = getAttributeValue;
exports.hasAttrib = hasAttrib;
exports.getName = getName;
exports.nextElementSibling = nextElementSibling;
exports.prevElementSibling = prevElementSibling;
var domhandler_1 = require("domhandler");
/**
* Get a node's children.
*
* @category Traversal
* @param elem Node to get the children of.
* @returns `elem`'s children, or an empty array.
*/
function getChildren(elem) {
return (0, domhandler_1.hasChildren)(elem) ? elem.children : [];
}
/**
* Get a node's parent.
*
* @category Traversal
* @param elem Node to get the parent of.
* @returns `elem`'s parent node, or `null` if `elem` is a root node.
*/
function getParent(elem) {
return elem.parent || null;
}
/**
* Gets an elements siblings, including the element itself.
*
* Attempts to get the children through the element's parent first. If we don't
* have a parent (the element is a root node), we walk the element's `prev` &
* `next` to get all remaining nodes.
*
* @category Traversal
* @param elem Element to get the siblings of.
* @returns `elem`'s siblings, including `elem`.
*/
function getSiblings(elem) {
var _a, _b;
var parent = getParent(elem);
if (parent != null)
return getChildren(parent);
var siblings = [elem];
var prev = elem.prev, next = elem.next;
while (prev != null) {
siblings.unshift(prev);
(_a = prev, prev = _a.prev);
}
while (next != null) {
siblings.push(next);
(_b = next, next = _b.next);
}
return siblings;
}
/**
* Gets an attribute from an element.
*
* @category Traversal
* @param elem Element to check.
* @param name Attribute name to retrieve.
* @returns The element's attribute value, or `undefined`.
*/
function getAttributeValue(elem, name) {
var _a;
return (_a = elem.attribs) === null || _a === void 0 ? void 0 : _a[name];
}
/**
* Checks whether an element has an attribute.
*
* @category Traversal
* @param elem Element to check.
* @param name Attribute name to look for.
* @returns Returns whether `elem` has the attribute `name`.
*/
function hasAttrib(elem, name) {
return (elem.attribs != null &&
Object.prototype.hasOwnProperty.call(elem.attribs, name) &&
elem.attribs[name] != null);
}
/**
* Get the tag name of an element.
*
* @category Traversal
* @param elem The element to get the name for.
* @returns The tag name of `elem`.
*/
function getName(elem) {
return elem.name;
}
/**
* Returns the next element sibling of a node.
*
* @category Traversal
* @param elem The element to get the next sibling of.
* @returns `elem`'s next sibling that is a tag, or `null` if there is no next
* sibling.
*/
function nextElementSibling(elem) {
var _a;
var next = elem.next;
while (next !== null && !(0, domhandler_1.isTag)(next))
(_a = next, next = _a.next);
return next;
}
/**
* Returns the previous element sibling of a node.
*
* @category Traversal
* @param elem The element to get the previous sibling of.
* @returns `elem`'s previous sibling that is a tag, or `null` if there is no
* previous sibling.
*/
function prevElementSibling(elem) {
var _a;
var prev = elem.prev;
while (prev !== null && !(0, domhandler_1.isTag)(prev))
(_a = prev, prev = _a.prev);
return prev;
}
//# sourceMappingURL=traversal.js.map
@@ -0,0 +1,155 @@
import { T as createGlobalLinebreakMatcher, f as createRule, g as import_ast_utils } from "../utils.js";
var operator_linebreak_default = createRule({
name: "operator-linebreak",
meta: {
type: "layout",
docs: { description: "Enforce consistent linebreak style for operators" },
fixable: "code",
schema: [{ oneOf: [{
type: "string",
enum: [
"after",
"before",
"none"
]
}, { type: "null" }] }, {
type: "object",
properties: { overrides: {
type: "object",
additionalProperties: {
type: "string",
enum: [
"after",
"before",
"none",
"ignore"
]
}
} },
additionalProperties: false
}],
defaultOptions: [],
messages: {
operatorAtBeginning: "'{{operator}}' should be placed at the beginning of the line.",
operatorAtEnd: "'{{operator}}' should be placed at the end of the line.",
badLinebreak: "Bad line breaking before and after '{{operator}}'.",
noLinebreak: "There should be no line break before or after '{{operator}}'."
}
},
create(context) {
const usedDefaultGlobal = !context.options[0];
const globalStyle = context.options[0] || "after";
const options = context.options[1] || {};
const styleOverrides = options.overrides ? Object.assign({}, options.overrides) : {};
if (usedDefaultGlobal && !styleOverrides["?"]) styleOverrides["?"] = "before";
if (usedDefaultGlobal && !styleOverrides[":"]) styleOverrides[":"] = "before";
const sourceCode = context.sourceCode;
function getFixer(operatorToken, desiredStyle) {
return (fixer) => {
const tokenBefore = sourceCode.getTokenBefore(operatorToken);
const tokenAfter = sourceCode.getTokenAfter(operatorToken);
const textBefore = sourceCode.text.slice(tokenBefore.range[1], operatorToken.range[0]);
const textAfter = sourceCode.text.slice(operatorToken.range[1], tokenAfter.range[0]);
const hasLinebreakBefore = !(0, import_ast_utils.isTokenOnSameLine)(tokenBefore, operatorToken);
const hasLinebreakAfter = !(0, import_ast_utils.isTokenOnSameLine)(operatorToken, tokenAfter);
let newTextBefore, newTextAfter;
if (hasLinebreakBefore !== hasLinebreakAfter && desiredStyle !== "none") {
if (sourceCode.getTokenBefore(operatorToken, { includeComments: true }) !== tokenBefore && sourceCode.getTokenAfter(operatorToken, { includeComments: true }) !== tokenAfter) return null;
newTextBefore = textAfter;
newTextAfter = textBefore;
} else {
const LINEBREAK_REGEX = createGlobalLinebreakMatcher();
newTextBefore = desiredStyle === "before" || textBefore.trim() ? textBefore : textBefore.replace(LINEBREAK_REGEX, "");
newTextAfter = desiredStyle === "after" || textAfter.trim() ? textAfter : textAfter.replace(LINEBREAK_REGEX, "");
if (newTextBefore === textBefore && newTextAfter === textAfter) return null;
}
if (newTextAfter === "" && tokenAfter.type === "Punctuator" && "+-".includes(operatorToken.value) && tokenAfter.value === operatorToken.value) newTextAfter += " ";
return fixer.replaceTextRange([tokenBefore.range[1], tokenAfter.range[0]], newTextBefore + operatorToken.value + newTextAfter);
};
}
function validateNode(node, rightSide, operator) {
const operatorToken = sourceCode.getTokenBefore(rightSide, (token) => token.value === operator);
const leftToken = sourceCode.getTokenBefore(operatorToken);
const rightToken = sourceCode.getTokenAfter(operatorToken);
const operatorStyleOverride = styleOverrides[operator];
const style = operatorStyleOverride || globalStyle;
const fix = getFixer(operatorToken, style);
if ((0, import_ast_utils.isTokenOnSameLine)(leftToken, operatorToken) && (0, import_ast_utils.isTokenOnSameLine)(operatorToken, rightToken)) {} else if (operatorStyleOverride !== "ignore" && !(0, import_ast_utils.isTokenOnSameLine)(leftToken, operatorToken) && !(0, import_ast_utils.isTokenOnSameLine)(operatorToken, rightToken)) context.report({
node,
loc: operatorToken.loc,
messageId: "badLinebreak",
data: { operator },
fix
});
else if (style === "before" && (0, import_ast_utils.isTokenOnSameLine)(leftToken, operatorToken)) context.report({
node,
loc: operatorToken.loc,
messageId: "operatorAtBeginning",
data: { operator },
fix
});
else if (style === "after" && (0, import_ast_utils.isTokenOnSameLine)(operatorToken, rightToken)) context.report({
node,
loc: operatorToken.loc,
messageId: "operatorAtEnd",
data: { operator },
fix
});
else if (style === "none") context.report({
node,
loc: operatorToken.loc,
messageId: "noLinebreak",
data: { operator },
fix
});
}
function validateBinaryExpression(node) {
validateNode(node, node.right, node.operator);
}
return {
BinaryExpression: validateBinaryExpression,
LogicalExpression: validateBinaryExpression,
AssignmentExpression: validateBinaryExpression,
VariableDeclarator(node) {
if (node.init) validateNode(node, node.init, "=");
},
PropertyDefinition(node) {
if (node.value) validateNode(node, node.value, "=");
},
AccessorProperty(node) {
if (node.value) validateNode(node, node.value, "=");
},
ConditionalExpression(node) {
validateNode(node, node.consequent, "?");
validateNode(node, node.alternate, ":");
},
TSImportEqualsDeclaration(node) {
validateNode(node, node.moduleReference, "=");
},
TSTypeAliasDeclaration(node) {
validateNode(node, node.typeAnnotation, "=");
},
TSConditionalType(node) {
validateNode(node, node.trueType, "?");
validateNode(node, node.falseType, ":");
},
TSIntersectionType(node) {
const { types } = node;
for (let idx = 0; idx < types.length - 1; idx++) validateNode(types[idx], types[idx + 1], "&");
},
TSUnionType(node) {
const { types } = node;
for (let idx = 0; idx < types.length - 1; idx++) validateNode(types[idx], types[idx + 1], "|");
},
TSTypeParameter(node) {
if (!node.default) return;
validateNode(node, node.default, "=");
},
TSEnumMember(node) {
if (!node.initializer) return;
validateNode(node, node.initializer, "=");
}
};
}
});
export { operator_linebreak_default as t };
@@ -0,0 +1,10 @@
export type Options = [
{
ignoreStringArrays?: boolean;
}
];
export type MessageIds = 'requireCompare';
declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"requireCompare", Options, import("../../rules").ESLintPluginDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener> & {
name: string;
};
export default _default;
@@ -0,0 +1,48 @@
// Run with: npx tsx src/examples/server/toolWithSampleServer.ts
import { McpServer } from '../../server/mcp.js';
import { StdioServerTransport } from '../../server/stdio.js';
import * as z from 'zod/v4';
const mcpServer = new McpServer({
name: 'tools-with-sample-server',
version: '1.0.0'
});
// Tool that uses LLM sampling to summarize any text
mcpServer.registerTool('summarize', {
description: 'Summarize any text using an LLM',
inputSchema: {
text: z.string().describe('Text to summarize')
}
}, async ({ text }) => {
// Call the LLM through MCP sampling
const response = await mcpServer.server.createMessage({
messages: [
{
role: 'user',
content: {
type: 'text',
text: `Please summarize the following text concisely:\n\n${text}`
}
}
],
maxTokens: 500
});
// Since we're not passing tools param to createMessage, response.content is single content
return {
content: [
{
type: 'text',
text: response.content.type === 'text' ? response.content.text : 'Unable to generate summary'
}
]
};
});
async function main() {
const transport = new StdioServerTransport();
await mcpServer.connect(transport);
console.log('MCP server is running...');
}
main().catch(error => {
console.error('Server error:', error);
process.exit(1);
});
//# sourceMappingURL=toolWithSampleServer.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 Loader = createLucideIcon("Loader", [
["path", { d: "M12 2v4", key: "3427ic" }],
["path", { d: "m16.2 7.8 2.9-2.9", key: "r700ao" }],
["path", { d: "M18 12h4", key: "wj9ykh" }],
["path", { d: "m16.2 16.2 2.9 2.9", key: "1bxg5t" }],
["path", { d: "M12 18v4", key: "jadmvz" }],
["path", { d: "m4.9 19.1 2.9-2.9", key: "bwix9q" }],
["path", { d: "M2 12h4", key: "j09sii" }],
["path", { d: "m4.9 4.9 2.9 2.9", key: "giyufr" }]
]);
export { Loader as default };
//# sourceMappingURL=loader.js.map
@@ -0,0 +1,25 @@
import './types.d-BjI5eAwu.js';
type Key = string | symbol;
type CreateMockInstanceProcedure = (options?: {
prototypeMembers?: (string | symbol)[];
name?: string | symbol;
originalImplementation?: (...args: any[]) => any;
keepMembersImplementation?: boolean;
}) => any;
interface MockObjectOptions {
type: "automock" | "autospy";
globalConstructors: GlobalConstructors;
createMockInstance: CreateMockInstanceProcedure;
}
declare function mockObject(options: MockObjectOptions, object: Record<Key, any>, mockExports?: Record<Key, any>): Record<Key, any>;
interface GlobalConstructors {
Object: ObjectConstructor;
Function: FunctionConstructor;
RegExp: RegExpConstructor;
Array: ArrayConstructor;
Map: MapConstructor;
}
export { mockObject as m };
export type { CreateMockInstanceProcedure as C, GlobalConstructors as G, MockObjectOptions as M };
@@ -0,0 +1,24 @@
/**
* @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 Newspaper = createLucideIcon("Newspaper", [
[
"path",
{
d: "M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",
key: "7pis2x"
}
],
["path", { d: "M18 14h-8", key: "sponae" }],
["path", { d: "M15 18h-5", key: "95g1m2" }],
["path", { d: "M10 6h8v4h-8V6Z", key: "smlsk5" }]
]);
export { Newspaper as default };
//# sourceMappingURL=newspaper.js.map
@@ -0,0 +1 @@
{"version":3,"file":"arrow-up-to-line.js","sources":["../../../src/icons/arrow-up-to-line.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowUpToLine\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNSAzaDE0IiAvPgogIDxwYXRoIGQ9Im0xOCAxMy02LTYtNiA2IiAvPgogIDxwYXRoIGQ9Ik0xMiA3djE0IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/arrow-up-to-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 ArrowUpToLine = createLucideIcon('ArrowUpToLine', [\n ['path', { d: 'M5 3h14', key: '7usisc' }],\n ['path', { d: 'm18 13-6-6-6 6', key: '1kf1n9' }],\n ['path', { d: 'M12 7v14', key: '1akyts' }],\n]);\n\nexport default ArrowUpToLine;\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,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,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,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,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"palmtree.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ListMinus = createLucideIcon("ListMinus", [
["path", { d: "M11 12H3", key: "51ecnj" }],
["path", { d: "M16 6H3", key: "1wxfjs" }],
["path", { d: "M16 18H3", key: "12xzn7" }],
["path", { d: "M21 12h-6", key: "bt1uis" }]
]);
export { ListMinus as default };
//# sourceMappingURL=list-minus.js.map
@@ -0,0 +1,50 @@
{
"name": "nopt",
"version": "10.0.1",
"description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
"author": "GitHub Inc.",
"main": "lib/nopt.js",
"scripts": {
"test": "node --test './test/**/*.js'",
"lint": "npm run eslint",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run eslint -- --fix",
"snap": "node --test --test-update-snapshots './test/**/*.js'",
"posttest": "npm run lint",
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"test:node20": "node --test test",
"test:cover": "node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100 './test/**/*.js'"
},
"repository": {
"type": "git",
"url": "git+https://github.com/npm/nopt.git"
},
"bin": {
"nopt": "bin/nopt.js"
},
"license": "ISC",
"dependencies": {
"abbrev": "^5.0.0"
},
"devDependencies": {
"@npmcli/eslint-config": "^7.0.0",
"@npmcli/template-oss": "5.1.0"
},
"files": [
"bin/",
"lib/"
],
"engines": {
"node": "^22.22.2 || ^24.15.0 || >=26.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"windowsCI": false,
"version": "5.1.0",
"publish": true,
"testRunner": "node:test",
"latestCiVersion": 24,
"updateNpm": false
}
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_yO","2":"_I","260":"_FB T"},C:{"1":"_H S _dQ","2":"_ZI","260":"_GD _fG","516":"_TC _MH","580":"_WO _LH","2049":"_UJ _QQ"},D:{"1":"_zO","2":"_8E","132":"_yQ","260":"_mH _mL T"},E:{"1":"_dE","2":"_qB","1090":"_6 M _IQ","2049":"N RD SD"},F:{"1":"_JK","2":"_GP","132":"_GH MB","260":"_wK _DM _rD"},G:{"2":"_XB","1090":"_GG _QH","2049":"_TD"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_yD","260":"_WE"},Q:{"260":"JE"},R:{"1":"KE"},S:{"1":"ME","516":"LE"}},B:5,C:"Web Animations API",D:true};
@@ -0,0 +1,663 @@
/* global window */
/* eslint-disable eqeqeq, prefer-const, @typescript-eslint/no-empty-function */
/*! Copyright (c) Meta Platforms, Inc. and affiliates. **/
/**
* This is simplified pure-js version of https://github.com/facebook/react/blob/main/packages/react-refresh/src/ReactFreshRuntime.js
* without IE11 compatibility and verbose isDev checks.
* Some utils are appended at the bottom for HMR integration.
*/
const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref')
const REACT_MEMO_TYPE = Symbol.for('react.memo')
// We never remove these associations.
// It's OK to reference families, but use WeakMap/Set for types.
let allFamiliesByID = new Map()
let allFamiliesByType = new WeakMap()
let allSignaturesByType = new WeakMap()
// This WeakMap is read by React, so we only put families
// that have actually been edited here. This keeps checks fast.
const updatedFamiliesByType = new WeakMap()
// This is cleared on every performReactRefresh() call.
// It is an array of [Family, NextType] tuples.
let pendingUpdates = []
// This is injected by the renderer via DevTools global hook.
const helpersByRendererID = new Map()
const helpersByRoot = new Map()
// We keep track of mounted roots so we can schedule updates.
const mountedRoots = new Set()
// If a root captures an error, we remember it so we can retry on edit.
const failedRoots = new Set()
// We also remember the last element for every root.
// It needs to be weak because we do this even for roots that failed to mount.
// If there is no WeakMap, we won't attempt to do retrying.
let rootElements = new WeakMap()
let isPerformingRefresh = false
function computeFullKey(signature) {
if (signature.fullKey !== null) {
return signature.fullKey
}
let fullKey = signature.ownKey
let hooks
try {
hooks = signature.getCustomHooks()
} catch (err) {
// This can happen in an edge case, e.g. if expression like Foo.useSomething
// depends on Foo which is lazily initialized during rendering.
// In that case just assume we'll have to remount.
signature.forceReset = true
signature.fullKey = fullKey
return fullKey
}
for (let i = 0; i < hooks.length; i++) {
const hook = hooks[i]
if (typeof hook !== 'function') {
// Something's wrong. Assume we need to remount.
signature.forceReset = true
signature.fullKey = fullKey
return fullKey
}
const nestedHookSignature = allSignaturesByType.get(hook)
if (nestedHookSignature === undefined) {
// No signature means Hook wasn't in the source code, e.g. in a library.
// We'll skip it because we can assume it won't change during this session.
continue
}
const nestedHookKey = computeFullKey(nestedHookSignature)
if (nestedHookSignature.forceReset) {
signature.forceReset = true
}
fullKey += '\n---\n' + nestedHookKey
}
signature.fullKey = fullKey
return fullKey
}
function haveEqualSignatures(prevType, nextType) {
const prevSignature = allSignaturesByType.get(prevType)
const nextSignature = allSignaturesByType.get(nextType)
if (prevSignature === undefined && nextSignature === undefined) {
return true
}
if (prevSignature === undefined || nextSignature === undefined) {
return false
}
if (computeFullKey(prevSignature) !== computeFullKey(nextSignature)) {
return false
}
if (nextSignature.forceReset) {
return false
}
return true
}
function isReactClass(type) {
return type.prototype && type.prototype.isReactComponent
}
function canPreserveStateBetween(prevType, nextType) {
if (isReactClass(prevType) || isReactClass(nextType)) {
return false
}
if (haveEqualSignatures(prevType, nextType)) {
return true
}
return false
}
function resolveFamily(type) {
// Only check updated types to keep lookups fast.
return updatedFamiliesByType.get(type)
}
// This is a safety mechanism to protect against rogue getters and Proxies.
function getProperty(object, property) {
try {
return object[property]
} catch (err) {
// Intentionally ignore.
return undefined
}
}
function performReactRefresh() {
if (pendingUpdates.length === 0) {
return null
}
if (isPerformingRefresh) {
return null
}
isPerformingRefresh = true
try {
const staleFamilies = new Set()
const updatedFamilies = new Set()
const updates = pendingUpdates
pendingUpdates = []
updates.forEach(([family, nextType]) => {
// Now that we got a real edit, we can create associations
// that will be read by the React reconciler.
const prevType = family.current
updatedFamiliesByType.set(prevType, family)
updatedFamiliesByType.set(nextType, family)
family.current = nextType
// Determine whether this should be a re-render or a re-mount.
if (canPreserveStateBetween(prevType, nextType)) {
updatedFamilies.add(family)
} else {
staleFamilies.add(family)
}
})
// TODO: rename these fields to something more meaningful.
const update = {
updatedFamilies, // Families that will re-render preserving state
staleFamilies, // Families that will be remounted
}
helpersByRendererID.forEach((helpers) => {
// Even if there are no roots, set the handler on first update.
// This ensures that if *new* roots are mounted, they'll use the resolve handler.
helpers.setRefreshHandler(resolveFamily)
})
let didError = false
let firstError = null
// We snapshot maps and sets that are mutated during commits.
// If we don't do this, there is a risk they will be mutated while
// we iterate over them. For example, trying to recover a failed root
// may cause another root to be added to the failed list -- an infinite loop.
const failedRootsSnapshot = new Set(failedRoots)
const mountedRootsSnapshot = new Set(mountedRoots)
const helpersByRootSnapshot = new Map(helpersByRoot)
failedRootsSnapshot.forEach((root) => {
const helpers = helpersByRootSnapshot.get(root)
if (helpers === undefined) {
throw new Error(
'Could not find helpers for a root. This is a bug in React Refresh.',
)
}
if (!failedRoots.has(root)) {
// No longer failed.
}
if (rootElements === null) {
return
}
if (!rootElements.has(root)) {
return
}
const element = rootElements.get(root)
try {
helpers.scheduleRoot(root, element)
} catch (err) {
if (!didError) {
didError = true
firstError = err
}
// Keep trying other roots.
}
})
mountedRootsSnapshot.forEach((root) => {
const helpers = helpersByRootSnapshot.get(root)
if (helpers === undefined) {
throw new Error(
'Could not find helpers for a root. This is a bug in React Refresh.',
)
}
if (!mountedRoots.has(root)) {
// No longer mounted.
}
try {
helpers.scheduleRefresh(root, update)
} catch (err) {
if (!didError) {
didError = true
firstError = err
}
// Keep trying other roots.
}
})
if (didError) {
throw firstError
}
return update
} finally {
isPerformingRefresh = false
}
}
export function register(type, id) {
if (type === null) {
return
}
if (typeof type !== 'function' && typeof type !== 'object') {
return
}
// This can happen in an edge case, e.g. if we register
// return value of a HOC but it returns a cached component.
// Ignore anything but the first registration for each type.
if (allFamiliesByType.has(type)) {
return
}
// Create family or remember to update it.
// None of this bookkeeping affects reconciliation
// until the first performReactRefresh() call above.
let family = allFamiliesByID.get(id)
if (family === undefined) {
family = { current: type }
allFamiliesByID.set(id, family)
} else {
pendingUpdates.push([family, type])
}
allFamiliesByType.set(type, family)
// Visit inner types because we might not have registered them.
if (typeof type === 'object' && type !== null) {
switch (getProperty(type, '$$typeof')) {
case REACT_FORWARD_REF_TYPE:
register(type.render, id + '$render')
break
case REACT_MEMO_TYPE:
register(type.type, id + '$type')
break
}
}
}
function setSignature(type, key, forceReset, getCustomHooks) {
if (!allSignaturesByType.has(type)) {
allSignaturesByType.set(type, {
forceReset,
ownKey: key,
fullKey: null,
getCustomHooks: getCustomHooks || (() => []),
})
}
// Visit inner types because we might not have signed them.
if (typeof type === 'object' && type !== null) {
switch (getProperty(type, '$$typeof')) {
case REACT_FORWARD_REF_TYPE:
setSignature(type.render, key, forceReset, getCustomHooks)
break
case REACT_MEMO_TYPE:
setSignature(type.type, key, forceReset, getCustomHooks)
break
}
}
}
// This is lazily called during first render for a type.
// It captures Hook list at that time so inline requires don't break comparisons.
function collectCustomHooksForSignature(type) {
const signature = allSignaturesByType.get(type)
if (signature !== undefined) {
computeFullKey(signature)
}
}
export function injectIntoGlobalHook(globalObject) {
// For React Native, the global hook will be set up by require('react-devtools-core').
// That code will run before us. So we need to monkeypatch functions on existing hook.
// For React Web, the global hook will be set up by the extension.
// This will also run before us.
let hook = globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__
if (hook === undefined) {
// However, if there is no DevTools extension, we'll need to set up the global hook ourselves.
// Note that in this case it's important that renderer code runs *after* this method call.
// Otherwise, the renderer will think that there is no global hook, and won't do the injection.
let nextID = 0
globalObject.__REACT_DEVTOOLS_GLOBAL_HOOK__ = hook = {
renderers: new Map(),
supportsFiber: true,
inject: (injected) => nextID++,
onScheduleFiberRoot: (id, root, children) => {},
onCommitFiberRoot: (id, root, maybePriorityLevel, didError) => {},
onCommitFiberUnmount() {},
}
}
if (hook.isDisabled) {
// This isn't a real property on the hook, but it can be set to opt out
// of DevTools integration and associated warnings and logs.
// Using console['warn'] to evade Babel and ESLint
console['warn'](
'Something has shimmed the React DevTools global hook (__REACT_DEVTOOLS_GLOBAL_HOOK__). ' +
'Fast Refresh is not compatible with this shim and will be disabled.',
)
return
}
// Here, we just want to get a reference to scheduleRefresh.
const oldInject = hook.inject
hook.inject = function (injected) {
const id = oldInject.apply(this, arguments)
if (
typeof injected.scheduleRefresh === 'function' &&
typeof injected.setRefreshHandler === 'function'
) {
// This version supports React Refresh.
helpersByRendererID.set(id, injected)
}
return id
}
// Do the same for any already injected roots.
// This is useful if ReactDOM has already been initialized.
// https://github.com/facebook/react/issues/17626
hook.renderers.forEach((injected, id) => {
if (
typeof injected.scheduleRefresh === 'function' &&
typeof injected.setRefreshHandler === 'function'
) {
// This version supports React Refresh.
helpersByRendererID.set(id, injected)
}
})
// We also want to track currently mounted roots.
const oldOnCommitFiberRoot = hook.onCommitFiberRoot
const oldOnScheduleFiberRoot = hook.onScheduleFiberRoot || (() => {})
hook.onScheduleFiberRoot = function (id, root, children) {
if (!isPerformingRefresh) {
// If it was intentionally scheduled, don't attempt to restore.
// This includes intentionally scheduled unmounts.
failedRoots.delete(root)
if (rootElements !== null) {
rootElements.set(root, children)
}
}
return oldOnScheduleFiberRoot.apply(this, arguments)
}
hook.onCommitFiberRoot = function (id, root, maybePriorityLevel, didError) {
const helpers = helpersByRendererID.get(id)
if (helpers !== undefined) {
helpersByRoot.set(root, helpers)
const current = root.current
const alternate = current.alternate
// We need to determine whether this root has just (un)mounted.
// This logic is copy-pasted from similar logic in the DevTools backend.
// If this breaks with some refactoring, you'll want to update DevTools too.
if (alternate !== null) {
const wasMounted =
alternate.memoizedState != null &&
alternate.memoizedState.element != null &&
mountedRoots.has(root)
const isMounted =
current.memoizedState != null && current.memoizedState.element != null
if (!wasMounted && isMounted) {
// Mount a new root.
mountedRoots.add(root)
failedRoots.delete(root)
} else if (wasMounted && isMounted) {
// Update an existing root.
// This doesn't affect our mounted root Set.
} else if (wasMounted && !isMounted) {
// Unmount an existing root.
mountedRoots.delete(root)
if (didError) {
// We'll remount it on future edits.
failedRoots.add(root)
} else {
helpersByRoot.delete(root)
}
} else if (!wasMounted && !isMounted) {
if (didError) {
// We'll remount it on future edits.
failedRoots.add(root)
}
}
} else {
// Mount a new root.
mountedRoots.add(root)
}
}
// Always call the decorated DevTools hook.
return oldOnCommitFiberRoot.apply(this, arguments)
}
}
// This is a wrapper over more primitive functions for setting signature.
// Signatures let us decide whether the Hook order has changed on refresh.
//
// This function is intended to be used as a transform target, e.g.:
// var _s = createSignatureFunctionForTransform()
//
// function Hello() {
// const [foo, setFoo] = useState(0);
// const value = useCustomHook();
// _s(); /* Call without arguments triggers collecting the custom Hook list.
// * This doesn't happen during the module evaluation because we
// * don't want to change the module order with inline requires.
// * Next calls are noops. */
// return <h1>Hi</h1>;
// }
//
// /* Call with arguments attaches the signature to the type: */
// _s(
// Hello,
// 'useState{[foo, setFoo]}(0)',
// () => [useCustomHook], /* Lazy to avoid triggering inline requires */
// );
export function createSignatureFunctionForTransform() {
let savedType
let hasCustomHooks
let didCollectHooks = false
return function (type, key, forceReset, getCustomHooks) {
if (typeof key === 'string') {
// We're in the initial phase that associates signatures
// with the functions. Note this may be called multiple times
// in HOC chains like _s(hoc1(_s(hoc2(_s(actualFunction))))).
if (!savedType) {
// We're in the innermost call, so this is the actual type.
// $FlowFixMe[escaped-generic] discovered when updating Flow
savedType = type
hasCustomHooks = typeof getCustomHooks === 'function'
}
// Set the signature for all types (even wrappers!) in case
// they have no signatures of their own. This is to prevent
// problems like https://github.com/facebook/react/issues/20417.
if (
type != null &&
(typeof type === 'function' || typeof type === 'object')
) {
setSignature(type, key, forceReset, getCustomHooks)
}
return type
} else {
// We're in the _s() call without arguments, which means
// this is the time to collect custom Hook signatures.
// Only do this once. This path is hot and runs *inside* every render!
if (!didCollectHooks && hasCustomHooks) {
didCollectHooks = true
collectCustomHooksForSignature(savedType)
}
}
}
}
function isLikelyComponentType(type) {
switch (typeof type) {
case 'function': {
// First, deal with classes.
if (type.prototype != null) {
if (type.prototype.isReactComponent) {
// React class.
return true
}
const ownNames = Object.getOwnPropertyNames(type.prototype)
if (ownNames.length > 1 || ownNames[0] !== 'constructor') {
// This looks like a class.
return false
}
if (type.prototype.__proto__ !== Object.prototype) {
// It has a superclass.
return false
}
// Pass through.
// This looks like a regular function with empty prototype.
}
// For plain functions and arrows, use name as a heuristic.
const name = type.name || type.displayName
return typeof name === 'string' && /^[A-Z]/.test(name)
}
case 'object': {
if (type != null) {
switch (getProperty(type, '$$typeof')) {
case REACT_FORWARD_REF_TYPE:
case REACT_MEMO_TYPE:
// Definitely React components.
return true
default:
return false
}
}
return false
}
default: {
return false
}
}
}
function isCompoundComponent(type) {
if (!isPlainObject(type)) return false
for (const key in type) {
if (!isLikelyComponentType(type[key])) return false
}
return true
}
function isPlainObject(obj) {
return (
Object.prototype.toString.call(obj) === '[object Object]' &&
(obj.constructor === Object || obj.constructor === undefined)
)
}
/**
* Plugin utils
*/
// Taken from https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/lib/runtime/RefreshUtils.js#L141
// This allows to resister components not detected by SWC like styled component
export function registerExportsForReactRefresh(filename, moduleExports) {
for (const key in moduleExports) {
if (key === '__esModule') continue
const exportValue = moduleExports[key]
if (isLikelyComponentType(exportValue)) {
// 'export' is required to avoid key collision when renamed exports that
// shadow a local component name: https://github.com/vitejs/vite-plugin-react/issues/116
// The register function has an identity check to not register twice the same component,
// so this is safe to not used the same key here.
register(exportValue, filename + ' export ' + key)
} else if (isCompoundComponent(exportValue)) {
for (const subKey in exportValue) {
register(
exportValue[subKey],
filename + ' export ' + key + '-' + subKey,
)
}
}
}
}
function debounce(fn, delay) {
let handle
return () => {
clearTimeout(handle)
handle = setTimeout(fn, delay)
}
}
const hooks = []
window.__registerBeforePerformReactRefresh = (cb) => {
hooks.push(cb)
}
const enqueueUpdate = debounce(async () => {
if (hooks.length) await Promise.all(hooks.map((cb) => cb()))
performReactRefresh()
}, 16)
export function validateRefreshBoundaryAndEnqueueUpdate(
id,
prevExports,
nextExports,
) {
const ignoredExports = window.__getReactRefreshIgnoredExports?.({ id }) ?? []
if (
predicateOnExport(
ignoredExports,
prevExports,
(key) => key in nextExports,
) !== true
) {
return 'Could not Fast Refresh (export removed)'
}
if (
predicateOnExport(
ignoredExports,
nextExports,
(key) => key in prevExports,
) !== true
) {
return 'Could not Fast Refresh (new export)'
}
let hasExports = false
const allExportsAreComponentsOrUnchanged = predicateOnExport(
ignoredExports,
nextExports,
(key, value) => {
hasExports = true
if (isLikelyComponentType(value)) return true
if (isCompoundComponent(value)) return true
return prevExports[key] === nextExports[key]
},
)
if (hasExports && allExportsAreComponentsOrUnchanged === true) {
enqueueUpdate()
} else {
return `Could not Fast Refresh ("${allExportsAreComponentsOrUnchanged}" export is incompatible). Learn more at __README_URL__#consistent-components-exports`
}
}
function predicateOnExport(ignoredExports, moduleExports, predicate) {
for (const key in moduleExports) {
if (ignoredExports.includes(key)) continue
if (!predicate(key, moduleExports[key])) return key
}
return true
}
// Hides vite-ignored dynamic import so that Vite can skip analysis if no other
// dynamic import is present (https://github.com/vitejs/vite/pull/12732)
export const __hmr_import = (module) => import(/* @vite-ignore */ module)
// For backwards compatibility with @vitejs/plugin-react.
export default { injectIntoGlobalHook }
@@ -0,0 +1 @@
{"version":3,"file":"constants.cjs","names":[],"sources":["../../../src/ssr/constants.ts"],"sourcesContent":["export const GLOBAL_TSR = '$_TSR'\nexport declare const GLOBAL_SEROVAL: '$R'\nexport const TSR_SCRIPT_BARRIER_ID = '$tsr-stream-barrier'\n"],"mappings":";AAAA,MAAa,aAAa;AAE1B,MAAa,wBAAwB"}
@@ -0,0 +1,29 @@
import * as core from "../core/index.cjs";
import { $ZodError } from "../core/index.cjs";
/** @deprecated Use `z.core.$ZodIssue` from `@zod/core` instead, especially if you are building a library on top of Zod. */
export type ZodIssue = core.$ZodIssue;
/** An Error-like class used to store Zod validation issues. */
export interface ZodError<T = unknown> extends $ZodError<T> {
/** @deprecated Use the `z.treeifyError(err)` function instead. */
format(): core.$ZodFormattedError<T>;
format<U>(mapper: (issue: core.$ZodIssue) => U): core.$ZodFormattedError<T, U>;
/** @deprecated Use the `z.treeifyError(err)` function instead. */
flatten(): core.$ZodFlattenedError<T>;
flatten<U>(mapper: (issue: core.$ZodIssue) => U): core.$ZodFlattenedError<T, U>;
/** @deprecated Push directly to `.issues` instead. */
addIssue(issue: core.$ZodIssue): void;
/** @deprecated Push directly to `.issues` instead. */
addIssues(issues: core.$ZodIssue[]): void;
/** @deprecated Check `err.issues.length === 0` instead. */
isEmpty: boolean;
}
export declare const ZodError: core.$constructor<ZodError>;
export declare const ZodRealError: core.$constructor<ZodError>;
/** @deprecated Use `z.core.$ZodFlattenedError` instead. */
export type ZodFlattenedError<T, U = string> = core.$ZodFlattenedError<T, U>;
/** @deprecated Use `z.core.$ZodFormattedError` instead. */
export type ZodFormattedError<T, U = string> = core.$ZodFormattedError<T, U>;
/** @deprecated Use `z.core.$ZodErrorMap` instead. */
export type ZodErrorMap<T extends core.$ZodIssueBase = core.$ZodIssue> = core.$ZodErrorMap<T>;
/** @deprecated Use `z.core.$ZodRawIssue` instead. */
export type IssueData = core.$ZodRawIssue;
@@ -0,0 +1 @@
{"version":3,"file":"build-attrs.mjs","sources":["../../../../../src/render/svg/utils/build-attrs.ts"],"sourcesContent":["import type { MotionNodeOptions } from \"../../../node/types\"\nimport { buildHTMLStyles } from \"../../html/utils/build-styles\"\nimport { ResolvedValues } from \"../../types\"\nimport { SVGRenderState } from \"../types\"\nimport { buildSVGPath } from \"./path\"\n\n/**\n * CSS Motion Path properties that should remain as CSS styles on SVG elements.\n */\nconst cssMotionPathProperties = [\n \"offsetDistance\",\n \"offsetPath\",\n \"offsetRotate\",\n \"offsetAnchor\",\n]\n\n/**\n * Build SVG visual attributes, like cx and style.transform\n */\nexport function buildSVGAttrs(\n state: SVGRenderState,\n {\n attrX,\n attrY,\n attrScale,\n pathLength,\n pathSpacing = 1,\n pathOffset = 0,\n // This is object creation, which we try to avoid per-frame.\n ...latest\n }: ResolvedValues,\n isSVGTag: boolean,\n transformTemplate?: MotionNodeOptions[\"transformTemplate\"],\n styleProp?: Record<string, any>\n) {\n buildHTMLStyles(state, latest, transformTemplate)\n\n /**\n * For svg tags we just want to make sure viewBox is animatable and treat all the styles\n * as normal HTML tags.\n */\n if (isSVGTag) {\n if (state.style.viewBox) {\n state.attrs.viewBox = state.style.viewBox\n }\n return\n }\n\n state.attrs = state.style\n state.style = {}\n const { attrs, style } = state\n\n /**\n * However, we apply transforms as CSS transforms.\n * So if we detect a transform, transformOrigin we take it from attrs and copy it into style.\n */\n if (attrs.transform) {\n style.transform = attrs.transform\n delete attrs.transform\n }\n if (style.transform || attrs.transformOrigin) {\n style.transformOrigin = attrs.transformOrigin ?? \"50% 50%\"\n delete attrs.transformOrigin\n }\n\n if (style.transform) {\n /**\n * SVG's element transform-origin uses its own median as a reference.\n * Therefore, transformBox becomes a fill-box\n */\n style.transformBox = (styleProp?.transformBox as string) ?? \"fill-box\"\n delete attrs.transformBox\n }\n\n for (const key of cssMotionPathProperties) {\n if (attrs[key] !== undefined) {\n style[key] = attrs[key]\n delete attrs[key]\n }\n }\n\n // Render attrX/attrY/attrScale as attributes\n if (attrX !== undefined) attrs.x = attrX\n if (attrY !== undefined) attrs.y = attrY\n if (attrScale !== undefined) attrs.scale = attrScale\n\n // Build SVG path if one has been defined\n if (pathLength !== undefined) {\n buildSVGPath(\n attrs,\n pathLength as number,\n pathSpacing as number,\n pathOffset as number,\n false\n )\n }\n}\n"],"names":[],"mappings":";;;AAMA;;AAEG;AACH,MAAM,uBAAuB,GAAG;IAC5B,gBAAgB;IAChB,YAAY;IACZ,cAAc;IACd,cAAc;CACjB;AAED;;AAEG;AACG,SAAU,aAAa,CACzB,KAAqB,EACrB,EACI,KAAK,EACL,KAAK,EACL,SAAS,EACT,UAAU,EACV,WAAW,GAAG,CAAC,EACf,UAAU,GAAG,CAAC;AACd;AACA,GAAG,MAAM,EACI,EACjB,QAAiB,EACjB,iBAA0D,EAC1D,SAA+B,EAAA;AAE/B,IAAA,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,iBAAiB,CAAC;AAEjD;;;AAGG;IACH,IAAI,QAAQ,EAAE;AACV,QAAA,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE;YACrB,KAAK,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO;QAC7C;QACA;IACJ;AAEA,IAAA,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK;AACzB,IAAA,KAAK,CAAC,KAAK,GAAG,EAAE;AAChB,IAAA,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK;AAE9B;;;AAGG;AACH,IAAA,IAAI,KAAK,CAAC,SAAS,EAAE;AACjB,QAAA,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS;QACjC,OAAO,KAAK,CAAC,SAAS;IAC1B;IACA,IAAI,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,eAAe,EAAE;QAC1C,KAAK,CAAC,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,SAAS;QAC1D,OAAO,KAAK,CAAC,eAAe;IAChC;AAEA,IAAA,IAAI,KAAK,CAAC,SAAS,EAAE;AACjB;;;AAGG;QACH,KAAK,CAAC,YAAY,GAAI,SAAS,EAAE,YAAuB,IAAI,UAAU;QACtE,OAAO,KAAK,CAAC,YAAY;IAC7B;AAEA,IAAA,KAAK,MAAM,GAAG,IAAI,uBAAuB,EAAE;AACvC,QAAA,IAAI,KAAK,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE;YAC1B,KAAK,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC;AACvB,YAAA,OAAO,KAAK,CAAC,GAAG,CAAC;QACrB;IACJ;;IAGA,IAAI,KAAK,KAAK,SAAS;AAAE,QAAA,KAAK,CAAC,CAAC,GAAG,KAAK;IACxC,IAAI,KAAK,KAAK,SAAS;AAAE,QAAA,KAAK,CAAC,CAAC,GAAG,KAAK;IACxC,IAAI,SAAS,KAAK,SAAS;AAAE,QAAA,KAAK,CAAC,KAAK,GAAG,SAAS;;AAGpD,IAAA,IAAI,UAAU,KAAK,SAAS,EAAE;QAC1B,YAAY,CACR,KAAK,EACL,UAAoB,EACpB,WAAqB,EACrB,UAAoB,EACpB,KAAK,CACR;IACL;AACJ;;;;"}
@@ -0,0 +1,29 @@
{
"name": "yallist",
"version": "3.1.1",
"description": "Yet Another Linked List",
"main": "yallist.js",
"directories": {
"test": "test"
},
"files": [
"yallist.js",
"iterator.js"
],
"dependencies": {},
"devDependencies": {
"tap": "^12.1.0"
},
"scripts": {
"test": "tap test/*.js --100",
"preversion": "npm test",
"postversion": "npm publish",
"postpublish": "git push origin --all; git push origin --tags"
},
"repository": {
"type": "git",
"url": "git+https://github.com/isaacs/yallist.git"
},
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"license": "ISC"
}
@@ -0,0 +1,11 @@
"use strict";
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE:
// npx nx generate-lib repo
Object.defineProperty(exports, "__esModule", { value: true });
exports.webworker_asynciterable = void 0;
exports.webworker_asynciterable = {
libs: [],
variables: [],
};
@@ -0,0 +1,14 @@
'use strict';
module.exports = function generate_comment(it, $keyword, $ruleType) {
var out = ' ';
var $schema = it.schema[$keyword];
var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
var $breakOnError = !it.opts.allErrors;
var $comment = it.util.toQuotedString($schema);
if (it.opts.$comment === true) {
out += ' console.log(' + ($comment) + ');';
} else if (typeof it.opts.$comment == 'function') {
out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);';
}
return out;
}
@@ -0,0 +1,315 @@
# tinyexec 📟
> A minimal package for executing commands
This package was created to provide a minimal way of interacting with child
processes without having to manually deal with streams, piping, etc.
## Installing
```sh
$ npm i -S tinyexec
```
## Usage
A process can be spawned and awaited like so:
```ts
import {x} from 'tinyexec';
const result = await x('ls', ['-l']);
// result.stdout - the stdout as a string
// result.stderr - the stderr as a string
// result.exitCode - the process exit code as a number
```
By default, tinyexec does not throw on non‑zero exit codes. Check `result.exitCode` or pass `{throwOnError: true}`.
Output is returned exactly as produced; trailing newlines are not trimmed. If you need trimming, do it explicitly:
```ts
const clean = result.stdout.replace(/\r?\n$/, '');
```
You may also iterate over the lines of output via an async loop:
```ts
import {x} from 'tinyexec';
const proc = x('ls', ['-l']);
for await (const line of proc) {
// line will be from stderr/stdout in the order you'd see it in a term
}
```
### Options
Options can be passed to have finer control over spawning of the process:
```ts
await x('ls', [], {
timeout: 1000
});
```
The options object can have the following properties:
- `signal` - an `AbortSignal` to allow aborting of the execution
- `timeout` - time in milliseconds at which the process will be forcibly killed
- `persist` - if `true`, the process will continue after the host exits
- `stdin` - `string` or another `Result` that will be used as the input to the process
- `nodeOptions` - any valid options to node's underlying `spawn` function
- `throwOnError` - if true, non-zero exit codes will throw an error
### Passing a string to stdin
You can pass a string to `stdin`, which is useful for whitespace-sensitive values and for secrets you shouldn’t be exposed in shell history:
```ts
const result = await x('gh', ['auth', 'login', '--with-token'], {
stdin: process.env.GITHUB_TOKEN
});
console.log(result.exitCode);
```
### Piping to another process
You can pipe a process to another via the `pipe` method:
```ts
const proc1 = x('ls', ['-l']);
const proc2 = proc1.pipe('grep', ['.js']);
const result = await proc2;
console.log(result.stdout);
```
`pipe` takes the same options as a regular execution. For example, you can
pass a timeout to the pipe call:
```ts
proc1.pipe('grep', ['.js'], {
timeout: 2000
});
```
### Killing a process
You can kill the process via the `kill` method:
```ts
const proc = x('ls');
proc.kill();
// or with a signal
proc.kill('SIGHUP');
```
### Node modules/binaries
By default, node's available binaries from `node_modules` will be accessible
in your command.
For example, in a repo which has `eslint` installed:
```ts
await x('eslint', ['.']);
```
In this example, `eslint` will come from the locally installed `node_modules`.
### Using an abort signal
An abort signal can be passed to a process in order to abort it at a later
time. This will result in the process being killed and `aborted` being set
to `true`.
```ts
const aborter = new AbortController();
const proc = x('node', ['./foo.mjs'], {
signal: aborter.signal
});
// elsewhere...
aborter.abort();
await proc;
proc.aborted; // true
proc.killed; // true
```
### Using with command strings
If you need to continue supporting commands as strings (e.g. "command arg0 arg1"),
you can use [args-tokenizer](https://github.com/TrySound/args-tokenizer),
a lightweight library for parsing shell command strings into an array.
```ts
import {x} from 'tinyexec';
import {tokenizeArgs} from 'args-tokenizer';
const commandString = 'echo "Hello, World!"';
const [command, ...args] = tokenizeArgs(commandString);
const result = await x(command, args);
result.stdout; // Hello, World!
```
### Synchronous
You can use `xSync` for synchronous (blocking) execution:
```ts
import {xSync} from 'tinyexec';
const result = xSync('ls', ['-l']);
// result.stdout - the stdout as a string
// result.stderr - the stderr as a string
// result.exitCode - the process exit code as a number
```
Like the async API, you can iterate over lines:
```ts
const result = xSync('ls', ['-l']);
for (const line of result) {
// line will be from stdout then stderr
}
```
Since the synchronous API blocks the event loop, there are some features that are supported in the async API that the sync API does not support:
- `signal`
- `persist`
- `kill()` method
- `stdin` piping
- `pipe()` method
Other options like `timeout`, `throwOnError`, and `nodeOptions` work the same way.
## API
Calling `x(command[, args])` returns an awaitable `Result` which has the
following API methods and properties available:
### `pipe(command[, args[, options]])`
Pipes the current command to another. For example:
```ts
x('ls', ['-l'])
.pipe('grep', ['js']);
```
The parameters are as follows:
- `command` - the command to execute (_without any arguments_)
- `args` - an array of arguments
- `options` - options object
### `process`
The underlying Node.js `ChildProcess`. tinyexec keeps the surface minimal and does not re‑expose every child_process method/event. Use `proc.process` for advanced access (streams, events, etc.).
```ts
const proc = x('node', ['./foo.mjs']);
proc.process?.stdout?.on('data', (chunk) => {
// ...
});
proc.process?.once('close', (code) => {
// ...
});
```
### `kill([signal])`
Kills the current process with the specified signal. By default, this will
use the `SIGTERM` signal.
For example:
```ts
const proc = x('ls');
proc.kill();
```
### `pid`
The current process ID. For example:
```ts
const proc = x('ls');
proc.pid; // number
```
### `aborted`
Whether the process has been aborted or not (via the `signal` originally
passed in the options object).
For example:
```ts
const proc = x('ls');
proc.aborted; // bool
```
### `killed`
Whether the process has been killed or not (e.g. via `kill()` or an abort
signal).
For example:
```ts
const proc = x('ls');
proc.killed; // bool
```
### `exitCode`
The exit code received when the process completed execution.
For example:
```ts
const proc = x('ls');
proc.exitCode; // number (e.g. 1)
```
## Comparison with other libraries
`tinyexec` aims to provide a lightweight layer on top of Node's own
`child_process` API.
Some clear benefits compared to other libraries are that `tinyexec` will be much lighter, have a much
smaller footprint and will have a less abstract interface (less "magic"). It
will also have equal security and cross-platform support to popular
alternatives.
There are various features other libraries include which we are unlikely
to ever implement, as they would prevent us from providing a lightweight layer.
For example, if you'd like write scripts rather than individual commands, and
prefer to use templating, we'd definitely recommend
[zx](https://github.com/google/zx). zx is a much higher level library which
does some of the same work `tinyexec` does but behind a template string
interface.
Similarly, libraries like `execa` will provide helpers for various things
like passing files as input to processes. We opt not to support features like
this since many of them are easy to do yourself (using Node's own APIs).
@@ -0,0 +1,64 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const utils_1 = require("@typescript-eslint/utils");
const util_1 = require("../util");
const getESLintCoreRule_1 = require("../util/getESLintCoreRule");
const baseRule = (0, getESLintCoreRule_1.getESLintCoreRule)('no-unused-expressions');
const defaultOptions = [
{
allowShortCircuit: false,
allowTaggedTemplates: false,
allowTernary: false,
},
];
exports.default = (0, util_1.createRule)({
name: 'no-unused-expressions',
meta: {
type: 'suggestion',
defaultOptions,
docs: {
description: 'Disallow unused expressions',
extendsBaseRule: true,
recommended: 'recommended',
},
hasSuggestions: baseRule.meta.hasSuggestions,
messages: baseRule.meta.messages,
schema: baseRule.meta.schema,
},
defaultOptions,
create(context, [{ allowShortCircuit = false, allowTernary = false }]) {
const rules = baseRule.create(context);
function isValidExpression(node) {
if (allowShortCircuit && node.type === utils_1.AST_NODE_TYPES.LogicalExpression) {
return isValidExpression(node.right);
}
if (allowTernary && node.type === utils_1.AST_NODE_TYPES.ConditionalExpression) {
return (isValidExpression(node.alternate) &&
isValidExpression(node.consequent));
}
return ((node.type === utils_1.AST_NODE_TYPES.ChainExpression &&
node.expression.type === utils_1.AST_NODE_TYPES.CallExpression) ||
node.type === utils_1.AST_NODE_TYPES.ImportExpression);
}
return {
ExpressionStatement(node) {
if (node.directive || isValidExpression(node.expression)) {
return;
}
const expressionType = node.expression.type;
if (expressionType ===
utils_1.TSESTree.AST_NODE_TYPES.TSInstantiationExpression ||
expressionType === utils_1.TSESTree.AST_NODE_TYPES.TSAsExpression ||
expressionType === utils_1.TSESTree.AST_NODE_TYPES.TSNonNullExpression ||
expressionType === utils_1.TSESTree.AST_NODE_TYPES.TSTypeAssertion) {
rules.ExpressionStatement({
...node,
expression: node.expression.expression,
});
return;
}
rules.ExpressionStatement(node);
},
};
},
});
@@ -0,0 +1,107 @@
"""
ELF file parser.
This provides a class ``ELFFile`` that parses an ELF executable in a similar
interface to ``ZipFile``. Only the read interface is implemented.
Based on: https://gist.github.com/lyssdod/f51579ae8d93c8657a5564aefc2ffbca
ELF header: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html
"""
import enum
import os
import struct
from typing import IO, Optional, Tuple
class ELFInvalid(ValueError):
pass
class EIClass(enum.IntEnum):
C32 = 1
C64 = 2
class EIData(enum.IntEnum):
Lsb = 1
Msb = 2
class EMachine(enum.IntEnum):
I386 = 3
S390 = 22
Arm = 40
X8664 = 62
AArc64 = 183
class ELFFile:
"""
Representation of an ELF executable.
"""
def __init__(self, f: IO[bytes]) -> None:
self._f = f
try:
ident = self._read("16B")
except struct.error:
raise ELFInvalid("unable to parse identification")
if (magic := bytes(ident[:4])) != b"\x7fELF":
raise ELFInvalid(f"invalid magic: {magic!r}")
self.capacity = ident[4] # Format for program header (bitness).
self.encoding = ident[5] # Data structure encoding (endianness).
try:
# e_fmt: Format for program header.
# p_fmt: Format for section header.
# p_idx: Indexes to find p_type, p_offset, and p_filesz.
e_fmt, self._p_fmt, self._p_idx = {
(1, 1): ("<HHIIIIIHHH", "<IIIIIIII", (0, 1, 4)), # 32-bit LSB.
(1, 2): (">HHIIIIIHHH", ">IIIIIIII", (0, 1, 4)), # 32-bit MSB.
(2, 1): ("<HHIQQQIHHH", "<IIQQQQQQ", (0, 2, 5)), # 64-bit LSB.
(2, 2): (">HHIQQQIHHH", ">IIQQQQQQ", (0, 2, 5)), # 64-bit MSB.
}[(self.capacity, self.encoding)]
except KeyError:
raise ELFInvalid(
f"unrecognized capacity ({self.capacity}) or "
f"encoding ({self.encoding})"
)
try:
(
_,
self.machine, # Architecture type.
_,
_,
self._e_phoff, # Offset of program header.
_,
self.flags, # Processor-specific flags.
_,
self._e_phentsize, # Size of section.
self._e_phnum, # Number of sections.
) = self._read(e_fmt)
except struct.error as e:
raise ELFInvalid("unable to parse machine and section information") from e
def _read(self, fmt: str) -> Tuple[int, ...]:
return struct.unpack(fmt, self._f.read(struct.calcsize(fmt)))
@property
def interpreter(self) -> Optional[str]:
"""
The path recorded in the ``PT_INTERP`` section header.
"""
for index in range(self._e_phnum):
self._f.seek(self._e_phoff + self._e_phentsize * index)
try:
data = self._read(self._p_fmt)
except struct.error:
continue
if data[self._p_idx[0]] != 3: # Not PT_INTERP.
continue
self._f.seek(data[self._p_idx[1]])
return os.fsdecode(self._f.read(data[self._p_idx[2]])).strip("\0")
return None
@@ -0,0 +1 @@
{"version":3,"file":"book-plus.js","sources":["../../../src/icons/book-plus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BookPlus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgN3Y2IiAvPgogIDxwYXRoIGQ9Ik00IDE5LjV2LTE1QTIuNSAyLjUgMCAwIDEgNi41IDJIMTlhMSAxIDAgMCAxIDEgMXYxOGExIDEgMCAwIDEtMSAxSDYuNWExIDEgMCAwIDEgMC01SDIwIiAvPgogIDxwYXRoIGQ9Ik05IDEwaDYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/book-plus\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 BookPlus = createLucideIcon('BookPlus', [\n ['path', { d: 'M12 7v6', key: 'lw1j43' }],\n [\n 'path',\n {\n d: 'M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20',\n key: 'k3hazp',\n },\n ],\n ['path', { d: 'M9 10h6', key: '9gxzsh' }],\n]);\n\nexport default BookPlus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACxC,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,331 @@
import { n as __toESM, t as require_binding } from "./shared/binding-TuFFIE_J.mjs";
import { n as BuiltinPlugin, t as normalizedStringOrRegex } from "./shared/normalize-string-or-regex-dnh67V_w.mjs";
import { o as transformToRollupOutput } from "./shared/bindingify-input-options-XPJLJOD0.mjs";
import { c as validateOption, n as createBundlerOptions, t as RolldownBuild, u as PluginDriver } from "./shared/rolldown-build-CtPvmZgJ.mjs";
import { i as unwrapBindingResult, r as normalizeBindingResult } from "./shared/error-BHRSI0R7.mjs";
import { n as parseSync$1, t as parse$1 } from "./shared/parse-D4dtlfWy.mjs";
import { a as viteDynamicImportVarsPlugin, c as viteLoadFallbackPlugin, d as viteReporterPlugin, f as viteResolvePlugin, i as viteBuildImportAnalysisPlugin, l as viteModulePreloadPolyfillPlugin, n as isolatedDeclarationPlugin, o as viteImportGlobPlugin, p as viteWebWorkerPostPlugin, r as oxcRuntimePlugin, s as viteJsonPlugin, u as viteReactRefreshWrapperPlugin } from "./shared/constructors-D_3i7dpX.mjs";
import { a as minify$1, i as transformSync$1, n as resolveTsconfig, o as minifySync$1, r as transform$1, t as TsconfigCache$1 } from "./shared/resolve-tsconfig-DxqIJB3x.mjs";
import { pathToFileURL } from "node:url";
//#region src/api/dev/dev-engine.ts
var import_binding = /* @__PURE__ */ __toESM(require_binding(), 1);
var DevEngine = class DevEngine {
#inner;
#cachedBuildFinishPromise = null;
static async create(inputOptions, outputOptions = {}, devOptions = {}) {
inputOptions = await PluginDriver.callOptionsHook(inputOptions);
const options = await createBundlerOptions(inputOptions, outputOptions, false);
const userOnHmrUpdates = devOptions.onHmrUpdates;
const bindingOnHmrUpdates = userOnHmrUpdates ? function(rawResult) {
const result = normalizeBindingResult(rawResult);
if (result instanceof Error) {
userOnHmrUpdates(result);
return;
}
const [updates, changedFiles] = result;
userOnHmrUpdates({
updates,
changedFiles
});
} : void 0;
const userOnOutput = devOptions.onOutput;
const bindingOnOutput = userOnOutput ? function(rawResult) {
const result = normalizeBindingResult(rawResult);
if (result instanceof Error) {
userOnOutput(result);
return;
}
userOnOutput(transformToRollupOutput(result));
} : void 0;
const userOnAdditionalAssets = devOptions.onAdditionalAssets;
const bindingDevOptions = {
onHmrUpdates: bindingOnHmrUpdates,
onOutput: bindingOnOutput,
onAdditionalAssets: userOnAdditionalAssets ? function(output) {
userOnAdditionalAssets(transformToRollupOutput(output));
} : void 0,
rebuildStrategy: devOptions.rebuildStrategy ? devOptions.rebuildStrategy === "always" ? import_binding.BindingRebuildStrategy.Always : devOptions.rebuildStrategy === "auto" ? import_binding.BindingRebuildStrategy.Auto : import_binding.BindingRebuildStrategy.Never : void 0,
watch: devOptions.watch && {
skipWrite: devOptions.watch.skipWrite,
usePolling: devOptions.watch.usePolling,
pollInterval: devOptions.watch.pollInterval,
useDebounce: devOptions.watch.useDebounce,
debounceDuration: devOptions.watch.debounceDuration,
compareContentsForPolling: devOptions.watch.compareContentsForPolling,
debounceTickRate: devOptions.watch.debounceTickRate,
include: normalizedStringOrRegex(devOptions.watch.include),
exclude: normalizedStringOrRegex(devOptions.watch.exclude)
}
};
const inner = new import_binding.BindingDevEngine(options.bundlerOptions, bindingDevOptions);
return new DevEngine(inner);
}
constructor(inner) {
this.#inner = inner;
}
async run() {
await this.#inner.run();
}
async ensureCurrentBuildFinish() {
if (this.#cachedBuildFinishPromise) return this.#cachedBuildFinishPromise;
const promise = this.#inner.ensureCurrentBuildFinish().then(() => {
this.#cachedBuildFinishPromise = null;
});
this.#cachedBuildFinishPromise = promise;
return promise;
}
async getBundleState() {
return this.#inner.getBundleState();
}
async ensureLatestBuildOutput() {
unwrapBindingResult(await this.#inner.ensureLatestBuildOutput());
}
triggerFullBuild() {
this.#inner.triggerFullBuild();
}
async invalidate(file, firstInvalidatedBy) {
return unwrapBindingResult(await this.#inner.invalidate(file, firstInvalidatedBy));
}
async registerModules(clientId, modules) {
await this.#inner.registerModules(clientId, modules);
}
async removeClient(clientId) {
await this.#inner.removeClient(clientId);
}
async close() {
await this.#inner.close();
}
/**
* Compile a lazy entry module and return HMR-style patch code.
*
* This is called when a dynamically imported module is first requested at runtime.
* The module was previously stubbed with a proxy, and now we need to compile the
* actual module and its dependencies.
*
* @param moduleId - The absolute file path of the module to compile
* @param clientId - The client ID requesting this compilation
* @returns The compiled JavaScript code as a string (HMR patch format)
*/
async compileEntry(moduleId, clientId) {
return this.#inner.compileEntry(moduleId, clientId);
}
};
//#endregion
//#region src/api/dev/index.ts
const dev = (...args) => DevEngine.create(...args);
//#endregion
//#region src/types/external-memory-handle.ts
const symbolForExternalMemoryHandle = "__rolldown_external_memory_handle__";
/**
* Frees the external memory held by the given handle.
*
* This is useful when you want to manually release memory held by Rust objects
* (like `OutputChunk` or `OutputAsset`) before they are garbage collected.
*
* @param handle - The object with external memory to free
* @param keepDataAlive - If true, evaluates all lazy fields before freeing memory (default: false).
* This will take time to copy data from Rust to JavaScript, but prevents errors
* when accessing properties after the memory is freed.
* @returns Status object with `freed` boolean and optional `reason` string.
* - `{ freed: true }` if memory was successfully freed
* - `{ freed: false, reason: "..." }` if memory couldn't be freed (e.g., already freed or other references exist)
*
* @example
* ```typescript
* import { freeExternalMemory } from 'rolldown/experimental';
*
* const output = await bundle.generate();
* const chunk = output.output[0];
*
* // Use the chunk...
*
* // Manually free the memory (fast, but accessing properties after will throw)
* const status = freeExternalMemory(chunk); // { freed: true }
* const statusAgain = freeExternalMemory(chunk); // { freed: false, reason: "Memory has already been freed" }
*
* // Keep data alive before freeing (slower, but data remains accessible)
* freeExternalMemory(chunk, true); // Evaluates all lazy fields first
* console.log(chunk.code); // OK - data was copied to JavaScript before freeing
*
* // Without keepDataAlive, accessing chunk properties after freeing will throw an error
* ```
*/
function freeExternalMemory(handle, keepDataAlive = false) {
return handle[symbolForExternalMemoryHandle](keepDataAlive);
}
//#endregion
//#region src/api/experimental.ts
/**
* This is an experimental API. Its behavior may change in the future.
*
* - Calling this API will only execute the `scan/build` stage of rolldown.
* - `scan` will clean up all resources automatically, but if you want to ensure timely cleanup, you need to wait for the returned promise to resolve.
*
* @example To ensure cleanup of resources, use the returned promise to wait for the scan to complete.
* ```ts
* import { scan } from 'rolldown/api/experimental';
*
* const cleanupPromise = await scan(...);
* await cleanupPromise;
* // Now all resources have been cleaned up.
* ```
*/
const scan = async (rawInputOptions, rawOutputOptions = {}) => {
validateOption("input", rawInputOptions);
validateOption("output", rawOutputOptions);
const ret = await createBundlerOptions(await PluginDriver.callOptionsHook(rawInputOptions), rawOutputOptions, false);
const bundler = new import_binding.BindingBundler();
if (RolldownBuild.asyncRuntimeShutdown) (0, import_binding.startAsyncRuntime)();
async function cleanup() {
await bundler.close();
await ret.stopWorkers?.();
(0, import_binding.shutdownAsyncRuntime)();
RolldownBuild.asyncRuntimeShutdown = true;
}
let cleanupPromise = Promise.resolve();
try {
unwrapBindingResult(await bundler.scan(ret.bundlerOptions));
} catch (err) {
await cleanup();
throw err;
} finally {
cleanupPromise = cleanup();
}
return cleanupPromise;
};
//#endregion
//#region src/plugin/parallel-plugin.ts
function defineParallelPlugin(pluginPath) {
return (options) => {
return { _parallel: {
fileUrl: pathToFileURL(pluginPath).href,
options
} };
};
}
//#endregion
//#region src/builtin-plugin/alias-plugin.ts
function viteAliasPlugin(config) {
return new BuiltinPlugin("builtin:vite-alias", config);
}
//#endregion
//#region src/builtin-plugin/bundle-analyzer-plugin.ts
/**
* A plugin that analyzes bundle composition and generates detailed reports.
*
* The plugin outputs a file containing detailed information about:
* - All chunks and their relationships
* - Modules bundled in each chunk
* - Import dependencies between chunks
* - Reachable modules from each entry point
*
* @example
* ```js
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
*
* export default {
* plugins: [
* bundleAnalyzerPlugin()
* ]
* }
* ```
*
* @example
* **Custom filename**
* ```js
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
*
* export default {
* plugins: [
* bundleAnalyzerPlugin({
* fileName: 'bundle-analysis.json'
* })
* ]
* }
* ```
*
* @example
* **LLM-friendly markdown output**
* ```js
* import { bundleAnalyzerPlugin } from 'rolldown/experimental';
*
* export default {
* plugins: [
* bundleAnalyzerPlugin({
* format: 'md'
* })
* ]
* }
* ```
*/
function bundleAnalyzerPlugin(config) {
return new BuiltinPlugin("builtin:bundle-analyzer", config);
}
//#endregion
//#region src/builtin-plugin/transform-plugin.ts
function viteTransformPlugin(config) {
return new BuiltinPlugin("builtin:vite-transform", {
...config,
include: normalizedStringOrRegex(config.include),
exclude: normalizedStringOrRegex(config.exclude),
jsxRefreshInclude: normalizedStringOrRegex(config.jsxRefreshInclude),
jsxRefreshExclude: normalizedStringOrRegex(config.jsxRefreshExclude),
yarnPnp: typeof process === "object" && !!process.versions?.pnp
});
}
//#endregion
//#region src/builtin-plugin/vite-manifest-plugin.ts
function viteManifestPlugin(config) {
return new BuiltinPlugin("builtin:vite-manifest", config);
}
//#endregion
//#region src/experimental-index.ts
/**
* In-memory file system for browser builds.
*
* This is a re-export of the {@link https://github.com/streamich/memfs | memfs} package used by the WASI runtime.
* It allows you to read and write files to a virtual filesystem when using rolldown in browser environments.
*
* - `fs`: A Node.js-compatible filesystem API (`IFs` from memfs)
* - `volume`: The underlying `Volume` instance that stores the filesystem state
*
* Returns `undefined` in Node.js builds (only available in browser builds via `@rolldown/browser`).
*
* @example
* ```typescript
* import { memfs } from 'rolldown/experimental';
*
* // Write files to virtual filesystem before bundling
* memfs?.volume.fromJSON({
* '/src/index.js': 'export const foo = 42;',
* '/package.json': '{"name": "my-app"}'
* });
*
* // Read files from the virtual filesystem
* const content = memfs?.fs.readFileSync('/src/index.js', 'utf8');
* ```
*
* @see {@link https://github.com/streamich/memfs} for more information on the memfs API.
*/
const memfs = void 0;
/** @deprecated Use from `rolldown/utils` instead. */
const parse = parse$1;
/** @deprecated Use from `rolldown/utils` instead. */
const parseSync = parseSync$1;
/** @deprecated Use from `rolldown/utils` instead. */
const minify = minify$1;
/** @deprecated Use from `rolldown/utils` instead. */
const minifySync = minifySync$1;
/** @deprecated Use from `rolldown/utils` instead. */
const transform = transform$1;
/** @deprecated Use from `rolldown/utils` instead. */
const transformSync = transformSync$1;
/** @deprecated Use from `rolldown/utils` instead. */
const TsconfigCache = TsconfigCache$1;
//#endregion
var BindingRebuildStrategy = import_binding.BindingRebuildStrategy;
var ResolverFactory = import_binding.ResolverFactory;
var isolatedDeclaration = import_binding.isolatedDeclaration;
var isolatedDeclarationSync = import_binding.isolatedDeclarationSync;
var moduleRunnerTransform = import_binding.moduleRunnerTransform;
export { BindingRebuildStrategy, DevEngine, ResolverFactory, TsconfigCache, bundleAnalyzerPlugin, defineParallelPlugin, dev, viteDynamicImportVarsPlugin as dynamicImportVarsPlugin, viteDynamicImportVarsPlugin, freeExternalMemory, viteImportGlobPlugin as importGlobPlugin, viteImportGlobPlugin, isolatedDeclaration, isolatedDeclarationPlugin, isolatedDeclarationSync, memfs, minify, minifySync, moduleRunnerTransform, oxcRuntimePlugin, parse, parseSync, resolveTsconfig, scan, transform, transformSync, viteAliasPlugin, viteBuildImportAnalysisPlugin, viteJsonPlugin, viteLoadFallbackPlugin, viteManifestPlugin, viteModulePreloadPolyfillPlugin, viteReactRefreshWrapperPlugin, viteReporterPlugin, viteResolvePlugin, viteTransformPlugin, viteWebWorkerPostPlugin };
@@ -0,0 +1 @@
{"version":3,"file":"tally-3.js","sources":["../../../src/icons/tally-3.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Tally3\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCA0djE2IiAvPgogIDxwYXRoIGQ9Ik05IDR2MTYiIC8+CiAgPHBhdGggZD0iTTE0IDR2MTYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/tally-3\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 Tally3 = createLucideIcon('Tally3', [\n ['path', { d: 'M4 4v16', key: '6qkkli' }],\n ['path', { d: 'M9 4v16', key: '81ygyz' }],\n ['path', { d: 'M14 4v16', key: '12vmem' }],\n]);\n\nexport default Tally3;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,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;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,308 @@
"use client";
// src/popper.tsx
import * as React from "react";
import {
useFloating,
autoUpdate,
offset,
shift,
limitShift,
hide,
arrow as floatingUIarrow,
flip,
size
} from "@floating-ui/react-dom";
import * as ArrowPrimitive from "@radix-ui/react-arrow";
import { useComposedRefs } from "@radix-ui/react-compose-refs";
import { createContextScope } from "@radix-ui/react-context";
import { Primitive } from "@radix-ui/react-primitive";
import { useCallbackRef } from "@radix-ui/react-use-callback-ref";
import { useLayoutEffect } from "@radix-ui/react-use-layout-effect";
import { useSize } from "@radix-ui/react-use-size";
import { jsx } from "react/jsx-runtime";
var SIDE_OPTIONS = ["top", "right", "bottom", "left"];
var ALIGN_OPTIONS = ["start", "center", "end"];
var POPPER_NAME = "Popper";
var [createPopperContext, createPopperScope] = createContextScope(POPPER_NAME);
var [PopperProvider, usePopperContext] = createPopperContext(POPPER_NAME);
var Popper = (props) => {
const { __scopePopper, children } = props;
const [anchor, setAnchor] = React.useState(null);
return /* @__PURE__ */ jsx(PopperProvider, { scope: __scopePopper, anchor, onAnchorChange: setAnchor, children });
};
Popper.displayName = POPPER_NAME;
var ANCHOR_NAME = "PopperAnchor";
var PopperAnchor = React.forwardRef(
(props, forwardedRef) => {
const { __scopePopper, virtualRef, ...anchorProps } = props;
const context = usePopperContext(ANCHOR_NAME, __scopePopper);
const ref = React.useRef(null);
const composedRefs = useComposedRefs(forwardedRef, ref);
const anchorRef = React.useRef(null);
React.useEffect(() => {
const previousAnchor = anchorRef.current;
anchorRef.current = virtualRef?.current || ref.current;
if (previousAnchor !== anchorRef.current) {
context.onAnchorChange(anchorRef.current);
}
});
return virtualRef ? null : /* @__PURE__ */ jsx(Primitive.div, { ...anchorProps, ref: composedRefs });
}
);
PopperAnchor.displayName = ANCHOR_NAME;
var CONTENT_NAME = "PopperContent";
var [PopperContentProvider, useContentContext] = createPopperContext(CONTENT_NAME);
var PopperContent = React.forwardRef(
(props, forwardedRef) => {
const {
__scopePopper,
side = "bottom",
sideOffset = 0,
align = "center",
alignOffset = 0,
arrowPadding = 0,
avoidCollisions = true,
collisionBoundary = [],
collisionPadding: collisionPaddingProp = 0,
sticky = "partial",
hideWhenDetached = false,
updatePositionStrategy = "optimized",
onPlaced,
...contentProps
} = props;
const context = usePopperContext(CONTENT_NAME, __scopePopper);
const [content, setContent] = React.useState(null);
const composedRefs = useComposedRefs(forwardedRef, (node) => setContent(node));
const [arrow, setArrow] = React.useState(null);
const arrowSize = useSize(arrow);
const arrowWidth = arrowSize?.width ?? 0;
const arrowHeight = arrowSize?.height ?? 0;
const desiredPlacement = side + (align !== "center" ? "-" + align : "");
const collisionPadding = typeof collisionPaddingProp === "number" ? collisionPaddingProp : { top: 0, right: 0, bottom: 0, left: 0, ...collisionPaddingProp };
const boundary = Array.isArray(collisionBoundary) ? collisionBoundary : [collisionBoundary];
const hasExplicitBoundaries = boundary.length > 0;
const detectOverflowOptions = {
padding: collisionPadding,
boundary: boundary.filter(isNotNull),
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
altBoundary: hasExplicitBoundaries
};
const { refs, floatingStyles, placement, isPositioned, middlewareData } = useFloating({
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
strategy: "fixed",
placement: desiredPlacement,
whileElementsMounted: (...args) => {
const cleanup = autoUpdate(...args, {
animationFrame: updatePositionStrategy === "always"
});
return cleanup;
},
elements: {
reference: context.anchor
},
middleware: [
offset({ mainAxis: sideOffset + arrowHeight, alignmentAxis: alignOffset }),
avoidCollisions && shift({
mainAxis: true,
crossAxis: false,
limiter: sticky === "partial" ? limitShift() : void 0,
...detectOverflowOptions
}),
avoidCollisions && flip({ ...detectOverflowOptions }),
size({
...detectOverflowOptions,
apply: ({ elements, rects, availableWidth, availableHeight }) => {
const { width: anchorWidth, height: anchorHeight } = rects.reference;
const contentStyle = elements.floating.style;
contentStyle.setProperty("--radix-popper-available-width", `${availableWidth}px`);
contentStyle.setProperty("--radix-popper-available-height", `${availableHeight}px`);
contentStyle.setProperty("--radix-popper-anchor-width", `${anchorWidth}px`);
contentStyle.setProperty("--radix-popper-anchor-height", `${anchorHeight}px`);
}
}),
arrow && floatingUIarrow({ element: arrow, padding: arrowPadding }),
transformOrigin({ arrowWidth, arrowHeight }),
hideWhenDetached && hide({ strategy: "referenceHidden", ...detectOverflowOptions })
]
});
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
const handlePlaced = useCallbackRef(onPlaced);
useLayoutEffect(() => {
if (isPositioned) {
handlePlaced?.();
}
}, [isPositioned, handlePlaced]);
const arrowX = middlewareData.arrow?.x;
const arrowY = middlewareData.arrow?.y;
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
const [contentZIndex, setContentZIndex] = React.useState();
useLayoutEffect(() => {
if (content) setContentZIndex(window.getComputedStyle(content).zIndex);
}, [content]);
return /* @__PURE__ */ jsx(
"div",
{
ref: refs.setFloating,
"data-radix-popper-content-wrapper": "",
style: {
...floatingStyles,
transform: isPositioned ? floatingStyles.transform : "translate(0, -200%)",
// keep off the page when measuring
minWidth: "max-content",
zIndex: contentZIndex,
["--radix-popper-transform-origin"]: [
middlewareData.transformOrigin?.x,
middlewareData.transformOrigin?.y
].join(" "),
// hide the content if using the hide middleware and should be hidden
// set visibility to hidden and disable pointer events so the UI behaves
// as if the PopperContent isn't there at all
...middlewareData.hide?.referenceHidden && {
visibility: "hidden",
pointerEvents: "none"
}
},
dir: props.dir,
children: /* @__PURE__ */ jsx(
PopperContentProvider,
{
scope: __scopePopper,
placedSide,
onArrowChange: setArrow,
arrowX,
arrowY,
shouldHideArrow: cannotCenterArrow,
children: /* @__PURE__ */ jsx(
Primitive.div,
{
"data-side": placedSide,
"data-align": placedAlign,
...contentProps,
ref: composedRefs,
style: {
...contentProps.style,
// if the PopperContent hasn't been placed yet (not all measurements done)
// we prevent animations so that users's animation don't kick in too early referring wrong sides
animation: !isPositioned ? "none" : void 0
}
}
)
}
)
}
);
}
);
PopperContent.displayName = CONTENT_NAME;
var ARROW_NAME = "PopperArrow";
var OPPOSITE_SIDE = {
top: "bottom",
right: "left",
bottom: "top",
left: "right"
};
var PopperArrow = React.forwardRef(function PopperArrow2(props, forwardedRef) {
const { __scopePopper, ...arrowProps } = props;
const contentContext = useContentContext(ARROW_NAME, __scopePopper);
const baseSide = OPPOSITE_SIDE[contentContext.placedSide];
return (
// we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
// doesn't report size as we'd expect on SVG elements.
// it reports their bounding box which is effectively the largest path inside the SVG.
/* @__PURE__ */ jsx(
"span",
{
ref: contentContext.onArrowChange,
style: {
position: "absolute",
left: contentContext.arrowX,
top: contentContext.arrowY,
[baseSide]: 0,
transformOrigin: {
top: "",
right: "0 0",
bottom: "center 0",
left: "100% 0"
}[contentContext.placedSide],
transform: {
top: "translateY(100%)",
right: "translateY(50%) rotate(90deg) translateX(-50%)",
bottom: `rotate(180deg)`,
left: "translateY(50%) rotate(-90deg) translateX(50%)"
}[contentContext.placedSide],
visibility: contentContext.shouldHideArrow ? "hidden" : void 0
},
children: /* @__PURE__ */ jsx(
ArrowPrimitive.Root,
{
...arrowProps,
ref: forwardedRef,
style: {
...arrowProps.style,
// ensures the element can be measured correctly (mostly for if SVG)
display: "block"
}
}
)
}
)
);
});
PopperArrow.displayName = ARROW_NAME;
function isNotNull(value) {
return value !== null;
}
var transformOrigin = (options) => ({
name: "transformOrigin",
options,
fn(data) {
const { placement, rects, middlewareData } = data;
const cannotCenterArrow = middlewareData.arrow?.centerOffset !== 0;
const isArrowHidden = cannotCenterArrow;
const arrowWidth = isArrowHidden ? 0 : options.arrowWidth;
const arrowHeight = isArrowHidden ? 0 : options.arrowHeight;
const [placedSide, placedAlign] = getSideAndAlignFromPlacement(placement);
const noArrowAlign = { start: "0%", center: "50%", end: "100%" }[placedAlign];
const arrowXCenter = (middlewareData.arrow?.x ?? 0) + arrowWidth / 2;
const arrowYCenter = (middlewareData.arrow?.y ?? 0) + arrowHeight / 2;
let x = "";
let y = "";
if (placedSide === "bottom") {
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
y = `${-arrowHeight}px`;
} else if (placedSide === "top") {
x = isArrowHidden ? noArrowAlign : `${arrowXCenter}px`;
y = `${rects.floating.height + arrowHeight}px`;
} else if (placedSide === "right") {
x = `${-arrowHeight}px`;
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
} else if (placedSide === "left") {
x = `${rects.floating.width + arrowHeight}px`;
y = isArrowHidden ? noArrowAlign : `${arrowYCenter}px`;
}
return { data: { x, y } };
}
});
function getSideAndAlignFromPlacement(placement) {
const [side, align = "center"] = placement.split("-");
return [side, align];
}
var Root2 = Popper;
var Anchor = PopperAnchor;
var Content = PopperContent;
var Arrow = PopperArrow;
export {
ALIGN_OPTIONS,
Anchor,
Arrow,
Content,
Popper,
PopperAnchor,
PopperArrow,
PopperContent,
Root2 as Root,
SIDE_OPTIONS,
createPopperScope
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"parallelToolCallsClient.d.ts","sourceRoot":"","sources":["../../../../src/examples/client/parallelToolCallsClient.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
{"version":3,"file":"use-render.mjs","sources":["../../../../src/render/dom/use-render.ts"],"sourcesContent":["\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { Fragment, createElement, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { VisualState } from \"../../motion/utils/use-visual-state\"\nimport { HTMLRenderState } from \"../html/types\"\nimport { useHTMLProps } from \"../html/use-props\"\nimport { SVGRenderState } from \"../svg/types\"\nimport { useSVGProps } from \"../svg/use-props\"\nimport { DOMMotionComponents } from \"./types\"\nimport { filterProps } from \"./utils/filter-props\"\nimport { isSVGComponent } from \"./utils/is-svg-component\"\n\nexport function useRender<\n Props = {},\n TagName extends keyof DOMMotionComponents | string = \"div\"\n>(\n Component: TagName | string | React.ComponentType<Props>,\n props: MotionProps,\n ref: React.Ref<HTMLElement | SVGElement>,\n {\n latestValues,\n }: VisualState<HTMLElement | SVGElement, HTMLRenderState | SVGRenderState>,\n isStatic: boolean,\n forwardMotionProps: boolean = false,\n isSVG?: boolean\n) {\n const useVisualProps =\n (isSVG ?? isSVGComponent(Component)) ? useSVGProps : useHTMLProps\n\n const visualProps = useVisualProps(\n props as any,\n latestValues,\n isStatic,\n Component as any\n )\n const filteredProps = filterProps(\n props,\n typeof Component === \"string\",\n forwardMotionProps\n )\n const elementProps =\n Component !== Fragment ? { ...filteredProps, ...visualProps, ref } : {}\n\n /**\n * If component has been handed a motion value as its child,\n * memoise its initial value and render that. Subsequent updates\n * will be handled by the onChange handler\n */\n const { children } = props\n const renderedChildren = useMemo(\n () => (isMotionValue(children) ? children.get() : children),\n [children]\n )\n\n return createElement<any>(Component, {\n ...elementProps,\n children: renderedChildren,\n })\n}\n"],"names":[],"mappings":";;;;;;;;;AA4BI;AAGA;AAMA;;AAQA;;;;AAIG;AACH;AACA;;AAMI;AACA;AACH;AACL;;"}
@@ -0,0 +1,75 @@
import { invariant, clamp, MotionGlobalConfig, noop, pipe, progress } from 'motion-utils';
import { mix } from './mix/index.mjs';
function createMixers(output, ease, customMixer) {
const mixers = [];
const mixerFactory = customMixer || MotionGlobalConfig.mix || mix;
const numMixers = output.length - 1;
for (let i = 0; i < numMixers; i++) {
let mixer = mixerFactory(output[i], output[i + 1]);
if (ease) {
const easingFunction = Array.isArray(ease) ? ease[i] || noop : ease;
mixer = pipe(easingFunction, mixer);
}
mixers.push(mixer);
}
return mixers;
}
/**
* Create a function that maps from a numerical input array to a generic output array.
*
* Accepts:
* - Numbers
* - Colors (hex, hsl, hsla, rgb, rgba)
* - Complex (combinations of one or more numbers or strings)
*
* ```jsx
* const mixColor = interpolate([0, 1], ['#fff', '#000'])
*
* mixColor(0.5) // 'rgba(128, 128, 128, 1)'
* ```
*
* TODO Revisit this approach once we've moved to data models for values,
* probably not needed to pregenerate mixer functions.
*
* @public
*/
function interpolate(input, output, { clamp: isClamp = true, ease, mixer } = {}) {
const inputLength = input.length;
invariant(inputLength === output.length, "Both input and output ranges must be the same length", "range-length");
/**
* If we're only provided a single input, we can just make a function
* that returns the output.
*/
if (inputLength === 1)
return () => output[0];
if (inputLength === 2 && output[0] === output[1])
return () => output[1];
const isZeroDeltaRange = input[0] === input[1];
// If input runs highest -> lowest, reverse both arrays
if (input[0] > input[inputLength - 1]) {
input = [...input].reverse();
output = [...output].reverse();
}
const mixers = createMixers(output, ease, mixer);
const numMixers = mixers.length;
const interpolator = (v) => {
if (isZeroDeltaRange && v < input[0])
return output[0];
let i = 0;
if (numMixers > 1) {
for (; i < input.length - 2; i++) {
if (v < input[i + 1])
break;
}
}
const progressInRange = progress(input[i], input[i + 1], v);
return mixers[i](progressInRange);
};
return isClamp
? (v) => interpolator(clamp(input[0], input[inputLength - 1], v))
: interpolator;
}
export { interpolate };
//# sourceMappingURL=interpolate.mjs.map
@@ -0,0 +1,72 @@
import addDays from "./addDays.mjs";
import addHours from "./addHours.mjs";
import addMilliseconds from "./addMilliseconds.mjs";
import addMinutes from "./addMinutes.mjs";
import addMonths from "./addMonths.mjs";
import addSeconds from "./addSeconds.mjs";
import addYears from "./addYears.mjs";
import units from "./units.mjs";
import { n as normalizeUnit } from "./normalizeUnit-bp5SODxw.mjs";
import daysInMonth from "./daysInMonth.mjs";
import { c as MS_IN_SECOND, b as MS_IN_MINUTE, a as MS_IN_HOUR } from "./constants-BuFquuHl.mjs";
const { DAY: DAY$1, HOUR: HOUR$1, MINUTE: MINUTE$1, MONTH: MONTH$1, SECOND: SECOND$1, YEAR: YEAR$1 } = units;
function addNumber(date, num, unit) {
unit = normalizeUnit(unit);
switch (unit) {
case YEAR$1:
return addYears(date, num);
case MONTH$1:
return addMonths(date, num);
case DAY$1:
return addDays(date, num);
case HOUR$1:
return addHours(date, num);
case MINUTE$1:
return addMinutes(date, num);
case SECOND$1:
return addSeconds(date, num);
default:
return addMilliseconds(date, num);
}
}
const { DAY, HOUR, MINUTE, MONTH, SECOND, YEAR } = units;
function addObject(date, obj, times) {
let time = 0;
let expectedMonth = 0;
let expectedDay = 0;
Object.entries(obj).forEach(([unit, num]) => {
unit = normalizeUnit(unit);
num *= times;
switch (unit) {
case YEAR:
expectedMonth += num * 12;
return;
case MONTH:
expectedMonth += date.getMonth() + num;
return;
case DAY:
expectedDay = num;
return;
case HOUR:
num *= MS_IN_HOUR;
break;
case MINUTE:
num *= MS_IN_MINUTE;
break;
case SECOND:
num *= MS_IN_SECOND;
break;
}
time += num;
});
if (expectedMonth) {
const tempMaxDay = daysInMonth(new Date(date.getFullYear(), expectedMonth, 1, 0, 0, 0, 0));
const currentDay = date.getDate();
date.setMonth(expectedMonth, (currentDay > tempMaxDay ? tempMaxDay : currentDay) + expectedDay);
}
return addMilliseconds(date, time);
}
export {
addObject as a,
addNumber as b
};
@@ -0,0 +1,194 @@
{
"name": "vite",
"version": "8.1.6",
"description": "Native-ESM powered web dev build tool",
"keywords": [
"build-tool",
"dev-server",
"framework",
"frontend",
"hmr",
"vite"
],
"homepage": "https://vite.dev",
"bugs": {
"url": "https://github.com/vitejs/vite/issues"
},
"license": "MIT",
"author": "Evan You",
"repository": {
"type": "git",
"url": "git+https://github.com/vitejs/vite.git",
"directory": "packages/vite"
},
"funding": "https://github.com/vitejs/vite?sponsor=1",
"bin": {
"vite": "bin/vite.js"
},
"files": [
"bin",
"dist",
"misc/**/*.js",
"client.d.ts",
"types"
],
"type": "module",
"imports": {
"#module-sync-enabled": {
"module-sync": "./misc/true.js",
"default": "./misc/false.js"
},
"#types/*": "./types/*.d.ts",
"#dep-types/*": "./src/types/*.d.ts"
},
"exports": {
".": "./dist/node/index.js",
"./client": {
"types": "./client.d.ts"
},
"./module-runner": "./dist/node/module-runner.js",
"./internal": "./dist/node/internal.js",
"./dist/client/*": "./dist/client/*",
"./types/*": {
"types": "./types/*"
},
"./types/internal/*": null,
"./package.json": "./package.json"
},
"dependencies": {
"lightningcss": "^1.32.0",
"picomatch": "^4.0.5",
"postcss": "^8.5.17",
"rolldown": "~1.1.5",
"tinyglobby": "^0.2.17"
},
"devDependencies": {
"@babel/parser": "^7.29.7",
"@jridgewell/remapping": "^2.3.5",
"@jridgewell/trace-mapping": "^0.3.31",
"@polka/compression": "^1.0.0-next.25",
"@rollup/plugin-alias": "^6.0.0",
"@rollup/plugin-dynamic-import-vars": "2.1.4",
"@rollup/pluginutils": "^5.4.0",
"@types/escape-html": "^1.0.4",
"@types/pnpapi": "^0.0.5",
"@vercel/detect-agent": "^1.2.3",
"@vitejs/devtools": "^0.3.4",
"@vitest/utils": "4.1.10",
"@voidzero-dev/vite-task-client": "^0.2.0",
"artichokie": "^0.4.4",
"baseline-browser-mapping": "^2.10.43",
"cac": "^7.0.0",
"chokidar": "^3.6.0",
"connect": "^3.7.0",
"convert-source-map": "^2.0.0",
"cors": "^2.8.6",
"cross-spawn": "^7.0.6",
"dotenv-expand": "^13.0.0",
"es-module-lexer": "^2.3.1",
"esbuild": "^0.28.1",
"escape-html": "^1.0.3",
"estree-walker": "^3.0.3",
"etag": "^1.8.1",
"fresh-import": "^0.2.1",
"host-validation-middleware": "^0.1.4",
"http-proxy-3": "^1.23.3",
"launch-editor-middleware": "^2.14.2",
"magic-string": "^0.30.21",
"mlly": "^1.8.2",
"mrmime": "^2.0.1",
"nanoid": "^5.1.16",
"obug": "^1.0.2",
"open": "^10.2.0",
"parse5": "^8.0.1",
"pathe": "^2.0.3",
"periscopic": "^4.0.3",
"picocolors": "^1.1.1",
"postcss-import": "^16.1.1",
"postcss-load-config": "^6.0.1",
"postcss-modules": "^9.0.1",
"premove": "^4.0.0",
"resolve.exports": "^2.0.3",
"rolldown-plugin-dts": "^0.27.6",
"rollup": "^4.59.0",
"rollup-plugin-license": "^3.7.1",
"sass": "^1.101.0",
"sass-embedded": "^1.100.0",
"sirv": "^3.0.2",
"strip-literal": "^3.1.0",
"terser": "^5.49.0",
"ufo": "^1.6.4",
"ws": "^8.21.0"
},
"peerDependencies": {
"@types/node": "^20.19.0 || >=22.12.0",
"@vitejs/devtools": "^0.3.0",
"esbuild": "^0.27.0 || ^0.28.0",
"jiti": ">=1.21.0",
"less": "^4.0.0",
"sass": "^1.70.0",
"sass-embedded": "^1.70.0",
"stylus": ">=0.54.8",
"sugarss": "^5.0.0",
"terser": "^5.16.0",
"tsx": "^4.8.1",
"yaml": "^2.4.2"
},
"peerDependenciesMeta": {
"@types/node": {
"optional": true
},
"@vitejs/devtools": {
"optional": true
},
"esbuild": {
"optional": true
},
"jiti": {
"optional": true
},
"sass": {
"optional": true
},
"sass-embedded": {
"optional": true
},
"stylus": {
"optional": true
},
"less": {
"optional": true
},
"sugarss": {
"optional": true
},
"terser": {
"optional": true
},
"tsx": {
"optional": true
},
"yaml": {
"optional": true
}
},
"optionalDependencies": {
"fsevents": "~2.3.3"
},
"engines": {
"node": "^20.19.0 || >=22.12.0"
},
"//": "READ CONTRIBUTING.md to understand what to put under deps vs. devDeps!",
"scripts": {
"dev": "premove dist && pnpm build-bundle -w",
"build": "premove dist && pnpm build-bundle && pnpm build-types",
"build-bundle": "rolldown --config rolldown.config.ts",
"build-types": "pnpm build-types-roll && pnpm build-types-check",
"build-types-roll": "rolldown --config rolldown.dts.config.ts",
"build-types-check": "tsc --project tsconfig.check.json",
"typecheck": "tsc && tsc -p src/node && tsc -p src/client && tsc -p src/module-runner && tsc -p src/shared && tsc -p src/node/__tests_dts__ && tsc -p src/module-runner/__tests_dts__",
"lint": "eslint --cache --ext .ts src/**",
"format": "oxfmt",
"generate-target": "tsx scripts/generateTarget.ts"
}
}
@@ -0,0 +1,497 @@
import { expect, expectTypeOf, test } from "vitest";
import * as z from "zod/v4";
const nested = z.object({
name: z.string(),
age: z.number(),
outer: z.object({
inner: z.string(),
}),
array: z.array(z.object({ asdf: z.string() })),
});
test("shallow inference", () => {
const shallow = nested.partial();
type shallow = z.infer<typeof shallow>;
expectTypeOf<shallow>().toEqualTypeOf<{
name?: string | undefined;
age?: number | undefined;
outer?: { inner: string } | undefined;
array?: { asdf: string }[] | undefined;
}>();
});
test("shallow partial parse", () => {
const shallow = nested.partial();
shallow.parse({});
shallow.parse({
name: "asdf",
age: 23143,
});
});
test("required", () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
nullableField: z.number().nullable(),
nullishField: z.string().nullish(),
});
const requiredObject = object.required();
expect(requiredObject.shape.name).toBeInstanceOf(z.ZodNonOptional);
expect(requiredObject.shape.name.unwrap()).toBeInstanceOf(z.ZodString);
expect(requiredObject.shape.age).toBeInstanceOf(z.ZodNonOptional);
expect(requiredObject.shape.age.unwrap()).toBeInstanceOf(z.ZodOptional);
expect(requiredObject.shape.field).toBeInstanceOf(z.ZodNonOptional);
expect(requiredObject.shape.field.unwrap()).toBeInstanceOf(z.ZodDefault);
expect(requiredObject.shape.nullableField).toBeInstanceOf(z.ZodNonOptional);
expect(requiredObject.shape.nullableField.unwrap()).toBeInstanceOf(z.ZodNullable);
expect(requiredObject.shape.nullishField).toBeInstanceOf(z.ZodNonOptional);
expect(requiredObject.shape.nullishField.unwrap()).toBeInstanceOf(z.ZodOptional);
expect(requiredObject.shape.nullishField.unwrap().unwrap()).toBeInstanceOf(z.ZodNullable);
});
test("required inference", () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
nullableField: z.number().nullable(),
nullishField: z.string().nullish(),
});
const requiredObject = object.required();
type required = z.infer<typeof requiredObject>;
type expected = {
name: string;
age: number;
field: string;
nullableField: number | null;
nullishField: string | null;
};
expectTypeOf<expected>().toEqualTypeOf<required>();
});
test("required with mask", () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
country: z.string().optional(),
});
const requiredObject = object.required({ age: true });
expect(requiredObject.shape.name).toBeInstanceOf(z.ZodString);
expect(requiredObject.shape.age).toBeInstanceOf(z.ZodNonOptional);
expect(requiredObject.shape.field).toBeInstanceOf(z.ZodDefault);
expect(requiredObject.shape.country).toBeInstanceOf(z.ZodOptional);
});
test("required with mask -- ignore falsy values", () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
country: z.string().optional(),
});
// @ts-expect-error
const requiredObject = object.required({ age: true, country: false });
expect(requiredObject.shape.name).toBeInstanceOf(z.ZodString);
expect(requiredObject.shape.age).toBeInstanceOf(z.ZodNonOptional);
expect(requiredObject.shape.field).toBeInstanceOf(z.ZodDefault);
expect(requiredObject.shape.country).toBeInstanceOf(z.ZodOptional);
});
test("partial with mask", async () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
country: z.string(),
});
const masked = object.partial({ age: true, field: true, name: true }).strict();
expect(masked.shape.name).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.age).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.field).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.country).toBeInstanceOf(z.ZodString);
masked.parse({ country: "US" });
await masked.parseAsync({ country: "US" });
});
test("partial with mask -- ignore falsy values", async () => {
const object = z.object({
name: z.string(),
age: z.number().optional(),
field: z.string().optional().default("asdf"),
country: z.string(),
});
// @ts-expect-error
const masked = object.partial({ name: true, country: false }).strict();
expect(masked.shape.name).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.age).toBeInstanceOf(z.ZodOptional);
expect(masked.shape.field).toBeInstanceOf(z.ZodDefault);
expect(masked.shape.country).toBeInstanceOf(z.ZodString);
masked.parse({ country: "US" });
await masked.parseAsync({ country: "US" });
});
test("catch/prefault/default", () => {
const mySchema = z.object({
a: z.string().catch("catch value").optional(),
b: z.string().default("default value").optional(),
c: z.string().prefault("prefault value").optional(),
d: z.string().catch("catch value"),
e: z.string().default("default value"),
f: z.string().prefault("prefault value"),
});
// Catch (d) and default/prefault (b, c, e, f) handle absent keys gracefully. `a: catch().optional()` short-circuits to undefined when the original input was undefined, so the property is omitted from the output. All other catch/default/prefault keys produce their fallback values.
expect(mySchema.parse({})).toMatchInlineSnapshot(`
{
"b": "default value",
"c": "prefault value",
"d": "catch value",
"e": "default value",
"f": "prefault value",
}
`);
expect(mySchema.parse({}, { jitless: true })).toMatchInlineSnapshot(`
{
"b": "default value",
"c": "prefault value",
"d": "catch value",
"e": "default value",
"f": "prefault value",
}
`);
expect(mySchema.parse({ d: undefined })).toMatchInlineSnapshot(`
{
"b": "default value",
"c": "prefault value",
"d": "catch value",
"e": "default value",
"f": "prefault value",
}
`);
expect(mySchema.parse({ d: undefined }, { jitless: true })).toMatchInlineSnapshot(`
{
"b": "default value",
"c": "prefault value",
"d": "catch value",
"e": "default value",
"f": "prefault value",
}
`);
});
test("handleOptionalObjectResult branches", () => {
const mySchema = z.object({
// Branch: input[key] === undefined, key not in input, caught error
caughtMissing: z.string().catch("caught").optional(),
// Branch: input[key] === undefined, key in input, caught error
caughtUndefined: z.string().catch("caught").optional(),
// Branch: input[key] === undefined, key not in input, validation issues
issueMissing: z.string().min(5).optional(),
// Branch: input[key] === undefined, key in input, validation issues
issueUndefined: z.string().min(5).optional(),
// Branch: input[key] === undefined, validation returns undefined
validUndefined: z.string().optional(),
// Branch: input[key] === undefined, non-undefined result (default/transform)
defaultValue: z.string().default("default").optional(),
// Branch: input[key] defined, caught error
caughtDefined: z.string().catch("caught").optional(),
// Branch: input[key] defined, validation issues
issueDefined: z.string().min(5).optional(),
// Branch: input[key] defined, validation returns undefined
validDefinedUndefined: z
.string()
.transform(() => undefined)
.optional(),
// Branch: input[key] defined, non-undefined value
validDefined: z.string().optional(),
});
// Test input[key] === undefined cases
const result1 = mySchema.parse(
{
// caughtMissing: not present (key not in input)
caughtUndefined: undefined, // key in input
// issueMissing: not present (key not in input)
issueUndefined: undefined, // key in input
validUndefined: undefined,
// defaultValue: not present, will get default
},
{ jitless: true }
);
expect(result1).toEqual({
caughtUndefined: undefined,
issueUndefined: undefined,
validUndefined: undefined,
defaultValue: "default",
});
// Test input[key] defined cases (successful)
const result2 = mySchema.parse(
{
caughtDefined: 123, // invalid type, should catch
validDefinedUndefined: "test", // transforms to undefined
validDefined: "valid", // valid value
},
{ jitless: true }
);
expect(result2).toEqual({
caughtDefined: "caught",
validDefinedUndefined: undefined,
validDefined: "valid",
defaultValue: "default",
});
// Test validation issues are properly reported (input[key] defined, validation fails)
expect(() =>
mySchema.parse(
{
issueDefined: "abc", // too short
},
{ jitless: true }
)
).toThrow();
});
test("fastpass vs non-fastpass consistency", () => {
const mySchema = z.object({
caughtMissing: z.string().catch("caught").optional(),
caughtUndefined: z.string().catch("caught").optional(),
issueMissing: z.string().min(5).optional(),
issueUndefined: z.string().min(5).optional(),
validUndefined: z.string().optional(),
defaultValue: z.string().default("default").optional(),
caughtDefined: z.string().catch("caught").optional(),
validDefinedUndefined: z
.string()
.transform(() => undefined)
.optional(),
validDefined: z.string().optional(),
});
const input = {
caughtUndefined: undefined,
issueUndefined: undefined,
validUndefined: undefined,
caughtDefined: 123,
validDefinedUndefined: "test",
validDefined: "valid",
};
// Test both paths produce identical results
const jitlessResult = mySchema.parse(input, { jitless: true });
const fastpassResult = mySchema.parse(input);
expect(jitlessResult).toEqual(fastpassResult);
expect(jitlessResult).toEqual({
caughtUndefined: undefined,
issueUndefined: undefined,
validUndefined: undefined,
defaultValue: "default",
caughtDefined: "caught",
validDefinedUndefined: undefined,
validDefined: "valid",
});
});
test("optional with check", () => {
const baseSchema = z
.string()
.optional()
.check(({ value, ...ctx }) => {
ctx.issues.push({
code: "custom",
input: value,
message: "message",
});
});
// this correctly fails
expect(baseSchema.safeParse(undefined)).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "custom",
"message": "message",
"path": []
}
]],
"success": false,
}
`);
const schemaObject = z.object({
date: baseSchema,
});
expect(schemaObject.safeParse({ date: undefined })).toMatchInlineSnapshot(`
{
"error": [ZodError: [
{
"code": "custom",
"message": "message",
"path": [
"date"
]
}
]],
"success": false,
}
`);
});
test("partial - throws error on schema with refinements", () => {
const baseSchema = z.object({
id: z.string(),
name: z.string(),
items: z.string().array(),
});
const refinedSchema = baseSchema.superRefine((val, ctx) => {
if (val.items.length === 0) {
ctx.addIssue({
message: "Must have at least one item",
code: "custom",
path: ["items"],
});
}
});
expect(() => refinedSchema.partial()).toThrow(".partial() cannot be used on object schemas containing refinements");
});
test("partial - throws error on schema with refine", () => {
const baseSchema = z.object({
password: z.string(),
confirmPassword: z.string(),
});
const refinedSchema = baseSchema.refine((data) => data.password === data.confirmPassword, {
message: "Passwords must match",
});
expect(() => refinedSchema.partial()).toThrow(".partial() cannot be used on object schemas containing refinements");
});
test("required - preserves refinements", () => {
const baseSchema = z.object({
name: z.string().optional(),
age: z.number().optional(),
});
const refinedSchema = baseSchema.superRefine((val, ctx) => {
if (val.name === "admin") {
ctx.addIssue({
message: "Name cannot be admin",
code: "custom",
path: ["name"],
});
}
});
const requiredSchema = refinedSchema.required();
// The refinement should still be applied
const result = requiredSchema.safeParse({ name: "admin", age: 25 });
expect(result.success).toBe(false);
if (!result.success) {
expect(result.error.issues[0].message).toBe("Name cannot be admin");
}
// Valid data should pass
const validResult = requiredSchema.safeParse({ name: "user", age: 25 });
expect(validResult.success).toBe(true);
});
test("required - refinement is executed on required schema", () => {
const baseSchema = z.object({
password: z.string().optional(),
confirmPassword: z.string().optional(),
});
const refinedSchema = baseSchema.refine((data) => data.password === data.confirmPassword, {
message: "Passwords must match",
});
const requiredSchema = refinedSchema.required();
// Mismatched passwords should fail refinement
const result = requiredSchema.safeParse({ password: "abc", confirmPassword: "xyz" });
expect(result.success).toBe(false);
if (!result.success) {
expect(result.error.issues[0].message).toBe("Passwords must match");
}
// Matching passwords should pass
const validResult = requiredSchema.safeParse({ password: "abc", confirmPassword: "abc" });
expect(validResult.success).toBe(true);
});
test("exactPartial - shallow inference", () => {
const shallow = nested.exactPartial();
type shallow = z.infer<typeof shallow>;
expectTypeOf<shallow>().toEqualTypeOf<{
name?: string;
age?: number;
outer?: { inner: string };
array?: { asdf: string }[];
}>();
// The point of exactPartial: unlike partial(), this matches TypeScript's Partial<> under exactOptionalPropertyTypes.
expectTypeOf<shallow>().toEqualTypeOf<Partial<z.infer<typeof nested>>>();
});
test("exactPartial - wraps fields in ZodExactOptional", () => {
const object = z.object({ name: z.string(), age: z.number() });
const exact = object.exactPartial();
expect(exact.shape.name).toBeInstanceOf(z.ZodExactOptional);
expect(exact.shape.age).toBeInstanceOf(z.ZodExactOptional);
expect(exact.shape.name.unwrap()).toBeInstanceOf(z.ZodString);
});
test("exactPartial - absent keys pass, explicit undefined rejected", () => {
const exact = z.object({ name: z.string(), age: z.number() }).exactPartial();
expect(exact.parse({})).toEqual({});
expect(exact.parse({ name: "asdf" })).toEqual({ name: "asdf" });
expect(exact.safeParse({ name: undefined }).success).toBe(false);
});
test("exactPartial with mask", () => {
const object = z.object({ name: z.string(), age: z.number(), country: z.string() });
const masked = object.exactPartial({ name: true, age: true });
expect(masked.shape.name).toBeInstanceOf(z.ZodExactOptional);
expect(masked.shape.age).toBeInstanceOf(z.ZodExactOptional);
expect(masked.shape.country).toBeInstanceOf(z.ZodString);
type masked = z.infer<typeof masked>;
expectTypeOf<masked>().toEqualTypeOf<{ name?: string; age?: number; country: string }>();
expect(masked.parse({ country: "US" })).toEqual({ country: "US" });
expect(masked.safeParse({ country: "US", name: undefined }).success).toBe(false);
});
test("exactPartial - throws on schema with refinements", () => {
const refined = z.object({ name: z.string() }).refine(() => true);
expect(() => refined.exactPartial()).toThrow(
".exactPartial() cannot be used on object schemas containing refinements"
);
});
@@ -0,0 +1 @@
{"version":3,"file":"message-square-lock.js","sources":["../../../src/icons/message-square-lock.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessageSquareLock\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTkgMTV2LTJhMiAyIDAgMSAwLTQgMHYyIiAvPgogIDxwYXRoIGQ9Ik05IDE3SDdsLTQgNFY1YTIgMiAwIDAgMSAyLTJoMTRhMiAyIDAgMCAxIDIgMnYzLjUiIC8+CiAgPHJlY3QgeD0iMTMiIHk9IjE1IiB3aWR0aD0iOCIgaGVpZ2h0PSI1IiByeD0iMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/message-square-lock\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 MessageSquareLock = createLucideIcon('MessageSquareLock', [\n ['path', { d: 'M19 15v-2a2 2 0 1 0-4 0v2', key: 'h3d1vz' }],\n ['path', { d: 'M9 17H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v3.5', key: 'xsnnhn' }],\n ['rect', { x: '13', y: '15', width: '8', height: '5', rx: '1', key: '1ccwuk' }],\n]);\n\nexport default MessageSquareLock;\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,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC1D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAClF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAG,MAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAQ,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,23 @@
/**
* @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 Logs = createLucideIcon("Logs", [
["path", { d: "M13 12h8", key: "h98zly" }],
["path", { d: "M13 18h8", key: "oe0vm4" }],
["path", { d: "M13 6h8", key: "15sg57" }],
["path", { d: "M3 12h1", key: "lp3yf2" }],
["path", { d: "M3 18h1", key: "1eiwyy" }],
["path", { d: "M3 6h1", key: "rgxa97" }],
["path", { d: "M8 12h1", key: "1con00" }],
["path", { d: "M8 18h1", key: "13wk12" }],
["path", { d: "M8 6h1", key: "tn6mkg" }]
]);
export { Logs as default };
//# sourceMappingURL=logs.js.map
@@ -0,0 +1,161 @@
/**
* String or binary
*/
type QrCodeGenerateData = string | Readonly<Array<number>>;
interface QrCodeGenerateOptions {
/**
* Error correction level
*
* L - Allows recovery of up to 7% data loss
* M - Allows recovery of up to 15% data loss
* Q - Allows recovery of up to 25% data loss
* H - Allows recovery of up to 30% data loss
*
* @default 'L'
*/
ecc?: 'L' | 'M' | 'Q' | 'H';
/**
* Mask pattern to use
*
* @default -1 (auto)
*/
maskPattern?: number;
/**
* Boost the error correction level to the maximum allowed by the version and size
*/
boostEcc?: boolean;
/**
* Minimum version of the QR code (1-40)
* @default 1
*/
minVersion?: number;
/**
* Maximum version of the QR code (1-40)
* @default 40
*/
maxVersion?: number;
/**
* Border around the QR code
*
* @default 1
*/
border?: number;
/**
* Invert black and white
*/
invert?: boolean;
/**
* Callback function to receive the generated QR Code
*/
onEncoded?: (qr: QrCodeGenerateResult) => void;
}
declare enum QrCodeDataType {
Border = -1,
Data = 0,
Function = 1,
Position = 2,
Timing = 3,
Alignment = 4
}
interface QrCodeGenerateResult {
/**
* QR Code version
*/
version: number;
/**
* Width and height of the QR Code array
*/
size: number;
/**
* Mask pattern used
*/
maskPattern: number;
/**
* Two dimensional array representing the QR Code
*
* `true` for black, `false` for white
*/
data: boolean[][];
/**
* Data type of each module
*/
types: QrCodeDataType[][];
}
interface QrCodeGenerateInvertableOptions extends QrCodeGenerateOptions {
/**
* Adds the option to invert the colour scheme of the QR code in addition to the standard options.
*/
invert?: boolean;
}
interface QrCodeGenerateUnicodeOptions extends QrCodeGenerateInvertableOptions {
/**
* Character used to represent white modules in the QR code.
*/
whiteChar?: string;
/**
* Character used to represent black modules in the QR code.
*/
blackChar?: string;
}
interface QrCodeGenerateSvgOptions extends QrCodeGenerateOptions {
/**
* Size of each pixel
*
* @default 10
*/
pixelSize?: number;
/**
* Color of the white module
*
* @default 'white'
*/
whiteColor?: string;
/**
* Color of the black module
*
* @default 'black'
*/
blackColor?: string;
}
/**
* Encodes the given data into a QR code format according to the given options.
* @param {QrCodeGenerateData} data - The data to encode, either as a string or an array of bytes. See {@link QrCodeGenerateData}.
* @param {QrCodeGenerateOptions} [options] - QR Code generation configuration options. Optional. See {@link QrCodeGenerateOptions}.
* @returns {QrCodeGenerateResult} The result of the QR code generation, including the QR code matrix. See {@link QrCodeGenerateResult}.
*/
declare function encode(data: QrCodeGenerateData, options?: QrCodeGenerateOptions): QrCodeGenerateResult;
/**
* Renders a QR code as a string using the specified Unicode characters for dark(`█`) and light(`░`) modules.
* @param {QrCodeGenerateData} data - The data to encode into the QR code. See {@link QrCodeGenerateData}.
* @param {QrCodeGenerateUnicodeOptions} [options] - Rendering options, including characters for white and black modules. optional. See {@link QrCodeGenerateUnicodeOptions}.
* Returns {string} A string representing the QR code, with each module replaced by the specified Unicode character.
*/
declare function renderUnicode(data: QrCodeGenerateData, options?: QrCodeGenerateUnicodeOptions): string;
/**
* Renders a QR code as a string suitable for display on terminals using ANSI background colours.
* @param {QrCodeGenerateData} data - The data to encode into the QR code. See {@link QrCodeGenerateData}.
* @param {QrCodeGenerateOptions} [options] - Options to render the QR code. optional. See {@link QrCodeGenerateOptions}.
* @returns {string} A string representing the QR code using ANSI colours, formatted for terminal display.
*/
declare function renderANSI(data: QrCodeGenerateData, options?: QrCodeGenerateOptions): string;
/**
* Renders a QR code as a compact string using a combination of top half block(`▀`), bottom half block(`▄`), full block(`█`) and spaces to represent two lines in a single line.
* @param {QrCodeGenerateData} data - The data to encode into the QR code. See {@link QrCodeGenerateData}.
* @param {QrCodeGenerateOptions} [options] - Options to render the QR code in a compact form. optional. See {@link QrCodeGenerateOptions}.
* @returns {string} A string representing the QR code in a compact format, using Unicode block characters to combine two lines per line.
*/
declare function renderUnicodeCompact(data: QrCodeGenerateData, options?: QrCodeGenerateOptions): string;
/**
* Renders a QR code as an SVG string.
* The function converts the input data into a QR code and then generates an SVG representation using the specified colours and pixel sizes.
* @param {QrCodeGenerateData} data - The data to encode into the QR code. See {@link QrCodeGenerateData}.
* @param {QrCodeGenerateSvgOptions} [options] - Options to render the QR code in SVG format, including pixel size and colours for modules. optional. See {@link QrCodeGenerateSvgOptions}.
* @returns {string} An SVG string representing the QR code.
*/
declare function renderSVG(data: QrCodeGenerateData, options?: QrCodeGenerateSvgOptions): string;
export { QrCodeDataType, encode, renderANSI, renderSVG, renderUnicode, renderUnicodeCompact };
export type { QrCodeGenerateData, QrCodeGenerateInvertableOptions, QrCodeGenerateOptions, QrCodeGenerateResult, QrCodeGenerateSvgOptions, QrCodeGenerateUnicodeOptions };
@@ -0,0 +1,3 @@
# `react-scroll-area`
View docs [here](https://radix-ui.com/primitives/docs/components/scroll-area).
@@ -0,0 +1,51 @@
/** Types of elements found in htmlparser2's DOM */
export var ElementType;
(function (ElementType) {
/** Type for the root element of a document */
ElementType["Root"] = "root";
/** Type for Text */
ElementType["Text"] = "text";
/** Type for <? ... ?> */
ElementType["Directive"] = "directive";
/** Type for <!-- ... --> */
ElementType["Comment"] = "comment";
/** Type for <script> tags */
ElementType["Script"] = "script";
/** Type for <style> tags */
ElementType["Style"] = "style";
/** Type for Any tag */
ElementType["Tag"] = "tag";
/** Type for <![CDATA[ ... ]]> */
ElementType["CDATA"] = "cdata";
/** Type for <!doctype ...> */
ElementType["Doctype"] = "doctype";
})(ElementType || (ElementType = {}));
/**
* Tests whether an element is a tag or not.
*
* @param elem Element to test
*/
export function isTag(elem) {
return (elem.type === ElementType.Tag ||
elem.type === ElementType.Script ||
elem.type === ElementType.Style);
}
// Exports for backwards compatibility
/** Type for the root element of a document */
export const Root = ElementType.Root;
/** Type for Text */
export const Text = ElementType.Text;
/** Type for <? ... ?> */
export const Directive = ElementType.Directive;
/** Type for <!-- ... --> */
export const Comment = ElementType.Comment;
/** Type for <script> tags */
export const Script = ElementType.Script;
/** Type for <style> tags */
export const Style = ElementType.Style;
/** Type for Any tag */
export const Tag = ElementType.Tag;
/** Type for <![CDATA[ ... ]]> */
export const CDATA = ElementType.CDATA;
/** Type for <!doctype ...> */
export const Doctype = ElementType.Doctype;
@@ -0,0 +1 @@
{"version":3,"file":"NativeAnimation.mjs","sources":["../../../src/animation/NativeAnimation.ts"],"sourcesContent":["import {\n invariant,\n millisecondsToSeconds,\n noop,\n secondsToMilliseconds,\n} from \"motion-utils\"\nimport { setStyle } from \"../render/dom/style-set\"\nimport { supportsScrollTimeline } from \"../utils/supports/scroll-timeline\"\nimport { getFinalKeyframe } from \"./keyframes/get-final\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n DOMValueAnimationOptions,\n TimelineWithFallback,\n} from \"./types\"\nimport { WithPromise } from \"./utils/WithPromise\"\nimport { startWaapiAnimation } from \"./waapi/start-waapi-animation\"\nimport { applyGeneratorOptions } from \"./waapi/utils/apply-generator\"\n\nexport interface NativeAnimationOptions<V extends AnyResolvedKeyframe = number>\n extends DOMValueAnimationOptions<V> {\n pseudoElement?: string\n startTime?: number\n}\n\n/**\n * NativeAnimation implements AnimationPlaybackControls for the browser's Web Animations API.\n */\nexport class NativeAnimation<T extends AnyResolvedKeyframe>\n extends WithPromise\n implements AnimationPlaybackControlsWithThen\n{\n /**\n * The interfaced Web Animation API animation\n */\n protected animation: Animation\n\n protected finishedTime: number | null = null\n\n protected options: NativeAnimationOptions\n\n private allowFlatten: boolean\n\n private isStopped = false\n\n private isPseudoElement: boolean\n\n /**\n * Tracks a manually-set start time that takes precedence over WAAPI's\n * dynamic startTime. This is cleared when play() or time setter is called,\n * allowing WAAPI to take over timing.\n */\n protected manualStartTime: number | null = null\n\n constructor(options?: NativeAnimationOptions) {\n super()\n\n if (!options) return\n\n const {\n element,\n name,\n keyframes,\n pseudoElement,\n allowFlatten = false,\n finalKeyframe,\n onComplete,\n } = options as any\n\n this.isPseudoElement = Boolean(pseudoElement)\n\n this.allowFlatten = allowFlatten\n this.options = options\n\n invariant(\n typeof options.type !== \"string\",\n `Mini animate() doesn't support \"type\" as a string.`,\n \"mini-spring\"\n )\n\n const transition = applyGeneratorOptions(options)\n\n this.animation = startWaapiAnimation(\n element,\n name,\n keyframes,\n transition,\n pseudoElement\n )\n\n if (transition.autoplay === false) {\n this.animation.pause()\n }\n\n this.animation.onfinish = () => {\n this.finishedTime = this.time\n\n if (!pseudoElement) {\n const keyframe = getFinalKeyframe(\n keyframes as any,\n this.options as any,\n finalKeyframe,\n this.speed\n )\n if (this.updateMotionValue) {\n this.updateMotionValue(keyframe)\n }\n\n /**\n * If we can, we want to commit the final style as set by the user,\n * rather than the computed keyframe value supplied by the animation.\n * We always do this, even when a motion value is present, to prevent\n * a visual flash in Firefox where the WAAPI animation's fill is removed\n * during cancel() before the scheduled render can apply the correct value.\n */\n setStyle(element, name, keyframe)\n\n this.animation.cancel()\n }\n\n onComplete?.()\n this.notifyFinished()\n }\n }\n\n updateMotionValue?(value?: T): void\n\n play() {\n if (this.isStopped) return\n\n this.manualStartTime = null\n this.animation.play()\n\n if (this.state === \"finished\") {\n this.updateFinished()\n }\n }\n\n pause() {\n this.animation.pause()\n }\n\n complete() {\n this.animation.finish?.()\n }\n\n cancel() {\n try {\n this.animation.cancel()\n } catch (e) {}\n }\n\n stop() {\n if (this.isStopped) return\n this.isStopped = true\n const { state } = this\n\n if (state === \"idle\" || state === \"finished\") {\n return\n }\n\n if (this.updateMotionValue) {\n this.updateMotionValue()\n } else {\n this.commitStyles()\n }\n\n if (!this.isPseudoElement) this.cancel()\n }\n\n /**\n * WAAPI doesn't natively have any interruption capabilities.\n *\n * In this method, we commit styles back to the DOM before cancelling\n * the animation.\n *\Line truncated
@@ -0,0 +1,86 @@
{
"name": "math-intrinsics",
"version": "1.1.0",
"description": "ES Math-related intrinsics and helpers, robustly cached.",
"main": false,
"exports": {
"./abs": "./abs.js",
"./floor": "./floor.js",
"./isFinite": "./isFinite.js",
"./isInteger": "./isInteger.js",
"./isNaN": "./isNaN.js",
"./isNegativeZero": "./isNegativeZero.js",
"./max": "./max.js",
"./min": "./min.js",
"./mod": "./mod.js",
"./pow": "./pow.js",
"./sign": "./sign.js",
"./round": "./round.js",
"./constants/maxArrayLength": "./constants/maxArrayLength.js",
"./constants/maxSafeInteger": "./constants/maxSafeInteger.js",
"./constants/maxValue": "./constants/maxValue.js",
"./package.json": "./package.json"
},
"sideEffects": false,
"scripts": {
"prepack": "npmignore --auto --commentLines=autogenerated",
"prepublishOnly": "safe-publish-latest",
"prepublish": "not-in-publish || npm run prepublishOnly",
"pretest": "npm run lint",
"test": "npm run tests-only",
"tests-only": "nyc tape 'test/**/*.js'",
"posttest": "npx npm@'>= 10.2' audit --production",
"prelint": "evalmd README.md && eclint check $(git ls-files | xargs find 2> /dev/null | grep -vE 'node_modules|\\.git' | grep -v dist/)",
"lint": "eslint --ext=js,mjs .",
"postlint": "tsc && attw -P",
"version": "auto-changelog && git add CHANGELOG.md",
"postversion": "auto-changelog && git add CHANGELOG.md && git commit --no-edit --amend && git tag -f \"v$(node -e \"console.log(require('./package.json').version)\")\""
},
"repository": {
"type": "git",
"url": "git+https://github.com/es-shims/math-intrinsics.git"
},
"author": "Jordan Harband <ljharb@gmail.com>",
"license": "MIT",
"bugs": {
"url": "https://github.com/es-shims/math-intrinsics/issues"
},
"homepage": "https://github.com/es-shims/math-intrinsics#readme",
"devDependencies": {
"@arethetypeswrong/cli": "^0.17.1",
"@ljharb/eslint-config": "^21.1.1",
"@ljharb/tsconfig": "^0.2.2",
"@types/for-each": "^0.3.3",
"@types/object-inspect": "^1.13.0",
"@types/tape": "^5.8.0",
"auto-changelog": "^2.5.0",
"eclint": "^2.8.1",
"es-value-fixtures": "^1.5.0",
"eslint": "^8.8.0",
"evalmd": "^0.0.19",
"for-each": "^0.3.3",
"in-publish": "^2.0.1",
"npmignore": "^0.3.1",
"nyc": "^10.3.2",
"object-inspect": "^1.13.3",
"safe-publish-latest": "^2.0.0",
"tape": "^5.9.0",
"typescript": "next"
},
"auto-changelog": {
"output": "CHANGELOG.md",
"template": "keepachangelog",
"unreleased": false,
"commitLimit": false,
"backfillLimit": false,
"hideCredit": true
},
"publishConfig": {
"ignore": [
".github/workflows"
]
},
"engines": {
"node": ">= 0.4"
}
}
@@ -0,0 +1,4 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_middleware_secure_headers_secure_headers = require("./secure-headers.js");
exports.NONCE = require_middleware_secure_headers_secure_headers.NONCE;
exports.secureHeaders = require_middleware_secure_headers_secure_headers.secureHeaders;
@@ -0,0 +1,37 @@
//#region src/client/fetch-result-please.d.ts
/**
* @description This file is a modified version of `fetch-result-please` (`ofetch`), minimalized and adapted to Hono's custom needs.
*
* @link https://www.npmjs.com/package/fetch-result-please
*/
/**
* Smartly parses and return the consumable result from a fetch `Response`.
*
* Throwing a structured error if the response is not `ok`. ({@link DetailedError})
*/
export declare function fetchRP(fetchRes: Response | Promise<Response>): Promise<any>;
export declare class DetailedError extends Error {
/**
* Additional `message` that will be logged AND returned to client
*/
detail?: any;
/**
* Additional `code` that will be logged AND returned to client
*/
code?: any;
/**
* Additional value that will be logged AND NOT returned to client
*/
log?: any;
/**
* Optionally set the status code to return, in a web server context
*/
statusCode?: any;
constructor(message: string, options?: {
detail?: any;
code?: any;
statusCode?: number;
log?: any;
});
}
//#endregion
@@ -0,0 +1 @@
{"version":3,"file":"square-pi.js","sources":["../../../src/icons/square-pi.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name SquarePi\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik03IDdoMTAiIC8+CiAgPHBhdGggZD0iTTEwIDd2MTAiIC8+CiAgPHBhdGggZD0iTTE2IDE3YTIgMiAwIDAgMS0yLTJWNyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/square-pi\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 SquarePi = createLucideIcon('SquarePi', [\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M7 7h10', key: 'udp07y' }],\n ['path', { d: 'M10 7v10', key: 'i1d9ee' }],\n ['path', { d: 'M16 17a2 2 0 0 1-2-2V7', key: 'ftwdc7' }],\n]);\n\nexport default SquarePi;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,iBAAiB,UAAY,CAAA,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,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,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,11 @@
import { isMotionValue } from './is-motion-value.mjs';
/**
* If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself
*/
function resolveMotionValue(value) {
return isMotionValue(value) ? value.get() : value;
}
export { resolveMotionValue };
//# sourceMappingURL=resolve-motion-value.mjs.map
@@ -0,0 +1 @@
module.exports={C:{"78":0.03269,"91":0.0109,"102":0.0109,"115":0.38143,"120":0.0109,"121":0.02725,"122":0.00545,"123":0.07629,"124":0.00545,"125":0.0109,"128":0.03269,"133":0.0109,"135":0.00545,"136":0.0109,"140":4.46818,"142":0.00545,"144":0.0109,"145":0.0109,"146":0.34329,"147":0.01635,"148":0.01635,"149":0.0109,"150":0.13623,"151":0.06539,"152":0.10353,"153":0.267,"154":0.45227,"155":1.98344,"156":2.23409,"157":0.07084,"158":0.00545,_:"2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 92 93 94 95 96 97 98 99 100 101 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 126 127 129 130 131 132 134 137 138 139 141 143 159 160 3.5 3.6"},D:{"100":0.00545,"103":0.04904,"104":0.03814,"105":0.03269,"106":0.03814,"107":0.03814,"108":0.03814,"109":0.2888,"110":0.03269,"111":0.03269,"112":0.04359,"114":0.01635,"116":0.13078,"117":0.03269,"118":0.17982,"119":0.11443,"120":0.21251,"121":0.05449,"122":0.10353,"123":0.03814,"124":0.04359,"126":0.00545,"127":0.00545,"128":0.0109,"130":0.01635,"131":0.07629,"132":0.0109,"133":0.11443,"134":0.08718,"135":0.03814,"136":0.04904,"137":0.08174,"138":0.34874,"139":0.07084,"140":0.22341,"141":0.05449,"142":0.25065,"143":0.38143,"144":0.19072,"145":0.07084,"146":0.07629,"147":0.25065,"148":0.16347,"149":0.16347,"150":1.16609,"151":1.3895,"152":6.33174,"153":6.95837,"154":1.6129,"155":0.02725,"156":0.00545,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 101 102 113 115 125 129 157"},F:{"84":0.00545,"90":0.00545,"95":0.0109,"102":0.01635,"105":0.00545,"106":0.0109,"107":0.00545,"114":0.00545,"116":0.00545,"133":0.00545,"134":0.11988,"135":1.3786,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 85 86 87 88 89 91 92 93 94 96 97 98 99 100 101 103 104 108 109 110 111 112 113 115 117 118 119 120 121 122 123 124 125 126 127 131 132 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"109":0.0109,"115":0.0109,"119":0.0109,"120":0.06539,"121":0.00545,"122":0.0109,"129":0.00545,"131":0.00545,"133":0.04904,"136":0.00545,"141":0.05449,"142":0.02725,"143":0.00545,"144":0.18527,"145":0.02725,"146":0.04359,"147":0.01635,"148":0.08174,"149":0.04904,"150":0.21251,"151":0.2888,"152":2.89342,"153":4.43549,"154":1.0789,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 116 117 118 123 124 125 126 127 128 130 132 134 135 137 138 139 140"},E:{"15":0.00545,"27":0.50676,_:"4 5 6 7 8 9 10 11 12 13 14 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 15.1 15.2-15.3 15.4 27.1 TP","13.1":0.0109,"14.1":0.0109,"15.5":0.00545,"15.6":0.05449,"16.0":0.0218,"16.1":0.01635,"16.2":0.00545,"16.3":0.00545,"16.4":0.00545,"16.5":0.03269,"16.6":0.13078,"17.0":0.00545,"17.1":0.17437,"17.2":0.03269,"17.3":0.00545,"17.4":0.0218,"17.5":0.02725,"17.6":0.19616,"18.0":0.0218,"18.1":0.08718,"18.2":0.07629,"18.3":0.11443,"18.4":0.03269,"18.5-18.7":0.04904,"26.0":0.19072,"26.1":0.0109,"26.2":0.14167,"26.3":0.11988,"26.4":0.21251,"26.5":0.8228,"26.6":3.07324,"27.2":0.00545},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00187,"5.0-5.1":0.00187,"6.0-6.1":0,"7.0-7.1":0.00374,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01868,"11.0-11.2":0.00187,"11.3-11.4":0.00374,"12.0-12.1":0,"12.2-12.5":0.04856,"13.0-13.1":0,"13.2":0.00934,"13.3":0,"13.4-13.7":0.00187,"14.0-14.4":0.00747,"14.5-14.8":0.01121,"15.0-15.1":0.01121,"15.2-15.3":0.00747,"15.4":0.00934,"15.5":0.01121,"15.6-15.8":0.2428,"16.0":0.01868,"16.1":0.03362,"16.2":0.01868,"16.3":0.04109,"16.4":0.00934,"16.5":0.01494,"16.6-16.7":0.33805,"17.0":0.01307,"17.1":0.01868,"17.2":0.01868,"17.3":0.02802,"17.4":0.03922,"17.5":0.07658,"17.6-17.7":0.19797,"18.0":0.04109,"18.1":0.08218,"18.2":0.11206,"18.3":0.19424,"18.4":0.1214,"18.5-18.7":2.5083,"26.0":0.1214,"26.1":0.12327,"26.2":0.32124,"26.3":0.34739,"26.4":0.25401,"26.5":1.70146,"26.6":10.49826,"27.0":0.80497,"27.1":0,"27.2":0.02054},P:{"23":0.00969,"26":0.00969,"27":0.00969,"28":0.01939,"29":0.07754,"30":3.97416,_:"4 20 21 22 24 25 5.0-5.4 6.2-6.4 7.2-7.4 9.2 10.1 11.1-11.2 12.0 13.0 15.0 16.0 17.0 18.0 19.0","8.2":0.00969,"14.0":0.00969},I:{"0":0.0091,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0},K:{"0":0.2367,_:"10 11 12 11.1 11.5 12.1"},A:{_:"6 7 8 9 10 11 5.5"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},N:{_:"10 11"},L:{"0":20.54848},R:{_:"0"},M:{"0":1.98467},Q:{"14.9":0.00455},O:{"0":0.07283},H:{all:0}};
@@ -0,0 +1,40 @@
# gopd <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][npm-badge-png]][package-url]
`Object.getOwnPropertyDescriptor`, but accounts for IE's broken implementation.
## Usage
```javascript
var gOPD = require('gopd');
var assert = require('assert');
if (gOPD) {
assert.equal(typeof gOPD, 'function', 'descriptors supported');
// use gOPD like Object.getOwnPropertyDescriptor here
} else {
assert.ok(!gOPD, 'descriptors not supported');
}
```
[package-url]: https://npmjs.org/package/gopd
[npm-version-svg]: https://versionbadg.es/ljharb/gopd.svg
[deps-svg]: https://david-dm.org/ljharb/gopd.svg
[deps-url]: https://david-dm.org/ljharb/gopd
[dev-deps-svg]: https://david-dm.org/ljharb/gopd/dev-status.svg
[dev-deps-url]: https://david-dm.org/ljharb/gopd#info=devDependencies
[npm-badge-png]: https://nodei.co/npm/gopd.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/gopd.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/gopd.svg
[downloads-url]: https://npm-stat.com/charts.html?package=gopd
[codecov-image]: https://codecov.io/gh/ljharb/gopd/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/ljharb/gopd/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/ljharb/gopd
[actions-url]: https://github.com/ljharb/gopd/actions
@@ -0,0 +1 @@
{"version":3,"file":"circle-dot.js","sources":["../../../src/icons/circle-dot.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CircleDot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/circle-dot\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 CircleDot = createLucideIcon('CircleDot', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['circle', { cx: '12', cy: '12', r: '1', key: '41hilf' }],\n]);\n\nexport default CircleDot;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CACzD,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AAC1D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,7 @@
import type { StringReader, StringWriter } from './strings.cts';
export declare const comma: number;
export declare const semicolon: number;
export declare function decodeInteger(reader: StringReader, relative: number): number;
export declare function encodeInteger(builder: StringWriter, num: number, relative: number): number;
export declare function hasMoreVlq(reader: StringReader, max: number): boolean;
//# sourceMappingURL=vlq.d.ts.map
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/presence.tsx", "../src/use-state-machine.tsx"],
"sourcesContent": ["import * as React from 'react';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { useLayoutEffect } from '@radix-ui/react-use-layout-effect';\nimport { useStateMachine } from './use-state-machine';\n\ninterface PresenceProps {\n children: React.ReactElement | ((props: { present: boolean }) => React.ReactElement);\n present: boolean;\n}\n\nconst Presence: React.FC<PresenceProps> = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n\n const child = (\n typeof children === 'function'\n ? children({ present: presence.isPresent })\n : React.Children.only(children)\n ) as React.ReactElement<{ ref?: React.Ref<HTMLElement> }>;\n\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? React.cloneElement(child, { ref }) : null;\n};\n\nPresence.displayName = 'Presence';\n\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/\n\nfunction usePresence(present: boolean) {\n const [node, setNode] = React.useState<HTMLElement>();\n const stylesRef = React.useRef<CSSStyleDeclaration | null>(null);\n const prevPresentRef = React.useRef(present);\n const prevAnimationNameRef = React.useRef<string>('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended',\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted',\n },\n unmounted: {\n MOUNT: 'mounted',\n },\n });\n\n React.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [state]);\n\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n\n if (present) {\n send('MOUNT');\n } else if (currentAnimationName === 'none' || styles?.display === 'none') {\n // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n } else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */\n const isAnimating = prevAnimationName !== currentAnimationName;\n\n if (wasPresent && isAnimating) {\n send('ANIMATION_OUT');\n } else {\n send('UNMOUNT');\n }\n }\n\n prevPresentRef.current = present;\n }\n }, [present, send]);\n\n useLayoutEffect(() => {\n if (node) {\n let timeoutId: number;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */\n const handleAnimationEnd = (event: AnimationEvent) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n // The event.animationName is unescaped for CSS syntax,\n // so we need to escape it to compare with the animationName computed from the style.\n const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n if (event.target === node && isCurrentAnimation) {\n // With React 18 concurrency this update is applied a frame after the\n // animation ends, creating a flash of visible content. By setting the\n // animation fill mode to \"forwards\", we force the node to keep the\n // styles of the last keyframe, removing the flash.\n //\n // Previously we flushed the update via ReactDom.flushSync, but with\n // exit animations this resulted in the node being removed from the\n // DOM before the synthetic animationEnd event was dispatched, meaning\n // user-provided event handlers would not be called.\n // https://github.com/radix-ui/primitives/pull/1849\n send('ANIMATION_END');\n if (!prevPresentRef.currentLine truncated
"mappings": ";;;AAAA,YAAYA,YAAW;AACvB,SAAS,uBAAuB;AAChC,SAAS,uBAAuB;;;ACFhC,YAAY,WAAW;AAWhB,SAAS,gBACd,cACA,SACA;AACA,SAAa,iBAAW,CAAC,OAAwB,UAA4C;AAC3F,UAAM,YAAa,QAAQ,KAAK,EAAU,KAAK;AAC/C,WAAO,aAAa;AAAA,EACtB,GAAG,YAAY;AACjB;;;ADTA,IAAM,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AAAA,EACF,GAAG,CAAC,MAAM,IAAI,CAAC;AAEf,SAAO;AAAA,IACL,WAAW,CAAC,WAAW,kBAAkB,EAAE,SAAS,KAAK;AAAA,IACzD,KAAW,mBAAY,CAACC,UAAsB;AAC5C,gBAAU,UAAUA,QAAO,iBAAiBA,KAAI,IAAI;AACpD,cAAQA,KAAI;AAAA,IACd,GAAG,CAAC,CAAC;AAAA,EACP;AACF;AAIA,SAAS,iBAAiB,QAAoC;AAC5D,SAAO,QAAQ,iBAAiB;AAClC;AAOA,SAAS,cAAc,SAA2D;AAEhF,MAAI,SAAS,OAAO,yBAAyB,QAAQ,OAAO,KAAK,GAAG;AACpE,MAAI,UAAU,UAAU,oBAAoB,UAAU,OAAO;AAC7D,MAAI,SAAS;AACX,WAAQ,QAAgB;AAAA,EAC1B;AAGA,WAAS,OAAO,yBAAyB,SAAS,KAAK,GAAG;AAC1D,YAAU,UAAU,oBAAoB,UAAU,OAAO;AACzD,MAAI,SAAS;AACX,WAAO,QAAQ,MAAM;AAAA,EACvB;AAGA,SAAO,QAAQ,MAAM,OAAQ,QAAgB;AAC/C;AAEA,IAAM,OAAO;",
"names": ["React", "node"]
}
@@ -0,0 +1,65 @@
import { Bench } from 'tinybench'
import { wsIsSecure } from '../lib/schemes.js'
const benchWsIsSecure = new Bench({ name: 'wsIsSecure' })
const wsComponentAttributeSecureTrue = {
scheme: 'ws',
secure: true,
}
const wsComponentAttributeSecureFalse = {
scheme: 'ws',
secure: false,
}
const wssComponent = {
scheme: 'wss',
}
const wssComponentMixedCase = {
scheme: 'Wss',
}
const wssComponentUpperCase = {
scheme: 'WSS',
}
const httpComponent = {
scheme: 'http',
}
console.assert(wsIsSecure(wsComponentAttributeSecureTrue) === true, 'wsComponentAttributeSecureTrue should be secure')
console.assert(wsIsSecure(wsComponentAttributeSecureFalse) === false, 'wsComponentAttributeSecureFalse should not be secure')
console.assert(wsIsSecure(wssComponent) === true, 'wssComponent should be secure')
console.assert(wsIsSecure(wssComponentMixedCase) === true, 'wssComponentMixedCase should be secure')
console.assert(wsIsSecure(wssComponentUpperCase) === true, 'wssComponentUpperCase should be secure')
console.assert(wsIsSecure(httpComponent) === false, 'httpComponent should not be secure')
benchWsIsSecure.add(JSON.stringify(wsComponentAttributeSecureFalse), function () {
wsIsSecure(wsComponentAttributeSecureFalse)
})
benchWsIsSecure.add(JSON.stringify(wsComponentAttributeSecureTrue), function () {
wsIsSecure(wsComponentAttributeSecureTrue)
})
benchWsIsSecure.add(JSON.stringify(wssComponent), function () {
wsIsSecure(wssComponent)
})
benchWsIsSecure.add(JSON.stringify(wssComponentMixedCase), function () {
wsIsSecure(wssComponentMixedCase)
})
benchWsIsSecure.add(JSON.stringify(wssComponentUpperCase), function () {
wsIsSecure(wssComponentUpperCase)
})
benchWsIsSecure.add(JSON.stringify(httpComponent), function () {
wsIsSecure(httpComponent)
})
await benchWsIsSecure.run()
console.log(benchWsIsSecure.name)
console.table(benchWsIsSecure.table())