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,292 @@
/**
* This is the common logic for both the Node.js and web browser
* implementations of `debug()`.
*/
function setup(env) {
createDebug.debug = createDebug;
createDebug.default = createDebug;
createDebug.coerce = coerce;
createDebug.disable = disable;
createDebug.enable = enable;
createDebug.enabled = enabled;
createDebug.humanize = require('ms');
createDebug.destroy = destroy;
Object.keys(env).forEach(key => {
createDebug[key] = env[key];
});
/**
* The currently active debug mode names, and names to skip.
*/
createDebug.names = [];
createDebug.skips = [];
/**
* Map of special "%n" handling functions, for the debug "format" argument.
*
* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
*/
createDebug.formatters = {};
/**
* Selects a color for a debug namespace
* @param {String} namespace The namespace string for the debug instance to be colored
* @return {Number|String} An ANSI color code for the given namespace
* @api private
*/
function selectColor(namespace) {
let hash = 0;
for (let i = 0; i < namespace.length; i++) {
hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
hash |= 0; // Convert to 32bit integer
}
return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
}
createDebug.selectColor = selectColor;
/**
* Create a debugger with the given `namespace`.
*
* @param {String} namespace
* @return {Function}
* @api public
*/
function createDebug(namespace) {
let prevTime;
let enableOverride = null;
let namespacesCache;
let enabledCache;
function debug(...args) {
// Disabled?
if (!debug.enabled) {
return;
}
const self = debug;
// Set `diff` timestamp
const curr = Number(new Date());
const ms = curr - (prevTime || curr);
self.diff = ms;
self.prev = prevTime;
self.curr = curr;
prevTime = curr;
args[0] = createDebug.coerce(args[0]);
if (typeof args[0] !== 'string') {
// Anything else let's inspect with %O
args.unshift('%O');
}
// Apply any `formatters` transformations
let index = 0;
args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
// If we encounter an escaped % then don't increase the array index
if (match === '%%') {
return '%';
}
index++;
const formatter = createDebug.formatters[format];
if (typeof formatter === 'function') {
const val = args[index];
match = formatter.call(self, val);
// Now we need to remove `args[index]` since it's inlined in the `format`
args.splice(index, 1);
index--;
}
return match;
});
// Apply env-specific formatting (colors, etc.)
createDebug.formatArgs.call(self, args);
const logFn = self.log || createDebug.log;
logFn.apply(self, args);
}
debug.namespace = namespace;
debug.useColors = createDebug.useColors();
debug.color = createDebug.selectColor(namespace);
debug.extend = extend;
debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.
Object.defineProperty(debug, 'enabled', {
enumerable: true,
configurable: false,
get: () => {
if (enableOverride !== null) {
return enableOverride;
}
if (namespacesCache !== createDebug.namespaces) {
namespacesCache = createDebug.namespaces;
enabledCache = createDebug.enabled(namespace);
}
return enabledCache;
},
set: v => {
enableOverride = v;
}
});
// Env-specific initialization logic for debug instances
if (typeof createDebug.init === 'function') {
createDebug.init(debug);
}
return debug;
}
function extend(namespace, delimiter) {
const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
newDebug.log = this.log;
return newDebug;
}
/**
* Enables a debug mode by namespaces. This can include modes
* separated by a colon and wildcards.
*
* @param {String} namespaces
* @api public
*/
function enable(namespaces) {
createDebug.save(namespaces);
createDebug.namespaces = namespaces;
createDebug.names = [];
createDebug.skips = [];
const split = (typeof namespaces === 'string' ? namespaces : '')
.trim()
.replace(/\s+/g, ',')
.split(',')
.filter(Boolean);
for (const ns of split) {
if (ns[0] === '-') {
createDebug.skips.push(ns.slice(1));
} else {
createDebug.names.push(ns);
}
}
}
/**
* Checks if the given string matches a namespace template, honoring
* asterisks as wildcards.
*
* @param {String} search
* @param {String} template
* @return {Boolean}
*/
function matchesTemplate(search, template) {
let searchIndex = 0;
let templateIndex = 0;
let starIndex = -1;
let matchIndex = 0;
while (searchIndex < search.length) {
if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
// Match character or proceed with wildcard
if (template[templateIndex] === '*') {
starIndex = templateIndex;
matchIndex = searchIndex;
templateIndex++; // Skip the '*'
} else {
searchIndex++;
templateIndex++;
}
} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
// Backtrack to the last '*' and try to match more characters
templateIndex = starIndex + 1;
matchIndex++;
searchIndex = matchIndex;
} else {
return false; // No match
}
}
// Handle trailing '*' in template
while (templateIndex < template.length && template[templateIndex] === '*') {
templateIndex++;
}
return templateIndex === template.length;
}
/**
* Disable debug output.
*
* @return {String} namespaces
* @api public
*/
function disable() {
const namespaces = [
...createDebug.names,
...createDebug.skips.map(namespace => '-' + namespace)
].join(',');
createDebug.enable('');
return namespaces;
}
/**
* Returns true if the given mode name is enabled, false otherwise.
*
* @param {String} name
* @return {Boolean}
* @api public
*/
function enabled(name) {
for (const skip of createDebug.skips) {
if (matchesTemplate(name, skip)) {
return false;
}
}
for (const ns of createDebug.names) {
if (matchesTemplate(name, ns)) {
return true;
}
}
return false;
}
/**
* Coerce `val`.
*
* @param {Mixed} val
* @return {Mixed}
* @api private
*/
function coerce(val) {
if (val instanceof Error) {
return val.stack || val.message;
}
return val;
}
/**
* XXX DO NOT USE. This is a temporary stub function.
* XXX It WILL be removed in the next major release.
*/
function destroy() {
console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
}
createDebug.enable(createDebug.load());
return createDebug;
}
module.exports = setup;
@@ -0,0 +1,81 @@
{
"name": "is-glob",
"description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.",
"version": "4.0.3",
"homepage": "https://github.com/micromatch/is-glob",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
"Brian Woodward (https://twitter.com/doowb)",
"Daniel Perez (https://tuvistavie.com)",
"Jon Schlinkert (http://twitter.com/jonschlinkert)"
],
"repository": "micromatch/is-glob",
"bugs": {
"url": "https://github.com/micromatch/is-glob/issues"
},
"license": "MIT",
"files": [
"index.js"
],
"main": "index.js",
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha && node benchmark.js"
},
"dependencies": {
"is-extglob": "^2.1.1"
},
"devDependencies": {
"gulp-format-md": "^0.1.10",
"mocha": "^3.0.2"
},
"keywords": [
"bash",
"braces",
"check",
"exec",
"expression",
"extglob",
"glob",
"globbing",
"globstar",
"is",
"match",
"matches",
"pattern",
"regex",
"regular",
"string",
"test"
],
"verb": {
"layout": "default",
"plugins": [
"gulp-format-md"
],
"related": {
"list": [
"assemble",
"base",
"update",
"verb"
]
},
"reflinks": [
"assemble",
"bach",
"base",
"composer",
"gulp",
"has-glob",
"is-valid-glob",
"micromatch",
"npm",
"scaffold",
"verb",
"vinyl"
]
}
}
@@ -0,0 +1,11 @@
import { AsyncRouteComponent } from './route.js';
/**
* Wrap a dynamic import to create a route component that supports
* `.preload()` and friendly reload-on-module-missing behavior.
*
* @param importer Function returning a module promise
* @param exportName Named export to use (default: `default`)
* @returns A lazy route component compatible with TanStack Router
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/lazyRouteComponentFunction
*/
export declare function lazyRouteComponent<T extends Record<string, any>, TKey extends keyof T = 'default'>(importer: () => Promise<T>, exportName?: TKey): T[TKey] extends (props: infer TProps) => any ? AsyncRouteComponent<TProps> : never;
@@ -0,0 +1 @@
var u=Object.defineProperty;var g=(s,n)=>u(s,"name",{value:n,configurable:!0});let t=!0;const l=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let i=0;if(l.process&&l.process.env&&l.process.stdout){const{FORCE_COLOR:s,NODE_DISABLE_COLORS:n,NO_COLOR:r,TERM:o,COLORTERM:c}=l.process.env;n||r||s==="0"?t=!1:s==="1"||s==="2"||s==="3"?t=!0:o==="dumb"?t=!1:"CI"in l.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(a=>a in l.process.env)?t=!0:t=process.stdout.isTTY,t&&(process.platform==="win32"||c&&(c==="truecolor"||c==="24bit")?i=3:o&&(o.endsWith("-256color")||o.endsWith("256"))?i=2:i=1)}let f={enabled:t,supportLevel:i};function e(s,n,r=1){const o=`\x1B[${s}m`,c=`\x1B[${n}m`,a=new RegExp(`\\x1b\\[${n}m`,"g");return p=>f.enabled&&f.supportLevel>=r?o+(""+p).replace(a,o)+c:""+p}g(e,"kolorist");const b=e(30,39),d=e(33,39),O=e(90,39),C=e(92,39),R=e(95,39),I=e(96,39),L=e(44,49),E=e(100,49),T=e(103,49);export{b as a,T as b,L as c,E as d,R as e,C as f,O as g,I as l,f as o,d as y};
@@ -0,0 +1,9 @@
import type { CodeKeywordDefinition, ErrorObject } from "../../types";
export type UniqueItemsError = ErrorObject<"uniqueItems", {
i: number;
j: number;
}, boolean | {
$data: string;
}>;
declare const def: CodeKeywordDefinition;
export default def;
@@ -0,0 +1,51 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://json-schema.org/draft/2020-12/meta/core",
"$vocabulary": {
"https://json-schema.org/draft/2020-12/vocab/core": true
},
"$dynamicAnchor": "meta",
"title": "Core vocabulary meta-schema",
"type": ["object", "boolean"],
"properties": {
"$id": {
"$ref": "#/$defs/uriReferenceString",
"$comment": "Non-empty fragments not allowed.",
"pattern": "^[^#]*#?$"
},
"$schema": {"$ref": "#/$defs/uriString"},
"$ref": {"$ref": "#/$defs/uriReferenceString"},
"$anchor": {"$ref": "#/$defs/anchorString"},
"$dynamicRef": {"$ref": "#/$defs/uriReferenceString"},
"$dynamicAnchor": {"$ref": "#/$defs/anchorString"},
"$vocabulary": {
"type": "object",
"propertyNames": {"$ref": "#/$defs/uriString"},
"additionalProperties": {
"type": "boolean"
}
},
"$comment": {
"type": "string"
},
"$defs": {
"type": "object",
"additionalProperties": {"$dynamicRef": "#meta"}
}
},
"$defs": {
"anchorString": {
"type": "string",
"pattern": "^[A-Za-z_][-A-Za-z0-9._]*$"
},
"uriString": {
"type": "string",
"format": "uri"
},
"uriReferenceString": {
"type": "string",
"format": "uri-reference"
}
}
}
@@ -0,0 +1,12 @@
"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.es2024_string = void 0;
const base_config_1 = require("./base-config");
exports.es2024_string = {
libs: [],
variables: [['String', base_config_1.TYPE]],
};
@@ -0,0 +1,3 @@
//#region src/router/utils.d.ts
export declare const createNullObject: () => any;
//#endregion
@@ -0,0 +1,28 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
// @ts-ignore `esbuild` may not be installed
import type esbuild from 'esbuild'
/* eslint-enable @typescript-eslint/ban-ts-comment */
export type EsbuildTarget = string | string[]
export type EsbuildLoader = esbuild.Loader
export type EsbuildTransformOptions = esbuild.TransformOptions
export type EsbuildTransformResult = esbuild.TransformResult
export type EsbuildMessage = esbuild.Message
export type DepsOptimizerEsbuildOptions = Omit<
esbuild.BuildOptions,
| 'bundle'
| 'entryPoints'
| 'external'
| 'write'
| 'watch'
| 'outdir'
| 'outfile'
| 'outbase'
| 'outExtension'
| 'metafile'
>
@@ -0,0 +1,42 @@
{
"name": "std-env",
"version": "4.1.0",
"description": "Runtime agnostic JS utils",
"license": "MIT",
"repository": "unjs/std-env",
"files": [
"dist"
],
"type": "module",
"sideEffects": false,
"main": "./dist/index.mjs",
"types": "./dist/index.d.mts",
"exports": {
".": "./dist/index.mjs"
},
"scripts": {
"build": "obuild",
"dev": "vitest",
"lint": "oxlint . && oxfmt",
"lint:fix": "oxlint --fix . && oxfmt",
"prepack": "obuild",
"release": "pnpm test && pnpm build && changelogen --release --publish && git push --follow-tags",
"test": "pnpm lint && pnpm typecheck && vitest run --coverage",
"typecheck": "tsgo --noEmit"
},
"devDependencies": {
"@types/node": "^25.2.3",
"@typescript/native-preview": "^7.0.0-dev.20260217.1",
"@vitest/coverage-v8": "^4.0.18",
"changelogen": "^0.6.2",
"esbuild": "^0.27.3",
"mitata": "^1.0.34",
"obuild": "^0.4.28",
"oxfmt": "^0.33.0",
"oxlint": "^1.48.0",
"rollup": "^4.57.1",
"typescript": "^5.9.3",
"vitest": "^4.0.18"
},
"packageManager": "pnpm@10.30.0"
}
@@ -0,0 +1,959 @@
// Copied from `@types/prettier`
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5bb07fc4b087cb7ee91084afa6fe750551a7bbb1/types/prettier/index.d.ts
// Minimum TypeScript Version: 4.2
// Add `export {}` here to shut off automatic exporting from index.d.ts. There
// are quite a few utility types here that don't need to be shipped with the
// exported module.
export {};
import { builders, printer, utils } from "./doc.js";
export namespace doc {
export { builders, printer, utils };
}
// This utility is here to handle the case where you have an explicit union
// between string literals and the generic string type. It would normally
// resolve out to just the string type, but this generic LiteralUnion maintains
// the intellisense of the original union.
//
// It comes from this issue: microsoft/TypeScript#29729:
// https://github.com/microsoft/TypeScript/issues/29729#issuecomment-700527227
export type LiteralUnion<T extends U, U = string> =
T | (Pick<U, never> & { _?: never | undefined });
export type AST = any;
export type Doc = doc.builders.Doc;
// The type of elements that make up the given array T.
type ArrayElement<T> = T extends Array<infer E> ? E : never;
// A union of the properties of the given object that are arrays.
type ArrayProperties<T> = {
[K in keyof T]: NonNullable<T[K]> extends readonly any[] ? K : never;
}[keyof T];
// A union of the properties of the given array T that can be used to index it.
// If the array is a tuple, then that's going to be the explicit indices of the
// array, otherwise it's going to just be number.
type IndexProperties<T extends { length: number }> =
IsTuple<T> extends true ? Exclude<Partial<T>["length"], T["length"]> : number;
// Effectively performing T[P], except that it's telling TypeScript that it's
// safe to do this for tuples, arrays, or objects.
type IndexValue<T, P> = T extends any[]
? P extends number
? T[P]
: never
: P extends keyof T
? T[P]
: never;
// Determines if an object T is an array like string[] (in which case this
// evaluates to false) or a tuple like [string] (in which case this evaluates to
// true).
// eslint-disable-next-line @typescript-eslint/no-unused-vars
type IsTuple<T> = T extends []
? true
: T extends [infer First, ...infer Remain]
? IsTuple<Remain>
: false;
type CallProperties<T> = T extends any[] ? IndexProperties<T> : keyof T;
type IterProperties<T> = T extends any[]
? IndexProperties<T>
: ArrayProperties<T>;
type CallCallback<T, U> = (path: AstPath<T>, index: number, value: any) => U;
type EachCallback<T> = (
path: AstPath<ArrayElement<T>>,
index: number,
value: any,
) => void;
type MapCallback<T, U> = (
path: AstPath<ArrayElement<T>>,
index: number,
value: any,
) => U;
// https://github.com/prettier/prettier/blob/next/src/common/ast-path.js
export class AstPath<T = any> {
constructor(value: T);
get key(): string | null;
get index(): number | null;
get node(): T;
get parent(): T | null;
get grandparent(): T | null;
get isInArray(): boolean;
get siblings(): T[] | null;
get next(): T | null;
get previous(): T | null;
get isFirst(): boolean;
get isLast(): boolean;
get isRoot(): boolean;
get root(): T;
get ancestors(): T[];
stack: T[];
callParent<U>(callback: (path: this) => U, count?: number): U;
/**
* @deprecated Please use `AstPath#key` or `AstPath#index`
*/
getName(): PropertyKey | null;
/**
* @deprecated Please use `AstPath#node` or `AstPath#siblings`
*/
getValue(): T;
getNode(count?: number): T | null;
getParentNode(count?: number): T | null;
match(
...predicates: Array<
(node: any, name: string | null, number: number | null) => boolean
>
): boolean;
// For each of the tree walk functions (call, each, and map) this provides 5
// strict type signatures, along with a fallback at the end if you end up
// calling more than 5 properties deep. This helps a lot with typing because
// for the majority of cases you're calling fewer than 5 properties, so the
// tree walk functions have a clearer understanding of what you're doing.
//
// Note that resolving these types is somewhat complicated, and it wasn't
// even supported until TypeScript 4.2 (before it would just say that the
// type instantiation was excessively deep and possibly infinite).
call<U>(callback: CallCallback<T, U>): U;
call<U, P1 extends CallProperties<T>>(
callback: CallCallback<IndexValue<T, P1>, U>,
prop1: P1,
): U;
call<U, P1 extends keyof T, P2 extends CallProperties<T[P1]>>(
callback: CallCallback<IndexValue<IndexValue<T, P1>, P2>, U>,
prop1: P1,
prop2: P2,
): U;
call<
U,
P1 extends keyof T,
P2 extends CallProperties<T[P1]>,
P3 extends CallProperties<IndexValue<T[P1], P2>>,
>(
callback: CallCallback<
IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>,
U
>,
prop1: P1,
prop2: P2,
prop3: P3,
): U;
call<
U,
P1 extends keyof T,
P2 extends CallProperties<T[P1]>,
P3 extends CallProperties<IndexValue<T[P1], P2>>,
P4 extends CallProperties<IndexValue<IndexValue<T[P1], P2>, P3>>,
>(
callback: CallCallback<
IndexValue<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, P4>,
U
>,
prop1: P1,
prop2: P2,
prop3: P3,
prop4: P4,
): U;
call<U, P extends PropertyKey>(
callback: CallCallback<any, U>,
prop1: P,
prop2: P,
prop3: P,
prop4: P,
...props: P[]
): U;
each(callback: EachCallback<T>): void;
each<P1 extends IterProperties<T>>(
callback: EachCallback<IndexValue<T, P1>>,
prop1: P1,
): void;
each<P1 extends keyof T, P2 extends IterProperties<T[P1]>>(
callback: EachCallback<IndexValue<IndexValue<T, P1>, P2>>,
prop1: P1,
prop2: P2,
): void;
each<
P1 extends keyof T,
P2 extends IterProperties<T[P1]>,
P3 extends IterProperties<IndexValue<T[P1], P2>>,
>(
callback: EachCallback<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>>,
prop1: P1,
prop2: P2,
prop3: P3,
): void;
each<
P1 extends keyof T,
P2 extends IterProperties<T[P1]>,
P3 extends IterProperties<IndexValue<T[P1], P2>>,
P4 extends IterProperties<IndexValue<IndexValue<T[P1], P2>, P3>>,
>(
callback: EachCallback<
IndexValue<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, P4>
>,
prop1: P1,
prop2: P2,
prop3: P3,
prop4: P4,
): void;
each(
callback: EachCallback<any[]>,
prop1: PropertyKey,
prop2: PropertyKey,
prop3: PropertyKey,
prop4: PropertyKey,
...props: PropertyKey[]
): void;
map<U>(callback: MapCallback<T, U>): U[];
map<U, P1 extends IterProperties<T>>(
callback: MapCallback<IndexValue<T, P1>, U>,
prop1: P1,
): U[];
map<U, P1 extends keyof T, P2 extends IterProperties<T[P1]>>(
callback: MapCallback<IndexValue<IndexValue<T, P1>, P2>, U>,
prop1: P1,
prop2: P2,
): U[];
map<
U,
P1 extends keyof T,
P2 extends IterProperties<T[P1]>,
P3 extends IterProperties<IndexValue<T[P1], P2>>,
>(
callback: MapCallback<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, U>,
prop1: P1,
prop2: P2,
prop3: P3,
): U[];
map<
U,
P1 extends keyof T,
P2 extends IterProperties<T[P1]>,
P3 extends IterProperties<IndexValue<T[P1], P2>>,
P4 extends IterProperties<IndexValue<IndexValue<T[P1], P2>, P3>>,
>(
callback: MapCallback<
IndexValue<IndexValue<IndexValue<IndexValue<T, P1>, P2>, P3>, P4>,
U
>,
prop1: P1,
prop2: P2,
prop3: P3,
prop4: P4,
): U[];
map<U>(
callback: MapCallback<any[], U>,
prop1: PropertyKey,
prop2: PropertyKey,
prop3: PropertyKey,
prop4: PropertyKey,
...props: PropertyKey[]
): U[];
}
/** @deprecated `FastPath` was renamed to `AstPath` */
export type FastPath<T = any> = AstPath<T>;
export type BuiltInParser = (text: string, options?: any) => AST;
export type BuiltInParserName =
| "acorn"
| "angular"
| "babel-flow"
| "babel-ts"
| "babel"
| "css"
| "espree"
| "flow"
| "glimmer"
| "graphql"
| "html"
| "json-stringify"
| "json"
| "json5"
| "jsonc"
| "less"
| "lwc"
| "markdown"
| "mdx"
| "meriyah"
| "mjml"
| "scss"
| "typescript"
| "vue"
| "yaml";
export type BuiltInParsers = Record<BuiltInParserName, BuiltInParser>;
/**
* For use in `.prettierrc.js`, `.prettierrc.ts`, `.prettierrc.cjs`, `.prettierrc.cts`, `prettierrc.mjs`, `prettierrc.mts`, `prettier.config.js`, `prettier.config.ts`, `prettier.config.cjs`, `prettier.config.cts`, `prettier.config.mjs`, `prettier.config.mts`
*/
export interface Config extends Options {
overrides?: Array<{
files: string | string[];
excludeFiles?: string | string[];
options?: Options;
}>;
}
export interface Options extends Partial<RequiredOptions> {}
export interface RequiredOptions extends doc.printer.Options {
/**
* Print semicolons at the ends of statements.
* @default true
*/
semi: boolean;
/**
* Use single quotes instead of double quotes.
* @default false
*/
singleQuote: boolean;
/**
* Use single quotes in JSX.
* @default false
*/
jsxSingleQuote: boolean;
/**
* Print trailing commas wherever possible.
* @default "all"
*/
trailingComma: "none" | "es5" | "all";
/**
* Print spaces between brackets in object literals.
* @default true
*/
bracketSpacing: boolean;
/**
* How to wrap object literals.
* @default "preserve"
*/
objectWrap: "preserve" | "collapse";
/**
* Put the `>` of a multi-line HTML (HTML, JSX, Vue, Angular) element at the end of the last line instead of being
* alone on the next line (does not apply to self closing elements).
* @default false
*/
bracketSameLine: boolean;
/**
* Format only a segment of a file.
* @default 0
*/
rangeStart: number;
/**
* Format only a segment of a file.
* @default Number.POSITIVE_INFINITY
*/
rangeEnd: number;
/**
* Specify which parser to use.
*/
parser: LiteralUnion<BuiltInParserName>;
/**
* Specify the input filepath. This will be used to do parser inference.
*/
filepath: string;
/**
* Prettier can restrict itself to only format files that contain a special comment, called a pragma, at the top of the file.
* This is very useful when gradually transitioning large, unformatted codebases to prettier.
* @default false
*/
requirePragma: boolean;
/**
* Prettier can insert a special @format marker at the top of files specifying that
* the file has been formatted with prettier. This works well when used in tandem with
* the --require-pragma option. If there is already a docblock at the top of
* the file then this option will add a newline to it with the @format marker.
* @default false
*/
insertPragma: boolean;
/**
* Prettier can allow individual files to opt out of formatting if they contain a special comment, called a pragma, at the top of the file.
* @default false
*/
checkIgnorePragma: boolean;
/**
* By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer.
* In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out.
* @default "preserve"
*/
proseWrap: "always" | "never" | "preserve";
/**
* Include parentheses around a sole arrow function parameter.
* @default "always"
*/
arrowParens: "avoid" | "always";
/**
* Provide ability to support new languages to prettier.
*/
plugins: Array<string | URL | Plugin>;
/**
* How to handle whitespaces in HTML.
* @default "css"
*/
htmlWhitespaceSensitivity: "css" | "strict" | "ignore";
/**
* Which end of line characters to apply.
* @default "lf"
*/
endOfLine: "auto" | "lf" | "crlf" | "cr";
/**
* Change when properties in objects are quoted.
* @default "as-needed"
*/
quoteProps: "as-needed" | "consistent" | "preserve";
/**
* Whether or not to indent the code inside <script> and <style> tags in Vue files.
* @default false
*/
vueIndentScriptAndStyle: boolean;
/**
* Control whether Prettier formats quoted code embedded in the file.
* @default "auto"
*/
embeddedLanguageFormatting: "auto" | "off";
/**
* Enforce single attribute per line in HTML, Vue and JSX.
* @default false
*/
singleAttributePerLine: boolean;
/**
* Where to print operators when binary expressions wrap lines.
* @default "end"
*/
experimentalOperatorPosition: "start" | "end";
/**
* Use curious ternaries, with the question mark after the condition, instead
* of on the same line as the consequent.
* @default false
*/
experimentalTernaries: boolean;
/**
* Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line.
* @default false
* @deprecated use bracketSameLine instead
*/
jsxBracketSameLine?: boolean;
/**
* Arbitrary additional values on an options object are always allowed.
*/
[_: string]: unknown;
}
export interface ParserOptions<T = any> extends RequiredOptions {
locStart: (node: T) => number;
locEnd: (node: T) => number;
originalText: string;
}
export interface Plugin<T = any> {
languages?: SupportLanguage[] | undefined;
parsers?: { [parserName: string]: Parser<T> } | undefined;
printers?: { [astFormat: string]: Printer<T> } | undefined;
options?: SupportOptions | undefined;
defaultOptions?: Partial<RequiredOptions> | undefined;
}
export interface Parser<T = any> {
parse: (text: string, options: ParserOptions<T>) => T | Promise<T>;
astFormat: string;
hasPragma?: ((text: string) => boolean) | undefined;
hasIgnorePragma?: ((text: string) => boolean) | undefined;
locStart: (node: T) => number;
locEnd: (node: T) => number;
preprocess?:
| ((text: string, options: ParserOptions<T>) => string | Promise<string>)
| undefined;
}
export interface Printer<T = any> {
print(
path: AstPath<T>,
options: ParserOptions<T>,
print: (
selector?: string | number | Array<string | number> | AstPath<T>,
args?: unknown,
) => Doc,
args?: unknown,
): Doc;
printPrettierIgnored?(
path: AstPath<T>,
options: ParserOptions<T>,
print: (
selector?: string | number | Array<string | number> | AstPath<T>,
args?: unknown,
) => Doc,
args?: unknown,
): Doc;
embed?:
| ((
path: AstPath,
options: Options,
) =>
| ((
textToDoc: (text: string, options: Options) => Promise<Doc>,
print: (
selector?: string | number | Array<string | number> | AstPath,
args?: unknown,
) => Doc,
path: AstPath,
options: Options,
) => Promise<Doc | undefined> | Doc | undefined)
| Doc
| null)
| undefined;
preprocess?:
((ast: T, options: ParserOptions<T>) => T | Promise<T>) | undefined;
insertPragma?: (text: string) => string;
/**
* @returns `null` if you want to remove this node
* @returns `void` if you want to use modified `cloned`
* @returns anything if you want to replace the node with it
*/
massageAstNode?:
((original: any, cloned: any, parent: any) => any) | undefined;
hasPrettierIgnore?: ((path: AstPath<T>) => boolean) | undefined;
canAttachComment?: ((node: T, ancestors: T[]) => boolean) | undefined;
isBlockComment?: ((node: T) => boolean) | undefined;
willPrintOwnComments?: ((path: AstPath<T>) => boolean) | undefined;
printComment?:
((commentPath: AstPath<T>, options: ParserOptions<T>) => Doc) | undefined;
/**
* By default, Prettier searches all object properties (except for a few predefined ones) of each node recursively.
* This function can be provided to override that behavior.
* @param node The node whose children should be returned.
* @param options Current options.
* @returns `[]` if the node has no children or `undefined` to fall back on the default behavior.
*/
getCommentChildNodes?:
((node: T, options: ParserOptions<T>) => T[] | undefined) | undefined;
handleComments?:
| {
ownLine?:
| ((
commentNode: any,
text: string,
options: ParserOptions<T>,
ast: T,
isLastComment: boolean,
) => boolean)
| undefined;
endOfLine?:
| ((
commentNode: any,
text: string,
options: ParserOptions<T>,
ast: T,
isLastComment: boolean,
) => boolean)
| undefined;
remaining?:
| ((
commentNode: any,
text: string,
options: ParserOptions<T>,
ast: T,
isLastComment: boolean,
) => boolean)
| undefined;
}
| undefined;
getVisitorKeys?:
((node: T, nonTraversableKeys: Set<string>) => string[]) | undefined;
}
export interface CursorOptions extends Options {
/**
* Specify where the cursor is.
*/
cursorOffset: number;
}
export interface CursorResult {
formatted: string;
cursorOffset: number;
}
/**
* `format` is used to format text using Prettier. [Options](https://prettier.io/docs/options) may be provided to override the defaults.
*/
export function format(source: string, options?: Options): Promise<string>;
/**
* `check` checks to see if the file has been formatted with Prettier given those options and returns a `Boolean`.
* This is similar to the `--list-different` parameter in the CLI and is useful for running Prettier in CI scenarios.
*/
export function check(source: string, options?: Options): Promise<boolean>;
/**
* `formatWithCursor` both formats the code, and translates a cursor position from unformatted code to formatted code.
* This is useful for editor integrations, to prevent the cursor from moving when code is formatted.
*
* The `cursorOffset` option should be provided, to specify where the cursor is.
*/
export function formatWithCursor(
source: string,
options: CursorOptions,
): Promise<CursorResult>;
export interface ResolveConfigOptions {
/**
* If set to `false`, all caching will be bypassed.
*/
useCache?: boolean | undefined;
/**
* Pass directly the path of the config file if you don't wish to search for it.
*/
config?: string | URL | undefined;
/**
* If set to `true` and an `.editorconfig` file is in your project,
* Prettier will parse it and convert its properties to the corresponding prettier configuration.
* This configuration will be overridden by `.prettierrc`, etc. Currently,
* the following EditorConfig properties are supported:
* - indent_style
* - indent_size/tab_width
* - max_line_length
*/
editorconfig?: boolean | undefined;
}
/**
* `resolveConfig` can be used to resolve configuration for a given source file,
* passing its path or url as the first argument. The config search will start at
* the directory of the file location and continue to search up the directory.
*
* A promise is returned which will resolve to:
*
* - An options object, providing a [config file](https://prettier.io/docs/configuration) was found.
* - `null`, if no file was found.
*
* The promise will be rejected if there was an error parsing the configuration file.
*/
export function resolveConfig(
fileUrlOrPath: string | URL,
options?: ResolveConfigOptions,
): Promise<Options | null>;
/**
* `resolveConfigFile` can be used to find the path of the Prettier configuration file,
* that will be used when resolving the config (i.e. when calling `resolveConfig`).
*
* A promise is returned which will resolve to:
*
* - The path of the configuration file.
* - `null`, if no file was found.
*
* The promise will be rejected if there was an error parsing the configuration file.
*/
export function resolveConfigFile(
fileUrlOrPath?: string | URL,
): Promise<string | null>;
/**
* As you repeatedly call `resolveConfig`, the file system structure will be cached for performance. This function will clear the cache.
* Generally this is only needed for editor integrations that know that the file system has changed since the last format took place.
*/
export function clearConfigCache(): Promise<void>;
export interface SupportLanguage {
name: string;
parsers: BuiltInParserName[] | string[];
group?: string | undefined;
tmScope?: string | undefined;
aceMode?: string | undefined;
codemirrorMode?: string | undefined;
codemirrorMimeType?: string | undefined;
aliases?: string[] | undefined;
extensions?: string[] | undefined;
filenames?: string[] | undefined;
linguistLanguageId?: number | undefined;
vscodeLanguageIds?: string[] | undefined;
interpreters?: string[] | undefined;
isSupported?: ((options: { filepath: string }) => boolean) | undefined;
}
export interface SupportOptionRange {
start: number;
end: number;
step: number;
}
export type SupportOptionType =
"int" | "string" | "boolean" | "choice" | "path";
export type CoreCategoryType =
"Config" | "Editor" | "Format" | "Other" | "Output" | "Global" | "Special";
export interface BaseSupportOption<Type extends SupportOptionType> {
readonly name?: string | undefined;
/**
* Usually you can use {@link CoreCategoryType}
*/
category: string;
/**
* The type of the option.
*
* When passing a type other than the ones listed below, the option is
* treated as taking any string as argument, and `--option <${type}>` will
* be displayed in --help.
*/
type: Type;
/**
* Indicate that the option is deprecated.
*
* Use a string to add an extra message to --help for the option,
* for example to suggest a replacement option.
*/
deprecated?: true | string | undefined;
/**
* Description to be displayed in --help. If omitted, the option won't be
* shown at all in --help.
*/
description?: string | undefined;
}
export interface IntSupportOption extends BaseSupportOption<"int"> {
default?: number | undefined;
array?: false | undefined;
range?: SupportOptionRange | undefined;
}
export interface IntArraySupportOption extends BaseSupportOption<"int"> {
default?: Array<{ value: number[] }> | undefined;
array: true;
}
export interface StringSupportOption extends BaseSupportOption<"string"> {
default?: string | undefined;
array?: false | undefined;
}
export interface StringArraySupportOption extends BaseSupportOption<"string"> {
default?: Array<{ value: string[] }> | undefined;
array: true;
}
export interface BooleanSupportOption extends BaseSupportOption<"boolean"> {
default?: boolean | undefined;
array?: false | undefined;
description: string;
oppositeDescription?: string | undefined;
}
export interface BooleanArraySupportOption extends BaseSupportOption<"boolean"> {
default?: Array<{ value: boolean[] }> | undefined;
array: true;
}
export interface ChoiceSupportOption<
Value = any,
> extends BaseSupportOption<"choice"> {
default?: Value | Array<{ value: Value }> | undefined;
description: string;
choices: Array<{
value: Value;
description: string;
}>;
}
export interface PathSupportOption extends BaseSupportOption<"path"> {
default?: string | undefined;
array?: false | undefined;
}
export interface PathArraySupportOption extends BaseSupportOption<"path"> {
default?: Array<{ value: string[] }> | undefined;
array: true;
}
export type SupportOption =
| IntSupportOption
| IntArraySupportOption
| StringSupportOption
| StringArraySupportOption
| BooleanSupportOption
| BooleanArraySupportOption
| ChoiceSupportOption
| PathSupportOption
| PathArraySupportOption;
export interface SupportOptions extends Record<string, SupportOption> {}
export interface SupportInfo {
languages: SupportLanguage[];
options: SupportOption[];
}
export interface FileInfoOptions {
ignorePath?: string | URL | (string | URL)[] | undefined;
withNodeModules?: boolean | undefined;
plugins?: Array<string | URL | Plugin> | undefined;
resolveConfig?: boolean | undefined;
}
export interface FileInfoResult {
ignored: boolean;
inferredParser: string | null;
}
export function getFileInfo(
file: string | URL,
options?: FileInfoOptions,
): Promise<FileInfoResult>;
export interface SupportInfoOptions {
plugins?: Array<string | URL | Plugin> | undefined;
showDeprecated?: boolean | undefined;
}
/**
* Returns an object representing the parsers, languages and file types Prettier supports for the current version.
*/
export function getSupportInfo(
options?: SupportInfoOptions,
): Promise<SupportInfo>;
/**
* `version` field in `package.json`
*/
export const version: string;
// https://github.com/prettier/prettier/blob/main/src/utilities/public.js
export namespace util {
interface SkipOptions {
backwards?: boolean | undefined;
}
type Quote = "'" | '"';
function getMaxContinuousCount(text: string, searchString: string): number;
function getStringWidth(text: string): number;
function getAlignmentSize(
text: string,
tabWidth: number,
startIndex?: number | undefined,
): number;
function getIndentSize(value: string, tabWidth: number): number;
function skipNewline(
text: string,
startIndex: number | false,
options?: SkipOptions | undefined,
): number | false;
function skipInlineComment(
text: string,
startIndex: number | false,
): number | false;
function skipTrailingComment(
text: string,
startIndex: number | false,
): number | false;
function skipTrailingComment(
text: string,
startIndex: number | false,
): number | false;
function hasNewline(
text: string,
startIndex: number,
options?: SkipOptions | undefined,
): boolean;
function hasNewlineInRange(
text: string,
startIndex: number,
endIndex: number,
): boolean;
function hasSpaces(
text: string,
startIndex: number,
options?: SkipOptions | undefined,
): boolean;
function getNextNonSpaceNonCommentCharacterIndex(
text: string,
startIndex: number,
): number | false;
function getNextNonSpaceNonCommentCharacter(
text: string,
startIndex: number,
): string;
function isNextLineEmpty(text: string, startIndex: number): boolean;
function isPreviousLineEmpty(text: string, startIndex: number): boolean;
function makeString(
rawText: string,
enclosingQuote: Quote,
unescapeUnnecessaryEscapes?: boolean | undefined,
): string;
function skip(
characters: string | RegExp,
): (
text: string,
startIndex: number | false,
options?: SkipOptions,
) => number | false;
const skipWhitespace: (
text: string,
startIndex: number | false,
options?: SkipOptions,
) => number | false;
const skipSpaces: (
text: string,
startIndex: number | false,
options?: SkipOptions,
) => number | false;
const skipToLineEnd: (
text: string,
startIndex: number | false,
options?: SkipOptions,
) => number | false;
const skipEverythingButNewLine: (
text: string,
startIndex: number | false,
options?: SkipOptions,
) => number | false;
function addLeadingComment(node: any, comment: any): void;
function addDanglingComment(node: any, comment: any, marker: any): void;
function addTrailingComment(node: any, comment: any): void;
function getPreferredQuote(
text: string,
preferredQuoteOrPreferSingleQuote: Quote | boolean,
): Quote;
}
@@ -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 SeparatorVertical = createLucideIcon("SeparatorVertical", [
["line", { x1: "12", x2: "12", y1: "3", y2: "21", key: "1efggb" }],
["polyline", { points: "8 8 4 12 8 16", key: "bnfmv4" }],
["polyline", { points: "16 16 20 12 16 8", key: "u90052" }]
]);
export { SeparatorVertical as default };
//# sourceMappingURL=separator-vertical.js.map
@@ -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 GlobeLock = createLucideIcon("GlobeLock", [
[
"path",
{
d: "M15.686 15A14.5 14.5 0 0 1 12 22a14.5 14.5 0 0 1 0-20 10 10 0 1 0 9.542 13",
key: "qkt0x6"
}
],
["path", { d: "M2 12h8.5", key: "ovaggd" }],
["path", { d: "M20 6V4a2 2 0 1 0-4 0v2", key: "1of5e8" }],
["rect", { width: "8", height: "5", x: "14", y: "6", rx: "1", key: "1fmf51" }]
]);
export { GlobeLock as default };
//# sourceMappingURL=globe-lock.js.map
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './sliders-vertical.js';
//# sourceMappingURL=sliders.js.map
@@ -0,0 +1,594 @@
'use strict'
const { bufferToLowerCasedHeaderName } = require('../../core/util')
const { HTTP_TOKEN_CODEPOINTS } = require('./data-url')
const { makeEntry } = require('./formdata')
const { webidl } = require('../webidl')
const assert = require('node:assert')
const { isomorphicDecode } = require('../infra')
const dd = Buffer.from('--')
const decoder = new TextDecoder()
const decoderIgnoreBOM = new TextDecoder('utf-8', { ignoreBOM: true })
/**
* @param {string} chars
*/
function isAsciiString (chars) {
for (let i = 0; i < chars.length; ++i) {
if ((chars.charCodeAt(i) & ~0x7F) !== 0) {
return false
}
}
return true
}
/**
* @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-boundary
* @param {string} boundary
*/
function validateBoundary (boundary) {
const length = boundary.length
// - its length is greater or equal to 27 and lesser or equal to 70, and
if (length < 27 || length > 70) {
return false
}
// - it is composed by bytes in the ranges 0x30 to 0x39, 0x41 to 0x5A, or
// 0x61 to 0x7A, inclusive (ASCII alphanumeric), or which are 0x27 ('),
// 0x2D (-) or 0x5F (_).
for (let i = 0; i < length; ++i) {
const cp = boundary.charCodeAt(i)
if (!(
(cp >= 0x30 && cp <= 0x39) ||
(cp >= 0x41 && cp <= 0x5a) ||
(cp >= 0x61 && cp <= 0x7a) ||
cp === 0x27 ||
cp === 0x2d ||
cp === 0x5f
)) {
return false
}
}
return true
}
/**
* @see https://andreubotella.github.io/multipart-form-data/#multipart-form-data-parser
* @param {Buffer} input
* @param {ReturnType<import('./data-url')['parseMIMEType']>} mimeType
*/
function multipartFormDataParser (input, mimeType) {
// 1. Assert: mimeType’s essence is "multipart/form-data".
assert(mimeType !== 'failure' && mimeType.essence === 'multipart/form-data')
const boundaryString = mimeType.parameters.get('boundary')
// 2. If mimeType’s parameters["boundary"] does not exist, return failure.
// Otherwise, let boundary be the result of UTF-8 decoding mimeType’s
// parameters["boundary"].
if (boundaryString === undefined) {
throw parsingError('missing boundary in content-type header')
}
const boundary = Buffer.from(`--${boundaryString}`, 'utf8')
// 3. Let entry list be an empty entry list.
const entryList = []
// 4. Let position be a pointer to a byte in input, initially pointing at
// the first byte.
const position = { position: 0 }
// Note: Per RFC 2046 Section 5.1.1, we must ignore anything before the
// first boundary delimiter line (preamble). Search for the first boundary.
const firstBoundaryIndex = input.indexOf(boundary)
if (firstBoundaryIndex === -1) {
throw parsingError('no boundary found in multipart body')
}
// Start parsing from the first boundary, ignoring any preamble
position.position = firstBoundaryIndex
// 5. While true:
while (true) {
// 5.1. If position points to a sequence of bytes starting with 0x2D 0x2D
// (`--`) followed by boundary, advance position by 2 + the length of
// boundary. Otherwise, return failure.
// Note: boundary is padded with 2 dashes already, no need to add 2.
if (input.subarray(position.position, position.position + boundary.length).equals(boundary)) {
position.position += boundary.length
} else {
throw parsingError('expected a value starting with -- and the boundary')
}
// 5.2. If position points to the sequence of bytes 0x2D 0x2D 0x0D 0x0A
// (`--` followed by CR LF) followed by the end of input, return entry list.
// Note: Per RFC 2046 Section 5.1.1, we must ignore anything after the
// final boundary delimiter (epilogue). Check for -- or --CRLF and return
// regardless of what follows.
if (bufferStartsWith(input, dd, position)) {
// Found closing boundary delimiter (--), ignore any epilogue
return entryList
}
// 5.3. If position does not point to a sequence of bytes starting with 0x0D
// 0x0A (CR LF), return failure.
if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {
throw parsingError('expected CRLF')
}
// 5.4. Advance position by 2. (This skips past the newline.)
position.position += 2
// 5.5. Let name, filename and contentType be the result of parsing
// multipart/form-data headers on input and position, if the result
// is not failure. Otherwise, return failure.
const result = parseMultipartFormDataHeaders(input, position)
let { name, filename, contentType, encoding } = result
// 5.6. Advance position by 2. (This skips past the empty line that marks
// the end of the headers.)
position.position += 2
// 5.7. Let body be the empty byte sequence.
let body
// 5.8. Body loop: While position is not past the end of input:
// TODO: the steps here are completely wrong
{
const boundaryIndex = input.indexOf(boundary.subarray(2), position.position)
if (boundaryIndex === -1) {
throw parsingError('expected boundary after body')
}
body = input.subarray(position.position, boundaryIndex - 4)
position.position += body.length
// Note: position must be advanced by the body's length before being
// decoded, otherwise the parsing will fail.
if (encoding === 'base64') {
body = Buffer.from(body.toString(), 'base64')
}
}
// 5.9. If position does not point to a sequence of bytes starting with
// 0x0D 0x0A (CR LF), return failure. Otherwise, advance position by 2.
if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {
throw parsingError('expected CRLF')
} else {
position.position += 2
}
// 5.10. If filename is not null:
let value
if (filename !== null) {
// 5.10.1. If contentType is null, set contentType to "text/plain".
contentType ??= 'text/plain'
// 5.10.2. If contentType is not an ASCII string, set contentType to the empty string.
// Note: `buffer.isAscii` can be used at zero-cost, but converting a string to a buffer is a high overhead.
// Content-Type is a relatively small string, so it is faster to use `String#charCodeAt`.
if (!isAsciiString(contentType)) {
contentType = ''
}
// 5.10.3. Let value be a new File object with name filename, type contentType, and body body.
value = new File([body], filename, { type: contentType })
} else {
// 5.11. Otherwise:
// 5.11.1. Let value be the UTF-8 decoding without BOM of body.
value = decoderIgnoreBOM.decode(Buffer.from(body))
}
// 5.12. Assert: name is a scalar value string and value is either a scalar value string or a File object.
assert(webidl.is.USVString(name))
assert((typeof value === 'string' && webidl.is.USVString(value)) || webidl.is.File(value))
// 5.13. Create an entry with name and value, and append it to entry list.
entryList.push(makeEntry(name, value, filename))
}
}
/**
* Parses content-disposition attributes (e.g., name="value" or filename*=utf-8''encoded)
* @param {Buffer} input
* @param {{ position: number }} position
* @returns {{ name: string, value: string, extended: boolean } | null}
*/
function parseContentDispositionAttribute (input, position) {
// Skip leading semicolon and whitespace
if (input[position.position] === 0x3b /* ; */) {
position.position++
}
// Skip whitespace
collectASequenceOfBytes(
(char) => char === 0x20 || char === 0x09,
input,
position
)
// Collect attribute name (token characters)
const attributeName = collectASequenceOfBytes(
(char) => isToken(char) && char !== 0x3d && char !== 0x2a, // not = or *
input,
position
)
if (attributeName.length === 0) {
return null
}
const attrNameStr = attributeName.toString('ascii').toLowerCase()
// Check for extended notation (attribute*)
const isExtended = input[position.position] === 0x2a /* * */
if (isExtended) {
position.position++ // skip *
}
// Expect = sign
if (input[position.position] !== 0x3d /* = */) {
return null
}
position.position++ // skip =
// Skip whitespace
collectASequenceOfBytes(
(char) => char === 0x20 || char === 0x09,
input,
position
)
let value
if (isExtended) {
// Extended attribute format: charset'language'encoded-value
const headerValue = collectASequenceOfBytes(
(char) => char !== 0x20 && char !== 0x0d && char !== 0x0a && char !== 0x3b, // not space, CRLF, or ;
input,
position
)
const charsetSeparator = headerValue.indexOf(0x27)
const languageSeparator = charsetSeparator === -1
? -1
: headerValue.indexOf(0x27, charsetSeparator + 1)
if (charsetSeparator === -1 || languageSeparator === -1) {
throw parsingError('expected charset and language separators in extended value')
}
if (
charsetSeparator !== 5 ||
(headerValue[0] !== 0x75 && headerValue[0] !== 0x55) || // u or U
(headerValue[1] !== 0x74 && headerValue[1] !== 0x54) || // t or T
(headerValue[2] !== 0x66 && headerValue[2] !== 0x46) || // f or F
headerValue[3] !== 0x2d || // -
headerValue[4] !== 0x38 // 8
) {
throw parsingError('unknown charset, expected utf-8')
}
value = decodeURIComponent(decoder.decode(headerValue.subarray(languageSeparator + 1)))
} else if (input[position.position] === 0x22 /* " */) {
// Quoted string
position.position++ // skip opening quote
const quotedValue = collectASequenceOfBytes(
(char) => char !== 0x0a && char !== 0x0d && char !== 0x22, // not LF, CR, or "
input,
position
)
if (input[position.position] !== 0x22) {
throw parsingError('Closing quote not found')
}
position.position++ // skip closing quote
value = decoder.decode(quotedValue)
.replace(/%0A/ig, '\n')
.replace(/%0D/ig, '\r')
.replace(/%22/g, '"')
} else {
// Token value (no quotes)
const tokenValue = collectASequenceOfBytes(
(char) => isToken(char) && char !== 0x3b, // not ;
input,
position
)
value = decoder.decode(tokenValue)
}
return { name: attrNameStr, value, extended: isExtended }
}
/**
* @see https://andreubotella.github.io/multipart-form-data/#parse-multipart-form-data-headers
* @param {Buffer} input
* @param {{ position: number }} position
*/
function parseMultipartFormDataHeaders (input, position) {
// 1. Let name, filename and contentType be null.
let name = null
let filename = null
let contentType = null
let encoding = null
// 2. While true:
while (true) {
// 2.1. If position points to a sequence of bytes starting with 0x0D 0x0A (CR LF):
if (input[position.position] === 0x0d && input[position.position + 1] === 0x0a) {
// 2.1.1. If name is null, return failure.
if (name === null) {
throw parsingError('header name is null')
}
// 2.1.2. Return name, filename and contentType.
return { name, filename, contentType, encoding }
}
// 2.2. Let header name be the result of collecting a sequence of bytes that are
// not 0x0A (LF), 0x0D (CR) or 0x3A (:), given position.
let headerName = collectASequenceOfBytes(
(char) => char !== 0x0a && char !== 0x0d && char !== 0x3a,
input,
position
)
// 2.3. Remove any HTTP tab or space bytes from the start or end of header name.
headerName = removeChars(headerName, true, true, (char) => char === 0x9 || char === 0x20)
// 2.4. If header name does not match the field-name token production, return failure.
if (!HTTP_TOKEN_CODEPOINTS.test(headerName.toString())) {
throw parsingError('header name does not match the field-name token production')
}
// 2.5. If the byte at position is not 0x3A (:), return failure.
if (input[position.position] !== 0x3a) {
throw parsingError('expected :')
}
// 2.6. Advance position by 1.
position.position++
// 2.7. Collect a sequence of bytes that are HTTP tab or space bytes given position.
// (Do nothing with those bytes.)
collectASequenceOfBytes(
(char) => char === 0x20 || char === 0x09,
input,
position
)
// 2.8. Byte-lowercase header name and switch on the result:
switch (bufferToLowerCasedHeaderName(headerName)) {
case 'content-disposition': {
name = filename = null
// Track whether filename was set from the extended (RFC 5987) form so
// a subsequent legacy `filename` attribute does not override it.
let filenameIsExtended = false
// Collect the disposition type (should be "form-data")
const dispositionType = collectASequenceOfBytes(
(char) => isToken(char),
input,
position
)
if (dispositionType.toString('ascii').toLowerCase() !== 'form-data') {
throw parsingError('expected form-data for content-disposition header')
}
// Parse attributes recursively until CRLF
while (
position.position < input.length &&
(input[position.position] !== 0x0d ||
input[position.position + 1] !== 0x0a)
) {
const attribute = parseContentDispositionAttribute(input, position)
if (!attribute) {
break
}
if (attribute.name === 'name') {
name = attribute.value
} else if (attribute.name === 'filename') {
// Per RFC 5987 §4.1, when both legacy and extended forms of the
// same parameter are present, the extended (filename*) form takes
// precedence regardless of the order they appear in.
if (attribute.extended) {
filename = attribute.value
filenameIsExtended = true
} else if (!filenameIsExtended) {
filename = attribute.value
}
}
}
if (name === null) {
throw parsingError('name attribute is required in content-disposition header')
}
break
}
case 'content-type': {
// 1. Let header value be the result of collecting a sequence of bytes that are
// not 0x0A (LF) or 0x0D (CR), given position.
let headerValue = collectASequenceOfBytes(
(char) => char !== 0x0a && char !== 0x0d,
input,
position
)
// 2. Remove any HTTP tab or space bytes from the end of header value.
headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)
// 3. Set contentType to the isomorphic decoding of header value.
contentType = isomorphicDecode(headerValue)
break
}
case 'content-transfer-encoding': {
let headerValue = collectASequenceOfBytes(
(char) => char !== 0x0a && char !== 0x0d,
input,
position
)
headerValue = removeChars(headerValue, false, true, (char) => char === 0x9 || char === 0x20)
encoding = isomorphicDecode(headerValue)
break
}
default: {
// Collect a sequence of bytes that are not 0x0A (LF) or 0x0D (CR), given position.
// (Do nothing with those bytes.)
collectASequenceOfBytes(
(char) => char !== 0x0a && char !== 0x0d,
input,
position
)
}
}
// 2.9. If position does not point to a sequence of bytes starting with 0x0D 0x0A
// (CR LF), return failure. Otherwise, advance position by 2 (past the newline).
if (input[position.position] !== 0x0d || input[position.position + 1] !== 0x0a) {
throw parsingError('expected CRLF')
} else {
position.position += 2
}
}
}
/**
* @param {(char: number) => boolean} condition
* @param {Buffer} input
* @param {{ position: number }} position
*/
function collectASequenceOfBytes (condition, input, position) {
let start = position.position
while (start < input.length && condition(input[start])) {
++start
}
return input.subarray(position.position, (position.position = start))
}
/**
* @param {Buffer} buf
* @param {boolean} leading
* @param {boolean} trailing
* @param {(charCode: number) => boolean} predicate
* @returns {Buffer}
*/
function removeChars (buf, leading, trailing, predicate) {
let lead = 0
let trail = buf.length - 1
if (leading) {
while (lead < buf.length && predicate(buf[lead])) lead++
}
if (trailing) {
while (trail > 0 && predicate(buf[trail])) trail--
}
return lead === 0 && trail === buf.length - 1 ? buf : buf.subarray(lead, trail + 1)
}
/**
* Checks if {@param buffer} starts with {@param start}
* @param {Buffer} buffer
* @param {Buffer} start
* @param {{ position: number }} position
*/
function bufferStartsWith (buffer, start, position) {
if (buffer.length < start.length) {
return false
}
for (let i = 0; i < start.length; i++) {
if (start[i] !== buffer[position.position + i]) {
return false
}
}
return true
}
function parsingError (cause) {
return new TypeError('Failed to parse body as FormData.', { cause: new TypeError(cause) })
}
/**
* CTL = <any US-ASCII control character
* (octets 0 - 31) and DEL (127)>
* @param {number} char
*/
function isCTL (char) {
return char <= 0x1f || char === 0x7f
}
/**
* tspecials := "(" / ")" / "<" / ">" / "@" /
* "," / ";" / ":" / "\" / <">
* "/" / "[" / "]" / "?" / "="
* ; Must be in quoted-string,
* ; to use within parameter values
* @param {number} char
*/
function isTSpecial (char) {
return (
char === 0x28 || // (
char === 0x29 || // )
char === 0x3c || // <
char === 0x3e || // >
char === 0x40 || // @
char === 0x2c || // ,
char === 0x3b || // ;
char === 0x3a || // :
char === 0x5c || // \
char === 0x22 || // "
char === 0x2f || // /
char === 0x5b || // [
char === 0x5d || // ]
char === 0x3f || // ?
char === 0x3d // +
)
}
/**
* token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
* or tspecials>
* @param {number} char
*/
function isToken (char) {
return (
char <= 0x7f && // ascii
char !== 0x20 && // space
char !== 0x09 &&
!isCTL(char) &&
!isTSpecial(char)
)
}
module.exports = {
multipartFormDataParser,
validateBoundary
}
@@ -0,0 +1,54 @@
import type {CodeKeywordDefinition, ErrorObject, KeywordErrorDefinition} from "../../types"
import type {KeywordCxt} from "../../compile/validate"
import {_, or, Name, Code} from "../../compile/codegen"
import {useFunc} from "../../compile/util"
import equal from "../../runtime/equal"
export type EnumError = ErrorObject<"enum", {allowedValues: any[]}, any[] | {$data: string}>
const error: KeywordErrorDefinition = {
message: "must be equal to one of the allowed values",
params: ({schemaCode}) => _`{allowedValues: ${schemaCode}}`,
}
const def: CodeKeywordDefinition = {
keyword: "enum",
schemaType: "array",
$data: true,
error,
code(cxt: KeywordCxt) {
const {gen, data, $data, schema, schemaCode, it} = cxt
if (!$data && schema.length === 0) throw new Error("enum must have non-empty array")
const useLoop = schema.length >= it.opts.loopEnum
let eql: Name | undefined
const getEql = (): Name => (eql ??= useFunc(gen, equal))
let valid: Code
if (useLoop || $data) {
valid = gen.let("valid")
cxt.block$data(valid, loopEnum)
} else {
/* istanbul ignore if */
if (!Array.isArray(schema)) throw new Error("ajv implementation error")
const vSchema = gen.const("vSchema", schemaCode)
valid = or(...schema.map((_x: unknown, i: number) => equalCode(vSchema, i)))
}
cxt.pass(valid)
function loopEnum(): void {
gen.assign(valid, false)
gen.forOf("v", schemaCode as Code, (v) =>
gen.if(_`${getEql()}(${data}, ${v})`, () => gen.assign(valid, true).break())
)
}
function equalCode(vSchema: Name, i: number): Code {
const sch = schema[i]
return typeof sch === "object" && sch !== null
? _`${getEql()}(${data}, ${vSchema}[${i}])`
: _`${data} === ${sch}`
}
},
}
export default def
@@ -0,0 +1,28 @@
import { HonoBase as Hono$1 } from "./hono-base.js";
import { RegExpRouter } from "./router/reg-exp-router/router.js";
import "./router/reg-exp-router/index.js";
import { SmartRouter } from "./router/smart-router/router.js";
import { TrieRouter } from "./router/trie-router/router.js";
import "./router/trie-router/index.js";
//#region src/hono.ts
/**
* The Hono class extends the functionality of the HonoBase class.
* It sets up routing and allows for custom options to be passed.
*
* @template E - The environment type.
* @template S - The schema type.
* @template BasePath - The base path type.
*/
var Hono = class extends Hono$1 {
/**
* Creates an instance of the Hono class.
*
* @param options - Optional configuration options for the Hono instance.
*/
constructor(options = {}) {
super(options);
this.router = options.router ?? new SmartRouter({ routers: [new RegExpRouter(), new TrieRouter()] });
}
};
//#endregion
export { Hono };
@@ -0,0 +1 @@
{"version":3,"file":"undo-dot.js","sources":["../../../src/icons/undo-dot.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name UndoDot\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTdhOSA5IDAgMCAwLTE1LTYuN0wzIDEzIiAvPgogIDxwYXRoIGQ9Ik0zIDd2Nmg2IiAvPgogIDxjaXJjbGUgY3g9IjEyIiBjeT0iMTciIHI9IjEiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/undo-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 UndoDot = createLucideIcon('UndoDot', [\n ['path', { d: 'M21 17a9 9 0 0 0-15-6.7L3 13', key: '8mp6z9' }],\n ['path', { d: 'M3 7v6h6', key: '1v2h90' }],\n ['circle', { cx: '12', cy: '17', r: '1', key: '1ixnty' }],\n]);\n\nexport default UndoDot;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC7D,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,CACzC,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,21 @@
MIT License
Copyright (c) Jordan Harband and 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,207 @@
import * as util from "../core/util.js";
const capitalizeFirstCharacter = (text) => {
return text.charAt(0).toUpperCase() + text.slice(1);
};
function getUnitTypeFromNumber(number) {
const abs = Math.abs(number);
const last = abs % 10;
const last2 = abs % 100;
if ((last2 >= 11 && last2 <= 19) || last === 0)
return "many";
if (last === 1)
return "one";
return "few";
}
const error = () => {
const Sizable = {
string: {
unit: {
one: "simbolis",
few: "simboliai",
many: "simbolių",
},
verb: {
smaller: {
inclusive: "turi būti ne ilgesnė kaip",
notInclusive: "turi būti trumpesnė kaip",
},
bigger: {
inclusive: "turi būti ne trumpesnė kaip",
notInclusive: "turi būti ilgesnė kaip",
},
},
},
file: {
unit: {
one: "baitas",
few: "baitai",
many: "baitų",
},
verb: {
smaller: {
inclusive: "turi būti ne didesnis kaip",
notInclusive: "turi būti mažesnis kaip",
},
bigger: {
inclusive: "turi būti ne mažesnis kaip",
notInclusive: "turi būti didesnis kaip",
},
},
},
array: {
unit: {
one: "elementą",
few: "elementus",
many: "elementų",
},
verb: {
smaller: {
inclusive: "turi turėti ne daugiau kaip",
notInclusive: "turi turėti mažiau kaip",
},
bigger: {
inclusive: "turi turėti ne mažiau kaip",
notInclusive: "turi turėti daugiau kaip",
},
},
},
set: {
unit: {
one: "elementą",
few: "elementus",
many: "elementų",
},
verb: {
smaller: {
inclusive: "turi turėti ne daugiau kaip",
notInclusive: "turi turėti mažiau kaip",
},
bigger: {
inclusive: "turi turėti ne mažiau kaip",
notInclusive: "turi turėti daugiau kaip",
},
},
},
};
function getSizing(origin, unitType, inclusive, targetShouldBe) {
const result = Sizable[origin] ?? null;
if (result === null)
return result;
return {
unit: result.unit[unitType],
verb: result.verb[targetShouldBe][inclusive ? "inclusive" : "notInclusive"],
};
}
const FormatDictionary = {
regex: "įvestis",
email: "el. pašto adresas",
url: "URL",
emoji: "jaustukas",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "ISO data ir laikas",
date: "ISO data",
time: "ISO laikas",
duration: "ISO trukmė",
ipv4: "IPv4 adresas",
ipv6: "IPv6 adresas",
mac: "MAC adresas",
cidrv4: "IPv4 tinklo prefiksas (CIDR)",
cidrv6: "IPv6 tinklo prefiksas (CIDR)",
base64: "base64 užkoduota eilutė",
base64url: "base64url užkoduota eilutė",
json_string: "JSON eilutė",
e164: "E.164 numeris",
credit_card: "kredito kortelės numeris",
currency_code: "valiutos kodas",
iban: "IBAN",
jwt: "JWT",
template_literal: "įvestis",
};
const TypeDictionary = {
nan: "NaN",
number: "skaičius",
bigint: "sveikasis skaičius",
string: "eilutė",
boolean: "loginė reikšmė",
undefined: "neapibrėžta reikšmė",
function: "funkcija",
symbol: "simbolis",
array: "masyvas",
object: "objektas",
null: "nulinė reikšmė",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Gautas tipas ${received}, o tikėtasi - instanceof ${issue.expected}`;
}
return `Gautas tipas ${received}, o tikėtasi - ${expected}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Privalo būti ${util.stringifyPrimitive(issue.values[0])}`;
return `Privalo būti vienas iš ${util.joinValues(issue.values, "|")} pasirinkimų`;
case "too_big": {
const origin = TypeDictionary[issue.origin] ?? issue.origin;
const sizing = getSizing(issue.origin, getUnitTypeFromNumber(Number(issue.maximum)), issue.inclusive ?? false, "smaller");
if (sizing?.verb)
return `${capitalizeFirstCharacter(origin ?? issue.origin ?? "reikšmė")} ${sizing.verb} ${issue.maximum.toString()} ${sizing.unit ?? "elementų"}`;
const adj = issue.inclusive ? "ne didesnis kaip" : "mažesnis kaip";
return `${capitalizeFirstCharacter(origin ?? issue.origin ?? "reikšmė")} turi būti ${adj} ${issue.maximum.toString()} ${sizing?.unit}`;
}
case "too_small": {
const origin = TypeDictionary[issue.origin] ?? issue.origin;
const sizing = getSizing(issue.origin, getUnitTypeFromNumber(Number(issue.minimum)), issue.inclusive ?? false, "bigger");
if (sizing?.verb)
return `${capitalizeFirstCharacter(origin ?? issue.origin ?? "reikšmė")} ${sizing.verb} ${issue.minimum.toString()} ${sizing.unit ?? "elementų"}`;
const adj = issue.inclusive ? "ne mažesnis kaip" : "didesnis kaip";
return `${capitalizeFirstCharacter(origin ?? issue.origin ?? "reikšmė")} turi būti ${adj} ${issue.minimum.toString()} ${sizing?.unit}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Eilutė privalo prasidėti "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Eilutė privalo pasibaigti "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Eilutė privalo įtraukti "${_issue.includes}"`;
if (_issue.format === "regex")
return `Eilutė privalo atitikti ${_issue.pattern}`;
return `Neteisingas ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Skaičius privalo būti ${issue.divisor} kartotinis.`;
case "unrecognized_keys":
return `Neatpažint${issue.keys.length > 1 ? "i" : "as"} rakt${issue.keys.length > 1 ? "ai" : "as"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return "Rastas klaidingas raktas";
case "invalid_union":
return "Klaidinga įvestis";
case "invalid_element": {
const origin = TypeDictionary[issue.origin] ?? issue.origin;
return `${capitalizeFirstCharacter(origin ?? issue.origin ?? "reikšmė")} turi klaidingą įvestį`;
}
default:
return "Klaidinga įvestis";
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -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/side-channel-map
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,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = isVar;
var _index = require("./generated/index.js");
var BLOCK_SCOPED_SYMBOL = Symbol.for("var used to be block scoped");
function isVar(node) {
return (0, _index.isVariableDeclaration)(node, {
kind: "var"
}) && !node[BLOCK_SCOPED_SYMBOL];
}
//# sourceMappingURL=isVar.js.map
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_eE _i","2":"_XH _vH"},C:{"2":"_WD _RG _YP aB _L","194":"bB","260":"_XL _uD"},D:{"1":"_eE _l","2":"_xF _VC"},E:{"1":"_YQ","2":"_gG _oE"},F:{"1":"_rQ _h","2":"_8 _HO _O"},G:{"1":"_gL","2":"_AF _oE"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"260":"YC"},N:{"2":"_A"},O:{"2":"bC"},P:{"2":"_F"},Q:{"2":"JE"},R:{"2":"KE"},S:{"2":"_C"}},B:5,C:"View Transitions (cross-document)",D:true};
@@ -0,0 +1,23 @@
The MIT License (MIT)
Copyright (c) 2014 Jonathan Ong me@jongleberry.com
Copyright (c) 2016 Douglas Christopher Wilson doug@somethingdoug.com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,72 @@
// Interface declaration for Float16Array, required in @types/node v24+.
// These definitions are specific to TS 5.7.
// This needs all of the "common" properties/methods of the TypedArrays,
// otherwise the type unions `TypedArray` and `ArrayBufferView` will be
// empty objects.
interface Float16Array<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> {
readonly BYTES_PER_ELEMENT: number;
readonly buffer: TArrayBuffer;
readonly byteLength: number;
readonly byteOffset: number;
readonly length: number;
readonly [Symbol.toStringTag]: "Float16Array";
at(index: number): number | undefined;
copyWithin(target: number, start: number, end?: number): this;
entries(): ArrayIterator<[number, number]>;
every(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
fill(value: number, start?: number, end?: number): this;
filter(predicate: (value: number, index: number, array: this) => any, thisArg?: any): Float16Array<ArrayBuffer>;
find(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number | undefined;
findIndex(predicate: (value: number, index: number, obj: this) => boolean, thisArg?: any): number;
findLast<S extends number>(
predicate: (value: number, index: number, array: this) => value is S,
thisArg?: any,
): S | undefined;
findLast(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): number | undefined;
findLastIndex(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): number;
forEach(callbackfn: (value: number, index: number, array: this) => void, thisArg?: any): void;
includes(searchElement: number, fromIndex?: number): boolean;
indexOf(searchElement: number, fromIndex?: number): number;
join(separator?: string): string;
keys(): ArrayIterator<number>;
lastIndexOf(searchElement: number, fromIndex?: number): number;
map(callbackfn: (value: number, index: number, array: this) => number, thisArg?: any): Float16Array<ArrayBuffer>;
reduce(
callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
): number;
reduce(
callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
initialValue: number,
): number;
reduce<U>(
callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U,
initialValue: U,
): U;
reduceRight(
callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
): number;
reduceRight(
callbackfn: (previousValue: number, currentValue: number, currentIndex: number, array: this) => number,
initialValue: number,
): number;
reduceRight<U>(
callbackfn: (previousValue: U, currentValue: number, currentIndex: number, array: this) => U,
initialValue: U,
): U;
reverse(): this;
set(array: ArrayLike<number>, offset?: number): void;
slice(start?: number, end?: number): Float16Array<ArrayBuffer>;
some(predicate: (value: number, index: number, array: this) => unknown, thisArg?: any): boolean;
sort(compareFn?: (a: number, b: number) => number): this;
subarray(begin?: number, end?: number): Float16Array<TArrayBuffer>;
toLocaleString(locales: string | string[], options?: Intl.NumberFormatOptions): string;
toReversed(): Float16Array<ArrayBuffer>;
toSorted(compareFn?: (a: number, b: number) => number): Float16Array<ArrayBuffer>;
toString(): string;
valueOf(): this;
values(): ArrayIterator<number>;
with(index: number, value: number): Float16Array<ArrayBuffer>;
[Symbol.iterator](): ArrayIterator<number>;
[index: number]: number;
}
@@ -0,0 +1,94 @@
import { type ErrorEvent, type EventSourceInit } from 'eventsource';
import { Transport, FetchLike } from '../shared/transport.js';
import { JSONRPCMessage } from '../types.js';
import { OAuthClientProvider } from './auth.js';
export declare class SseError extends Error {
readonly code: number | undefined;
readonly event: ErrorEvent;
constructor(code: number | undefined, message: string | undefined, event: ErrorEvent);
}
/**
* Configuration options for the `SSEClientTransport`.
*/
export type SSEClientTransportOptions = {
/**
* An OAuth client provider to use for authentication.
*
* When an `authProvider` is specified and the SSE connection is started:
* 1. The connection is attempted with any existing access token from the `authProvider`.
* 2. If the access token has expired, the `authProvider` is used to refresh the token.
* 3. If token refresh fails or no access token exists, and auth is required, `OAuthClientProvider.redirectToAuthorization` is called, and an `UnauthorizedError` will be thrown from `connect`/`start`.
*
* After the user has finished authorizing via their user agent, and is redirected back to the MCP client application, call `SSEClientTransport.finishAuth` with the authorization code before retrying the connection.
*
* If an `authProvider` is not provided, and auth is required, an `UnauthorizedError` will be thrown.
*
* `UnauthorizedError` might also be thrown when sending any message over the SSE transport, indicating that the session has expired, and needs to be re-authed and reconnected.
*/
authProvider?: OAuthClientProvider;
/**
* Customizes the initial SSE request to the server (the request that begins the stream).
*
* NOTE: Setting this property will prevent an `Authorization` header from
* being automatically attached to the SSE request, if an `authProvider` is
* also given. This can be worked around by setting the `Authorization` header
* manually.
*/
eventSourceInit?: EventSourceInit;
/**
* Customizes recurring POST requests to the server.
*/
requestInit?: RequestInit;
/**
* Custom fetch implementation used for all network requests.
*/
fetch?: FetchLike;
/**
* How a redirect of one of the transport's requests is handled, including the OAuth requests it makes for `authProvider`.
*
* - `'same-origin'` (default): a redirect is followed only when it keeps the method and stays within the origin of the request, or goes from http to https on the same host with default ports; any other redirect is not followed and the request fails.
* - `'follow'`: redirects are left to the fetch implementation, as in earlier versions of the SDK.
*
* With either value, a `requestInit.redirect` of `'error'` or `'manual'` is passed to fetch unchanged for the POST requests that carry messages.
* The OAuth requests read `requestInit.redirect` only with `'follow'`, and the request that opens the stream does not read it.
*/
redirectPolicy?: 'same-origin' | 'follow';
};
/**
* Client transport for SSE: this will connect to a server using Server-Sent Events for receiving
* messages and make separate POST requests for sending messages.
* @deprecated SSEClientTransport is deprecated. Prefer to use StreamableHTTPClientTransport where possible instead. Note that because some servers are still using SSE, clients may need to support both transports during the migration period.
*/
export declare class SSEClientTransport implements Transport {
private _eventSource?;
private _endpoint?;
private _abortController?;
private _url;
private _resourceMetadataUrl?;
private _scope?;
private _eventSourceInit?;
private _requestInit?;
private _authProvider?;
private _fetch?;
private _fetchWithInit;
private _followRedirects;
private _protocolVersion?;
onclose?: () => void;
onerror?: (error: Error) => void;
onmessage?: (message: JSONRPCMessage) => void;
constructor(url: URL, opts?: SSEClientTransportOptions);
/** Error text for a redirect `response` that was not followed, or `undefined` for any other response. */
private _unfollowedRedirect;
private _authThenStart;
private _commonHeaders;
private _startOrAuth;
start(): Promise<void>;
/**
* Call this method after the user has finished authorizing via their user agent and is redirected back to the MCP client application. This will exchange the authorization code for an access token, enabling the next connection attempt to successfully auth.
*/
finishAuth(authorizationCode: string): Promise<void>;
close(): Promise<void>;
send(message: JSONRPCMessage): Promise<void>;
setProtocolVersion(version: string): void;
}
//# sourceMappingURL=sse.d.ts.map
@@ -0,0 +1,16 @@
import { AnyRouter, Constrain, InferFrom, InferMaskFrom, InferMaskTo, InferSelected, InferShouldThrow, InferStrict, InferTo, RegisteredRouter } from '@tanstack/router-core';
import { LinkComponentProps } from './link.cjs';
import { UseParamsOptions } from './useParams.cjs';
import { UseSearchOptions } from './useSearch.cjs';
export type ValidateLinkOptions<TRouter extends AnyRouter = RegisteredRouter, TOptions = unknown, TDefaultFrom extends string = string, TComp = 'a'> = Constrain<TOptions, LinkComponentProps<TComp, TRouter, InferFrom<TOptions, TDefaultFrom>, InferTo<TOptions>, InferMaskFrom<TOptions>, InferMaskTo<TOptions>>>;
/**
* @private
*/
export type InferStructuralSharing<TOptions> = TOptions extends {
structuralSharing: infer TStructuralSharing;
} ? TStructuralSharing : unknown;
export type ValidateUseSearchOptions<TOptions, TRouter extends AnyRouter = RegisteredRouter> = Constrain<TOptions, UseSearchOptions<TRouter, InferFrom<TOptions>, InferStrict<TOptions>, InferShouldThrow<TOptions>, InferSelected<TOptions>, InferStructuralSharing<TOptions>>>;
export type ValidateUseParamsOptions<TOptions, TRouter extends AnyRouter = RegisteredRouter> = Constrain<TOptions, UseParamsOptions<TRouter, InferFrom<TOptions>, InferStrict<TOptions>, InferShouldThrow<TOptions>, InferSelected<TOptions>, InferSelected<TOptions>>>;
export type ValidateLinkOptionsArray<TRouter extends AnyRouter = RegisteredRouter, TOptions extends ReadonlyArray<any> = ReadonlyArray<unknown>, TDefaultFrom extends string = string, TComp = 'a'> = {
[K in keyof TOptions]: ValidateLinkOptions<TRouter, TOptions[K], TDefaultFrom, TComp>;
};
@@ -0,0 +1,681 @@
"use client";
// src/slider.tsx
import * as React from "react";
import { clamp } from "@radix-ui/number";
import { composeEventHandlers } from "@radix-ui/primitive";
import { useComposedRefs } from "@radix-ui/react-compose-refs";
import { createContextScope } from "@radix-ui/react-context";
import { useControllableState } from "@radix-ui/react-use-controllable-state";
import { useDirection } from "@radix-ui/react-direction";
import { usePrevious } from "@radix-ui/react-use-previous";
import { useSize } from "@radix-ui/react-use-size";
import { Primitive } from "@radix-ui/react-primitive";
import { createCollection } from "@radix-ui/react-collection";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
var PAGE_KEYS = ["PageUp", "PageDown"];
var ARROW_KEYS = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"];
var BACK_KEYS = {
"from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
"from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
"from-bottom": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
"from-top": ["Home", "PageDown", "ArrowUp", "ArrowLeft"]
};
var SLIDER_NAME = "Slider";
var [Collection, useCollection, createCollectionScope] = createCollection(SLIDER_NAME);
var [createSliderContext, createSliderScope] = createContextScope(SLIDER_NAME, [
createCollectionScope
]);
var [SliderProvider, useSliderContext] = createSliderContext(SLIDER_NAME);
var Slider = React.forwardRef(
(props, forwardedRef) => {
const {
name,
min = 0,
max = 100,
step = 1,
orientation = "horizontal",
disabled = false,
minStepsBetweenThumbs = 0,
defaultValue = [min],
value,
onValueChange = () => {
},
onValueCommit = () => {
},
inverted = false,
form,
...sliderProps
} = props;
const thumbRefs = React.useRef(/* @__PURE__ */ new Set());
const valueIndexToChangeRef = React.useRef(0);
const isKeyboardInteractionRef = React.useRef(false);
const isHorizontal = orientation === "horizontal";
const SliderOrientation = isHorizontal ? SliderHorizontal : SliderVertical;
const [control, setControl] = React.useState(null);
const composedRefs = useComposedRefs(forwardedRef, setControl);
const [values = [], setValues] = useControllableState({
prop: value,
defaultProp: defaultValue,
onChange: (value2) => {
const thumbs = [...thumbRefs.current];
thumbs[valueIndexToChangeRef.current]?.focus({
preventScroll: true,
focusVisible: isKeyboardInteractionRef.current
});
isKeyboardInteractionRef.current = false;
onValueChange(value2);
}
});
const valuesBeforeSlideStartRef = React.useRef(values);
const initialValuesRef = React.useRef(values);
React.useEffect(() => {
const associatedForm = form ? control?.ownerDocument.getElementById(form) : control?.closest("form");
if (associatedForm instanceof HTMLFormElement) {
const reset = () => setValues(initialValuesRef.current);
associatedForm.addEventListener("reset", reset);
return () => associatedForm.removeEventListener("reset", reset);
}
}, [control, form, setValues]);
function handleSlideStart(value2) {
const closestIndex = getClosestValueIndex(values, value2);
updateValues(value2, closestIndex);
}
function handleSlideMove(value2) {
updateValues(value2, valueIndexToChangeRef.current);
}
function handleSlideEnd() {
const prevValue = valuesBeforeSlideStartRef.current[valueIndexToChangeRef.current];
const nextValue = values[valueIndexToChangeRef.current];
const hasChanged = nextValue !== prevValue;
if (hasChanged) onValueCommit(values);
}
function updateValues(value2, atIndex, { commit } = { commit: false }) {
const decimalCount = getDecimalCount(step);
const snapToStep = roundValue(Math.round((value2 - min) / step) * step + min, decimalCount);
const nextValue = clamp(snapToStep, [min, max]);
setValues((prevValues = []) => {
const nextValues = getNextSortedValues(prevValues, nextValue, atIndex);
if (hasMinStepsBetweenValues(nextValues, minStepsBetweenThumbs * step)) {
valueIndexToChangeRef.current = nextValues.indexOf(nextValue);
const hasChanged = String(nextValues) !== String(prevValues);
if (hasChanged && commit) onValueCommit(nextValues);
return hasChanged ? nextValues : prevValues;
} else {
return prevValues;
}
});
}
return /* @__PURE__ */ jsx(
SliderProvider,
{
scope: props.__scopeSlider,
name,
disabled,
min,
max,
valueIndexToChangeRef,
thumbs: thumbRefs.current,
values,
orientation,
form,
children: /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeSlider, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeSlider, children: /* @__PURE__ */ jsx(
SliderOrientation,
{
"aria-disabled": disabled,
"data-disabled": disabled ? "" : void 0,
...sliderProps,
ref: composedRefs,
onPointerDown: composeEventHandlers(sliderProps.onPointerDown, () => {
if (!disabled) {
valuesBeforeSlideStartRef.current = values;
isKeyboardInteractionRef.current = false;
}
}),
min,
max,
inverted,
onSlideStart: disabled ? void 0 : handleSlideStart,
onSlideMove: disabled ? void 0 : handleSlideMove,
onSlideEnd: disabled ? void 0 : handleSlideEnd,
onHomeKeyDown: () => {
if (!disabled) {
isKeyboardInteractionRef.current = true;
updateValues(min, 0, { commit: true });
}
},
onEndKeyDown: () => {
if (!disabled) {
isKeyboardInteractionRef.current = true;
updateValues(max, values.length - 1, { commit: true });
}
},
onStepKeyDown: ({ event, direction: stepDirection }) => {
if (!disabled) {
isKeyboardInteractionRef.current = true;
const isPageKey = PAGE_KEYS.includes(event.key);
const isSkipKey = isPageKey || event.shiftKey && ARROW_KEYS.includes(event.key);
const multiplier = isSkipKey ? 10 : 1;
const atIndex = valueIndexToChangeRef.current;
const value2 = values[atIndex];
const nextValue = getNextStepValue(value2, {
min,
step,
direction: stepDirection,
multiplier
});
updateValues(nextValue, atIndex, { commit: true });
}
}
}
) }) })
}
);
}
);
Slider.displayName = SLIDER_NAME;
var [SliderOrientationProvider, useSliderOrientationContext] = createSliderContext(SLIDER_NAME, {
startEdge: "left",
endEdge: "right",
size: "width",
direction: 1
});
var SliderHorizontal = React.forwardRef(
(props, forwardedRef) => {
const {
min,
max,
dir,
inverted,
onSlideStart,
onSlideMove,
onSlideEnd,
onStepKeyDown,
...sliderProps
} = props;
const [slider, setSlider] = React.useState(null);
const composedRefs = useComposedRefs(forwardedRef, setSlider);
const rectRef = React.useRef(void 0);
const direction = useDirection(dir);
const isDirectionLTR = direction === "ltr";
const isSlidingFromLeft = isDirectionLTR && !inverted || !isDirectionLTR && inverted;
function getValueFromPointer(pointerPosition) {
const rect = rectRef.current || slider.getBoundingClientRect();
const input = [0, rect.width];
const output = isSlidingFromLeft ? [min, max] : [max, min];
const value = linearScale(input, output);
rectRef.current = rect;
return value(pointerPosition - rect.left);
}
return /* @__PURE__ */ jsx(
SliderOrientationProvider,
{
scope: props.__scopeSlider,
startEdge: isSlidingFromLeft ? "left" : "right",
endEdge: isSlidingFromLeft ? "right" : "left",
direction: isSlidingFromLeft ? 1 : -1,
size: "width",
children: /* @__PURE__ */ jsx(
SliderImpl,
{
dir: direction,
"data-orientation": "horizontal",
...sliderProps,
ref: composedRefs,
style: {
...sliderProps.style,
"--radix-slider-thumb-transform": "translateX(-50%)"
},
onSlideStart: (event) => {
const value = getValueFromPointer(event.clientX);
onSlideStart?.(value);
},
onSlideMove: (event) => {
const value = getValueFromPointer(event.clientX);
onSlideMove?.(value);
},
onSlideEnd: () => {
rectRef.current = void 0;
onSlideEnd?.();
},
onStepKeyDown: (event) => {
const slideDirection = isSlidingFromLeft ? "from-left" : "from-right";
const isBackKey = BACK_KEYS[slideDirection].includes(event.key);
onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 });
}
}
)
}
);
}
);
var SliderVertical = React.forwardRef(
(props, forwardedRef) => {
const {
min,
max,
inverted,
onSlideStart,
onSlideMove,
onSlideEnd,
onStepKeyDown,
...sliderProps
} = props;
const sliderRef = React.useRef(null);
const ref = useComposedRefs(forwardedRef, sliderRef);
const rectRef = React.useRef(void 0);
const isSlidingFromBottom = !inverted;
function getValueFromPointer(pointerPosition) {
const rect = rectRef.current || sliderRef.current.getBoundingClientRect();
const input = [0, rect.height];
const output = isSlidingFromBottom ? [max, min] : [min, max];
const value = linearScale(input, output);
rectRef.current = rect;
return value(pointerPosition - rect.top);
}
return /* @__PURE__ */ jsx(
SliderOrientationProvider,
{
scope: props.__scopeSlider,
startEdge: isSlidingFromBottom ? "bottom" : "top",
endEdge: isSlidingFromBottom ? "top" : "bottom",
size: "height",
direction: isSlidingFromBottom ? 1 : -1,
children: /* @__PURE__ */ jsx(
SliderImpl,
{
"data-orientation": "vertical",
...sliderProps,
ref,
style: {
...sliderProps.style,
"--radix-slider-thumb-transform": "translateY(50%)"
},
onSlideStart: (event) => {
const value = getValueFromPointer(event.clientY);
onSlideStart?.(value);
},
onSlideMove: (event) => {
const value = getValueFromPointer(event.clientY);
onSlideMove?.(value);
},
onSlideEnd: () => {
rectRef.current = void 0;
onSlideEnd?.();
},
onStepKeyDown: (event) => {
const slideDirection = isSlidingFromBottom ? "from-bottom" : "from-top";
const isBackKey = BACK_KEYS[slideDirection].includes(event.key);
onStepKeyDown?.({ event, direction: isBackKey ? -1 : 1 });
}
}
)
}
);
}
);
var SliderImpl = React.forwardRef(
(props, forwardedRef) => {
const {
__scopeSlider,
onSlideStart,
onSlideMove,
onSlideEnd,
onHomeKeyDown,
onEndKeyDown,
onStepKeyDown,
...sliderProps
} = props;
const context = useSliderContext(SLIDER_NAME, __scopeSlider);
return /* @__PURE__ */ jsx(
Primitive.span,
{
...sliderProps,
ref: forwardedRef,
onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {
if (event.key === "Home") {
onHomeKeyDown(event);
event.preventDefault();
} else if (event.key === "End") {
onEndKeyDown(event);
event.preventDefault();
} else if (PAGE_KEYS.concat(ARROW_KEYS).includes(event.key)) {
onStepKeyDown(event);
event.preventDefault();
}
}),
onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
const target = event.target;
target.setPointerCapture(event.pointerId);
event.preventDefault();
if (context.thumbs.has(target)) {
target.focus({ preventScroll: true, focusVisible: false });
} else {
onSlideStart(event);
}
}),
onPointerMove: composeEventHandlers(props.onPointerMove, (event) => {
const target = event.target;
if (target.hasPointerCapture(event.pointerId)) onSlideMove(event);
}),
onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
const target = event.target;
if (target.hasPointerCapture(event.pointerId)) {
target.releasePointerCapture(event.pointerId);
onSlideEnd(event);
}
})
}
);
}
);
var TRACK_NAME = "SliderTrack";
var SliderTrack = React.forwardRef(
(props, forwardedRef) => {
const { __scopeSlider, ...trackProps } = props;
const context = useSliderContext(TRACK_NAME, __scopeSlider);
return /* @__PURE__ */ jsx(
Primitive.span,
{
"data-disabled": context.disabled ? "" : void 0,
"data-orientation": context.orientation,
...trackProps,
ref: forwardedRef
}
);
}
);
SliderTrack.displayName = TRACK_NAME;
var RANGE_NAME = "SliderRange";
var SliderRange = React.forwardRef(
(props, forwardedRef) => {
const { __scopeSlider, ...rangeProps } = props;
const context = useSliderContext(RANGE_NAME, __scopeSlider);
const orientation = useSliderOrientationContext(RANGE_NAME, __scopeSlider);
const ref = React.useRef(null);
const composedRefs = useComposedRefs(forwardedRef, ref);
const valuesCount = context.values.length;
const percentages = context.values.map(
(value) => convertValueToPercentage(value, context.min, context.max)
);
const offsetStart = valuesCount > 1 ? Math.min(...percentages) : 0;
const offsetEnd = 100 - Math.max(...percentages);
return /* @__PURE__ */ jsx(
Primitive.span,
{
"data-orientation": context.orientation,
"data-disabled": context.disabled ? "" : void 0,
...rangeProps,
ref: composedRefs,
style: {
...props.style,
[orientation.startEdge]: offsetStart + "%",
[orientation.endEdge]: offsetEnd + "%"
}
}
);
}
);
SliderRange.displayName = RANGE_NAME;
var THUMB_NAME = "SliderThumb";
var [SliderThumbContextProvider, useSliderThumbContext] = createSliderContext(THUMB_NAME);
var THUMB_PROVIDER_NAME = "SliderThumbProvider";
function SliderThumbProvider(props) {
const {
__scopeSlider,
name,
children,
// @ts-expect-error internal render prop
internal_do_not_use_render
} = props;
const context = useSliderContext(THUMB_PROVIDER_NAME, __scopeSlider);
const getItems = useCollection(__scopeSlider);
const [thumb, setThumb] = React.useState(null);
const index = React.useMemo(
() => thumb ? getItems().findIndex((item) => item.ref.current === thumb) : -1,
[getItems, thumb]
);
const size = useSize(thumb);
const isFormControl = thumb ? !!context.form || !!thumb.closest("form") : true;
const value = context.values[index];
const resolvedName = name ?? (context.name ? context.name + (context.values.length > 1 ? "[]" : "") : void 0);
const percent = value === void 0 ? 0 : convertValueToPercentage(value, context.min, context.max);
React.useEffect(() => {
if (thumb) {
context.thumbs.add(thumb);
return () => {
context.thumbs.delete(thumb);
};
}
}, [thumb, context.thumbs]);
const thumbContext = {
value,
name: resolvedName,
form: context.form,
isFormControl,
index,
thumb,
onThumbChange: setThumb,
percent,
size
};
return /* @__PURE__ */ jsx(SliderThumbContextProvider, { scope: __scopeSlider, ...thumbContext, children: isFunction(internal_do_not_use_render) ? internal_do_not_use_render(thumbContext) : children });
}
SliderThumbProvider.displayName = THUMB_PROVIDER_NAME;
var THUMB_TRIGGER_NAME = "SliderThumbTrigger";
var SliderThumbTrigger = React.forwardRef(
(props, forwardedRef) => {
const { __scopeSlider, ...thumbProps } = props;
const context = useSliderContext(THUMB_TRIGGER_NAME, __scopeSlider);
const orientation = useSliderOrientationContext(THUMB_TRIGGER_NAME, __scopeSlider);
const { index, value, percent, size, onThumbChange } = useSliderThumbContext(
THUMB_TRIGGER_NAME,
__scopeSlider
);
const composedRefs = useComposedRefs(forwardedRef, onThumbChange);
const label = getLabel(index, context.values.length);
const orientationSize = size?.[orientation.size];
const thumbInBoundsOffset = orientationSize ? getThumbInBoundsOffset(orientationSize, percent, orientation.direction) : 0;
return /* @__PURE__ */ jsx(
"span",
{
style: {
transform: "var(--radix-slider-thumb-transform)",
position: "absolute",
[orientation.startEdge]: `calc(${percent}% + ${thumbInBoundsOffset}px)`
},
children: /* @__PURE__ */ jsx(Collection.ItemSlot, { scope: __scopeSlider, children: /* @__PURE__ */ jsx(
Primitive.span,
{
role: "slider",
"aria-label": props["aria-label"] || label,
"aria-valuemin": context.min,
"aria-valuenow": value,
"aria-valuemax": context.max,
"aria-orientation": context.orientation,
"data-orientation": context.orientation,
"data-disabled": context.disabled ? "" : void 0,
tabIndex: context.disabled ? void 0 : 0,
...thumbProps,
ref: composedRefs,
style: value === void 0 ? { display: "none" } : props.style,
onFocus: composeEventHandlers(props.onFocus, () => {
context.valueIndexToChangeRef.current = index;
})
}
) })
}
);
}
);
SliderThumbTrigger.displayName = THUMB_TRIGGER_NAME;
var SliderThumb = React.forwardRef(
(props, forwardedRef) => {
const { __scopeSlider, name, ...thumbProps } = props;
return /* @__PURE__ */ jsx(
SliderThumbProvider,
{
__scopeSlider,
name,
internal_do_not_use_render: ({ index, isFormControl }) => /* @__PURE__ */ jsxs(Fragment, { children: [
/* @__PURE__ */ jsx(
SliderThumbTrigger,
{
...thumbProps,
ref: forwardedRef,
__scopeSlider
}
),
isFormControl ? /* @__PURE__ */ jsx(
SliderBubbleInput,
{
__scopeSlider
},
index
) : null
] })
}
);
}
);
SliderThumb.displayName = THUMB_NAME;
var BUBBLE_INPUT_NAME = "SliderBubbleInput";
var SliderBubbleInput = React.forwardRef(
({ __scopeSlider, ...props }, forwardedRef) => {
const { value, name, form } = useSliderThumbContext(BUBBLE_INPUT_NAME, __scopeSlider);
const ref = React.useRef(null);
const composedRefs = useComposedRefs(ref, forwardedRef);
const prevValue = usePrevious(value);
React.useEffect(() => {
const input = ref.current;
if (!input) return;
const inputProto = window.HTMLInputElement.prototype;
const descriptor = Object.getOwnPropertyDescriptor(inputProto, "value");
const setValue = descriptor.set;
if (prevValue !== value && setValue) {
const event = new Event("input", { bubbles: true });
setValue.call(input, value);
input.dispatchEvent(event);
}
}, [prevValue, value]);
return /* @__PURE__ */ jsx(
Primitive.input,
{
style: { display: "none" },
name,
form,
...props,
ref: composedRefs,
defaultValue: value
}
);
}
);
SliderBubbleInput.displayName = BUBBLE_INPUT_NAME;
function getNextSortedValues(prevValues = [], nextValue, atIndex) {
const nextValues = [...prevValues];
nextValues[atIndex] = nextValue;
return nextValues.sort((a, b) => a - b);
}
function convertValueToPercentage(value, min, max) {
const maxSteps = max - min;
const percentPerStep = 100 / maxSteps;
const percentage = percentPerStep * (value - min);
return clamp(percentage, [0, 100]);
}
function getLabel(index, totalValues) {
if (totalValues > 2) {
return `Value ${index + 1} of ${totalValues}`;
} else if (totalValues === 2) {
return ["Minimum", "Maximum"][index];
} else {
return void 0;
}
}
function getClosestValueIndex(values, nextValue) {
if (values.length === 1) return 0;
const distances = values.map((value) => Math.abs(value - nextValue));
const closestDistance = Math.min(...distances);
return distances.indexOf(closestDistance);
}
function getThumbInBoundsOffset(width, left, direction) {
const halfWidth = width / 2;
const halfPercent = 50;
const offset = linearScale([0, halfPercent], [0, halfWidth]);
return (halfWidth - offset(left) * direction) * direction;
}
function getStepsBetweenValues(values) {
return values.slice(0, -1).map((value, index) => values[index + 1] - value);
}
function hasMinStepsBetweenValues(values, minStepsBetweenValues) {
if (minStepsBetweenValues > 0) {
const stepsBetweenValues = getStepsBetweenValues(values);
const actualMinStepsBetweenValues = Math.min(...stepsBetweenValues);
return actualMinStepsBetweenValues >= minStepsBetweenValues;
}
return true;
}
function linearScale(input, output) {
return (value) => {
if (input[0] === input[1] || output[0] === output[1]) return output[0];
const ratio = (output[1] - output[0]) / (input[1] - input[0]);
return output[0] + ratio * (value - input[0]);
};
}
function getDecimalCount(value) {
if (!Number.isFinite(value)) return 0;
const str = value.toString();
if (str.includes("e")) {
const [coefficient, exponent] = str.split("e");
const decimalPart2 = coefficient.split(".")[1] || "";
const exponentNum = Number(exponent);
return Math.max(0, decimalPart2.length - exponentNum);
}
const decimalPart = str.split(".")[1];
return decimalPart ? decimalPart.length : 0;
}
function roundValue(value, decimalCount) {
const rounder = Math.pow(10, decimalCount);
return Math.round(value * rounder) / rounder;
}
function getNextStepValue(value, {
min,
step,
direction,
multiplier
}) {
const decimalCount = getDecimalCount(step);
const stepsFromMin = (value - min) / step;
const nearestSteps = Math.round(stepsFromMin);
const isAligned = roundValue(nearestSteps * step + min, decimalCount) === roundValue(value, decimalCount);
let nextSteps;
if (isAligned) {
nextSteps = nearestSteps + multiplier * direction;
} else if (direction > 0) {
nextSteps = Math.ceil(stepsFromMin);
} else {
nextSteps = Math.floor(stepsFromMin);
}
return roundValue(nextSteps * step + min, decimalCount);
}
function isFunction(value) {
return typeof value === "function";
}
export {
SliderRange as Range,
Slider as Root,
Slider,
SliderRange,
SliderThumb,
SliderTrack,
SliderThumb as Thumb,
SliderTrack as Track,
createSliderScope,
SliderBubbleInput as unstable_BubbleInput,
SliderBubbleInput as unstable_SliderBubbleInput,
SliderThumbProvider as unstable_SliderThumbProvider,
SliderThumbTrigger as unstable_SliderThumbTrigger,
SliderThumbProvider as unstable_ThumbProvider,
SliderThumbTrigger as unstable_ThumbTrigger
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,112 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import { z } from "zod/v3";
import { util } from "../helpers/util.js";
test("basic defaults", () => {
expect(z.string().default("default").parse(undefined)).toBe("default");
});
test("default with transform", () => {
const stringWithDefault = z
.string()
.transform((val) => val.toUpperCase())
.default("default");
expect(stringWithDefault.parse(undefined)).toBe("DEFAULT");
expect(stringWithDefault).toBeInstanceOf(z.ZodDefault);
expect(stringWithDefault._def.innerType).toBeInstanceOf(z.ZodEffects);
expect(stringWithDefault._def.innerType._def.schema).toBeInstanceOf(z.ZodSchema);
type inp = z.input<typeof stringWithDefault>;
util.assertEqual<inp, string | undefined>(true);
type out = z.output<typeof stringWithDefault>;
util.assertEqual<out, string>(true);
});
test("default on existing optional", () => {
const stringWithDefault = z.string().optional().default("asdf");
expect(stringWithDefault.parse(undefined)).toBe("asdf");
expect(stringWithDefault).toBeInstanceOf(z.ZodDefault);
expect(stringWithDefault._def.innerType).toBeInstanceOf(z.ZodOptional);
expect(stringWithDefault._def.innerType._def.innerType).toBeInstanceOf(z.ZodString);
type inp = z.input<typeof stringWithDefault>;
util.assertEqual<inp, string | undefined>(true);
type out = z.output<typeof stringWithDefault>;
util.assertEqual<out, string>(true);
});
test("optional on default", () => {
const stringWithDefault = z.string().default("asdf").optional();
type inp = z.input<typeof stringWithDefault>;
util.assertEqual<inp, string | undefined>(true);
type out = z.output<typeof stringWithDefault>;
util.assertEqual<out, string | undefined>(true);
});
test("complex chain example", () => {
const complex = z
.string()
.default("asdf")
.transform((val) => val.toUpperCase())
.default("qwer")
.removeDefault()
.optional()
.default("asdfasdf");
expect(complex.parse(undefined)).toBe("ASDFASDF");
});
test("removeDefault", () => {
const stringWithRemovedDefault = z.string().default("asdf").removeDefault();
type out = z.output<typeof stringWithRemovedDefault>;
util.assertEqual<out, string>(true);
});
test("nested", () => {
const inner = z.string().default("asdf");
const outer = z.object({ inner }).default({
inner: undefined,
});
type input = z.input<typeof outer>;
util.assertEqual<input, { inner?: string | undefined } | undefined>(true);
type out = z.output<typeof outer>;
util.assertEqual<out, { inner: string }>(true);
expect(outer.parse(undefined)).toEqual({ inner: "asdf" });
expect(outer.parse({})).toEqual({ inner: "asdf" });
expect(outer.parse({ inner: undefined })).toEqual({ inner: "asdf" });
});
test("chained defaults", () => {
const stringWithDefault = z.string().default("inner").default("outer");
const result = stringWithDefault.parse(undefined);
expect(result).toEqual("outer");
});
test("factory", () => {
expect(z.ZodDefault.create(z.string(), { default: "asdf" }).parse(undefined)).toEqual("asdf");
});
test("native enum", () => {
enum Fruits {
apple = "apple",
orange = "orange",
}
const schema = z.object({
fruit: z.nativeEnum(Fruits).default(Fruits.apple),
});
expect(schema.parse({})).toEqual({ fruit: Fruits.apple });
});
test("enum", () => {
const schema = z.object({
fruit: z.enum(["apple", "orange"]).default("apple"),
});
expect(schema.parse({})).toEqual({ fruit: "apple" });
});
@@ -0,0 +1 @@
{"version":3,"file":"patternProperties.js","sourceRoot":"","sources":["../../../lib/vocabularies/applicator/patternProperties.ts"],"names":[],"mappings":";;AAEA,kCAAuD;AACvD,mDAAkD;AAClD,6CAAqE;AACrE,6CAA6D;AAG7D,MAAM,GAAG,GAA0B;IACjC,OAAO,EAAE,mBAAmB;IAC5B,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE,QAAQ;IACpB,IAAI,CAAC,GAAe;QAClB,MAAM,EAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,EAAC,GAAG,GAAG,CAAA;QACjD,MAAM,EAAC,IAAI,EAAC,GAAG,EAAE,CAAA;QACjB,MAAM,QAAQ,GAAG,IAAA,0BAAmB,EAAC,MAAM,CAAC,CAAA;QAC5C,MAAM,mBAAmB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAChD,IAAA,wBAAiB,EAAC,EAAE,EAAE,MAAM,CAAC,CAAC,CAAc,CAAC,CAC9C,CAAA;QAED,IACE,QAAQ,CAAC,MAAM,KAAK,CAAC;YACrB,CAAC,mBAAmB,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;gBAC7C,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,EAC9C,CAAC;YACD,OAAM;QACR,CAAC;QAED,MAAM,eAAe,GACnB,IAAI,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,uBAAuB,IAAI,YAAY,CAAC,UAAU,CAAA;QAC/E,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;QAC/B,IAAI,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,KAAK,YAAY,cAAI,CAAC,EAAE,CAAC;YACrD,EAAE,CAAC,KAAK,GAAG,IAAA,2BAAoB,EAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;QAChD,CAAC;QACD,MAAM,EAAC,KAAK,EAAC,GAAG,EAAE,CAAA;QAClB,yBAAyB,EAAE,CAAA;QAE3B,SAAS,yBAAyB;YAChC,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;gBAC3B,IAAI,eAAe;oBAAE,uBAAuB,CAAC,GAAG,CAAC,CAAA;gBACjD,IAAI,EAAE,CAAC,SAAS,EAAE,CAAC;oBACjB,kBAAkB,CAAC,GAAG,CAAC,CAAA;gBACzB,CAAC;qBAAM,CAAC;oBACN,GAAG,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA,CAAC,WAAW;oBAChC,kBAAkB,CAAC,GAAG,CAAC,CAAA;oBACvB,GAAG,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;gBACf,CAAC;YACH,CAAC;QACH,CAAC;QAED,SAAS,uBAAuB,CAAC,GAAW;YAC1C,KAAK,MAAM,IAAI,IAAI,eAAe,EAAE,CAAC;gBACnC,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;oBAC/B,IAAA,sBAAe,EACb,EAAE,EACF,YAAY,IAAI,oBAAoB,GAAG,gCAAgC,CACxE,CAAA;gBACH,CAAC;YACH,CAAC;QACH,CAAC;QAED,SAAS,kBAAkB,CAAC,GAAW;YACrC,GAAG,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;gBAC7B,GAAG,CAAC,EAAE,CAAC,IAAA,WAAC,EAAA,GAAG,IAAA,iBAAU,EAAC,GAAG,EAAE,GAAG,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,EAAE;oBACnD,MAAM,WAAW,GAAG,mBAAmB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;oBACrD,IAAI,CAAC,WAAW,EAAE,CAAC;wBACjB,GAAG,CAAC,SAAS,CACX;4BACE,OAAO,EAAE,mBAAmB;4BAC5B,UAAU,EAAE,GAAG;4BACf,QAAQ,EAAE,GAAG;4BACb,YAAY,EAAE,WAAI,CAAC,GAAG;yBACvB,EACD,KAAK,CACN,CAAA;oBACH,CAAC;oBAED,IAAI,EAAE,CAAC,IAAI,CAAC,WAAW,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;wBAC1C,GAAG,CAAC,MAAM,CAAC,IAAA,WAAC,EAAA,GAAG,KAAK,IAAI,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;oBACvC,CAAC;yBAAM,IAAI,CAAC,WAAW,IAAI,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC;wBACzC,sFAAsF;wBACtF,uDAAuD;wBACvD,GAAG,CAAC,EAAE,CAAC,IAAA,aAAG,EAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;oBACvC,CAAC;gBACH,CAAC,CAAC,CAAA;YACJ,CAAC,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAED,kBAAe,GAAG,CAAA"}
@@ -0,0 +1,11 @@
var l33tTableToTrieNode = (l33tTable, triNode) => {
Object.entries(l33tTable).forEach(([letter, substitutions]) => {
substitutions.forEach(substitution => {
triNode.addSub(substitution, letter);
});
});
return triNode;
};
export { l33tTableToTrieNode as default };
//# sourceMappingURL=l33tTableToTrieNode.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"animation-state.mjs","sources":["../../../../src/render/utils/animation-state.ts"],"sourcesContent":["import type {\n AnimationDefinition,\n TargetAndTransition,\n VariantLabels,\n} from \"../../node/types\"\nimport type { AnimationType } from \"../types\"\nimport type { VisualElementAnimationOptions } from \"../../animation/interfaces/types\"\nimport { animateVisualElement } from \"../../animation/interfaces/visual-element\"\nimport { calcChildStagger } from \"../../animation/utils/calc-child-stagger\"\nimport { getVariantContext } from \"./get-variant-context\"\nimport { isAnimationControls } from \"./is-animation-controls\"\nimport { isKeyframesTarget } from \"./is-keyframes-target\"\nimport { isVariantLabel } from \"./is-variant-label\"\nimport { resolveVariant } from \"./resolve-dynamic-variants\"\nimport { shallowCompare } from \"./shallow-compare\"\nimport { variantPriorityOrder } from \"./variant-props\"\n\nexport type { VisualElementAnimationOptions }\n\nexport interface AnimationState {\n animateChanges: (type?: AnimationType) => Promise<any>\n setActive: (\n type: AnimationType,\n isActive: boolean,\n options?: VisualElementAnimationOptions\n ) => Promise<any>\n setAnimateFunction: (fn: any) => void\n getState: () => { [key: string]: AnimationTypeState }\n reset: () => void\n}\n\ninterface DefinitionAndOptions {\n animation: AnimationDefinition\n options?: VisualElementAnimationOptions\n}\n\nexport type AnimationList = string[] | TargetAndTransition[]\n\nconst reversePriorityOrder = [...variantPriorityOrder].reverse()\nconst numAnimationTypes = variantPriorityOrder.length\n\n/**\n * Type for the animate function that can be injected.\n * This allows the animation implementation to be provided by the framework layer.\n */\nexport type AnimateFunction = (animations: DefinitionAndOptions[]) => Promise<any>\n\nfunction createAnimateFunction(visualElement: any): AnimateFunction {\n return (animations: DefinitionAndOptions[]) => {\n return Promise.all(\n animations.map(({ animation, options }) =>\n animateVisualElement(visualElement, animation, options)\n )\n )\n }\n}\n\nexport function createAnimationState(visualElement: any): AnimationState {\n let animate = createAnimateFunction(visualElement)\n let state = createState()\n let isInitialRender = true\n /**\n * Track whether the animation state has been reset (e.g. via StrictMode\n * double-invocation or Suspense unmount/remount). On the first\n * animateChanges() call after a reset we need to behave like the initial\n * render for variant-inheritance checks, even though isInitialRender is\n * already false.\n */\n let wasReset = false\n\n /**\n * This function will be used to reduce the animation definitions for\n * each active animation type into an object of resolved values for it.\n */\n const buildResolvedTypeValues =\n (type: AnimationType) =>\n (\n acc: { [key: string]: any },\n definition: string | TargetAndTransition | undefined\n ) => {\n const resolved = resolveVariant(\n visualElement,\n definition,\n type === \"exit\"\n ? visualElement.presenceContext?.custom\n : undefined\n )\n\n if (resolved) {\n const { transition, transitionEnd, ...target } = resolved\n acc = { ...acc, ...target, ...transitionEnd }\n }\n\n return acc\n }\n\n /**\n * This just allows us to inject mocked animation functions\n * @internal\n */\n function setAnimateFunction(\n makeAnimator: (visualElement: any) => AnimateFunction\n ) {\n animate = makeAnimator(visualElement)\n }\n\n /**\n * When we receive new props, we need to:\n * 1. Create a list of protected keys for each type. This is a directory of\n * value keys that are currently being \"handled\" by types of a higher priority\n * so that whenever an animation is played of a given type, these values are\n * protected from being animated.\n * 2. Determine if an animation type needs animating.\n * 3. Determine if any values have been removed from a type and figure out\n * what to animate those to.\n */\n function animateChanges(changedActiveType?: AnimationType) {\n const { props } = visualElement\n const context = getVariantContext(visualElement.parent) || {}\n\n /**\n * A list of animations that we'll build into as we iterate through the animation\n * types. This will get executed at the end of the function.\n */\n const animations: DefinitionAndOptions[] = []\n\n /**\n * Keep track of which values have been removed. Then, as we hit lower priority\n Line truncated
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './diamond-percent.js';
//# sourceMappingURL=percent-diamond.js.map
@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './square-mouse-pointer.js';
//# sourceMappingURL=inspect.js.map
@@ -0,0 +1 @@
module.exports={C:{"78":0.00386,"115":0.02318,"120":0.66847,"121":1.34854,"123":0.00773,"124":0.01159,"125":0.00386,"130":0.00386,"136":0.00386,"140":0.0425,"142":0.00386,"143":0.00386,"147":0.00773,"148":0.00386,"149":0.00386,"150":0.01159,"152":0.08887,"153":0.01932,"154":0.06955,"155":0.17002,"156":0.1932,"157":0.00773,_:"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 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 122 126 127 128 129 131 132 133 134 135 137 138 139 141 144 145 146 151 158 159 160 3.5 3.6"},D:{"49":0.00386,"65":0.00386,"66":0.00386,"68":0.00386,"69":0.00386,"70":0.00386,"76":0.00386,"79":0.00386,"81":0.01159,"83":0.00386,"87":0.00386,"91":0.00386,"93":0.00773,"98":0.01546,"101":0.00773,"103":0.20479,"104":0.17002,"105":0.17002,"106":0.17002,"107":0.17002,"108":0.17002,"109":0.30526,"110":0.17002,"111":0.17774,"112":0.16615,"114":0.00773,"116":0.36708,"117":0.17002,"118":0.89258,"119":1.36013,"120":1.54946,"121":0.00773,"122":0.02318,"123":0.01159,"124":0.18161,"125":0.00773,"126":0.01546,"127":0.00773,"128":0.03091,"129":0.01159,"130":0.00773,"131":0.35162,"132":0.01159,"133":0.44822,"134":0.10819,"135":0.85008,"136":0.12365,"137":0.11978,"138":0.24343,"139":0.1391,"140":0.1391,"141":0.13524,"142":0.38254,"143":0.03478,"144":0.2898,"145":0.1507,"146":0.34776,"147":0.06182,"148":0.1391,"149":0.31298,"150":0.34003,"151":1.71948,"152":5.77668,"153":5.66849,"154":1.2017,"155":0.01932,"156":0.00386,_:"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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 67 71 72 73 74 75 77 78 80 84 85 86 88 89 90 92 94 95 96 97 99 100 102 113 115 157"},F:{"53":0.00386,"54":0.00386,"55":0.00386,"56":0.00386,"95":0.00386,"100":0.00386,"101":0.01932,"102":0.01159,"105":0.00386,"106":0.01159,"107":0.00773,"114":0.00386,"115":0.00386,"120":0.00386,"121":0.00386,"122":0.00386,"132":0.00773,"133":0.00386,"134":0.0541,"135":0.36322,_:"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 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 96 97 98 99 103 104 108 109 110 111 112 113 116 117 118 119 123 124 125 126 127 131 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"92":0.00773,"109":0.00386,"114":0.00386,"119":0.68006,"120":0.69166,"122":0.01159,"124":0.00386,"131":0.00386,"132":0.00386,"133":0.00386,"135":0.00386,"138":0.00386,"139":0.00386,"140":0.00773,"141":0.00386,"142":0.00386,"143":0.00386,"144":0.00773,"145":0.00773,"146":0.00386,"147":0.01159,"148":0.01546,"149":0.01546,"150":0.03478,"151":0.1391,"152":1.10124,"153":1.51855,"154":0.3864,_:"12 13 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 121 123 125 126 127 128 129 130 134 136 137"},E:{"27":0.15842,_:"4 5 6 7 8 9 10 11 12 13 14 15 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 15.5 16.0 27.1 TP","13.1":0.00386,"14.1":0.00386,"15.6":0.03478,"16.1":0.00386,"16.2":0.00386,"16.3":0.00773,"16.4":0.00386,"16.5":0.00386,"16.6":0.03478,"17.0":0.00386,"17.1":0.0541,"17.2":0.00386,"17.3":0.00386,"17.4":0.00773,"17.5":0.01546,"17.6":0.06182,"18.0":0.01159,"18.1":0.02318,"18.2":0.00386,"18.3":0.01546,"18.4":0.00386,"18.5-18.7":0.02318,"26.0":0.02318,"26.1":0.01932,"26.2":0.0425,"26.3":0.05023,"26.4":0.0425,"26.5":0.23957,"26.6":1.15147,"27.2":0.00386},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00135,"5.0-5.1":0.00135,"6.0-6.1":0,"7.0-7.1":0.00269,"8.1-8.4":0,"9.0-9.2":0,"9.3":0,"10.0-10.2":0,"10.3":0.01346,"11.0-11.2":0.00135,"11.3-11.4":0.00269,"12.0-12.1":0,"12.2-12.5":0.03499,"13.0-13.1":0,"13.2":0.00673,"13.3":0,"13.4-13.7":0.00135,"14.0-14.4":0.00538,"14.5-14.8":0.00807,"15.0-15.1":0.00807,"15.2-15.3":0.00538,"15.4":0.00673,"15.5":0.00807,"15.6-15.8":0.17493,"16.0":0.01346,"16.1":0.02422,"16.2":0.01346,"16.3":0.0296,"16.4":0.00673,"16.5":0.01076,"16.6-16.7":0.24356,"17.0":0.00942,"17.1":0.01346,"17.2":0.01346,"17.3":0.02018,"17.4":0.02826,"17.5":0.05517,"17.6-17.7":0.14264,"18.0":0.0296,"18.1":0.05921,"18.2":0.08074,"18.3":0.13994,"18.4":0.08747,"18.5-18.7":1.80717,"26.0":0.08747,"26.1":0.08881,"26.2":0.23145,"26.3":0.25029,"26.4":0.183,"26.5":1.22586,"26.6":7.56376,"27.0":0.57996,"27.1":0,"27.2":0.0148},P:{"22":0.00924,"23":0.00924,"24":0.00924,"25":0.00924,"26":0.01847,"27":0.00924,"28":0.04618,"29":0.07389,"30":1.53328,_:"4 20 21 5.0-5.4 6.2-6.4 8.2 9.2 10.1 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.00924,"11.1-11.2":0.00924},I:{"0":0.03066,"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.00001},K:{"0":1.0Line truncated
@@ -0,0 +1 @@
{"version":3,"file":"earth-lock.js","sources":["../../../src/icons/earth-lock.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name EarthLock\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNyAzLjM0VjVhMyAzIDAgMCAwIDMgMyIgLz4KICA8cGF0aCBkPSJNMTEgMjEuOTVWMThhMiAyIDAgMCAwLTItMiAyIDIgMCAwIDEtMi0ydi0xYTIgMiAwIDAgMC0yLTJIMi4wNSIgLz4KICA8cGF0aCBkPSJNMjEuNTQgMTVIMTdhMiAyIDAgMCAwLTIgMnY0LjU0IiAvPgogIDxwYXRoIGQ9Ik0xMiAyYTEwIDEwIDAgMSAwIDkuNTQgMTMiIC8+CiAgPHBhdGggZD0iTTIwIDZWNGEyIDIgMCAxIDAtNCAwdjIiIC8+CiAgPHJlY3Qgd2lkdGg9IjgiIGhlaWdodD0iNSIgeD0iMTQiIHk9IjYiIHJ4PSIxIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/earth-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 EarthLock = createLucideIcon('EarthLock', [\n ['path', { d: 'M7 3.34V5a3 3 0 0 0 3 3', key: 'w732o8' }],\n ['path', { d: 'M11 21.95V18a2 2 0 0 0-2-2 2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05', key: 'f02343' }],\n ['path', { d: 'M21.54 15H17a2 2 0 0 0-2 2v4.54', key: '1djwo0' }],\n ['path', { d: 'M12 2a10 10 0 1 0 9.54 13', key: 'zjsr6q' }],\n ['path', { d: 'M20 6V4a2 2 0 1 0-4 0v2', key: '1of5e8' }],\n ['rect', { width: '8', height: '5', x: '14', y: '6', rx: '1', key: '1fmf51' }],\n]);\n\nexport default EarthLock;\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,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAChE,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,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,KAAK,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/E,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"receipt.js","sources":["../../../src/icons/receipt.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Receipt\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAydjIwbDItMSAyIDEgMi0xIDIgMSAyLTEgMiAxIDItMSAyIDFWMmwtMiAxLTItMS0yIDEtMi0xLTIgMS0yLTEtMiAxWiIgLz4KICA8cGF0aCBkPSJNMTYgOGgtNmEyIDIgMCAxIDAgMCA0aDRhMiAyIDAgMSAxIDAgNEg4IiAvPgogIDxwYXRoIGQ9Ik0xMiAxNy41di0xMSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/receipt\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 Receipt = createLucideIcon('Receipt', [\n [\n 'path',\n { d: 'M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z', key: 'q3az6g' },\n ],\n ['path', { d: 'M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8', key: '1h4pet' }],\n ['path', { d: 'M12 17.5v-11', key: '1jc1ny' }],\n]);\n\nexport default Receipt;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAU,iBAAiB,SAAW,CAAA,CAAA,CAAA;AAAA,CAC1C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA2E,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAChG,CAAA,CAAA,CAAA;AAAA,CAAA,CACA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC/C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,99 @@
'use strict'
const { InvalidArgumentError, RequestAbortedError } = require('../core/errors')
const DecoratorHandler = require('../handler/decorator-handler')
class DumpHandler extends DecoratorHandler {
#maxSize = 1024 * 1024
#dumped = false
#size = 0
aborted = false
reason = false
constructor ({ maxSize, signal }, handler) {
if (maxSize != null && (!Number.isFinite(maxSize) || maxSize < 1)) {
throw new InvalidArgumentError('maxSize must be a number greater than 0')
}
super(handler)
this.#maxSize = maxSize ?? this.#maxSize
// this.#handler = handler
}
#abort (reason) {
this.aborted = true
this.reason = reason
}
onRequestStart (controller, context) {
controller.abort = this.#abort.bind(this)
return super.onRequestStart(controller, context)
}
onResponseStart (controller, statusCode, headers, statusMessage) {
const contentLength = headers['content-length']
if (contentLength != null && contentLength > this.#maxSize) {
throw new RequestAbortedError(
`Response size (${contentLength}) larger than maxSize (${
this.#maxSize
})`
)
}
if (this.aborted === true) {
return true
}
return super.onResponseStart(controller, statusCode, headers, statusMessage)
}
onResponseError (controller, err) {
super.onResponseError(controller, this.aborted === true ? this.reason : err)
}
onResponseData (controller, chunk) {
this.#size = this.#size + chunk.length
if (this.#size > this.#maxSize) {
throw new RequestAbortedError(
`Response size (${this.#size}) larger than maxSize (${this.#maxSize})`
)
}
if (this.#size === this.#maxSize) {
this.#dumped = true
}
return true
}
onResponseEnd (controller, trailers) {
if (this.aborted === true) {
super.onResponseError(controller, this.reason)
return
}
super.onResponseEnd(controller, this.#dumped ? {} : trailers)
}
}
function createDumpInterceptor (
{ maxSize: defaultMaxSize } = {
maxSize: 1024 * 1024
}
) {
return dispatch => {
return function Intercept (opts, handler) {
const { dumpMaxSize = defaultMaxSize } = opts
const dumpHandler = new DumpHandler({ maxSize: dumpMaxSize, signal: opts.signal }, handler)
return dispatch(opts, dumpHandler)
}
}
}
module.exports = createDumpInterceptor
@@ -0,0 +1,124 @@
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
import { raw } from "../../utils/html.js";
import { PERMALINK } from "../constants.js";
import { useContext } from "../context.js";
import { dataPrecedenceAttr, deDupeKeyMap, isStylesheetLinkWithPrecedence, shouldDeDupeByKey } from "./common.js";
import { toArray } from "../children.js";
import { JSXNode, getNameSpaceContext, renderChildren } from "../base.js";
//#region src/jsx/intrinsic-element/components.ts
var components_exports = /* @__PURE__ */ __exportAll({
button: () => button,
form: () => form,
input: () => input,
link: () => link,
meta: () => meta,
script: () => script,
style: () => style,
title: () => title
});
const metaTagMap = /* @__PURE__ */ new WeakMap();
const insertIntoHead = (tagName, tag, props, precedence) => ({ buffer, context }) => {
if (!buffer) return;
const map = metaTagMap.get(context) || {};
metaTagMap.set(context, map);
const tags = map[tagName] ||= [];
let duped = false;
const deDupeKeys = deDupeKeyMap[tagName];
const deDupeByKey = shouldDeDupeByKey(tagName, precedence !== void 0);
if (deDupeByKey) LOOP: for (const [, tagProps] of tags) {
if (tagName === "link" && !(tagProps.rel === "stylesheet" && tagProps["data-precedence"] !== void 0)) continue;
for (const key of deDupeKeys) if ((tagProps?.[key] ?? null) === props?.[key]) {
duped = true;
break LOOP;
}
}
if (duped) buffer[0] = buffer[0].replaceAll(tag, "");
else if (deDupeByKey || tagName === "link") tags.push([
tag,
props,
precedence
]);
else tags.unshift([
tag,
props,
precedence
]);
if (buffer[0].indexOf("</head>") !== -1) {
let insertTags;
if (tagName === "link" || precedence !== void 0) {
const precedences = [];
insertTags = tags.map(([tag, , tagPrecedence], index) => {
if (tagPrecedence === void 0) return [
tag,
Number.MAX_SAFE_INTEGER,
index
];
let order = precedences.indexOf(tagPrecedence);
if (order === -1) {
precedences.push(tagPrecedence);
order = precedences.length - 1;
}
return [
tag,
order,
index
];
}).sort((a, b) => a[1] - b[1] || a[2] - b[2]).map(([tag]) => tag);
} else insertTags = tags.map(([tag]) => tag);
insertTags.forEach((tag) => {
buffer[0] = buffer[0].replaceAll(tag, "");
});
buffer[0] = buffer[0].replace(/(?=<\/head>)/, () => insertTags.join(""));
}
};
const returnWithoutSpecialBehavior = (tag, children, props) => renderChildren([new JSXNode(tag, props, toArray(children ?? []))]);
const documentMetadataTag = (tag, children, props, sort) => {
if ("itemProp" in props) return returnWithoutSpecialBehavior(tag, children, props);
let { precedence, blocking, ...restProps } = props;
precedence = sort ? precedence ?? "" : void 0;
if (sort) restProps[dataPrecedenceAttr] = precedence;
const string = new JSXNode(tag, restProps, toArray(children || [])).toString();
if (string instanceof Promise) return string.then((resString) => raw(resString, [...resString.callbacks || [], insertIntoHead(tag, resString, restProps, precedence)]));
else return raw(string, [insertIntoHead(tag, string, restProps, precedence)]);
};
const title = ({ children, ...props }) => {
const nameSpaceContext = getNameSpaceContext();
if (nameSpaceContext) {
const context = useContext(nameSpaceContext);
if (context === "svg" || context === "head") return new JSXNode("title", props, toArray(children ?? []));
}
return documentMetadataTag("title", children, props, false);
};
const script = ({ children, ...props }) => {
const nameSpaceContext = getNameSpaceContext();
if (["src", "async"].some((k) => !props[k]) || nameSpaceContext && useContext(nameSpaceContext) === "head") return returnWithoutSpecialBehavior("script", children, props);
return documentMetadataTag("script", children, props, false);
};
const style = ({ children, ...props }) => {
if (!["href", "precedence"].every((k) => k in props)) return returnWithoutSpecialBehavior("style", children, props);
props["data-href"] = props.href;
delete props.href;
return documentMetadataTag("style", children, props, true);
};
const link = ({ children, ...props }) => {
if (["onLoad", "onError"].some((k) => k in props) || props.rel === "stylesheet" && (!("precedence" in props) || "disabled" in props)) return returnWithoutSpecialBehavior("link", children, props);
return documentMetadataTag("link", children, props, isStylesheetLinkWithPrecedence(props));
};
const meta = ({ children, ...props }) => {
const nameSpaceContext = getNameSpaceContext();
if (nameSpaceContext && useContext(nameSpaceContext) === "head") return returnWithoutSpecialBehavior("meta", children, props);
return documentMetadataTag("meta", children, props, false);
};
const newJSXNode = (tag, { children, ...props }) => new JSXNode(tag, props, toArray(children ?? []));
const form = (props) => {
if (typeof props.action === "function") props.action = PERMALINK in props.action ? props.action[PERMALINK] : void 0;
return newJSXNode("form", props);
};
const formActionableElement = (tag, props) => {
if (typeof props.formAction === "function") props.formAction = PERMALINK in props.formAction ? props.formAction[PERMALINK] : void 0;
return newJSXNode(tag, props);
};
const input = (props) => formActionableElement("input", props);
const button = (props) => formActionableElement("button", props);
//#endregion
export { button, components_exports, form, input, link, meta, script, style, title };
@@ -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 Command = createLucideIcon("Command", [
[
"path",
{ d: "M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3", key: "11bfej" }
]
]);
export { Command as default };
//# sourceMappingURL=command.js.map
@@ -0,0 +1 @@
{"version":3,"file":"phone-outgoing.js","sources":["../../../src/icons/phone-outgoing.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name PhoneOutgoing\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cG9seWxpbmUgcG9pbnRzPSIyMiA4IDIyIDIgMTYgMiIgLz4KICA8bGluZSB4MT0iMTYiIHgyPSIyMiIgeTE9IjgiIHkyPSIyIiAvPgogIDxwYXRoIGQ9Ik0yMiAxNi45MnYzYTIgMiAwIDAgMS0yLjE4IDIgMTkuNzkgMTkuNzkgMCAwIDEtOC42My0zLjA3IDE5LjUgMTkuNSAwIDAgMS02LTYgMTkuNzkgMTkuNzkgMCAwIDEtMy4wNy04LjY3QTIgMiAwIDAgMSA0LjExIDJoM2EyIDIgMCAwIDEgMiAxLjcyIDEyLjg0IDEyLjg0IDAgMCAwIC43IDIuODEgMiAyIDAgMCAxLS40NSAyLjExTDguMDkgOS45MWExNiAxNiAwIDAgMCA2IDZsMS4yNy0xLjI3YTIgMiAwIDAgMSAyLjExLS40NSAxMi44NCAxMi44NCAwIDAgMCAyLjgxLjdBMiAyIDAgMCAxIDIyIDE2LjkyeiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/phone-outgoing\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 PhoneOutgoing = createLucideIcon('PhoneOutgoing', [\n ['polyline', { points: '22 8 22 2 16 2', key: '1g204g' }],\n ['line', { x1: '16', x2: '22', y1: '8', y2: '2', key: '1ggias' }],\n [\n 'path',\n {\n d: 'M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z',\n key: 'foiqr5',\n },\n ],\n]);\n\nexport default PhoneOutgoing;\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,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,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,CACxD,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAChE,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"is-svg-component.mjs","sources":["../../../../../src/render/dom/utils/is-svg-component.ts"],"sourcesContent":["import * as React from \"react\"\nimport { lowercaseSVGElements } from \"../../svg/lowercase-elements\"\n\nexport function isSVGComponent(Component: string | React.ComponentType<any>) {\n if (\n /**\n * If it's not a string, it's a custom React component. Currently we only support\n * HTML custom React components.\n */\n typeof Component !== \"string\" ||\n /**\n * If it contains a dash, the element is a custom HTML webcomponent.\n */\n Component.includes(\"-\")\n ) {\n return false\n } else if (\n /**\n * If it's in our list of lowercase SVG tags, it's an SVG component\n */\n lowercaseSVGElements.indexOf(Component) > -1 ||\n /**\n * If it contains a capital letter, it's an SVG component\n */\n /[A-Z]/u.test(Component)\n ) {\n return true\n }\n\n return false\n}\n"],"names":[],"mappings":";;AAGM,SAAU,cAAc,CAAC,SAA4C,EAAA;AACvE,IAAA;AACI;;;AAGG;IACH,OAAO,SAAS,KAAK,QAAQ;AAC7B;;AAEG;AACH,QAAA,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EACzB;AACE,QAAA,OAAO,KAAK;IAChB;AAAO,SAAA;AACH;;AAEG;AACH,IAAA,oBAAoB,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,EAAE;AAC5C;;AAEG;AACH,QAAA,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAC1B;AACE,QAAA,OAAO,IAAI;IACf;AAEA,IAAA,OAAO,KAAK;AAChB;;;;"}
@@ -0,0 +1,43 @@
"use client";
import { jsx } from 'react/jsx-runtime';
import { isMotionValue } from 'motion-dom';
import { invariant } from 'motion-utils';
import { forwardRef, useContext } from 'react';
import { ReorderContext } from '../../context/ReorderContext.mjs';
import { motion } from '../../render/components/motion/proxy.mjs';
import { useConstant } from '../../utils/use-constant.mjs';
import { useMotionValue } from '../../value/use-motion-value.mjs';
import { useTransform } from '../../value/use-transform.mjs';
import { autoScrollIfNeeded, resetAutoScrollState } from './utils/auto-scroll.mjs';
function useDefaultMotionValue(value, defaultValue = 0) {
return isMotionValue(value) ? value : useMotionValue(defaultValue);
}
function ReorderItemComponent({ children, style = {}, value, as = "li", onDrag, onDragEnd, layout = true, ...props }, externalRef) {
const Component = useConstant(() => motion[as]);
const context = useContext(ReorderContext);
const point = {
x: useDefaultMotionValue(style.x),
y: useDefaultMotionValue(style.y),
};
const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) => latestX || latestY ? 1 : "unset");
invariant(Boolean(context), "Reorder.Item must be a child of Reorder.Group", "reorder-item-child");
const { axis, registerItem, updateOrder, groupRef } = context;
return (jsx(Component, { drag: axis, ...props, dragSnapToOrigin: true, style: { ...style, x: point.x, y: point.y, zIndex }, layout: layout, onDrag: (event, gesturePoint) => {
const { velocity, point: pointerPoint } = gesturePoint;
const offset = point[axis].get();
// Always attempt to update order - checkReorder handles the logic
updateOrder(value, offset, velocity[axis]);
autoScrollIfNeeded(groupRef.current, pointerPoint[axis], axis, velocity[axis]);
onDrag && onDrag(event, gesturePoint);
}, onDragEnd: (event, gesturePoint) => {
resetAutoScrollState();
onDragEnd && onDragEnd(event, gesturePoint);
}, onLayoutMeasure: (measured) => {
registerItem(value, measured);
}, ref: externalRef, ignoreStrict: true, children: children }));
}
const ReorderItem = /*@__PURE__*/ forwardRef(ReorderItemComponent);
export { ReorderItem, ReorderItemComponent };
//# sourceMappingURL=Item.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"circle-chevron-left.js","sources":["../../../src/icons/circle-chevron-left.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CircleChevronLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIgLz4KICA8cGF0aCBkPSJtMTQgMTYtNC00IDQtNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/circle-chevron-left\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 CircleChevronLeft = createLucideIcon('CircleChevronLeft', [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'm14 16-4-4 4-4', key: 'ojs7w8' }],\n]);\n\nexport default CircleChevronLeft;\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,CAC9D,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACzD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,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;AACjD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"beef.js","sources":["../../../src/icons/beef.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Beef\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMi41IiBjeT0iOC41IiByPSIyLjUiIC8+CiAgPHBhdGggZD0iTTEyLjUgMmE2LjUgNi41IDAgMCAwLTYuMjIgNC42Yy0xLjEgMy4xMy0uNzggMy45LTMuMTggNi4wOEEzIDMgMCAwIDAgNSAxOGM0IDAgOC40LTEuOCAxMS40LTQuM0E2LjUgNi41IDAgMCAwIDEyLjUgMloiIC8+CiAgPHBhdGggZD0ibTE4LjUgNiAyLjE5IDQuNWE2LjQ4IDYuNDggMCAwIDEgLjMxIDIgNi40OSA2LjQ5IDAgMCAxLTIuNiA1LjJDMTUuNCAyMC4yIDExIDIyIDcgMjJhMyAzIDAgMCAxLTIuNjgtMS42NkwyLjQgMTYuNSIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/beef\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 Beef = createLucideIcon('Beef', [\n ['circle', { cx: '12.5', cy: '8.5', r: '2.5', key: '9738u8' }],\n [\n 'path',\n {\n d: 'M12.5 2a6.5 6.5 0 0 0-6.22 4.6c-1.1 3.13-.78 3.9-3.18 6.08A3 3 0 0 0 5 18c4 0 8.4-1.8 11.4-4.3A6.5 6.5 0 0 0 12.5 2Z',\n key: 'o0f6za',\n },\n ],\n [\n 'path',\n {\n d: 'm18.5 6 2.19 4.5a6.48 6.48 0 0 1 .31 2 6.49 6.49 0 0 1-2.6 5.2C15.4 20.2 11 22 7 22a3 3 0 0 1-2.68-1.66L2.4 16.5',\n key: 'k7p6i0',\n },\n ],\n]);\n\nexport default Beef;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CACpC,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAI,CAAA,CAAA,CAAA,KAAA,CAAO,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAC7D,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;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,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/slot.tsx"],
"sourcesContent": ["import * as React from 'react';\nimport { composeRefs } from '@radix-ui/react-compose-refs';\n\ndeclare module 'react' {\n interface ReactElement {\n $$typeof?: symbol | string;\n }\n}\n\nconst REACT_LAZY_TYPE = Symbol.for('react.lazy');\n\ninterface LazyReactElement extends React.ReactElement {\n $$typeof: typeof REACT_LAZY_TYPE;\n _payload: PromiseLike<Exclude<React.ReactNode, PromiseLike<any>>>;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/\n\nexport type Usable<T> = PromiseLike<T> | React.Context<T>;\nconst use: typeof React.use | undefined = (React as any)[' use '.trim().toString()];\n\ninterface SlotProps extends React.HTMLAttributes<HTMLElement> {\n children?: React.ReactNode;\n}\n\nfunction isPromiseLike(value: unknown): value is PromiseLike<unknown> {\n return typeof value === 'object' && value !== null && 'then' in value;\n}\n\nfunction isLazyComponent(element: React.ReactNode): element is LazyReactElement {\n return (\n element != null &&\n typeof element === 'object' &&\n '$$typeof' in element &&\n element.$$typeof === REACT_LAZY_TYPE &&\n '_payload' in element &&\n isPromiseLike(element._payload)\n );\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlot(ownerName: string) {\n const SlotClone = createSlotClone(ownerName);\n const Slot = React.forwardRef<HTMLElement, SlotProps>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === 'function') {\n children = use(children._payload);\n }\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement)\n ? (newElement.props as { children: React.ReactNode }).children\n : null;\n } else {\n return child;\n }\n });\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {React.isValidElement(newElement)\n ? React.cloneElement(newElement, undefined, newChildren)\n : null}\n </SlotClone>\n );\n }\n\n return (\n <SlotClone {...slotProps} ref={forwardedRef}>\n {children}\n </SlotClone>\n );\n });\n\n Slot.displayName = `${ownerName}.Slot`;\n return Slot;\n}\n\nconst Slot = createSlot('Slot');\n\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SlotCloneProps {\n children: React.ReactNode;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ function createSlotClone(ownerName: string) {\n const SlotClone = React.forwardRef<any, SlotCloneProps>((props, forwardedRef) => {\n let { children, ...slotProps } = props;\n if (isLazyComponent(children) && typeof use === 'function') {\n children = use(children._payload);\n }\n\n if (React.isValidElement(children)) {\n const childrenRef = getElementRef(children);\n const props = mergeProps(slotProps, children.props as AnyProps);\n // do not pass ref to React.Fragment for React 19 compatibility\n if (children.type !== React.Fragment) {\n props.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;\n }\n return React.cloneElement(children, props);\n }\n\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/\n\nconst SLOTTABLE_IDENTIFIER = Symbol('radix.slottable');\n\ninterface SlottableProps {\n children: React.ReactNode;\n}\n\ninterface SlottableComponent extends React.FC<SlottableProps> {\n __radixId: symbol;\n}\n\n/* @__NO_SIDE_EFFECTS__ */ export function createSlottable(ownerName: string) {\n const Slottable: SlottableComponent = ({ children }) => {\n return <>{children}</>;\n };\n Slottable.displayName = `${ownerName}.Slottable`;\n Slottable.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable;\n}\n\nconst SlottLine truncated
"mappings": ";AAAA,YAAY,WAAW;AACvB,SAAS,mBAAmB;AAqEpB,SAqEG,YAAAA,WArEH;AA7DR,IAAM,kBAAkB,OAAO,IAAI,YAAY;AAY/C,IAAM,MAAqC,MAAc,QAAQ,KAAK,EAAE,SAAS,CAAC;AAMlF,SAAS,cAAc,OAA+C;AACpE,SAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,UAAU;AAClE;AAEA,SAAS,gBAAgB,SAAuD;AAC9E,SACE,WAAW,QACX,OAAO,YAAY,YACnB,cAAc,WACd,QAAQ,aAAa,mBACrB,cAAc,WACd,cAAc,QAAQ,QAAQ;AAElC;AAAA;AAEkC,SAAS,WAAW,WAAmB;AACvE,QAAM,YAAY,gCAAgB,SAAS;AAC3C,QAAMC,QAAa,iBAAmC,CAAC,OAAO,iBAAiB;AAC7E,QAAI,EAAE,UAAU,GAAG,UAAU,IAAI;AACjC,QAAI,gBAAgB,QAAQ,KAAK,OAAO,QAAQ,YAAY;AAC1D,iBAAW,IAAI,SAAS,QAAQ;AAAA,IAClC;AACA,UAAM,gBAAsB,eAAS,QAAQ,QAAQ;AACrD,UAAM,YAAY,cAAc,KAAK,WAAW;AAEhD,QAAI,WAAW;AAEb,YAAM,aAAa,UAAU,MAAM;AAEnC,YAAM,cAAc,cAAc,IAAI,CAAC,UAAU;AAC/C,YAAI,UAAU,WAAW;AAGvB,cAAU,eAAS,MAAM,UAAU,IAAI,EAAG,QAAa,eAAS,KAAK,IAAI;AACzE,iBAAa,qBAAe,UAAU,IACjC,WAAW,MAAwC,WACpD;AAAA,QACN,OAAO;AACL,iBAAO;AAAA,QACT;AAAA,MACF,CAAC;AAED,aACE,oBAAC,aAAW,GAAG,WAAW,KAAK,cAC5B,UAAM,qBAAe,UAAU,IACtB,mBAAa,YAAY,QAAW,WAAW,IACrD,MACN;AAAA,IAEJ;AAEA,WACE,oBAAC,aAAW,GAAG,WAAW,KAAK,cAC5B,UACH;AAAA,EAEJ,CAAC;AAED,EAAAA,MAAK,cAAc,GAAG,SAAS;AAC/B,SAAOA;AACT;AAEA,IAAM,OAAO,2BAAW,MAAM;AAAA;AAUH,SAAS,gBAAgB,WAAmB;AACrE,QAAM,YAAkB,iBAAgC,CAAC,OAAO,iBAAiB;AAC/E,QAAI,EAAE,UAAU,GAAG,UAAU,IAAI;AACjC,QAAI,gBAAgB,QAAQ,KAAK,OAAO,QAAQ,YAAY;AAC1D,iBAAW,IAAI,SAAS,QAAQ;AAAA,IAClC;AAEA,QAAU,qBAAe,QAAQ,GAAG;AAClC,YAAM,cAAc,cAAc,QAAQ;AAC1C,YAAMC,SAAQ,WAAW,WAAW,SAAS,KAAiB;AAE9D,UAAI,SAAS,SAAe,gBAAU;AACpC,QAAAA,OAAM,MAAM,eAAe,YAAY,cAAc,WAAW,IAAI;AAAA,MACtE;AACA,aAAa,mBAAa,UAAUA,MAAK;AAAA,IAC3C;AAEA,WAAa,eAAS,MAAM,QAAQ,IAAI,IAAU,eAAS,KAAK,IAAI,IAAI;AAAA,EAC1E,CAAC;AAED,YAAU,cAAc,GAAG,SAAS;AACpC,SAAO;AACT;AAMA,IAAM,uBAAuB,OAAO,iBAAiB;AAAA;AAUnB,SAAS,gBAAgB,WAAmB;AAC5E,QAAMC,aAAgC,CAAC,EAAE,SAAS,MAAM;AACtD,WAAO,oBAAAH,WAAA,EAAG,UAAS;AAAA,EACrB;AACA,EAAAG,WAAU,cAAc,GAAG,SAAS;AACpC,EAAAA,WAAU,YAAY;AACtB,SAAOA;AACT;AAEA,IAAM,YAAY,gCAAgB,WAAW;AAM7C,SAAS,YACP,OAC+D;AAC/D,SACQ,qBAAe,KAAK,KAC1B,OAAO,MAAM,SAAS,cACtB,eAAe,MAAM,QACrB,MAAM,KAAK,cAAc;AAE7B;AAEA,SAAS,WAAW,WAAqB,YAAsB;AAE7D,QAAM,gBAAgB,EAAE,GAAG,WAAW;AAEtC,aAAW,YAAY,YAAY;AACjC,UAAM,gBAAgB,UAAU,QAAQ;AACxC,UAAM,iBAAiB,WAAW,QAAQ;AAE1C,UAAM,YAAY,WAAW,KAAK,QAAQ;AAC1C,QAAI,WAAW;AAEb,UAAI,iBAAiB,gBAAgB;AACnC,sBAAc,QAAQ,IAAI,IAAI,SAAoB;AAChD,gBAAM,SAAS,eAAe,GAAG,IAAI;AACrC,wBAAc,GAAG,IAAI;AACrB,iBAAO;AAAA,QACT;AAAA,MACF,WAES,eAAe;AACtB,sBAAc,QAAQ,IAAI;AAAA,MAC5B;AAAA,IACF,WAES,aAAa,SAAS;AAC7B,oBAAc,QAAQ,IAAI,EAAE,GAAG,eAAe,GAAG,eAAe;AAAA,IAClE,WAAW,aAAa,aAAa;AACnC,oBAAc,QAAQ,IAAI,CAAC,eAAe,cAAc,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAAA,IACpF;AAAA,EACF;AAEA,SAAO,EAAE,GAAG,WAAW,GAAG,cAAc;AAC1C;AAOA,SAAS,cAAc,SAA6B;AAElD,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,WAAQ,QAAQ,MAAuC;AAAA,EACzD;AAGA,SAAQ,QAAQ,MAAuC,OAAQ,QAAgB;AACjF;",
"names": ["Fragment", "Slot", "props", "Slottable"]
}
@@ -0,0 +1,19 @@
"use strict";
module.exports = function (it) {
const { pluginName, resolvePluginsRelativeTo, importerName } = it;
return `
ESLint couldn't find the plugin "${pluginName}".
(The package "${pluginName}" was not found when loaded as a Node module from the directory "${resolvePluginsRelativeTo}".)
It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
npm install ${pluginName}@latest --save-dev
The plugin "${pluginName}" was referenced from the config file in "${importerName}".
If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.
`.trimStart();
};
@@ -0,0 +1,46 @@
{
"name": "locate-path",
"version": "6.0.0",
"description": "Get the first path that exists on disk of multiple paths",
"license": "MIT",
"repository": "sindresorhus/locate-path",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"locate",
"path",
"paths",
"file",
"files",
"exists",
"find",
"finder",
"search",
"searcher",
"array",
"iterable",
"iterator"
],
"dependencies": {
"p-locate": "^5.0.0"
},
"devDependencies": {
"ava": "^2.4.0",
"tsd": "^0.13.1",
"xo": "^0.32.1"
}
}
@@ -0,0 +1,112 @@
import * as util from "../core/util.js";
const error = () => {
const Sizable = {
string: { unit: "caràcters", verb: "contenir" },
file: { unit: "bytes", verb: "contenir" },
array: { unit: "elements", verb: "contenir" },
set: { unit: "elements", verb: "contenir" },
map: { unit: "elements", verb: "contenir" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const FormatDictionary = {
regex: "entrada",
email: "adreça electrònica",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "data i hora ISO",
date: "data ISO",
time: "hora ISO",
duration: "durada ISO",
ipv4: "adreça IPv4",
ipv6: "adreça IPv6",
mac: "adreça MAC",
cidrv4: "rang IPv4",
cidrv6: "rang IPv6",
base64: "cadena codificada en base64",
base64url: "cadena codificada en base64url",
json_string: "cadena JSON",
e164: "número E.164",
credit_card: "número de targeta de crèdit",
currency_code: "codi de moneda",
iban: "IBAN",
jwt: "JWT",
template_literal: "entrada",
};
const TypeDictionary = {
nan: "NaN",
};
return (issue) => {
switch (issue.code) {
case "invalid_type": {
const expected = TypeDictionary[issue.expected] ?? issue.expected;
const receivedType = util.parsedType(issue.input);
const received = TypeDictionary[receivedType] ?? receivedType;
if (/^[A-Z]/.test(issue.expected)) {
return `Tipus invàlid: s'esperava instanceof ${issue.expected}, s'ha rebut ${received}`;
}
return `Tipus invàlid: s'esperava ${expected}, s'ha rebut ${received}`;
}
case "invalid_value":
if (issue.values.length === 1)
return `Valor invàlid: s'esperava ${util.stringifyPrimitive(issue.values[0])}`;
return `Opció invàlida: s'esperava una de ${util.joinValues(issue.values, " o ")}`;
case "too_big": {
const adj = issue.inclusive ? "com a màxim" : "menys de";
const sizing = getSizing(issue.origin);
if (sizing)
return `Massa gran: s'esperava que ${issue.origin ?? "el valor"} contingués ${adj} ${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
return `Massa gran: s'esperava que ${issue.origin ?? "el valor"} fos ${adj} ${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? "com a mínim" : "més de";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Massa petit: s'esperava que ${issue.origin} contingués ${adj} ${issue.minimum.toString()} ${sizing.unit}`;
}
return `Massa petit: s'esperava que ${issue.origin} fos ${adj} ${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with") {
return `Format invàlid: ha de començar amb "${_issue.prefix}"`;
}
if (_issue.format === "ends_with")
return `Format invàlid: ha d'acabar amb "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Format invàlid: ha d'incloure "${_issue.includes}"`;
if (_issue.format === "regex")
return `Format invàlid: ha de coincidir amb el patró ${_issue.pattern}`;
return `Format invàlid per a ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Número invàlid: ha de ser múltiple de ${issue.divisor}`;
case "unrecognized_keys":
return `Clau${issue.keys.length > 1 ? "s" : ""} no reconeguda${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Clau invàlida a ${issue.origin}`;
case "invalid_union":
return "Entrada invàlida"; // Could also be "Tipus d'unió invàlid" but "Entrada invàlida" is more general
case "invalid_element":
return `Element invàlid a ${issue.origin}`;
default:
return `Entrada invàlida`;
}
};
};
export default function () {
return {
localeError: error(),
};
}
@@ -0,0 +1,144 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _default;
function helpers() {
const data = require("@babel/helpers");
helpers = function () {
return data;
};
return data;
}
function _generator() {
const data = require("@babel/generator");
_generator = function () {
return data;
};
return data;
}
function _template() {
const data = require("@babel/template");
_template = function () {
return data;
};
return data;
}
function _t() {
const data = require("@babel/types");
_t = function () {
return data;
};
return data;
}
const {
arrayExpression,
assignmentExpression,
binaryExpression,
blockStatement,
callExpression,
cloneNode,
conditionalExpression,
exportNamedDeclaration,
exportSpecifier,
expressionStatement,
functionExpression,
identifier,
memberExpression,
objectExpression,
program,
stringLiteral,
unaryExpression,
variableDeclaration,
variableDeclarator
} = _t();
const buildUmdWrapper = replacements => _template().default.statement`
(function (root, factory) {
if (typeof define === "function" && define.amd) {
define(AMD_ARGUMENTS, factory);
} else if (typeof exports === "object") {
factory(COMMON_ARGUMENTS);
} else {
factory(BROWSER_ARGUMENTS);
}
})(UMD_ROOT, function (FACTORY_PARAMETERS) {
FACTORY_BODY
});
`(replacements);
function buildGlobal(allowlist) {
const namespace = identifier("babelHelpers");
const body = [];
const container = functionExpression(null, [identifier("global")], blockStatement(body));
const tree = program([expressionStatement(callExpression(container, [conditionalExpression(binaryExpression("===", unaryExpression("typeof", identifier("global")), stringLiteral("undefined")), identifier("self"), identifier("global"))]))]);
body.push(variableDeclaration("var", [variableDeclarator(namespace, assignmentExpression("=", memberExpression(identifier("global"), namespace), objectExpression([])))]));
buildHelpers(body, namespace, allowlist);
return tree;
}
function buildModule(allowlist) {
const body = [];
const refs = buildHelpers(body, null, allowlist);
body.unshift(exportNamedDeclaration(null, Object.keys(refs).map(name => {
return exportSpecifier(cloneNode(refs[name]), identifier(name));
})));
return program(body, [], "module");
}
function buildUmd(allowlist) {
const namespace = identifier("babelHelpers");
const body = [];
body.push(variableDeclaration("var", [variableDeclarator(namespace, identifier("global"))]));
buildHelpers(body, namespace, allowlist);
return program([buildUmdWrapper({
FACTORY_PARAMETERS: identifier("global"),
BROWSER_ARGUMENTS: assignmentExpression("=", memberExpression(identifier("root"), namespace), objectExpression([])),
COMMON_ARGUMENTS: identifier("exports"),
AMD_ARGUMENTS: arrayExpression([stringLiteral("exports")]),
FACTORY_BODY: body,
UMD_ROOT: identifier("this")
})]);
}
function buildVar(allowlist) {
const namespace = identifier("babelHelpers");
const body = [];
body.push(variableDeclaration("var", [variableDeclarator(namespace, objectExpression([]))]));
const tree = program(body);
buildHelpers(body, namespace, allowlist);
body.push(expressionStatement(namespace));
return tree;
}
function buildHelpers(body, namespace, allowlist) {
const getHelperReference = name => {
return namespace ? memberExpression(namespace, identifier(name)) : identifier(`_${name}`);
};
const refs = {};
helpers().list.forEach(function (name) {
if (allowlist && !allowlist.includes(name)) return;
const ref = refs[name] = getHelperReference(name);
const {
nodes
} = helpers().get(name, getHelperReference, namespace ? null : `_${name}`, [], namespace ? (ast, exportName, mapExportBindingAssignments) => {
mapExportBindingAssignments(node => assignmentExpression("=", ref, node));
ast.body.push(expressionStatement(assignmentExpression("=", ref, identifier(exportName))));
} : null);
body.push(...nodes);
});
return refs;
}
function _default(allowlist, outputType = "global") {
let tree;
const build = {
global: buildGlobal,
module: buildModule,
umd: buildUmd,
var: buildVar
}[outputType];
if (build) {
tree = build(allowlist);
} else {
throw new Error(`Unsupported output type ${outputType}`);
}
return (0, _generator().default)(tree).code;
}
0 && 0;
//# sourceMappingURL=build-external-helpers.js.map
@@ -0,0 +1,311 @@
// parse a 512-byte header block to a data object, or vice-versa
// encode returns `true` if a pax extended header is needed, because
// the data could not be faithfully encoded in a simple header.
// (Also, check header.needPax to see if it needs a pax header.)
import { posix as pathModule } from 'node:path';
import * as large from './large-numbers.js';
import * as types from './types.js';
const notNegative = (n) => n === undefined || n < 0 ? undefined : n;
export class Header {
cksumValid = false;
needPax = false;
nullBlock = false;
block;
path;
mode;
uid;
gid;
size;
cksum;
#type = 'Unsupported';
linkpath;
uname;
gname;
devmaj = 0;
devmin = 0;
atime;
ctime;
mtime;
charset;
comment;
constructor(data, off = 0, ex, gex) {
if (Buffer.isBuffer(data)) {
this.decode(data, off || 0, ex, gex);
}
else if (data) {
this.#slurp(data);
}
}
decode(buf, off, ex, gex) {
if (!off) {
off = 0;
}
if (!buf || !(buf.length >= off + 512)) {
throw new Error('need 512 bytes for header');
}
// Decode the typeflag (independent of any pending PAX/GNU extended header)
// up front so we can tell whether THIS block is itself an intermediary
// extension header (PAX `x`/`g`, GNU long-name `L`, GNU long-link `K`).
// Per POSIX pax, a PAX extended header describes the *next file entry*, not
// the extension headers that may sit between it and that file. Applying the
// pending PAX overrides (notably `size`) to an intervening `L`/`K`/`x`/`g`
// header desynchronizes the stream relative to other tar implementations
// and enables tar interpretation-conflict / file-smuggling attacks.
const t = decString(buf, off + 156, 1);
const isNormalFS = types.normalFsTypes.has(t);
const exForFields = isNormalFS ? ex : undefined;
const gexForFields = isNormalFS ? gex : undefined;
this.path = exForFields?.path ?? decString(buf, off, 100);
this.mode =
exForFields?.mode ??
gexForFields?.mode ??
decNumber(buf, off + 100, 8);
this.uid =
exForFields?.uid ?? gexForFields?.uid ?? decNumber(buf, off + 108, 8);
this.gid =
exForFields?.gid ?? gexForFields?.gid ?? decNumber(buf, off + 116, 8);
this.size = notNegative(exForFields?.size ??
gexForFields?.size ??
decNumber(buf, off + 124, 12));
this.mtime =
exForFields?.mtime ??
gexForFields?.mtime ??
decDate(buf, off + 136, 12);
this.cksum = decNumber(buf, off + 148, 12);
// if we have extended or global extended headers, apply them now
// See https://github.com/npm/node-tar/pull/187
// Apply global before local, so it overrides. Never slurp the pending
// extended-header fields onto an intermediary extension header.
if (gexForFields)
this.#slurp(gexForFields, true);
if (exForFields)
this.#slurp(exForFields);
// old tar versions marked dirs as a file with a trailing /
if (types.isCode(t)) {
this.#type = t || '0';
}
if (this.#type === '0' && this.path.slice(-1) === '/') {
this.#type = '5';
}
// tar implementations sometimes incorrectly put the stat(dir).size
// as the size in the tarball, even though Directory entries are
// not able to have any body at all. In the very rare chance that
// it actually DOES have a body, we weren't going to do anything with
// it anyway, and it'll just be a warning about an invalid header.
if (this.#type === '5') {
this.size = 0;
}
this.linkpath = decString(buf, off + 157, 100);
if (buf.subarray(off + 257, off + 265).toString() === 'ustar\u000000') {
/* c8 ignore start */
this.uname =
exForFields?.uname ??
gexForFields?.uname ??
decString(buf, off + 265, 32);
this.gname =
exForFields?.gname ??
gexForFields?.gname ??
decString(buf, off + 297, 32);
this.devmaj =
exForFields?.devmaj ??
gexForFields?.devmaj ??
decNumber(buf, off + 329, 8) ??
0;
this.devmin =
exForFields?.devmin ??
gexForFields?.devmin ??
decNumber(buf, off + 337, 8) ??
0;
/* c8 ignore stop */
if (buf[off + 475] !== 0) {
// definitely a prefix, definitely >130 chars.
const prefix = decString(buf, off + 345, 155);
this.path = prefix + '/' + this.path;
}
else {
const prefix = decString(buf, off + 345, 130);
if (prefix) {
this.path = prefix + '/' + this.path;
}
/* c8 ignore start */
this.atime = ex?.atime ?? gex?.atime ?? decDate(buf, off + 476, 12);
this.ctime = ex?.ctime ?? gex?.ctime ?? decDate(buf, off + 488, 12);
/* c8 ignore stop */
}
}
let sum = 8 * 0x20;
for (let i = off; i < off + 148; i++) {
sum += buf[i];
}
for (let i = off + 156; i < off + 512; i++) {
sum += buf[i];
}
this.cksumValid = sum === this.cksum;
if (this.cksum === undefined && sum === 8 * 0x20) {
this.nullBlock = true;
}
}
#slurp(ex, gex = false) {
Object.assign(this, Object.fromEntries(Object.entries(ex).filter(([k, v]) => {
// we slurp in everything except for the path attribute in
// a global extended header, because that's weird. Also, any
// null/undefined values are ignored.
return !(v === null ||
v === undefined ||
(k === 'size' && Number(v) < 0) ||
(k === 'path' && gex) ||
(k === 'linkpath' && gex) ||
k === 'global');
})));
}
encode(buf, off = 0) {
if (!buf) {
buf = this.block = Buffer.alloc(512);
}
if (this.#type === 'Unsupported') {
this.#type = '0';
}
if (!(buf.length >= off + 512)) {
throw new Error('need 512 bytes for header');
}
const prefixSize = this.ctime || this.atime ? 130 : 155;
const split = splitPrefix(this.path || '', prefixSize);
const path = split[0];
const prefix = split[1];
this.needPax = !!split[2];
this.needPax = encString(buf, off, 100, path) || this.needPax;
this.needPax = encNumber(buf, off + 100, 8, this.mode) || this.needPax;
this.needPax = encNumber(buf, off + 108, 8, this.uid) || this.needPax;
this.needPax = encNumber(buf, off + 116, 8, this.gid) || this.needPax;
this.needPax = encNumber(buf, off + 124, 12, this.size) || this.needPax;
this.needPax = encDate(buf, off + 136, 12, this.mtime) || this.needPax;
buf[off + 156] = Number(this.#type.codePointAt(0));
this.needPax =
encString(buf, off + 157, 100, this.linkpath) || this.needPax;
buf.write('ustar\u000000', off + 257, 8);
this.needPax =
encString(buf, off + 265, 32, this.uname) || this.needPax;
this.needPax =
encString(buf, off + 297, 32, this.gname) || this.needPax;
this.needPax =
encNumber(buf, off + 329, 8, this.devmaj) || this.needPax;
this.needPax =
encNumber(buf, off + 337, 8, this.devmin) || this.needPax;
this.needPax =
encString(buf, off + 345, prefixSize, prefix) || this.needPax;
if (buf[off + 475] !== 0) {
this.needPax = encString(buf, off + 345, 155, prefix) || this.needPax;
}
else {
this.needPax = encString(buf, off + 345, 130, prefix) || this.needPax;
this.needPax =
encDate(buf, off + 476, 12, this.atime) || this.needPax;
this.needPax =
encDate(buf, off + 488, 12, this.ctime) || this.needPax;
}
let sum = 8 * 0x20;
for (let i = off; i < off + 148; i++) {
sum += buf[i];
}
for (let i = off + 156; i < off + 512; i++) {
sum += buf[i];
}
this.cksum = sum;
encNumber(buf, off + 148, 8, this.cksum);
this.cksumValid = true;
return this.needPax;
}
get type() {
return (this.#type === 'Unsupported' ?
this.#type
: types.name.get(this.#type));
}
get typeKey() {
return this.#type;
}
set type(type) {
const c = String(types.code.get(type));
if (types.isCode(c) || c === 'Unsupported') {
this.#type = c;
}
else if (types.isCode(type)) {
this.#type = type;
}
else {
throw new TypeError('invalid entry type: ' + type);
}
}
}
const splitPrefix = (p, prefixSize) => {
const pathSize = 100;
let pp = p;
let prefix = '';
let ret = undefined;
const root = pathModule.parse(p).root || '.';
if (Buffer.byteLength(pp) < pathSize) {
ret = [pp, prefix, false];
}
else {
// first set prefix to the dir, and path to the base
prefix = pathModule.dirname(pp);
pp = pathModule.basename(pp);
do {
if (Buffer.byteLength(pp) <= pathSize &&
Buffer.byteLength(prefix) <= prefixSize) {
// both fit!
ret = [pp, prefix, false];
}
else if (Buffer.byteLength(pp) > pathSize &&
Buffer.byteLength(prefix) <= prefixSize) {
// prefix fits in prefix, but path doesn't fit in path
ret = [pp.slice(0, pathSize - 1), prefix, true];
}
else {
// make path take a bit from prefix
pp = pathModule.join(pathModule.basename(prefix), pp);
prefix = pathModule.dirname(prefix);
}
} while (prefix !== root && ret === undefined);
// at this point, found no resolution, just truncate
if (!ret) {
ret = [p.slice(0, pathSize - 1), '', true];
}
}
return ret;
};
const decString = (buf, off, size) => buf
.subarray(off, off + size)
.toString('utf8')
.replace(/\0.*/, '');
const decDate = (buf, off, size) => numToDate(decNumber(buf, off, size));
const numToDate = (num) => num === undefined ? undefined : new Date(num * 1000);
const decNumber = (buf, off, size) => Number(buf[off]) & 0x80 ?
large.parse(buf.subarray(off, off + size))
: decSmallNumber(buf, off, size);
const nanUndef = (value) => (isNaN(value) ? undefined : value);
const decSmallNumber = (buf, off, size) => nanUndef(parseInt(buf
.subarray(off, off + size)
.toString('utf8')
.replace(/\0.*$/, '')
.trim(), 8));
// the maximum encodable as a null-terminated octal, by field size
const MAXNUM = {
12: 0o77777777777,
8: 0o7777777,
};
const encNumber = (buf, off, size, num) => num === undefined ? false
: num > MAXNUM[size] || num < 0 ?
(large.encode(num, buf.subarray(off, off + size)), true)
: (encSmallNumber(buf, off, size, num), false);
const encSmallNumber = (buf, off, size, num) => buf.write(octalString(num, size), off, size, 'ascii');
const octalString = (num, size) => padOctal(Math.floor(num).toString(8), size);
const padOctal = (str, size) => (str.length === size - 1 ?
str
: new Array(size - str.length - 1).join('0') + str + ' ') + '\0';
const encDate = (buf, off, size, date) => date === undefined ? false : (encNumber(buf, off, size, date.getTime() / 1000));
// enough to fill the longest string we've got
const NULLS = new Array(156).join('\0');
// pad with nulls, return true if it's longer or non-ascii
const encString = (buf, off, size, str) => str === undefined ? false : ((buf.write(str + NULLS, off, size, 'utf8'),
str.length !== Buffer.byteLength(str) || str.length > size));
//# sourceMappingURL=header.js.map
@@ -0,0 +1,61 @@
'use strict'
let list = {
comma(string) {
return list.split(string, [','], true)
},
space(string) {
let spaces = [' ', '\n', '\t']
return list.split(string, spaces)
},
split(string, separators, last) {
if (typeof string !== 'string') return []
let array = []
let current = ''
let split = false
let func = 0
let inQuote = false
let prevQuote = ''
let escape = false
for (let letter of string) {
if (escape) {
escape = false
} else if (letter === '\\') {
escape = true
} else if (inQuote) {
if (letter === prevQuote) {
inQuote = false
}
} else if (letter === '"' || letter === "'") {
inQuote = true
prevQuote = letter
} else if (letter === '(') {
func += 1
} else if (letter === ')') {
if (func > 0) func -= 1
} else if (func === 0) {
if (separators.includes(letter)) split = true
}
if (split) {
let value = current.trim()
if (last || value !== '') array.push(value)
current = ''
split = false
} else {
current += letter
}
}
let value = current.trim()
if (last || value !== '') array.push(value)
return array
}
}
module.exports = list
list.default = list
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/index.ts", "../src/number.ts"],
"sourcesContent": ["export { clamp } from './number';\n", "function clamp(value: number, [min, max]: [number, number]): number {\n return Math.min(max, Math.max(min, value));\n}\n\nexport { clamp };\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,SAAS,MAAM,OAAe,CAAC,KAAK,GAAG,GAA6B;AAClE,SAAO,KAAK,IAAI,KAAK,KAAK,IAAI,KAAK,KAAK,CAAC;AAC3C;",
"names": []
}
@@ -0,0 +1 @@
{"version":3,"file":"book-open-text.js","sources":["../../../src/icons/book-open-text.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BookOpenText\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgN3YxNCIgLz4KICA8cGF0aCBkPSJNMTYgMTJoMiIgLz4KICA8cGF0aCBkPSJNMTYgOGgyIiAvPgogIDxwYXRoIGQ9Ik0zIDE4YTEgMSAwIDAgMS0xLTFWNGExIDEgMCAwIDEgMS0xaDVhNCA0IDAgMCAxIDQgNCA0IDQgMCAwIDEgNC00aDVhMSAxIDAgMCAxIDEgMXYxM2ExIDEgMCAwIDEtMSAxaC02YTMgMyAwIDAgMC0zIDMgMyAzIDAgMCAwLTMtM3oiIC8+CiAgPHBhdGggZD0iTTYgMTJoMiIgLz4KICA8cGF0aCBkPSJNNiA4aDIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/book-open-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 BookOpenText = createLucideIcon('BookOpenText', [\n ['path', { d: 'M12 7v14', key: '1akyts' }],\n ['path', { d: 'M16 12h2', key: '7q9ll5' }],\n ['path', { d: 'M16 8h2', key: 'msurwy' }],\n [\n 'path',\n {\n d: 'M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z',\n key: 'ruj8y',\n },\n ],\n ['path', { d: 'M6 12h2', key: '32wvfc' }],\n ['path', { d: 'M6 8h2', key: '30oboj' }],\n]);\n\nexport default BookOpenText;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;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,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACzC,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;
function schemaHasRulesForType({ schema, self }, type) {
const group = self.RULES.types[type];
return group && group !== true && shouldUseGroup(schema, group);
}
exports.schemaHasRulesForType = schemaHasRulesForType;
function shouldUseGroup(schema, group) {
return group.rules.some((rule) => shouldUseRule(schema, rule));
}
exports.shouldUseGroup = shouldUseGroup;
function shouldUseRule(schema, rule) {
var _a;
return (schema[rule.keyword] !== undefined ||
((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));
}
exports.shouldUseRule = shouldUseRule;
//# sourceMappingURL=applicability.js.map
@@ -0,0 +1,18 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ArrowLeftRight = createLucideIcon("ArrowLeftRight", [
["path", { d: "M8 3 4 7l4 4", key: "9rb6wj" }],
["path", { d: "M4 7h16", key: "6tx8e3" }],
["path", { d: "m16 21 4-4-4-4", key: "siv7j2" }],
["path", { d: "M20 17H4", key: "h6l3hr" }]
]);
export { ArrowLeftRight as default };
//# sourceMappingURL=arrow-left-right.js.map
@@ -0,0 +1,30 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const metaSchema = require("./schema.json");
const applicator = require("./meta/applicator.json");
const unevaluated = require("./meta/unevaluated.json");
const content = require("./meta/content.json");
const core = require("./meta/core.json");
const format = require("./meta/format-annotation.json");
const metadata = require("./meta/meta-data.json");
const validation = require("./meta/validation.json");
const META_SUPPORT_DATA = ["/properties"];
function addMetaSchema2020($data) {
;
[
metaSchema,
applicator,
unevaluated,
content,
core,
with$data(this, format),
metadata,
with$data(this, validation),
].forEach((sch) => this.addMetaSchema(sch, undefined, false));
return this;
function with$data(ajv, sch) {
return $data ? ajv.$dataMetaSchema(sch, META_SUPPORT_DATA) : sch;
}
}
exports.default = addMetaSchema2020;
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
{"version":3,"file":"resolve-uri.mjs","sources":["../src/resolve-uri.ts"],"sourcesContent":["// Matches the scheme of a URL, eg \"http://\"\nconst schemeRegex = /^[\\w+.-]+:\\/\\//;\n\n/**\n * Matches the parts of a URL:\n * 1. Scheme, including \":\", guaranteed.\n * 2. User/password, including \"@\", optional.\n * 3. Host, guaranteed.\n * 4. Port, including \":\", optional.\n * 5. Path, including \"/\", optional.\n * 6. Query, including \"?\", optional.\n * 7. Hash, including \"#\", optional.\n */\nconst urlRegex = /^([\\w+.-]+:)\\/\\/([^@/#?]*@)?([^:/#?]*)(:\\d+)?(\\/[^#?]*)?(\\?[^#]*)?(#.*)?/;\n\n/**\n * File URLs are weird. They dont' need the regular `//` in the scheme, they may or may not start\n * with a leading `/`, they can have a domain (but only if they don't start with a Windows drive).\n *\n * 1. Host, optional.\n * 2. Path, which may include \"/\", guaranteed.\n * 3. Query, including \"?\", optional.\n * 4. Hash, including \"#\", optional.\n */\nconst fileRegex = /^file:(?:\\/\\/((?![a-z]:)[^/#?]*)?)?(\\/?[^#?]*)(\\?[^#]*)?(#.*)?/i;\n\ntype Url = {\n scheme: string;\n user: string;\n host: string;\n port: string;\n path: string;\n query: string;\n hash: string;\n type: UrlType;\n};\n\nconst enum UrlType {\n Empty = 1,\n Hash = 2,\n Query = 3,\n RelativePath = 4,\n AbsolutePath = 5,\n SchemeRelative = 6,\n Absolute = 7,\n}\n\nfunction isAbsoluteUrl(input: string): boolean {\n return schemeRegex.test(input);\n}\n\nfunction isSchemeRelativeUrl(input: string): boolean {\n return input.startsWith('//');\n}\n\nfunction isAbsolutePath(input: string): boolean {\n return input.startsWith('/');\n}\n\nfunction isFileUrl(input: string): boolean {\n return input.startsWith('file:');\n}\n\nfunction isRelative(input: string): boolean {\n return /^[.?#]/.test(input);\n}\n\nfunction parseAbsoluteUrl(input: string): Url {\n const match = urlRegex.exec(input)!;\n return makeUrl(\n match[1],\n match[2] || '',\n match[3],\n match[4] || '',\n match[5] || '/',\n match[6] || '',\n match[7] || '',\n );\n}\n\nfunction parseFileUrl(input: string): Url {\n const match = fileRegex.exec(input)!;\n const path = match[2];\n return makeUrl(\n 'file:',\n '',\n match[1] || '',\n '',\n isAbsolutePath(path) ? path : '/' + path,\n match[3] || '',\n match[4] || '',\n );\n}\n\nfunction makeUrl(\n scheme: string,\n user: string,\n host: string,\n port: string,\n path: string,\n query: string,\n hash: string,\n): Url {\n return {\n scheme,\n user,\n host,\n port,\n path,\n query,\n hash,\n type: UrlType.Absolute,\n };\n}\n\nfunction parseUrl(input: string): Url {\n if (isSchemeRelativeUrl(input)) {\n const url = parseAbsoluteUrl('http:' + input);\n url.scheme = '';\n url.type = UrlType.SchemeRelative;\n return url;\n }\n\n if (isAbsolutePath(input)) {\n const url = parseAbsoluteUrl('http://foo.com' + input);\n url.scheme = '';\n url.host = '';\n url.type = UrlType.AbsolutePath;\n return url;\n }\n\n if (isFileUrl(input)) return parseFileUrl(input);\n\n if (isAbsoluteUrl(input)) return parseAbsoluteUrl(input);\n\n const url = parseAbsoluteUrl('http://foo.com/' + input);\n url.scheme = '';\n url.host = '';\n url.type = input\n ? input.startsWith('?')\n ? UrlType.Query\n : input.startsWith('#')\n ? UrlType.Hash\n : UrlType.RelativePath\n : UrlType.Empty;\n return url;\n}\n\nfunction stripPathFilename(path: string): string {\n // If a path ends with a parent directory \"..\", then it's a relative path with excess parent\n // paths. It's not a file, so we can't strip it.\n if (path.endsWith('/..')) return path;\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n}\n\nfunction mergePaths(url: Url, base: Url) {\n normalizePath(base, base.type);\n\n // If the path is just a \"/\", then it was an empty path to begin with (remember, we're a relative\n // path).\n if (url.path === '/') {\n url.path = base.path;\n } else {\n // Resolution happens relative to the base path's directory, not the file.\n url.path = stripPathFilename(base.path) + url.path;\n }\n}\n\n/**\n * The path can have empty directories \"//\", unneeded parents \"foo/..\", or current directory\n * \"foo/.\". We need to normalize to a standard representation.\n */\nfunction normalizePath(url: Url, type: UrlType) {\n const rel = type <= UrlType.RelativePath;\n const pieces = url.path.split('/');\n\n // We need to preserve the first piece always, so that we output a leading slash. The item at\n // pieces[0] is an empty string.\n let pointer = 1;\n\n // Positive is the number of real directories we've output, used for popping a parent directory.\n // Eg, \"foo/bar/..\" will have a positive 2, and we can decrement to be left with just \"foo\".\n let positive = 0;\n\n // We need to keep a trailing slash if we encounter an empty directory (eg, splitting \"foo/\" will\n Line truncated
@@ -0,0 +1,324 @@
/**
* @fileoverview Rule to control usage of strict mode directives.
* @author Brandon Mills
*/
"use strict";
//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------
/**
* Gets all of the Use Strict Directives in the Directive Prologue of a group of
* statements.
* @param {ASTNode[]} statements Statements in the program or function body.
* @returns {ASTNode[]} All of the Use Strict Directives.
*/
function getUseStrictDirectives(statements) {
const directives = [];
for (let i = 0; i < statements.length; i++) {
const statement = statements[i];
if (
statement.type === "ExpressionStatement" &&
statement.expression.type === "Literal" &&
statement.expression.value === "use strict"
) {
directives[i] = statement;
} else {
break;
}
}
return directives;
}
/**
* Checks whether a given parameter is a simple parameter.
* @param {ASTNode} node A pattern node to check.
* @returns {boolean} `true` if the node is an Identifier node.
*/
function isSimpleParameter(node) {
return node.type === "Identifier";
}
/**
* Checks whether a given parameter list is a simple parameter list.
* @param {ASTNode[]} params A parameter list to check.
* @returns {boolean} `true` if the every parameter is an Identifier node.
*/
function isSimpleParameterList(params) {
return params.every(isSimpleParameter);
}
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
defaultOptions: ["safe"],
docs: {
description: "Require or disallow strict mode directives",
recommended: false,
url: "https://eslint.org/docs/latest/rules/strict",
},
schema: [
{
enum: ["never", "global", "function", "safe"],
},
],
fixable: "code",
messages: {
function: "Use the function form of 'use strict'.",
global: "Use the global form of 'use strict'.",
multiple: "Multiple 'use strict' directives.",
never: "Strict mode is not permitted.",
unnecessary: "Unnecessary 'use strict' directive.",
module: "'use strict' is unnecessary inside of modules.",
implied:
"'use strict' is unnecessary when implied strict mode is enabled.",
unnecessaryInClasses:
"'use strict' is unnecessary inside of classes.",
nonSimpleParameterList:
"'use strict' directive inside a function with non-simple parameter list throws a syntax error since ES2016.",
wrap: "Wrap {{name}} in a function with 'use strict' directive.",
},
},
create(context) {
const ecmaFeatures =
context.languageOptions.parserOptions.ecmaFeatures || {},
scopes = [],
classScopes = [];
let [mode] = context.options;
if (ecmaFeatures.impliedStrict) {
mode = "implied";
} else if (mode === "safe") {
mode =
ecmaFeatures.globalReturn ||
context.languageOptions.sourceType === "commonjs"
? "global"
: "function";
}
/**
* Determines whether a reported error should be fixed, depending on the error type.
* @param {string} errorType The type of error
* @returns {boolean} `true` if the reported error should be fixed
*/
function shouldFix(errorType) {
return (
errorType === "multiple" ||
errorType === "unnecessary" ||
errorType === "module" ||
errorType === "implied" ||
errorType === "unnecessaryInClasses"
);
}
/**
* Gets a fixer function to remove a given 'use strict' directive.
* @param {ASTNode} node The directive that should be removed
* @returns {Function} A fixer function
*/
function getFixFunction(node) {
return fixer => fixer.remove(node);
}
/**
* Report a slice of an array of nodes with a given message.
* @param {ASTNode[]} nodes Nodes.
* @param {string} start Index to start from.
* @param {string} end Index to end before.
* @param {string} messageId Message to display.
* @param {boolean} fix `true` if the directive should be fixed (i.e. removed)
* @returns {void}
*/
function reportSlice(nodes, start, end, messageId, fix) {
nodes.slice(start, end).forEach(node => {
context.report({
node,
messageId,
fix: fix ? getFixFunction(node) : null,
});
});
}
/**
* Report all nodes in an array with a given message.
* @param {ASTNode[]} nodes Nodes.
* @param {string} messageId Message id to display.
* @param {boolean} fix `true` if the directive should be fixed (i.e. removed)
* @returns {void}
*/
function reportAll(nodes, messageId, fix) {
reportSlice(nodes, 0, nodes.length, messageId, fix);
}
/**
* Report all nodes in an array, except the first, with a given message.
* @param {ASTNode[]} nodes Nodes.
* @param {string} messageId Message id to display.
* @param {boolean} fix `true` if the directive should be fixed (i.e. removed)
* @returns {void}
*/
function reportAllExceptFirst(nodes, messageId, fix) {
reportSlice(nodes, 1, nodes.length, messageId, fix);
}
/**
* Entering a function in 'function' mode pushes a new nested scope onto the
* stack. The new scope is true if the nested function is strict mode code.
* @param {ASTNode} node The function declaration or expression.
* @param {ASTNode[]} useStrictDirectives The Use Strict Directives of the node.
* @returns {void}
*/
function enterFunctionInFunctionMode(node, useStrictDirectives) {
const isInClass = classScopes.length > 0,
isParentGlobal =
scopes.length === 0 && classScopes.length === 0,
isParentStrict = scopes.length > 0 && scopes.at(-1),
isStrict = useStrictDirectives.length > 0;
if (isStrict) {
if (!isSimpleParameterList(node.params)) {
context.report({
node: useStrictDirectives[0],
messageId: "nonSimpleParameterList",
});
} else if (isParentStrict) {
context.report({
node: useStrictDirectives[0],
messageId: "unnecessary",
fix: getFixFunction(useStrictDirectives[0]),
});
} else if (isInClass) {
context.report({
node: useStrictDirectives[0],
messageId: "unnecessaryInClasses",
fix: getFixFunction(useStrictDirectives[0]),
});
}
reportAllExceptFirst(useStrictDirectives, "multiple", true);
} else if (isParentGlobal) {
if (isSimpleParameterList(node.params)) {
context.report({ node, messageId: "function" });
} else {
context.report({
node,
messageId: "wrap",
data: { name: astUtils.getFunctionNameWithKind(node) },
});
}
}
scopes.push(isParentStrict || isStrict);
}
/**
* Exiting a function in 'function' mode pops its scope off the stack.
* @returns {void}
*/
function exitFunctionInFunctionMode() {
scopes.pop();
}
/**
* Enter a function and either:
* - Push a new nested scope onto the stack (in 'function' mode).
* - Report all the Use Strict Directives (in the other modes).
* @param {ASTNode} node The function declaration or expression.
* @returns {void}
*/
function enterFunction(node) {
const isBlock = node.body.type === "BlockStatement",
useStrictDirectives = isBlock
? getUseStrictDirectives(node.body.body)
: [];
if (mode === "function") {
enterFunctionInFunctionMode(node, useStrictDirectives);
} else if (useStrictDirectives.length > 0) {
if (isSimpleParameterList(node.params)) {
reportAll(useStrictDirectives, mode, shouldFix(mode));
} else {
context.report({
node: useStrictDirectives[0],
messageId: "nonSimpleParameterList",
});
reportAllExceptFirst(useStrictDirectives, "multiple", true);
}
}
}
/** @type {import('../types').Rule.RuleListener} */
const rule = {
Program(node) {
const useStrictDirectives = getUseStrictDirectives(node.body);
if (node.sourceType === "module") {
mode = "module";
}
if (mode === "global") {
if (
node.body.length > 0 &&
useStrictDirectives.length === 0
) {
/*
* Report the range as v9 does
*/
context.report({
loc: {
start: node.body[0].loc.start,
end: node.body.at(-1).loc.end,
},
messageId: "global",
});
}
reportAllExceptFirst(useStrictDirectives, "multiple", true);
} else {
reportAll(useStrictDirectives, mode, shouldFix(mode));
}
},
FunctionDeclaration: enterFunction,
FunctionExpression: enterFunction,
ArrowFunctionExpression: enterFunction,
};
if (mode === "function") {
Object.assign(rule, {
// Inside of class bodies are always strict mode.
ClassBody() {
classScopes.push(true);
},
"ClassBody:exit"() {
classScopes.pop();
},
"FunctionDeclaration:exit": exitFunctionInFunctionMode,
"FunctionExpression:exit": exitFunctionInFunctionMode,
"ArrowFunctionExpression:exit": exitFunctionInFunctionMode,
});
}
return rule;
},
};
@@ -0,0 +1,10 @@
"use client";
import { createContext } from 'react';
/**
* Internal, exported only for usage in Framer
*/
const SwitchLayoutGroupContext = createContext({});
export { SwitchLayoutGroupContext };
//# sourceMappingURL=SwitchLayoutGroupContext.mjs.map
@@ -0,0 +1,136 @@
"use client";
const require_runtime = require("./_virtual/_rolldown/runtime.cjs");
const require_useRouter = require("./useRouter.cjs");
let react = require("react");
react = require_runtime.__toESM(react);
//#region src/useBlocker.tsx
function _resolveBlockerOpts(opts, condition) {
if (opts === void 0) return {
shouldBlockFn: () => true,
withResolver: false
};
if ("shouldBlockFn" in opts) return opts;
if (typeof opts === "function") {
const shouldBlock = Boolean(condition ?? true);
const _customBlockerFn = async () => {
if (shouldBlock) return await opts();
return false;
};
return {
shouldBlockFn: _customBlockerFn,
enableBeforeUnload: shouldBlock,
withResolver: false
};
}
const shouldBlock = Boolean(opts.condition ?? true);
const fn = opts.blockerFn;
const _customBlockerFn = async () => {
if (shouldBlock && fn !== void 0) return await fn();
return shouldBlock;
};
return {
shouldBlockFn: _customBlockerFn,
enableBeforeUnload: shouldBlock,
withResolver: fn === void 0
};
}
function useBlocker(opts, condition) {
const { shouldBlockFn, enableBeforeUnload = true, disabled = false, withResolver = false } = _resolveBlockerOpts(opts, condition);
const router = require_useRouter.useRouter();
const { history } = router;
const [resolver, setResolver] = react.useState({
status: "idle",
current: void 0,
next: void 0,
action: void 0,
proceed: void 0,
reset: void 0
});
react.useEffect(() => {
const blockerFnComposed = async (blockerFnArgs) => {
function getLocation(location) {
const parsedLocation = router.parseLocation(location);
const matchedRoutes = router.getMatchedRoutes(parsedLocation.pathname);
if (matchedRoutes.foundRoute === void 0) return {
routeId: "__notFound__",
fullPath: parsedLocation.pathname,
pathname: parsedLocation.pathname,
params: matchedRoutes.routeParams,
search: router.options.parseSearch(location.search)
};
return {
routeId: matchedRoutes.foundRoute.id,
fullPath: matchedRoutes.foundRoute.fullPath,
pathname: parsedLocation.pathname,
params: matchedRoutes.routeParams,
search: router.options.parseSearch(location.search)
};
}
const current = getLocation(blockerFnArgs.currentLocation);
const next = getLocation(blockerFnArgs.nextLocation);
if (current.routeId === "__notFound__" && next.routeId !== "__notFound__") return false;
const shouldBlock = await shouldBlockFn({
action: blockerFnArgs.action,
current,
next
});
if (!withResolver) return shouldBlock;
if (!shouldBlock) return false;
const canNavigateAsync = await new Promise((resolve) => {
setResolver({
status: "blocked",
current,
next,
action: blockerFnArgs.action,
proceed: () => resolve(false),
reset: () => resolve(true)
});
});
setResolver({
status: "idle",
current: void 0,
next: void 0,
action: void 0,
proceed: void 0,
reset: void 0
});
return canNavigateAsync;
};
return disabled ? void 0 : history.block({
blockerFn: blockerFnComposed,
enableBeforeUnload
});
}, [
shouldBlockFn,
enableBeforeUnload,
disabled,
withResolver,
history,
router
]);
return resolver;
}
var _resolvePromptBlockerArgs = (props) => {
if ("shouldBlockFn" in props) return { ...props };
const shouldBlock = Boolean(props.condition ?? true);
const fn = props.blockerFn;
const _customBlockerFn = async () => {
if (shouldBlock && fn !== void 0) return await fn();
return shouldBlock;
};
return {
shouldBlockFn: _customBlockerFn,
enableBeforeUnload: shouldBlock,
withResolver: fn === void 0
};
};
function Block(opts) {
const { children, ...rest } = opts;
const resolver = useBlocker(_resolvePromptBlockerArgs(rest));
return children ? typeof children === "function" ? children(resolver) : children : null;
}
//#endregion
exports.Block = Block;
exports.useBlocker = useBlocker;
//# sourceMappingURL=useBlocker.cjs.map
@@ -0,0 +1,25 @@
(function(f){function e(){var i=f();return i.default||i}if(typeof exports=="object"&&typeof module=="object")module.exports=e();else if(typeof define=="function"&&define.amd)define(e);else{var t=typeof globalThis<"u"?globalThis:typeof global<"u"?global:typeof self<"u"?self:this||{};t.prettierPlugins=t.prettierPlugins||{},t.prettierPlugins.html=e()}})(function(){"use strict";var ot=Object.defineProperty;var Zi=Object.getOwnPropertyDescriptor;var es=Object.getOwnPropertyNames;var ts=Object.prototype.hasOwnProperty;var Dr=e=>{throw TypeError(e)};var rs=(e,t,r)=>t in e?ot(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ir=(e,t)=>{for(var r in t)ot(e,r,{get:t[r],enumerable:!0})},ns=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of es(t))!ts.call(e,i)&&i!==r&&ot(e,i,{get:()=>t[i],enumerable:!(n=Zi(t,i))||n.enumerable});return e};var is=e=>ns(ot({},"__esModule",{value:!0}),e);var zt=(e,t,r)=>rs(e,typeof t!="symbol"?t+"":t,r),ss=(e,t,r)=>t.has(e)||Dr("Cannot "+r);var qe=(e,t,r)=>(ss(e,t,"read from private field"),r?r.call(e):t.get(e)),Rr=(e,t,r)=>t.has(e)?Dr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r);var Xo={};Ir(Xo,{languages:()=>Ui,options:()=>zi,parsers:()=>Nr,printers:()=>Qo});var ke=(e,t)=>(r,n,...i)=>r|1&&n==null?void 0:(t.call(n)??n[e]).apply(n,i);var as=String.prototype.replaceAll??function(e,t){return e.global?this.replace(e,t):this.split(e).join(t)},os=ke("replaceAll",function(){if(typeof this=="string")return as}),T=os;function ls(e){return this[e<0?this.length+e:e]}var cs=ke("at",function(){if(Array.isArray(this)||typeof this=="string")return ls}),I=cs;var us=()=>{},He=us;var Fe="string",Ve="array",lt="cursor",be="indent",we="align",ct="trim",Te="group",ye="fill",Ee="if-break",xe="indent-if-break",ut="line-suffix",pt="line-suffix-boundary",z="line",ht="label",Le="break-parent",mt=new Set([lt,be,we,ct,Te,ye,Ee,xe,ut,pt,z,ht,Le]);function ft(e,t,r){if(!e.has(t)){let n=r(t);e.set(t,n)}return e.get(t)}function ps(e){if(typeof e=="string")return Fe;if(Array.isArray(e))return Ve;if(!e)return;let{type:t}=e;if(mt.has(t))return t}var dt=ps;var hs=e=>new Intl.ListFormat("en-US",{type:"disjunction"}).format(e);function ms(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}',
Expected it to be 'string' or 'object'.`;if(dt(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=hs([...mt].map(i=>`'${i}'`));return`Unexpected doc.type '${e.type}'.
Expected it to be ${n}.`}var Gt=class extends Error{name="InvalidDocError";constructor(t){super(ms(t)),this.doc=t}},Or=Gt;function $t(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(s){return ft(r,s,i)}function i(s){switch(dt(s)){case Ve:return t(s.map(n));case ye:return t({...s,parts:s.parts.map(n)});case Ee:return t({...s,breakContents:n(s.breakContents),flatContents:n(s.flatContents)});case Te:{let{expandedStates:a,contents:o}=s;return a?(a=a.map(n),o=a[0]):o=n(o),t({...s,contents:o,expandedStates:a})}case we:case be:case xe:case ht:case ut:return t({...s,contents:n(s.contents)});case Fe:case lt:case ct:case pt:case z:case Le:return t(s);default:throw new Or(s)}}}function L(e,t=Mr){return $t(e,r=>typeof r=="string"?R(t,r.split(`
`)):r)}var D=He,gt=He,Br=He,qr=He;function A(e){return D(e),{type:be,contents:e}}function fs(e,t){return qr(e),D(t),{type:we,contents:t,n:e}}function Hr(e){return fs(Number.NEGATIVE_INFINITY,e)}var G={type:Le};function _t(e){return Br(e),{type:ye,parts:e}}function C(e,t={}){return D(e),gt(t.expandedStates,!0),{type:Te,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function $(e,t="",r={}){return D(e),t!==""&&D(t),{type:Ee,breakContents:e,flatContents:t,groupId:r.groupId}}function Fr(e,t){return D(e),{type:xe,contents:e,groupId:t.groupId,negate:t.negate}}function R(e,t){D(e),gt(t);let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}var S={type:z},y={type:z,soft:!0},ds={type:z,hard:!0},k=[ds,G],gs={type:z,hard:!0,literal:!0},Mr=[gs,G];var Vr=Object.freeze({character:"'",codePoint:39}),Ur=Object.freeze({character:'"',codePoint:34}),_s=Object.freeze({preferred:Vr,alternate:Ur}),Ss=Object.freeze({preferred:Ur,alternate:Vr});function Wr(e,t){let{preferred:r,alternate:n}=t===!0||t==="'"?_s:Ss,{length:i}=e,s=0,a=0;for(let o=0;o<i;o++){let l=e.charCodeAt(o);l===r.codePoint?s++:l===n.codePoint&&a++}return(s>a?n:r).character}function jt(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var Yt=class{#e;constructor(t){this.#e=new Set(t)}getLeadingWhitespaceCount(t){let r=this.#e,n=0;for(let i=0;i<t.length&&r.has(t.charAt(i));i++)n++;return n}getTrailingWhitespaceCount(t){let r=this.#e,n=0;for(let i=t.length-1;i>=0&&r.has(t.charAt(i));i--)n++;return n}getLeadingWhitespace(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(0,r)}getTrailingWhitespace(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(t.length-r)}hasLeadingWhitespace(t){return this.#e.has(t.charAt(0))}hasTrailingWhitespace(t){return this.#e.has(I(0,t,-1))}trimStart(t){let r=this.getLeadingWhitespaceCount(t);return t.slice(r)}trimEnd(t){let r=this.getTrailingWhitespaceCount(t);return t.slice(0,t.length-r)}trim(t){return this.trimEnd(this.trimStart(t))}split(t,r=!1){let n=`[${jt([...this.#e].join(""))}]+`,i=new RegExp(r?`(${n})`:n);return t.split(i)}hasWhitespaceCharacter(t){let r=this.#e;return Array.prototype.some.call(t,n=>r.has(n))}hasNonWhitespaceCharacter(t){let r=this.#e;return Array.prototype.some.call(t,n=>!r.has(n))}isWhitespaceOnly(t){let r=this.#e;return Array.prototype.every.call(t,n=>r.has(n))}#t(t){let r=Number.POSITIVE_INFINITY;for(let n of t.split(`
`)){if(n.length===0)continue;let i=this.getLeadingWhitespaceCount(n);if(i===0)return 0;n.length!==i&&i<r&&(r=i)}return r===Number.POSITIVE_INFINITY?0:r}dedentString(t){let r=this.#t(t);return r===0?t:t.split(`
`).map(n=>n.slice(r)).join(`
`)}},zr=Yt;var vs=[" ",`
`,"\f","\r"," "],Cs=new zr(vs),P=Cs;var Kt=class extends Error{name="UnexpectedNodeError";constructor(t,r,n="type"){super(`Unexpected ${r} node ${n}: ${JSON.stringify(t[n])}.`),this.node=t}},Gr=Kt;function j(e,t=!0){return[A([y,e]),t?y:""]}function q(e,t){let r=e.type==="NGRoot"?e.node.type==="NGMicrosyntax"&&e.node.body.length===1&&e.node.body[0].type==="NGMicrosyntaxExpression"?e.node.body[0].expression:e.node:e.type==="JsExpressionRoot"?e.node:e;return r&&(r.type==="ObjectExpression"||r.type==="ArrayExpression"||(t.parser==="__vue_expression"||t.parser==="__vue_ts_expression"||t.parser==="__ng_binding"||t.parser==="__ng_directive")&&(r.type==="TemplateLiteral"||r.type==="StringLiteral"))}async function E(e,t,r,n){r={__isInHtmlAttribute:!0,__embeddedInHtml:!0,...r};let i=!0;n&&(r.__onHtmlBindingRoot=(a,o)=>{i=n(a,o)});let s=await t(e,r,t);return i?C(s):j(s)}function ks(e,t,r,n){let{node:i}=r,s=n.originalText.slice(i.sourceSpan.start.offset,i.sourceSpan.end.offset);return/^\s*$/.test(s)?"":E(s,e,{parser:"__ng_directive",__isInHtmlAttribute:!1},q)}var $r=ks;var bs=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),Y=bs;var ws=Array.prototype.toReversed??function(){return[...this].reverse()},Ts=ke("toReversed",function(){if(Array.isArray(this))return ws}),jr=Ts;function ys(){let e=globalThis,t=e.process?.platform;if(typeof t=="string")return t.startsWith("win");let r=e.Deno?.build?.os;return typeof r=="string"?r==="windows":e.navigator?.platform?.startsWith("Win")??!1}var Es=ys();function Yr(e){if(e=e instanceof URL?e:new URL(e),e.protocol!=="file:")throw new TypeError(`URL must be a file URL: received "${e.protocol}"`);return e}function xs(e){return e=Yr(e),decodeURIComponent(e.pathname.replace(/%(?![0-9A-Fa-f]{2})/g,"%25"))}function Ls(e){e=Yr(e);let t=decodeURIComponent(e.pathname.replace(/\//g,"\\").replace(/%(?![0-9A-Fa-f]{2})/g,"%25")).replace(/^\\*([A-Za-z]:)(\\|$)/,"$1\\");return e.hostname!==""&&(t=`\\\\${e.hostname}${t}`),t}function Qt(e){return Es?Ls(e):xs(e)}var Kr=e=>String(e).split(/[/\\]/).pop(),Qr=e=>String(e).startsWith("file:");function As(e){return Array.isArray(e)&&e.length>0}var J=As;function Xr(e,t){if(!t)return;let r=Kr(t).toLowerCase();return e.find(({filenames:n})=>n?.some(i=>i.toLowerCase()===r))??e.find(({extensions:n})=>n?.some(i=>r.endsWith(i)))}function Ps(e,t){if(t)return e.find(({name:r})=>r.toLowerCase()===t)??e.find(({aliases:r})=>r?.includes(t))??e.find(({extensions:r})=>r?.includes(`.${t}`))}var Ns=void 0;function Jr(e,t){if(t){if(Qr(t))try{t=Qt(t)}catch{return}if(typeof t=="string")return e.find(({isSupported:r})=>r?.({filepath:t}))}}function Ds(e,t){let r=jr(0,e.plugins).flatMap(i=>i.languages??[]);return(Ps(r,t.language)??Xr(r,t.physicalFile)??Xr(r,t.file)??Jr(r,t.physicalFile)??Jr(r,t.file)??Ns?.(r,t.physicalFile))?.parsers[0]}var St=Ds;var vt=Symbol.for("PRETTIER_IS_FRONT_MATTER");function Is(e){return!!e?.[vt]}var ae=Is;function Rs(e){return T(0,e,/[^\n]/g," ")}var Ct=Rs;var Ue=3;function Os(e){let t=e.slice(0,Ue);if(t!=="---"&&t!=="+++")return;let r=e.indexOf(`
`,Ue);if(r===-1)return;let n=e.slice(Ue,r).trim(),i=e.indexOf(`
${t}`,r),s=n;if(s||(s=t==="+++"?"toml":"yaml"),i===-1&&t==="---"&&s==="yaml"&&(i=e.indexOf(`
...`,r)),i===-1)return;let a=i+1+Ue,o=e.charAt(a+1);if(!/\s?/.test(o))return;let l=e.slice(0,a),c;return{language:s,explicitLanguage:n||null,value:e.slice(r+1,i),startDelimiter:t,endDelimiter:l.slice(-Ue),raw:l,start:{line:1,column:0,index:0},end:{index:l.length,get line(){return c??(c=l.split(`
`)),c.length},get column(){return c??(c=l.split(`
`)),I(0,c,-1).length}},[vt]:!0}}function Ms(e){let t=Os(e);return t?{frontMatter:t,get content(){let{raw:r}=t;return Ct(r)+e.slice(r.length)}}:{content:e}}var Xt=Ms;var Zr="inline",Jt={area:"none",base:"none",basefont:"none",datalist:"none",head:"none",link:"none",meta:"none",noembed:"none",noframes:"none",param:"block",rp:"none",script:"block",style:"none",template:"inline",title:"none",html:"block",body:"block",address:"block",blockquote:"block",center:"block",dialog:"block",div:"block",figure:"block",figcaption:"block",footer:"block",form:"block",header:"block",hr:"block",legend:"block",listing:"block",main:"block",p:"block",plaintext:"block",pre:"block",search:"block",xmp:"block",slot:"contents",ruby:"ruby",rt:"ruby-text",article:"block",aside:"block",h1:"block",h2:"block",h3:"block",h4:"block",h5:"block",h6:"block",hgroup:"block",nav:"block",section:"block",dir:"block",dd:"block",dl:"block",dt:"block",menu:"block",ol:"block",ul:"block",li:"list-item",table:"table",caption:"table-caption",colgroup:"table-column-group",col:"table-column",thead:"table-header-group",tbody:"table-row-group",tfoot:"table-footer-group",tr:"table-row",td:"table-cell",th:"table-cell",input:"inline-block",button:"inline-block",fieldset:"block",details:"block",summary:"block",marquee:"inline-block",option:"block",optgroup:"block",select:"inline-block",source:"block",track:"block",meter:"inline-block",progress:"inline-block",object:"inline-block",video:"inline-block",audio:"inline-block"},en="normal",Zt={listing:"pre",plaintext:"pre",pre:"pre",xmp:"pre",nobr:"nowrap",table:"initial",textarea:"pre-wrap"};function Bs(e){return e.kind==="element"&&!e.hasExplicitNamespace&&!["html","svg"].includes(e.namespace)}var oe=Bs;var qs=e=>T(0,e,/^[\t\f\r ]*\n/g,""),er=e=>qs(P.trimEnd(e)),tn=e=>{let t=e,r=P.getLeadingWhitespace(t);r&&(t=t.slice(r.length));let n=P.getTrailingWhitespace(t);return n&&(t=t.slice(0,-n.length)),{leadingWhitespace:r,trailingWhitespace:n,text:t}};function kt(e,t){return!!(e.kind==="ieConditionalComment"&&e.lastChild&&!e.lastChild.isSelfClosing&&!e.lastChild.endSourceSpan||e.kind==="ieConditionalComment"&&!e.complete||K(e)&&e.children.some(r=>r.kind!=="text"&&r.kind!=="interpolation")||Tt(e,t)&&!O(e,t)&&e.kind!=="interpolation")}function le(e){return e.kind==="attribute"||!e.parent||!e.prev?!1:Hs(e.prev)}function Hs(e){return e.kind==="comment"&&e.value.trim()==="prettier-ignore"}function N(e){return e.kind==="text"||e.kind==="comment"}function O(e,t){return e.kind==="element"&&(e.fullName==="script"||e.fullName==="style"||e.fullName==="svg:style"||e.fullName==="svg:script"||e.fullName==="mj-style"&&t.parser==="mjml"||oe(e)&&(e.name==="script"||e.name==="style"))}function rn(e,t){return e.children&&!O(e,t)}function nn(e,t){return O(e,t)||e.kind==="interpolation"||tr(e)}function tr(e){return dn(e).startsWith("pre")}function sn(e,t){let r=n();if(r&&!e.prev&&e.parent?.tagDefinition?.ignoreFirstLf)return e.kind==="interpolation";return r;function n(){return ae(e)||e.kind==="angularControlFlowBlock"?!1:(e.kind==="text"||e.kind==="interpolation")&&e.prev&&(e.prev.kind==="text"||e.prev.kind==="interpolation")?!0:!e.parent||e.parent.cssDisplay==="none"?!1:K(e.parent)?!0:!(!e.prev&&(e.parent.kind==="root"||K(e)&&e.parent||O(e.parent,t)||Ge(e.parent,t)||!Gs(e.parent.cssDisplay))||e.prev&&!Ys(e.prev.cssDisplay))}}function an(e,t){return ae(e)||e.kind==="angularControlFlowBlock"?!1:(e.kind==="text"||e.kind==="interpolation")&&e.next&&(e.next.kind==="text"||e.next.kind==="interpolation")?!0:!e.parent||e.parent.cssDisplay==="none"?!1:K(e.parent)?!0:!(!e.next&&(e.parent.kind==="root"||K(e)&&e.parent||O(e.parent,t)||Ge(e.parent,t)||!$s(e.parent.cssDisplay))||e.next&&!js(e.next.cssDisplay))}function on(e,t){return Ks(e.cssDisplay)&&!O(e,t)}function We(e){return ae(e)||e.next&&e.sourceSpan.end&&e.sourceSpan.end.line+1<e.next.sourceSpan.start.line}function ln(e){return rr(e)||e.kind==="element"&&e.children.length>0&&(["body","script","style"].includes(e.name)||e.children.some(t=>Vs(t)))||e.firstChild&&e.firstChild===e.lastChild&&e.firstChild.kind!=="text"&&un(e.firstChild)&&(!e.lastChild.isTrailingSpaceSensitive||pn(e.lastChild))}function rr(e){return e.kind==="element"&&e.children.length>0&&(["html","head","ul","ol","select"].includes(e.name)||e.cssDisplay.startsWith("table")&&e.cssDisplay!=="table-cell")}function bt(e){return hn(e)||e.prev&&Fs(e.prev)||cn(e)}function Fs(e){return hn(e)||e.kind==="element"&&e.fullName==="br"||cn(e)}function cn(e){return un(e)&&pn(e)}function un(e){return e.hasLeadingSpaces&&(e.prev?e.prev.sourceSpan.end.line<e.sourceSpan.start.line:e.parent.kind==="root"||e.parent.startSourceSpan.end.line<e.sourceSpan.start.line)}function pn(e){return e.hasTrailingSpaces&&(e.next?e.next.sourceSpan.start.line>e.sourceSpan.end.line:e.parent.kind==="root"||e.parent.endSourceSpan&&e.parent.endSourceSpan.start.line>e.sourceSpan.end.line)}function hn(e){switch(e.kind){case"ieConditionalComment":case"comment":case"directive":rLine truncated
`||e==="\f"||e==="\r"||e===" "}var ia=/^[ \t\n\r\u000c]+/,sa=/^[, \t\n\r\u000c]+/,aa=/^[^ \t\n\r\u000c]+/,oa=/[,]+$/,Pn=/^\d+$/,la=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/;function ca(e){let t=e.length,r,n,i,s,a,o=0,l;function c(h){let f,g=h.exec(e.substring(o));if(g)return[f]=g,o+=f.length,f}let u=[];for(;;){if(c(sa),o>=t){if(u.length===0)throw new Error("Must contain one or more image candidate strings.");return u}l=o,r=c(aa),n=[],r.slice(-1)===","?(r=r.replace(oa,""),_()):d()}function d(){for(c(ia),i="",s="in descriptor";;){if(a=e.charAt(o),s==="in descriptor")if(An(a))i&&(n.push(i),i="",s="after descriptor");else if(a===","){o+=1,i&&n.push(i),_();return}else if(a==="(")i+=a,s="in parens";else if(a===""){i&&n.push(i),_();return}else i+=a;else if(s==="in parens")if(a===")")i+=a,s="in descriptor";else if(a===""){n.push(i),_();return}else i+=a;else if(s==="after descriptor"&&!An(a))if(a===""){_();return}else s="in descriptor",o-=1;o+=1}}function _(){let h=!1,f,g,v,W,se={},X,at,Ce,Be,Wt;for(W=0;W<n.length;W++)X=n[W],at=X[X.length-1],Ce=X.substring(0,X.length-1),Be=parseInt(Ce,10),Wt=parseFloat(Ce),Pn.test(Ce)&&at==="w"?((f||g)&&(h=!0),Be===0?h=!0:f=Be):la.test(Ce)&&at==="x"?((f||g||v)&&(h=!0),Wt<0?h=!0:g=Wt):Pn.test(Ce)&&at==="h"?((v||g)&&(h=!0),Be===0?h=!0:v=Be):h=!0;if(!h)se.source={value:r,startOffset:l},f&&(se.width={value:f}),g&&(se.density={value:g}),v&&(se.height={value:v}),u.push(se);else throw new Error(`Invalid srcset descriptor found in "${e}" at "${X}".`)}}var Nn=ca;var Dn=e=>e.node.fullName==="srcset"&&(e.parent.fullName==="img"||e.parent.fullName==="source"),In={width:"w",height:"h",density:"x"},ua=Object.keys(In);function Rn(e,t,r){let n=w(r.node),i=Nn(n),s=ua.filter(h=>i.some(f=>Y(f,h)));if(s.length>1)throw new Error("Mixed descriptor in srcset is not supported");let[a]=s,o=In[a],l=i.map(h=>h.source.value),c=Math.max(...l.map(h=>h.length)),u=i.map(h=>h[a]?String(h[a].value):""),d=u.map(h=>{let f=h.indexOf(".");return f===-1?h.length:f}),_=Math.max(...d);return j(R([",",S],l.map((h,f)=>{let g=[h],v=u[f];if(v){let W=c-h.length+1,se=_-d[f],X=" ".repeat(W+se);g.push($(X," "),v+o)}return g})))}var On=({node:e},t)=>e.fullName==="style"&&!t.parentParser&&!e.value.includes("{{"),Mn=async(e,t,r)=>j(await e(w(r.node),{parser:"css",__isHTMLStyleAttribute:!0}));var pa=new WeakMap;function ha(e,t){return ft(pa,e.root,r=>r.children.some(n=>Et(n,t)&&["ts","typescript"].includes(n.attrMap.lang)))}var H=ha;function Bn(e,t,r){let n=w(r.node);return E(`type T<${n}> = any`,e,{parser:"babel-ts",__isEmbeddedTypescriptGenericParameters:!0},q)}function qn(e,t,r,n){let i=w(r.node),s=H(r,n)?"babel-ts":"babel";return E(`function _(${i}) {}`,e,{parser:s,__isVueBindings:!0})}async function Hn(e,t,r,n){let i=w(r.node),{left:s,operator:a,right:o}=ma(i),l=H(r,n);return[C(await E(`function _(${s}) {}`,e,{parser:l?"babel-ts":"babel",__isVueForBindingLeft:!0}))," ",a," ",await E(o,e,{parser:l?"__ts_expression":"__js_expression"})]}function ma(e){let t=/(.*?)\s+(in|of)\s+(.*)/s,r=e.match(t);if(!r)return;let n={for:r[3].trim()};if(!n.for)return;let i=/,([^,\]}]*)(?:,([^,\]}]*))?$/,s=/^\(|\)$/g,a=T(0,r[1].trim(),s,""),o=a.match(i);o?(n.alias=a.replace(i,""),n.iterator1=o[1].trim(),o[2]&&(n.iterator2=o[2].trim())):n.alias=a;let l=[n.alias,n.iterator1,n.iterator2];if(!l.some((c,u)=>!c&&(u===0||l.slice(u+1).some(Boolean))))return{left:l.filter(Boolean).join(","),operator:r[2],right:n.for}}var fa=[{test:e=>e.node.fullName==="v-for",print:Hn},{test:(e,t)=>e.node.fullName==="generic"&&Et(e.parent,t),print:Bn},{test:({node:e},t)=>gn(e)||_n(e,t),print:qn},{test(e){let t=e.node.fullName;return t.startsWith("@")||t.startsWith("v-on:")},print:da},{test(e){let t=e.node.fullName;return t.startsWith(":")||t.startsWith(".")||t.startsWith("v-bind:")},print:ga},{test:e=>e.node.fullName.startsWith("v-"),print:Fn}].map(({test:e,print:t})=>({test:(r,n)=>n.parser==="vue"&&e(r,n),print:t}));async function da(e,t,r,n){try{return await Fn(e,t,r,n)}catch(a){if(a.cause?.code!=="BABEL_PARSER_SYNTAX_ERROR")throw a}let i=w(r.node),s=H(r,n)?"__vue_ts_event_binding":"__vue_event_binding";return E(i,e,{parser:s},q)}function ga(e,t,r,n){let i=w(r.node),s=H(r,n)?"__vue_ts_expression":"__vue_expression";return E(i,e,{parser:s},q)}function Fn(e,t,r,n){let i=w(r.node),s=H(r,n)?"__ts_expression":"__js_expression";return E(i,e,{parser:s},q)}var Vn=fa;var _a=[{test:Dn,print:Rn},{test:On,print:Mn},{test:Tn,print:yn},{test:bn,print:wn},{test:xn,print:Ln},...Vn,...kn].map(({test:e,print:t})=>({test:e,print:va(t)}));function Sa(e,t){let{node:r}=e,{value:n}=r;if(n)return xt(r,t)?[r.rawName,"=",n]:_a.find(({test:i})=>i(e,t))?.print}function va(e){return async(t,r,n,i)=>{let s=await e(t,r,n,i);if(s)return s=$t(s,a=>typeof a=="string"?T(0,a,'"',"&quot;"):a),[n.node.rawName,'="',C(s),'"']}}var Un=Sa;var F=e=>e.sourceSpan.start.offset,Z=e=>e.sourceSpan.end.offset;function $e(e,t){return[e.isSelfClosing?"":Ca(e,t),ue(e,t)]}function Ca(e,t){return e.lastChild&&Q(e.lastLine truncated
${e}`;var ti=new Map([["if",new Set(["else if","else"])],["else if",new Set(["else if","else"])],["for",new Set(["empty"])],["defer",new Set(["placeholder","error","loading"])],["placeholder",new Set(["placeholder","error","loading"])],["error",new Set(["placeholder","error","loading"])],["loading",new Set(["placeholder","error","loading"])],["boundary",new Set(["error"])]]);function ri(e){let t=Z(e);return e.kind==="element"&&!e.endSourceSpan&&J(e.children)?Math.max(t,ri(I(0,e.children,-1))):t}function Ze(e,t,r){let n=e.node;if(le(n)){let i=ri(n);return[B(n,t),L(P.trimEnd(t.originalText.slice(F(n)+(n.prev&&je(n.prev)?At(n).length:0),i-(n.next&&V(n.next)?pe(n,t).length:0)))),M(n,t)]}return r()}function Dt(e,t){return N(e)&&N(t)?e.isTrailingSpaceSensitive?e.hasTrailingSpaces?bt(t)?k:S:"":bt(t)?k:y:je(e)&&(le(t)||t.firstChild||t.isSelfClosing||t.kind==="element"&&t.attrs.length>0)||e.kind==="element"&&e.isSelfClosing&&V(t)?"":t.kind==="comment"&&t.isLeadingSpaceSensitive&&!t.hasLeadingSpaces?y:!t.isLeadingSpaceSensitive||bt(t)||V(t)&&e.lastChild&&Q(e.lastChild)&&e.lastChild.lastChild&&Q(e.lastChild.lastChild)?k:t.hasLeadingSpaces?S:y}function Ae(e,t,r){let{node:n}=e;if(rr(n))return[G,...e.map(()=>{let s=e.node,a=s.prev?Dt(s.prev,s):"";return[a?[a,We(s.prev)?k:""]:"",Ze(e,t,r)]},"children")];let i=n.children.map(()=>Symbol(""));return e.map(({node:s,index:a})=>{if(N(s)){if(s.prev&&N(s.prev)){let h=Dt(s.prev,s);if(h)return We(s.prev)?[k,k,Ze(e,t,r)]:[h,Ze(e,t,r)]}return Ze(e,t,r)}let o=[],l=[],c=[],u=[],d=s.prev?Dt(s.prev,s):"",_=s.next?Dt(s,s.next):"";return d&&(We(s.prev)?o.push(k,k):d===k?o.push(k):N(s.prev)?l.push(d):l.push($("",y,{groupId:i[a-1]}))),_&&(We(s)?N(s.next)&&u.push(k,k):_===k?N(s.next)&&u.push(k):c.push(_)),[...o,C([...l,C([Ze(e,t,r),...c],{id:i[a]})]),...u]},"children")}function ni(e,t,r){let{node:n}=e,i=[];Ma(e)&&i.push("} "),i.push("@",n.name);let s=Ra(n);if(n.parameters&&(s||i.push(" "),i.push("(",C(r("parameters")),")")),s)return i.push(";"),i;if(!Oa(n)){i.push(" {");let a=ii(n);n.children.length>0?(n.firstChild.hasLeadingSpaces=!0,n.lastChild.hasTrailingSpaces=!0,i.push(A([k,Ae(e,t,r)])),a&&i.push(k,"}")):a&&i.push("}")}return C(i,{shouldBreak:!0})}function ii(e){return!(e.next?.kind==="angularControlFlowBlock"&&ti.get(e.name)?.has(e.next.name))}var Ia=e=>e?.kind==="angularControlFlowBlock"&&(e.name==="case"||e.name==="default"),Ra=e=>e?.kind==="angularControlFlowBlock"&&e.name==="default never";function Oa(e){return Ia(e)&&e.endSourceSpan&&e.endSourceSpan.start.offset===e.endSourceSpan.end.offset}function Ma(e){let{previous:t}=e;return t?.kind==="angularControlFlowBlock"&&!le(t)&&!ii(t)}function si(e,t,r){return[A([y,R([";",S],e.map(r,"children"))]),y]}function ai(e,t,r){let{node:n}=e;return[me(n,t),C([n.switchValue.trim(),", ",n.type,n.cases.length>0?[",",A([S,R(S,e.map(r,"cases"))])]:"",y]),ue(n,t)]}function oi(e,t,r){let{node:n}=e;return[n.value," {",C([A([y,e.map(({node:i,isLast:s})=>{let a=[r()];return i.kind==="text"&&(i.hasLeadingSpaces&&a.unshift(S),i.hasTrailingSpaces&&!s&&a.push(S)),a},"expression")]),y]),"}"]}function li(e,t,r){let{node:n}=e;if(kt(n,t))return[B(n,t),C(Ke(e,t,r)),L(Nt(n,t)),...$e(n,t),M(n,t)];let i=n.children.length===1&&(n.firstChild.kind==="interpolation"||n.firstChild.kind==="angularIcuExpression")&&n.firstChild.isLeadingSpaceSensitive&&!n.firstChild.hasLeadingSpaces&&n.lastChild.isTrailingSpaceSensitive&&!n.lastChild.hasTrailingSpaces,s=Symbol("element-attr-group-id"),a=u=>C([C(Ke(e,t,r),{id:s}),u,$e(n,t)]);if(n.children.length===0)return a(n.hasDanglingSpaces&&n.isDanglingSpaceSensitive?S:"");let o=u=>i?Fr(u,{groupId:s}):(O(n,t)||Ge(n,t))&&n.parent.kind==="root"&&t.parser==="vue"&&!t.vueIndentScriptAndStyle?u:A(u),l=()=>i?$(y,"",{groupId:s}):n.firstChild.hasLeadingSpaces&&n.firstChild.isLeadingSpaceSensitive?S:n.firstChild.kind==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive?Hr(y):y,c=()=>(n.next?V(n.next):he(n.parent))?n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?" ":"":K(n)&&Q(n.lastChild)?"":i?$(y,"",{groupId:s}):n.lastChild.hasTrailingSpaces&&n.lastChild.isTrailingSpaceSensitive?S:(n.lastChild.kind==="comment"||n.lastChild.kind==="text"&&n.isWhitespaceSensitive&&n.isIndentationSensitive)&&new RegExp(`\\n[\\t ]{${t.tabWidth*(e.ancestors.length-1)}}$`).test(n.lastChild.value)?"":y;return a([ln(n)?G:"",o([l(),Ae(e,t,r)]),c()])}function ci(e){let{node:{value:t,type:r}}=e;return r==="single"?`//${t.trimEnd()}`:["/*",L(t),"*/"]}var cr=(function(e){return e[e.RAW_TEXT=0]="RAW_TEXT",e[e.ESCAPABLE_RAW_TEXT=1]="ESCAPABLE_RAW_TEXT",e[e.PARSABLE_DATA=2]="PARSABLE_DATA",e})({});function ee(e,t=!0){if(e[0]!=":")return[null,e];let r=e.indexOf(":",1);if(r===-1){if(t)throw new Error(`Unsupported format "${e}" expecting ":namespace:name"`);return[null,e]}return[e.slice(1,r),e.slice(r+1)]}function ur(e){return ee(e)[1]==="ng-container"}function pr(e){return ee(e)[1]==="ng-content"}function Pe(e){return e===null?null:ee(e)[0]}function fLine truncated
If '${e}' is a directive input, make sure the directive is imported by the current module.`}:{error:!1}}validateAttribute(e){return e.toLowerCase().startsWith("on")?{error:!0,msg:`Binding to event attribute '${e}' is disallowed for security reasons, please use (${e.slice(2)})=...`}:{error:!1}}allKnownElementNames(){return Array.from(this._schema.keys())}allKnownAttributesOfElement(e){let t=It(e),r=this._schema.get(t)||this._schema.get("unknown");return Array.from(r.keys()).map(n=>Ga.get(n)??n)}allKnownEventsOfElement(e){let t=It(e);return Array.from(this._eventSchema.get(t)??[])}normalizeAnimationStyleProperty(e){return pi(e)}normalizeAnimationStyleValue(e,t,r){let n="",i=r.toString().trim(),s=null;if($a(e)&&r!==0&&r!=="0")if(typeof r=="number")n="px";else{let a=r.match(/^[+-]?[\d\.]+([a-z]*)$/);a&&a[1].length==0&&(s=`Please provide a CSS unit value for ${t}:${r}`)}return{error:s,value:i+n}}};function $a(e){switch(e){case"width":case"height":case"minWidth":case"minHeight":case"maxWidth":case"maxHeight":case"left":case"top":case"bottom":case"right":case"fontSize":case"outlineWidth":case"outlineOffset":case"paddingTop":case"paddingLeft":case"paddingBottom":case"paddingRight":case"marginTop":case"marginLeft":case"marginBottom":case"marginRight":case"borderRadius":case"borderWidth":case"borderTopWidth":case"borderLeftWidth":case"borderRightWidth":case"borderBottomWidth":case"textIndent":return!0;default:return!1}}var m=class{closedByChildren={};contentType;closedByParent=!1;implicitNamespacePrefix;isVoid;ignoreFirstLf;canSelfClose;preventNamespaceInheritance;constructor({closedByChildren:e,implicitNamespacePrefix:t,contentType:r=2,closedByParent:n=!1,isVoid:i=!1,ignoreFirstLf:s=!1,preventNamespaceInheritance:a=!1,canSelfClose:o=!1}={}){e&&e.length>0&&e.forEach(l=>this.closedByChildren[l]=!0),this.isVoid=i,this.closedByParent=n||i,this.implicitNamespacePrefix=t||null,this.contentType=r,this.ignoreFirstLf=s,this.preventNamespaceInheritance=a,this.canSelfClose=o??i}isClosedByChild(e){return this.isVoid||e.toLowerCase()in this.closedByChildren}getContentType(e){return typeof this.contentType=="object"?(e===void 0?void 0:this.contentType[e])??this.contentType.default:this.contentType}},di,tt;function Ne(e){return tt||(di=new m({canSelfClose:!0}),tt=Object.assign(Object.create(null),{base:new m({isVoid:!0}),meta:new m({isVoid:!0}),area:new m({isVoid:!0}),embed:new m({isVoid:!0}),link:new m({isVoid:!0}),img:new m({isVoid:!0}),input:new m({isVoid:!0}),param:new m({isVoid:!0}),hr:new m({isVoid:!0}),br:new m({isVoid:!0}),source:new m({isVoid:!0}),track:new m({isVoid:!0}),wbr:new m({isVoid:!0}),p:new m({closedByChildren:["address","article","aside","blockquote","div","dl","fieldset","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","main","nav","ol","p","pre","section","table","ul"],closedByParent:!0}),thead:new m({closedByChildren:["tbody","tfoot"]}),tbody:new m({closedByChildren:["tbody","tfoot"],closedByParent:!0}),tfoot:new m({closedByChildren:["tbody"],closedByParent:!0}),tr:new m({closedByChildren:["tr"],closedByParent:!0}),td:new m({closedByChildren:["td","th"],closedByParent:!0}),th:new m({closedByChildren:["td","th"],closedByParent:!0}),col:new m({isVoid:!0}),svg:new m({implicitNamespacePrefix:"svg"}),foreignObject:new m({implicitNamespacePrefix:"svg",preventNamespaceInheritance:!0}),math:new m({implicitNamespacePrefix:"math"}),li:new m({closedByChildren:["li"],closedByParent:!0}),dt:new m({closedByChildren:["dt","dd"]}),dd:new m({closedByChildren:["dt","dd"],closedByParent:!0}),rb:new m({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rt:new m({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),rtc:new m({closedByChildren:["rb","rtc","rp"],closedByParent:!0}),rp:new m({closedByChildren:["rb","rt","rtc","rp"],closedByParent:!0}),optgroup:new m({closedByChildren:["optgroup"],closedByParent:!0}),option:new m({closedByChildren:["option","optgroup"],closedByParent:!0}),pre:new m({ignoreFirstLf:!0}),listing:new m({ignoreFirstLf:!0}),style:new m({contentType:0}),script:new m({contentType:0}),title:new m({contentType:{default:1,svg:2}}),textarea:new m({contentType:1,ignoreFirstLf:!0})}),new fi().allKnownElementNames().forEach(t=>{!tt[t]&&Pe(t)===null&&(tt[t]=new m({canSelfClose:!1}))})),tt[e]??di}var De=class gi{file;offset;line;col;constructor(t,r,n,i){this.file=t,this.offset=r,this.line=n,this.col=i}toString(){return this.offset!=null?`${this.file.url}@${this.line}:${this.col}`:this.file.url}moveBy(t){let r=this.file.content,n=r.length,i=this.offset,s=this.line,a=this.col;for(;i>0&&t<0;)if(i--,t++,r.charCodeAt(i)==10){s--;let o=r.substring(0,i-1).lastIndexOf(`
`);a=o>0?i-o:i}else a--;for(;i<n&&t>0;){let o=r.charCodeAt(i);i++,t--,o==10?(s++,a=0):a++}return new gi(this.file,i,s,a)}getContext(t,r){let n=this.file.content,i=this.offset;if(i!=null){i>n.length-1&&(i=n.length-1);let s=i,a=0,o=0;for(;a<t&&i>0&&(i--,a++,!(n[i]==`
`&&++o==r)););for(a=0,o=0;a<t&&s<n.length-1&&(s++,a++,!(n[s]==`
`&&++o==r)););return{before:n.substring(i,this.offset),after:n.substring(this.offset,s+1)}}return null}},rt=class{content;url;constructor(e,t){this.content=e,this.url=t}},p=class{start;end;fullStart;details;constructor(e,t,r=e,n=null){this.start=e,this.end=t,this.fullStart=r,this.details=n}toString(){return this.start.file.content.substring(this.start.offset,this.end.offset)}},ja=(function(e){return e[e.WARNING=0]="WARNING",e[e.ERROR=1]="ERROR",e})({}),re=class extends Error{span;msg;level;relatedError;constructor(e,t,r=1,n){super(t),this.span=e,this.msg=t,this.level=r,this.relatedError=n,Object.setPrototypeOf(this,new.target.prototype)}contextualMessage(){let e=this.span.start.getContext(100,3);return e?`${this.msg} ("${e.before}[${ja[this.level]} ->]${e.after}")`:this.msg}toString(){let e=this.span.details?`, ${this.span.details}`:"";return`${this.contextualMessage()}: ${this.span.start}${e}`}};var de=class{sourceSpan;i18n;constructor(e,t){this.sourceSpan=e,this.i18n=t}},_i=class extends de{value;tokens;constructor(e,t,r,n){super(t,n),this.value=e,this.tokens=r}visit(e,t){return e.visitText(this,t)}kind="text"},Si=class extends de{value;tokens;constructor(e,t,r,n){super(t,n),this.value=e,this.tokens=r}visit(e,t){return e.visitCdata(this,t)}kind="cdata"},vi=class extends de{switchValue;type;cases;switchValueSourceSpan;constructor(e,t,r,n,i,s){super(n,s),this.switchValue=e,this.type=t,this.cases=r,this.switchValueSourceSpan=i}visit(e,t){return e.visitExpansion(this,t)}kind="expansion"},Ci=class{value;expression;sourceSpan;valueSourceSpan;expSourceSpan;constructor(e,t,r,n,i){this.value=e,this.expression=t,this.sourceSpan=r,this.valueSourceSpan=n,this.expSourceSpan=i}visit(e,t){return e.visitExpansionCase(this,t)}kind="expansionCase"},ki=class extends de{name;value;keySpan;valueSpan;valueTokens;constructor(e,t,r,n,i,s,a){super(r,a),this.name=e,this.value=t,this.keySpan=n,this.valueSpan=i,this.valueTokens=s}visit(e,t){return e.visitAttribute(this,t)}kind="attribute";get nameSpan(){return this.keySpan}},bi=class{value;type;sourceSpan;constructor(e,t,r){this.value=e,this.type=t,this.sourceSpan=r}visit(e,t){return e.visitStartTagComment?e.visitStartTagComment(this,t):void 0}kind="startTagComment"},ne=class extends de{name;attrs;directives;children;isSelfClosing;startSourceSpan;endSourceSpan;nameSpan;isVoid;comments;constructor(e,t,r,n,i,s,a,o=null,l=null,c,u,d=[]){super(s,u),this.name=e,this.attrs=t,this.directives=r,this.children=n,this.isSelfClosing=i,this.startSourceSpan=a,this.endSourceSpan=o,this.nameSpan=l,this.isVoid=c,this.comments=d}visit(e,t){return e.visitElement(this,t)}kind="element"},wi=class{value;sourceSpan;constructor(e,t){this.value=e,this.sourceSpan=t}visit(e,t){return e.visitComment(this,t)}kind="comment"},Ti=class{value;sourceSpan;constructor(e,t){this.value=e,this.sourceSpan=t}visit(e,t){return e.visitDocType(this,t)}kind="docType"},ge=class extends de{name;parameters;children;nameSpan;startSourceSpan;endSourceSpan;constructor(e,t,r,n,i,s,a=null,o){super(n,o),this.name=e,this.parameters=t,this.children=r,this.nameSpan=i,this.startSourceSpan=s,this.endSourceSpan=a}visit(e,t){return e.visitBlock(this,t)}kind="block"},U=class extends de{componentName;tagName;fullName;attrs;directives;children;isSelfClosing;startSourceSpan;endSourceSpan;comments;constructor(e,t,r,n,i,s,a,o,l,c=null,u,d=[]){super(o,u),this.componentName=e,this.tagName=t,this.fullName=r,this.attrs=n,this.directives=i,this.children=s,this.isSelfClosing=a,this.startSourceSpan=l,this.endSourceSpan=c,this.comments=d}visit(e,t){return e.visitComponent(this,t)}kind="component"},yi=class{name;attrs;sourceSpan;startSourceSpan;endSourceSpan;constructor(e,t,r,n,i=null){this.name=e,this.attrs=t,this.sourceSpan=r,this.startSourceSpan=n,this.endSourceSpan=i}visit(e,t){return e.visitDirective(this,t)}kind="directive"},dr=class{expression;sourceSpan;constructor(e,t){this.expression=e,this.sourceSpan=t}visit(e,t){return e.visitBlockParameter(this,t)}kind="blockParameter";startSourceSpan=null;endSourceSpan=null},gr=class{name;value;sourceSpan;nameSpan;valueSpan;constructor(e,t,r,n,i){this.name=e,this.value=t,this.sourceSpan=r,this.nameSpan=n,this.valueSpan=i}visit(e,t){return e.visitLetDeclaration(this,t)}kind="letDeclaration";startSourceSpan=null;endSourceSpan=null};function Rt(e,t,r=null){let n=[],i=e.visit?s=>e.visit(s,r)||s.visit(e,r):s=>s.visit(e,r);return t.forEach(s=>{let a=i(s);a&&n.push(a)}),n}var _r=class{constructor(){}visitElement(e,t){this.visitChildren(t,r=>{r(e.attrs),r(e.directives),r(e.comments),r(e.children)})}visitAttribute(e,t){}visitStartTagComment(e,t){}visitText(e,t){}visitCdata(e,t){}visitComment(e,t){}visitDocType(e,t){}visitExpansion(e,t){return this.visitChildren(t,r=>{r(e.cases)})}visitExpansionCase(e,t){}visitBlock(e,t){this.visitChildren(t,r=>{r(e.parameters),r(e.children)})}visitBlockParameter(e,t){}visitLetDeclaration(e,t){}visitComponent(e,t){this.visitChildren(t,r=>{r(e.attrs),r(e.comments),r(e.children)})}visitDLine truncated
`,Nfr:"\u{1D511}",NoBreak:"\u2060",NonBreakingSpace:"\xA0",nbsp:"\xA0",Nopf:"\u2115",naturals:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",nequiv:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",npar:"\u2226",nparallel:"\u2226",nshortparallel:"\u2226",nspar:"\u2226",NotElement:"\u2209",notin:"\u2209",notinva:"\u2209",NotEqual:"\u2260",ne:"\u2260",NotEqualTilde:"\u2242\u0338",nesim:"\u2242\u0338",NotExists:"\u2204",nexist:"\u2204",nexists:"\u2204",NotGreater:"\u226F",ngt:"\u226F",ngtr:"\u226F",NotGreaterEqual:"\u2271",nge:"\u2271",ngeq:"\u2271",NotGreaterFullEqual:"\u2267\u0338",ngE:"\u2267\u0338",ngeqq:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",nGtv:"\u226B\u0338",NotGreaterLess:"\u2279",ntgl:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",NotGreaterTilde:"\u2275",ngsim:"\u2275",NotHumpDownHump:"\u224E\u0338",nbump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",nbumpe:"\u224F\u0338",NotLeftTriangle:"\u22EA",nltri:"\u22EA",ntriangleleft:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",nltrie:"\u22EC",ntrianglelefteq:"\u22EC",NotLess:"\u226E",nless:"\u226E",nlt:"\u226E",NotLessEqual:"\u2270",nle:"\u2270",nleq:"\u2270",NotLessGreater:"\u2278",ntlg:"\u2278",NotLessLess:"\u226A\u0338",nLtv:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",NotLessTilde:"\u2274",nlsim:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",npr:"\u2280",nprec:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",npre:"\u2AAF\u0338",npreceq:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",nprcue:"\u22E0",NotReverseElement:"\u220C",notni:"\u220C",notniva:"\u220C",NotRightTriangle:"\u22EB",nrtri:"\u22EB",ntriangleright:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",nrtrie:"\u22ED",ntrianglerighteq:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",nsqsube:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",nsqsupe:"\u22E3",NotSubset:"\u2282\u20D2",nsubset:"\u2282\u20D2",vnsub:"\u2282\u20D2",NotSubsetEqual:"\u2288",nsube:"\u2288",nsubseteq:"\u2288",NotSucceeds:"\u2281",nsc:"\u2281",nsucc:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",nsce:"\u2AB0\u0338",nsucceq:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",nsccue:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",nsupset:"\u2283\u20D2",vnsup:"\u2283\u20D2",NotSupersetEqual:"\u2289",nsupe:"\u2289",nsupseteq:"\u2289",NotTilde:"\u2241",nsim:"\u2241",NotTildeEqual:"\u2244",nsime:"\u2244",nsimeq:"\u2244",NotTildeFullEqual:"\u2247",ncong:"\u2247",NotTildeTilde:"\u2249",nap:"\u2249",napprox:"\u2249",NotVerticalBar:"\u2224",nmid:"\u2224",nshortmid:"\u2224",nsmid:"\u2224",Nscr:"\u{1D4A9}",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\u{1D512}",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",ohm:"\u03A9",Omicron:"\u039F",Oopf:"\u{1D546}",OpenCurlyDoubleQuote:"\u201C",ldquo:"\u201C",OpenCurlyQuote:"\u2018",lsquo:"\u2018",Or:"\u2A54",Oscr:"\u{1D4AA}",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",oline:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",tbrk:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",part:"\u2202",Pcy:"\u041F",Pfr:"\u{1D513}",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",plusmn:"\xB1",pm:"\xB1",Popf:"\u2119",primes:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",pr:"\u227A",prec:"\u227A",PrecedesEqual:"\u2AAF",pre:"\u2AAF",preceq:"\u2AAF",PrecedesSlantEqual:"\u227C",prcue:"\u227C",preccurlyeq:"\u227C",PrecedesTilde:"\u227E",precsim:"\u227E",prsim:"\u227E",Prime:"\u2033",Product:"\u220F",prod:"\u220F",Proportional:"\u221D",prop:"\u221D",propto:"\u221D",varpropto:"\u221D",vprop:"\u221D",Pscr:"\u{1D4AB}",Psi:"\u03A8",QUOT:'"',quot:'"',Qfr:"\u{1D514}",Qopf:"\u211A",rationals:"\u211A",Qscr:"\u{1D4AC}",RBarr:"\u2910",drbkarow:"\u2910",REG:"\xAE",circledR:"\xAE",reg:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",twoheadrightarrow:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",Rfr:"\u211C",real:"\u211C",realpart:"\u211C",ReverseElement:"\u220B",SuchThat:"\u220B",ni:"\u220B",niv:"\u220B",ReverseEquilibrium:"\u21CB",leftrightharpoons:"\u21CB",lrhar:"\u21CB",ReverseUpEquilibrium:"\u296F",duhar:"\u296F",Rho:"\u03A1",RightAngleBracket:"\u27E9",rang:"\u27E9",rangle:"\u27E9",RightArrow:"\u2192",ShortRightArrow:"\u2192",rarr:"\u2192",rightarrow:"\u2192",srarr:"\u2192",RightArrowBar:"\u21E5",rarrb:"\u21E5",RightArrowLeftArrow:"\u21C4",rightleftarrows:"\u21C4",rlarr:"\u21C4",RightCeiling:"\u2309",rceil:"\u2309",RightDoubleBracket:"\u27E7",robrk:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",dharr:"\u21C2",downharpoonright:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rfloor:"\u230B",RightTee:"\u22A2",vdash:"\u22A2",RightTeeArrow:"\u21A6",map:"\u21A6",mapsto:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",vartriangleright:"\u22B3",vLine truncated
`)}tokenize(){for(;this._cursor.peek()!==0;){let e=this._cursor.clone();try{if(this._attemptCharCode(60))if(this._attemptCharCode(33))this._attemptStr("[CDATA[")?this._consumeCdata(e):this._attemptStr("--")?this._consumeComment(e):this._attemptStrCaseInsensitive("doctype")?this._consumeDocType(e):this._consumeBogusComment(e);else if(this._attemptCharCode(47))this._consumeTagClose(e);else{let t=this._cursor.clone();this._attemptCharCode(63)?(this._cursor=t,this._consumeBogusComment(e)):this._consumeTagOpen(e)}else this._tokenizeLet&&this._cursor.peek()===64&&!this._inInterpolation&&this._isLetStart()?this._consumeLetDeclaration(e):this._tokenizeBlocks&&this._isBlockStart()?this._consumeBlockStart(e):this._tokenizeBlocks&&!this._inInterpolation&&!this._isInExpansionCase()&&!this._isInExpansionForm()&&this._attemptCharCode(125)?this._consumeBlockEnd(e):this._tokenizeIcu&&this._tokenizeExpansionForm()||this._consumeWithInterpolation(5,8,()=>this._isTextEnd(),()=>this._isTagStart())}catch(t){this.handleError(t)}}this._beginToken(44),this._endToken([])}_getBlockName(){let e=!1,t=this._cursor.clone();this._attemptCharCodeUntilFn(n=>nt(n)?!e:ao(n)?(e=!0,!1):!0);let r=this._cursor.getChars(t).trim();return Za.test(r)?r="else if":Ja.test(r)&&(r="default never"),r}_consumeBlockStart(e){this._requireCharCode(64),this._beginToken(26,e);let t=this._endToken([this._getBlockName()]);if(this._cursor.peek()===40)if(this._cursor.advance(),this._consumeBlockParameters(),this._attemptCharCodeUntilFn(b),this._attemptCharCode(41))this._attemptCharCodeUntilFn(b);else{t.type=30;return}if(t.parts[0]==="default never"&&this._attemptCharCode(59)){this._beginToken(27),this._endToken([]),this._beginToken(28),this._endToken([]);return}this._attemptCharCode(123)?(this._beginToken(27),this._endToken([])):this._isBlockStart()&&(t.parts[0]==="case"||t.parts[0]==="default")?(this._beginToken(27),this._endToken([]),this._beginToken(28),this._endToken([])):t.type=30}_consumeBlockEnd(e){this._beginToken(28,e),this._endToken([])}_consumeBlockParameters(){for(this._attemptCharCodeUntilFn(Ai);this._cursor.peek()!==41&&this._cursor.peek()!==0;){this._beginToken(29);let e=this._cursor.clone(),t=null,r=0;for(;this._cursor.peek()!==59&&this._cursor.peek()!==0||t!==null;){let n=this._cursor.peek();if(n===92)this._cursor.advance();else if(n===t)t=null;else if(t===null&&Ot(n))t=n;else if(n===40&&t===null)r++;else if(n===41&&t===null){if(r===0)break;r>0&&r--}this._cursor.advance()}this._endToken([this._cursor.getChars(e)]),this._attemptCharCodeUntilFn(Ai)}}_consumeLetDeclaration(e){if(this._requireStr("@let"),this._beginToken(31,e),nt(this._cursor.peek()))this._attemptCharCodeUntilFn(b);else{let r=this._endToken([this._cursor.getChars(e)]);r.type=34;return}let t=this._endToken([this._getLetDeclarationName()]);if(this._attemptCharCodeUntilFn(b),!this._attemptCharCode(61)){t.type=34;return}this._attemptCharCodeUntilFn(r=>b(r)&&!Oe(r)),this._consumeLetDeclarationValue(),this._cursor.peek()===59?(this._beginToken(33),this._cursor.advance(),this._endToken([])):(t.type=34,t.sourceSpan=this._cursor.getSpan(e))}_getLetDeclarationName(){let e=this._cursor.clone(),t=!1;return this._attemptCharCodeUntilFn(r=>Re(r)||r===36||r===95||t&&Ie(r)?(t=!0,!1):!0),this._cursor.getChars(e).trim()}_consumeLetDeclarationValue(){let e=this._cursor.clone();this._beginToken(32,e),this._attemptUntilIgnoreQuotes(t=>t===59),this._endToken([this._cursor.getChars(e)])}_tokenizeExpansionForm(){if(this.isExpansionFormStart())return this._consumeExpansionFormStart(),!0;if(io(this._cursor.peek())&&this._isInExpansionForm())return this._consumeExpansionCaseStart(),!0;if(this._cursor.peek()===125){if(this._isInExpansionCase())return this._consumeExpansionCaseEnd(),!0;if(this._isInExpansionForm())return this._consumeExpansionFormEnd(),!0}return!1}_beginToken(e,t=this._cursor.clone()){this._currentTokenStart=t,this._currentTokenType=e}_endToken(e,t){if(this._currentTokenStart===null)throw new re(this._cursor.getSpan(t),"Programming error - attempted to end a token when there was no start to the token");if(this._currentTokenType===null)throw new re(this._cursor.getSpan(this._currentTokenStart),"Programming error - attempted to end a token which has no token type");let r={type:this._currentTokenType,parts:e,sourceSpan:(t??this._cursor).getSpan(this._currentTokenStart,this._leadingTriviaCodePoints)};return this.tokens.push(r),this._currentTokenStart=null,this._currentTokenType=null,r}_createError(e,t){this._isInExpansionForm()&&(e+=` (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)`);let r=new re(t,e);return this._currentTokenStart=null,this._currentTokenType=null,r}handleError(e){if(e instanceof kr&&(e=this._createError(e.msg,this._cursor.getSpan(e.cursor))),e instanceof re)this.errors.push(e);else throw e}_attemptCharCode(e){return this._cursor.peek()===e?(this._cursor.advance(),!0):!1}_attemptCharCodeCaseInsensitive(e){return so(this._cursor.peek(),e)?(this._cursorLine truncated
`){var n;let i=this._getClosestElementLikeParent();i!=null&&i.children.length==0&&(!((n=this._getTagDefinition(i))===null||n===void 0)&&n.ignoreFirstLf)&&(r=r.substring(1))}return r}_consumeText(t){let r=[t],n=t.sourceSpan,i=t.parts[0];if(i.length>0&&i[0]===`
`){var s;let a=this._getContainer();a!=null&&a.children.length===0&&(!((s=this._getTagDefinition(a))===null||s===void 0)&&s.ignoreFirstLf)&&(i=i.substring(1),r[0]={type:t.type,sourceSpan:t.sourceSpan,parts:[i]})}for(;this._peek.type===8||this._peek.type===5||this._peek.type===9;)t=this._advance(),r.push(t),t.type===8?i+=t.parts.join("").replace(/&([^;]+);/g,Oi):t.type===9?i+=t.parts[0]:i+=t.parts.join("");if(i.length>0){let a=t.sourceSpan;this._addToParent(new _i(i,new p(n.start,a.end,n.fullStart,n.details),r))}}_closeVoidElement(){var t;let r=this._getContainer();r!==null&&(!((t=this._getTagDefinition(r))===null||t===void 0)&&t.isVoid)&&this._containerStack.pop()}_consumeElementStartTag(t){var r;let n=[],i=[],s=[];this._consumeAttributesAndDirectives(n,i,s);let a=this._getElementFullName(t,this._getClosestElementLikeParent()),o=this._getTagDefinition(a),l=!1;if(this._peek.type===2){this._advance(),l=!0;let v=this._getTagDefinition(a);this.canSelfClose||v?.canSelfClose||Pe(a)!==null||v?.isVoid||this.errors.push(x.create(a,t.sourceSpan,`Only void, custom and foreign elements can be self closed "${t.parts[1]}"`))}else this._peek.type===1&&(this._advance(),l=!1);let c=this._peek.sourceSpan.fullStart,u=new p(t.sourceSpan.start,c,t.sourceSpan.fullStart),d=new p(t.sourceSpan.start,c,t.sourceSpan.fullStart),_=new p(t.sourceSpan.start.moveBy(1),t.sourceSpan.end),h=new ne(a,n,i,[],l,u,d,void 0,_,o?.isVoid??!1,void 0,s),f=this._getContainer(),g=f!==null&&!!(!((r=this._getTagDefinition(f))===null||r===void 0)&&r.isClosedByChild(h.name));this._pushContainer(h,g),l?this._popContainer(a,ne,u):t.type===4&&(this._popContainer(a,ne,null),this.errors.push(x.create(a,u,`Opening tag "${a}" not terminated.`)))}_consumeComponentStartTag(t){var r;let n=t.parts[0],i=[],s=[],a=[];this._consumeAttributesAndDirectives(i,s,a);let o=this._getClosestElementLikeParent(),l=this._getComponentTagName(t,o),c=this._getComponentFullName(t,o),u=this._peek.type===37;this._advance();let d=this._peek.sourceSpan.fullStart,_=new p(t.sourceSpan.start,d,t.sourceSpan.fullStart),h=new p(t.sourceSpan.start,d,t.sourceSpan.fullStart),f=new U(n,l,c,i,s,[],u,_,h,void 0,void 0,a),g=this._getContainer(),v=g!==null&&f.tagName!==null&&!!(!((r=this._getTagDefinition(g))===null||r===void 0)&&r.isClosedByChild(f.tagName));this._pushContainer(f,v),u?this._popContainer(c,U,_):t.type===39&&(this._popContainer(c,U,null),this.errors.push(x.create(c,_,`Opening tag "${c}" not terminated.`)))}_consumeAttributesAndDirectives(t,r,n){for(;this._peek.type===15||this._peek.type===40||this._peek.type===12;)if(this._peek.type===40)r.push(this._consumeDirective(this._peek));else if(this._peek.type===15)t.push(this._consumeAttr(this._advance()));else{let i=this._advance();n.push(new bi(i.parts[0],i.parts[1],i.sourceSpan))}}_consumeComponentEndTag(t){let r=this._getComponentFullName(t,this._getClosestElementLikeParent());if(!this._popContainer(r,U,t.sourceSpan)){let n=this._containerStack[this._containerStack.length-1],i;n instanceof U&&n.componentName===t.parts[0]?i=`, did you mean "${n.fullName}"?`:i=". It may happen when the tag has already been closed by another tag.";let s=`Unexpected closing tag "${r}"${i}`;this.errors.push(x.create(r,t.sourceSpan,s))}}_getTagDefinition(t){return typeof t=="string"?this.tagDefinitionResolver(t):t instanceof ne?this.tagDefinitionResolver(t.name):t instanceof U&&t.tagName!==null?this.tagDefinitionResolver(t.tagName):null}_pushContainer(t,r){r&&this._containerStack.pop(),this._addToParent(t),this._containerStack.push(t)}_consumeElementEndTag(t){var r;let n=this.allowHtmComponentClosingTags&&t.parts.length===0?null:this._getElementFullName(t,this._getClosestElementLikeParent());if(n&&(!((r=this._getTagDefinition(n))===null||r===void 0)&&r.isVoid))this.errors.push(x.create(n,t.sourceSpan,`Void elements do not have end tags "${t.parts[1]}"`));else if(!this._popContainer(n,ne,t.sourceSpan)){let i=`Unexpected closing tag "${n}". It may happen when the tag has already been closed by another tag. For more info see https://www.w3.org/TR/html5/syntax.html#closing-elements-that-have-implied-end-tags`;this.errors.push(x.create(n,t.sourceSpan,i))}}_popContainer(t,r,n){let i=!1;for(let a=this._containerStack.length-1;a>=0;a--){var s;let o=this._containerStack[a],l=o instanceof U?o.fullName:o.name;if(Pe(l)?l===t:(l===t||t===null)&&o instanceof r)return o.endSourceSpan=n,o.sourceSpan.end=n!==null?n.end:o.sourceSpan.end,this._containerStack.splice(a,this._containerStack.length-a),!i;(o instanceof ge||!(!((s=this._getTagDefinition(o))===null||s===void 0)&&s.closedByParent))&&(i=!0)}return!1}_consumeAttr(t){let r=fe(t.parts[0],t.parts[1]),n=t.sourceSpan.end,i;this._peek.type===16&&(i=this._advance());let s="",a=[],o,l;if(this._peek.type===17)for(o=this._peek.sourceSpan,l=this._peek.sourceSpan.end;this._peek.type===17||this._peek.type===18||this._peek.type===9;){let u=this._advance();a.push(u),u.type===18?s+=u.parts.join("").replace(/&([^;]+);/g,Oi):u.type===9?s+=Line truncated
`){let r=t.children[0];r.value.length===1?t.removeChild(r):r.value=r.value.slice(1)}})}function fo(e){let t=r=>r.kind==="element"&&r.prev?.kind==="ieConditionalStartComment"&&r.prev.sourceSpan.end.offset===r.startSourceSpan.start.offset&&r.firstChild?.kind==="ieConditionalEndComment"&&r.firstChild.sourceSpan.start.offset===r.startSourceSpan.end.offset;e.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!t(i))continue;let s=i.prev,a=i.firstChild;r.removeChild(s),n--;let o=new p(s.sourceSpan.start,a.sourceSpan.end),l=new p(o.start,i.sourceSpan.end);i.condition=s.condition,i.sourceSpan=l,i.startSourceSpan=o,i.removeChild(a)}})}function go(e,t,r){e.walk(n=>{if(n.children)for(let i=0;i<n.children.length;i++){let s=n.children[i];if(s.kind!=="text"&&!t(s))continue;s.kind!=="text"&&(s.kind="text",s.value=r(s));let a=s.prev;!a||a.kind!=="text"||(a.value+=s.value,a.sourceSpan=new p(a.sourceSpan.start,s.sourceSpan.end),n.removeChild(s),i--)}})}function _o(e){return go(e,t=>t.kind==="cdata",t=>`<![CDATA[${t.value}]]>`)}function So(e){let t=r=>r.kind==="element"&&r.attrs.length===0&&!J(r.startTagComments)&&r.children.length===1&&r.firstChild.kind==="text"&&!P.hasWhitespaceCharacter(r.children[0].value)&&!r.firstChild.hasLeadingSpaces&&!r.firstChild.hasTrailingSpaces&&r.isLeadingSpaceSensitive&&!r.hasLeadingSpaces&&r.isTrailingSpaceSensitive&&!r.hasTrailingSpaces&&r.prev?.kind==="text"&&r.next?.kind==="text";e.walk(r=>{if(r.children)for(let n=0;n<r.children.length;n++){let i=r.children[n];if(!t(i))continue;let s=i.prev,a=i.next;s.value+=`<${i.rawName}>`+i.firstChild.value+`</${i.rawName}>`+a.value,s.sourceSpan=new p(s.sourceSpan.start,a.sourceSpan.end),s.isTrailingSpaceSensitive=a.isTrailingSpaceSensitive,s.hasTrailingSpaces=a.hasTrailingSpaces,r.removeChild(i),n--,r.removeChild(a)}})}function vo(e,t){if(t.parser==="html")return;let r=/\{\{(.+?)\}\}/s;e.walk(n=>{if(rn(n,t))for(let i of n.children){if(i.kind!=="text")continue;let s=i.sourceSpan.start,a,o=i.value.split(r);for(let l=0;l<o.length;l++,s=a){let c=o[l];if(l%2===0){a=s.moveBy(c.length),c.length>0&&n.insertChildBefore(i,{kind:"text",value:c,sourceSpan:new p(s,a)});continue}a=s.moveBy(c.length+4),n.insertChildBefore(i,{kind:"interpolation",sourceSpan:new p(s,a),children:c.length===0?[]:[{kind:"text",value:c,sourceSpan:new p(s.moveBy(2),a.moveBy(-2))}]})}n.removeChild(i)}})}function Co(e,t){e.walk(r=>{let n=r.$children;if(!n)return;if(n.length===0||n.length===1&&n[0].kind==="text"&&P.trim(n[0].value).length===0){r.hasDanglingSpaces=n.length>0,r.$children=[];return}let i=nn(r,t),s=tr(r);if(!i)for(let a=0;a<n.length;a++){let o=n[a];if(o.kind!=="text")continue;let{leadingWhitespace:l,text:c,trailingWhitespace:u}=tn(o.value),d=o.prev,_=o.next;c?(o.value=c,o.sourceSpan=new p(o.sourceSpan.start.moveBy(l.length),o.sourceSpan.end.moveBy(-u.length)),l&&(d&&(d.hasTrailingSpaces=!0),o.hasLeadingSpaces=!0),u&&(o.hasTrailingSpaces=!0,_&&(_.hasLeadingSpaces=!0))):(r.removeChild(o),a--,(l||u)&&(d&&(d.hasTrailingSpaces=!0),_&&(_.hasLeadingSpaces=!0)))}r.isWhitespaceSensitive=i,r.isIndentationSensitive=s})}function ko(e){e.walk(t=>{t.isSelfClosing=!t.children||t.kind==="element"&&(t.tagDefinition.isVoid||t.endSourceSpan&&t.startSourceSpan.start===t.endSourceSpan.start&&t.startSourceSpan.end===t.endSourceSpan.end)})}function bo(e,t){e.walk(r=>{r.kind==="element"&&(r.hasHtmComponentClosingTag=r.endSourceSpan&&/^<\s*\/\s*\/\s*>$/.test(t.originalText.slice(r.endSourceSpan.start.offset,r.endSourceSpan.end.offset)))})}function wo(e,t){e.walk(r=>{r.cssDisplay=fn(r,t)})}function To(e,t){e.walk(r=>{let{children:n}=r;if(n){if(n.length===0){r.isDanglingSpaceSensitive=on(r,t);return}for(let i of n)i.isLeadingSpaceSensitive=sn(i,t),i.isTrailingSpaceSensitive=an(i,t);for(let i=0;i<n.length;i++){let s=n[i];s.isLeadingSpaceSensitive=(i===0||s.prev.isTrailingSpaceSensitive)&&s.isLeadingSpaceSensitive,s.isTrailingSpaceSensitive=(i===n.length-1||s.next.isLeadingSpaceSensitive)&&s.isTrailingSpaceSensitive}}})}var Fi=ho;function yo(e,t,r){let{node:n}=e;switch(n.kind){case"root":return t.__onHtmlRoot&&t.__onHtmlRoot(n),[C(Ae(e,t,r)),k];case"element":case"ieConditionalComment":return li(e,t,r);case"angularControlFlowBlock":return ni(e,t,r);case"angularControlFlowBlockParameters":return si(e,t,r);case"angularControlFlowBlockParameter":return P.trim(n.expression);case"angularLetDeclaration":return C(["@let ",C([n.id," =",C(A([S,r("init")]))]),";"]);case"angularLetDeclarationInitializer":return n.value;case"angularIcuExpression":return ai(e,t,r);case"angularIcuCase":return oi(e,t,r);case"ieConditionalStartComment":case"ieConditionalEndComment":return[me(n),ue(n)];case"interpolation":return[me(n,t),...e.map(r,"children"),ue(n,t)];case"text":{if(n.parent.kind==="interpolation"){let o=/\n[^\S\n]*$/,l=o.test(n.value),c=l?n.value.replace(o,""):n.value;return[L(c),l?k:""]}let i=B(n,t),s=yt(n),a=M(n,t);return s[0]=[i,s[0]],s.push([s.pop(),a]),_t(s)}case"docType":return[C([me(n,t),Line truncated
@@ -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 BadgeCent = createLucideIcon("BadgeCent", [
[
"path",
{
d: "M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",
key: "3c2336"
}
],
["path", { d: "M12 7v10", key: "jspqdw" }],
["path", { d: "M15.4 10a4 4 0 1 0 0 4", key: "2eqtx8" }]
]);
export { BadgeCent as default };
//# sourceMappingURL=badge-cent.js.map
@@ -0,0 +1,935 @@
let source, pos, end,
openTokenDepth,
lastTokenPos,
openTokenPosStack,
openClassPosStack,
curDynamicImport,
templateStackDepth,
facade,
lastSlashWasDivision,
nextBraceIsClass,
templateDepth,
templateStack,
imports,
exports,
name;
function addImport (ss, s, e, d) {
const impt = { ss, se: d === -2 ? e : d === -1 ? e + 1 : 0, s, e, d, a: -1, n: undefined, at: null };
imports.push(impt);
return impt;
}
function addExport (s, e, ls, le) {
exports.push({
s,
e,
ls,
le,
n: s[0] === '"' ? readString(s, '"') : s[0] === "'" ? readString(s, "'") : source.slice(s, e),
ln: ls[0] === '"' ? readString(ls, '"') : ls[0] === "'" ? readString(ls, "'") : source.slice(ls, le)
});
}
function readName (impt) {
let { d, s } = impt;
if (d !== -1)
s++;
impt.n = readString(s, source.charCodeAt(s - 1));
}
// Note: parsing is based on the _assumption_ that the source is already valid
export function parse (_source, _name) {
openTokenDepth = 0;
curDynamicImport = null;
templateDepth = -1;
lastTokenPos = -1;
lastSlashWasDivision = false;
templateStack = Array(1024);
templateStackDepth = 0;
openTokenPosStack = Array(1024);
openClassPosStack = Array(1024);
nextBraceIsClass = false;
facade = true;
name = _name || '@';
imports = [];
exports = [];
source = _source;
pos = -1;
end = source.length - 1;
let ch = 0;
// start with a pure "module-only" parser
m: while (pos++ < end) {
ch = source.charCodeAt(pos);
if (ch === 32 || ch < 14 && ch > 8)
continue;
switch (ch) {
case 101/*e*/:
if (openTokenDepth === 0 && keywordStart(pos) && source.startsWith('xport', pos + 1)) {
tryParseExportStatement();
// export might have been a non-pure declaration
if (!facade) {
lastTokenPos = pos;
break m;
}
}
break;
case 105/*i*/:
if (keywordStart(pos) && source.startsWith('mport', pos + 1))
tryParseImportStatement();
break;
case 59/*;*/:
break;
case 47/*/*/: {
const next_ch = source.charCodeAt(pos + 1);
if (next_ch === 47/*/*/) {
lineComment();
// dont update lastToken
continue;
}
else if (next_ch === 42/***/) {
blockComment(true);
// dont update lastToken
continue;
}
// fallthrough
}
default:
// as soon as we hit a non-module token, we go to main parser
facade = false;
pos--;
break m;
}
lastTokenPos = pos;
}
while (pos++ < end) {
ch = source.charCodeAt(pos);
if (ch === 32 || ch < 14 && ch > 8)
continue;
switch (ch) {
case 101/*e*/:
if (openTokenDepth === 0 && keywordStart(pos) && source.startsWith('xport', pos + 1))
tryParseExportStatement();
break;
case 105/*i*/:
if (keywordStart(pos) && source.startsWith('mport', pos + 1))
tryParseImportStatement();
break;
case 99/*c*/:
if (keywordStart(pos) && source.startsWith('lass', pos + 1) && isBrOrWs(source.charCodeAt(pos + 5)))
nextBraceIsClass = true;
break;
case 40/*(*/:
openTokenPosStack[openTokenDepth++] = lastTokenPos;
break;
case 41/*)*/:
if (openTokenDepth === 0)
syntaxError();
openTokenDepth--;
if (curDynamicImport && curDynamicImport.d === openTokenPosStack[openTokenDepth]) {
if (curDynamicImport.e === 0)
curDynamicImport.e = pos;
curDynamicImport.se = pos;
curDynamicImport = null;
}
break;
case 123/*{*/:
// dynamic import followed by { is not a dynamic import (so remove)
// this is a sneaky way to get around { import () {} } v { import () }
// block / object ambiguity without a parser (assuming source is valid)
if (source.charCodeAt(lastTokenPos) === 41/*)*/ && imports.length && imports[imports.length - 1].e === lastTokenPos) {
imports.pop();
}
openClassPosStack[openTokenDepth] = nextBraceIsClass;
nextBraceIsClass = false;
openTokenPosStack[openTokenDepth++] = lastTokenPos;
break;
case 125/*}*/:
if (openTokenDepth === 0)
syntaxError();
if (openTokenDepth-- === templateDepth) {
templateDepth = templateStack[--templateStackDepth];
templateString();
}
else {
if (templateDepth !== -1 && openTokenDepth < templateDepth)
syntaxError();
}
break;
case 39/*'*/:
case 34/*"*/:
stringLiteral(ch);
break;
case 47/*/*/: {
const next_ch = source.charCodeAt(pos + 1);
if (next_ch === 47/*/*/) {
lineComment();
// dont update lastToken
continue;
}
else if (next_ch === 42/***/) {
blockComment(true);
// dont update lastToken
continue;
}
else {
// Division / regex ambiguity handling based on checking backtrack analysis of:
// - what token came previously (lastToken)
// - if a closing brace or paren, what token came before the corresponding
// opening brace or paren (lastOpenTokenIndex)
const lastToken = source.charCodeAt(lastTokenPos);
const lastExport = exports[exports.length - 1];
if (isExpressionPunctuator(lastToken) &&
!(lastToken === 46/*.*/ && (source.charCodeAt(lastTokenPos - 1) >= 48/*0*/ && source.charCodeAt(lastTokenPos - 1) <= 57/*9*/)) &&
!(lastToken === 43/*+*/ && source.charCodeAt(lastTokenPos - 1) === 43/*+*/) && !(lastToken === 45/*-*/ && source.charCodeAt(lastTokenPos - 1) === 45/*-*/) ||
lastToken === 41/*)*/ && isParenKeyword(openTokenPosStack[openTokenDepth]) ||
lastToken === 125/*}*/ && (isExpressionTerminator(openTokenPosStack[openTokenDepth]) || openClassPosStack[openTokenDepth]) ||
lastToken === 47/*/*/ && lastSlashWasDivision ||
isExpressionKeyword(lastTokenPos) ||
!lastToken) {
regularExpression();
lastSlashWasDivision = false;
}
else if (lastExport && lastTokenPos >= lastExport.s && lastTokenPos <= lastExport.e) {
// export default /some-regexp/
regularExpression();
lastSlashWasDivision = false;
}
else {
lastSlashWasDivision = true;
}
}
break;
}
case 96/*`*/:
templateString();
break;
}
lastTokenPos = pos;
}
if (templateDepth !== -1 || openTokenDepth)
syntaxError();
return [imports, exports, facade];
}
function tryParseImportStatement () {
const startPos = pos;
pos += 6;
let ch = commentWhitespace(true);
switch (ch) {
// dynamic import
case 40/*(*/:
openTokenPosStack[openTokenDepth++] = startPos;
if (source.charCodeAt(lastTokenPos) === 46/*.*/)
return;
// dynamic import indicated by positive d
const impt = addImport(startPos, pos + 1, 0, startPos);
curDynamicImport = impt;
// try parse a string, to record a safe dynamic import string
pos++;
ch = commentWhitespace(true);
if (ch === 39/*'*/ || ch === 34/*"*/) {
stringLiteral(ch);
}
else {
pos--;
return;
}
pos++;
ch = commentWhitespace(true);
if (ch === 44/*,*/) {
impt.e = pos;
pos++;
ch = commentWhitespace(true);
impt.a = pos;
readName(impt);
pos--;
}
else if (ch === 41/*)*/) {
openTokenDepth--;
impt.e = pos;
impt.se = pos;
readName(impt);
}
else {
pos--;
}
return;
// import.meta
case 46/*.*/:
pos++;
ch = commentWhitespace(true);
// import.meta indicated by d === -2
if (ch === 109/*m*/ && source.startsWith('eta', pos + 1) && source.charCodeAt(lastTokenPos) !== 46/*.*/)
addImport(startPos, startPos, pos + 4, -2);
return;
default:
// no space after "import" -> not an import keyword
if (pos === startPos + 6)
break;
case 34/*"*/:
case 39/*'*/:
case 123/*{*/:
case 42/***/:
// import statement only permitted at base-level
if (openTokenDepth !== 0) {
pos--;
return;
}
while (pos < end) {
ch = source.charCodeAt(pos);
if (ch === 39/*'*/ || ch === 34/*"*/) {
readImportString(startPos, ch);
return;
}
pos++;
}
syntaxError();
}
}
function tryParseExportStatement () {
const sStartPos = pos;
const prevExport = exports.length;
pos += 6;
const curPos = pos;
let ch = commentWhitespace(true);
if (pos === curPos && !isPunctuator(ch))
return;
switch (ch) {
// export default ...
case 100/*d*/:
addExport(pos, pos + 7, -1, -1);
return;
// export async? function*? name () {
case 97/*a*/:
pos += 5;
commentWhitespace(true);
// fallthrough
case 102/*f*/:
pos += 8;
ch = commentWhitespace(true);
if (ch === 42/***/) {
pos++;
ch = commentWhitespace(true);
}
const startPos = pos;
ch = readToWsOrPunctuator(ch);
addExport(startPos, pos, startPos, pos);
pos--;
return;
// export class name ...
case 99/*c*/:
if (source.startsWith('lass', pos + 1) && isBrOrWsOrPunctuatorNotDot(source.charCodeAt(pos + 5))) {
pos += 5;
ch = commentWhitespace(true);
const startPos = pos;
ch = readToWsOrPunctuator(ch);
addExport(startPos, pos, startPos, pos);
pos--;
return;
}
pos += 2;
// fallthrough
// export var/let/const name = ...(, name = ...)+
case 118/*v*/:
case 109/*l*/:
// destructured initializations not currently supported (skipped for { or [)
// also, lexing names after variable equals is skipped (export var p = function () { ... }, q = 5 skips "q")
pos += 2;
facade = false;
do {
pos++;
ch = commentWhitespace(true);
const startPos = pos;
ch = readToWsOrPunctuator(ch);
// dont yet handle [ { destructurings
if (ch === 123/*{*/ || ch === 91/*[*/) {
pos--;
return;
}
if (pos === startPos)
return;
addExport(startPos, pos, startPos, pos);
ch = commentWhitespace(true);
if (ch === 61/*=*/) {
pos--;
return;
}
} while (ch === 44/*,*/);
pos--;
return;
// export {...}
case 123/*{*/:
pos++;
ch = commentWhitespace(true);
while (true) {
const startPos = pos;
readToWsOrPunctuator(ch);
const endPos = pos;
commentWhitespace(true);
ch = readExportAs(startPos, endPos);
// ,
if (ch === 44/*,*/) {
pos++;
ch = commentWhitespace(true);
}
if (ch === 125/*}*/)
break;
if (pos === startPos)
return syntaxError();
if (pos > end)
return syntaxError();
}
pos++;
ch = commentWhitespace(true);
break;
// export *
// export * as X
case 42/***/:
pos++;
commentWhitespace(true);
ch = readExportAs(pos, pos);
ch = commentWhitespace(true);
break;
}
// from ...
if (ch === 102/*f*/ && source.startsWith('rom', pos + 1)) {
pos += 4;
readImportString(sStartPos, commentWhitespace(true));
// There were no local names.
for (let i = prevExport; i < exports.length; ++i) {
exports[i].ls = exports[i].le = -1;
exports[i].ln = undefined;
}
}
else {
pos--;
}
}
/*
* Ported from Acorn
*
* MIT License
* Copyright (C) 2012-2020 by various contributors (see AUTHORS)
* 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.
*/
let acornPos;
function readString (start, quote) {
acornPos = start;
let out = '', chunkStart = acornPos;
for (;;) {
if (acornPos >= source.length) syntaxError();
const ch = source.charCodeAt(acornPos);
if (ch === quote) break;
if (ch === 92) { // '\'
out += source.slice(chunkStart, acornPos);
out += readEscapedChar();
chunkStart = acornPos;
}
else if (ch === 0x2028 || ch === 0x2029) {
++acornPos;
}
else {
if (isBr(ch)) syntaxError();
++acornPos;
}
}
out += source.slice(chunkStart, acornPos++);
return out;
}
// Used to read escaped characters
function readEscapedChar () {
let ch = source.charCodeAt(++acornPos);
++acornPos;
switch (ch) {
case 110: return '\n'; // 'n' -> '\n'
case 114: return '\r'; // 'r' -> '\r'
case 120: return String.fromCharCode(readHexChar(2)); // 'x'
case 117: return readCodePointToString(); // 'u'
case 116: return '\t'; // 't' -> '\t'
case 98: return '\b'; // 'b' -> '\b'
case 118: return '\u000b'; // 'v' -> '\u000b'
case 102: return '\f'; // 'f' -> '\f'
case 13: if (source.charCodeAt(acornPos) === 10) ++acornPos; // '\r\n'
case 10: // ' \n'
return '';
case 56:
case 57:
syntaxError();
default:
if (ch >= 48 && ch <= 55) {
let octalStr = source.substr(acornPos - 1, 3).match(/^[0-7]+/)[0];
let octal = parseInt(octalStr, 8);
if (octal > 255) {
octalStr = octalStr.slice(0, -1);
octal = parseInt(octalStr, 8);
}
acornPos += octalStr.length - 1;
ch = source.charCodeAt(acornPos);
if (octalStr !== '0' || ch === 56 || ch === 57)
syntaxError();
return String.fromCharCode(octal);
}
if (isBr(ch)) {
// Unicode new line characters after \ get removed from output in both
// template literals and strings
return '';
}
return String.fromCharCode(ch);
}
}
// Used to read character escape sequences ('\x', '\u', '\U').
function readHexChar (len) {
const start = acornPos;
let total = 0, lastCode = 0;
for (let i = 0; i < len; ++i, ++acornPos) {
let code = source.charCodeAt(acornPos), val;
if (code === 95) {
if (lastCode === 95 || i === 0) syntaxError();
lastCode = code;
continue;
}
if (code >= 97) val = code - 97 + 10; // a
else if (code >= 65) val = code - 65 + 10; // A
else if (code >= 48 && code <= 57) val = code - 48; // 0-9
else break;
if (val >= 16) break;
lastCode = code;
total = total * 16 + val;
}
if (lastCode === 95 || acornPos - start !== len) syntaxError();
return total;
}
// Read a string value, interpreting backslash-escapes.
function readCodePointToString () {
const ch = source.charCodeAt(acornPos);
let code;
if (ch === 123) { // '{'
++acornPos;
code = readHexChar(source.indexOf('}', acornPos) - acornPos);
++acornPos;
if (code > 0x10FFFF) syntaxError();
} else {
code = readHexChar(4);
}
// UTF-16 Decoding
if (code <= 0xFFFF) return String.fromCharCode(code);
code -= 0x10000;
return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00);
}
/*
* </ Acorn Port>
*/
function readExportAs (startPos, endPos) {
let ch = source.charCodeAt(pos);
let ls = startPos, le = endPos;
if (ch === 97 /*a*/) {
pos += 2;
ch = commentWhitespace(true);
startPos = pos;
readToWsOrPunctuator(ch);
endPos = pos;
ch = commentWhitespace(true);
}
if (pos !== startPos)
addExport(startPos, endPos, ls, le);
return ch;
}
function readImportString (ss, ch) {
const startPos = pos + 1;
if (ch === 39/*'*/ || ch === 34/*"*/) {
stringLiteral(ch);
}
else {
syntaxError();
return;
}
const impt = addImport(ss, startPos, pos, -1);
readName(impt);
pos++;
ch = commentWhitespace(false);
if (ch !== 119/*w*/ || !source.startsWith('ith', pos + 1)) {
pos--;
return;
}
const attrIndex = pos;
pos += 4;
ch = commentWhitespace(true);
if (ch !== 123/*{*/) {
pos = attrIndex;
return;
}
const attrStart = pos;
const attrs = [];
do {
pos++;
ch = commentWhitespace(true);
let key, keyStart, keyEnd;
if (ch === 39/*'*/ || ch === 34/*"*/) {
keyStart = pos;
stringLiteral(ch);
keyEnd = pos + 1;
key = readString(keyStart, ch);
pos++;
ch = commentWhitespace(true);
}
else {
keyStart = pos;
ch = readToWsOrPunctuator(ch);
keyEnd = pos;
key = source.slice(keyStart, keyEnd);
}
if (ch !== 58/*:*/) {
pos = attrIndex;
return;
}
pos++;
ch = commentWhitespace(true);
let value, valueStart;
if (ch === 39/*'*/ || ch === 34/*"*/) {
valueStart = pos;
stringLiteral(ch);
value = readString(valueStart, ch);
}
else {
pos = attrIndex;
return;
}
attrs.push([key, value]);
pos++;
ch = commentWhitespace(true);
if (ch === 44/*,*/) {
pos++;
continue;
}
if (ch === 125/*}*/)
break;
pos = attrIndex;
return;
} while (true);
impt.a = attrStart;
impt.at = attrs;
impt.se = pos + 1;
}
function commentWhitespace (br) {
let ch;
do {
ch = source.charCodeAt(pos);
if (ch === 47/*/*/) {
const next_ch = source.charCodeAt(pos + 1);
if (next_ch === 47/*/*/)
lineComment();
else if (next_ch === 42/***/)
blockComment(br);
else
return ch;
}
else if (br ? !isBrOrWs(ch): !isWsNotBr(ch)) {
return ch;
}
} while (pos++ < end);
return ch;
}
function templateString () {
while (pos++ < end) {
const ch = source.charCodeAt(pos);
if (ch === 36/*$*/ && source.charCodeAt(pos + 1) === 123/*{*/) {
pos++;
templateStack[templateStackDepth++] = templateDepth;
templateDepth = ++openTokenDepth;
return;
}
if (ch === 96/*`*/)
return;
if (ch === 92/*\*/)
pos++;
}
syntaxError();
}
function blockComment (br) {
pos++;
while (pos++ < end) {
const ch = source.charCodeAt(pos);
if (!br && isBr(ch))
return;
if (ch === 42/***/ && source.charCodeAt(pos + 1) === 47/*/*/) {
pos++;
return;
}
}
}
function lineComment () {
while (pos++ < end) {
const ch = source.charCodeAt(pos);
if (ch === 10/*\n*/ || ch === 13/*\r*/)
return;
}
}
function stringLiteral (quote) {
while (pos++ < end) {
let ch = source.charCodeAt(pos);
if (ch === quote)
return;
if (ch === 92/*\*/) {
ch = source.charCodeAt(++pos);
if (ch === 13/*\r*/ && source.charCodeAt(pos + 1) === 10/*\n*/)
pos++;
}
else if (isBr(ch))
break;
}
syntaxError();
}
function regexCharacterClass () {
while (pos++ < end) {
let ch = source.charCodeAt(pos);
if (ch === 93/*]*/)
return ch;
if (ch === 92/*\*/)
pos++;
else if (ch === 10/*\n*/ || ch === 13/*\r*/)
break;
}
syntaxError();
}
function regularExpression () {
while (pos++ < end) {
let ch = source.charCodeAt(pos);
if (ch === 47/*/*/)
return;
if (ch === 91/*[*/)
ch = regexCharacterClass();
else if (ch === 92/*\*/)
pos++;
else if (ch === 10/*\n*/ || ch === 13/*\r*/)
break;
}
syntaxError();
}
function readToWsOrPunctuator (ch) {
do {
if (isBrOrWs(ch) || isPunctuator(ch))
return ch;
} while (ch = source.charCodeAt(++pos));
return ch;
}
// Note: non-asii BR and whitespace checks omitted for perf / footprint
// if there is a significant user need this can be reconsidered
function isBr (c) {
return c === 13/*\r*/ || c === 10/*\n*/;
}
function isWsNotBr (c) {
return c === 9 || c === 11 || c === 12 || c === 32 || c === 160;
}
function isBrOrWs (c) {
return c > 8 && c < 14 || c === 32 || c === 160;
}
function isBrOrWsOrPunctuatorNotDot (c) {
return c > 8 && c < 14 || c === 32 || c === 160 || isPunctuator(c) && c !== 46/*.*/;
}
function keywordStart (pos) {
return pos === 0 || isBrOrWsOrPunctuatorNotDot(source.charCodeAt(pos - 1));
}
function readPrecedingKeyword (pos, match) {
if (pos < match.length - 1)
return false;
return source.startsWith(match, pos - match.length + 1) && (pos === 0 || isBrOrWsOrPunctuatorNotDot(source.charCodeAt(pos - match.length)));
}
function readPrecedingKeyword1 (pos, ch) {
return source.charCodeAt(pos) === ch && (pos === 0 || isBrOrWsOrPunctuatorNotDot(source.charCodeAt(pos - 1)));
}
// Detects one of case, debugger, delete, do, else, in, instanceof, new,
// return, throw, typeof, void, yield, await
function isExpressionKeyword (pos) {
switch (source.charCodeAt(pos)) {
case 100/*d*/:
switch (source.charCodeAt(pos - 1)) {
case 105/*i*/:
// void
return readPrecedingKeyword(pos - 2, 'vo');
case 108/*l*/:
// yield
return readPrecedingKeyword(pos - 2, 'yie');
default:
return false;
}
case 101/*e*/:
switch (source.charCodeAt(pos - 1)) {
case 115/*s*/:
switch (source.charCodeAt(pos - 2)) {
case 108/*l*/:
// else
return readPrecedingKeyword1(pos - 3, 101/*e*/);
case 97/*a*/:
// case
return readPrecedingKeyword1(pos - 3, 99/*c*/);
default:
return false;
}
case 116/*t*/:
// delete
return readPrecedingKeyword(pos - 2, 'dele');
default:
return false;
}
case 102/*f*/:
if (source.charCodeAt(pos - 1) !== 111/*o*/ || source.charCodeAt(pos - 2) !== 101/*e*/)
return false;
switch (source.charCodeAt(pos - 3)) {
case 99/*c*/:
// instanceof
return readPrecedingKeyword(pos - 4, 'instan');
case 112/*p*/:
// typeof
return readPrecedingKeyword(pos - 4, 'ty');
default:
return false;
}
case 110/*n*/:
// in, return
return readPrecedingKeyword1(pos - 1, 105/*i*/) || readPrecedingKeyword(pos - 1, 'retur');
case 111/*o*/:
// do
return readPrecedingKeyword1(pos - 1, 100/*d*/);
case 114/*r*/:
// debugger
return readPrecedingKeyword(pos - 1, 'debugge');
case 116/*t*/:
// await
return readPrecedingKeyword(pos - 1, 'awai');
case 119/*w*/:
switch (source.charCodeAt(pos - 1)) {
case 101/*e*/:
// new
return readPrecedingKeyword1(pos - 2, 110/*n*/);
case 111/*o*/:
// throw
return readPrecedingKeyword(pos - 2, 'thr');
default:
return false;
}
}
return false;
}
function isParenKeyword (curPos) {
return source.charCodeAt(curPos) === 101/*e*/ && source.startsWith('whil', curPos - 4) ||
source.charCodeAt(curPos) === 114/*r*/ && source.startsWith('fo', curPos - 2) ||
source.charCodeAt(curPos - 1) === 105/*i*/ && source.charCodeAt(curPos) === 102/*f*/;
}
function isPunctuator (ch) {
// 23 possible punctuator endings: !%&()*+,-./:;<=>?[]^{}|~
return ch === 33/*!*/ || ch === 37/*%*/ || ch === 38/*&*/ ||
ch > 39 && ch < 48 || ch > 57 && ch < 64 ||
ch === 91/*[*/ || ch === 93/*]*/ || ch === 94/*^*/ ||
ch > 122 && ch < 127;
}
function isExpressionPunctuator (ch) {
// 20 possible expression endings: !%&(*+,-.:;<=>?[^{|~
return ch === 33/*!*/ || ch === 37/*%*/ || ch === 38/*&*/ ||
ch > 39 && ch < 47 && ch !== 41 || ch > 57 && ch < 64 ||
ch === 91/*[*/ || ch === 94/*^*/ || ch > 122 && ch < 127 && ch !== 125/*}*/;
}
function isExpressionTerminator (curPos) {
// detects:
// => ; ) finally catch else
// as all of these followed by a { will indicate a statement brace
switch (source.charCodeAt(curPos)) {
case 62/*>*/:
return source.charCodeAt(curPos - 1) === 61/*=*/;
case 59/*;*/:
case 41/*)*/:
return true;
case 104/*h*/:
return source.startsWith('catc', curPos - 4);
case 121/*y*/:
return source.startsWith('finall', curPos - 6);
case 101/*e*/:
return source.startsWith('els', curPos - 3);
}
return false;
}
function syntaxError () {
throw Object.assign(new Error(`Parse error ${name}:${source.slice(0, pos).split('\n').length}:${pos - source.lastIndexOf('\n', pos - 1)}`), { idx: pos });
}
@@ -0,0 +1,3 @@
/*! For license information please see gridstack-all.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.GridStack=t():e.GridStack=t()}(self,()=>(()=>{"use strict";var e={d:(t,i)=>{for(var s in i)e.o(i,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},t={};e.d(t,{GridStack:()=>x});class i{static getElements(e,t=document){if("string"==typeof e){const i="getElementById"in t?t:void 0;if(i&&!isNaN(+e[0])){const t=i.getElementById(e);return t?[t]:[]}let s=t.querySelectorAll(e);if(!s.length&&"."!==e[0]&&"#"!==e[0]&&(s=t.querySelectorAll("."+e),s.length||(s=t.querySelectorAll("#"+e)),!s.length)){const i=t.querySelector(`[gs-id="${e}"]`);return i?[i]:[]}return Array.from(s)}return[e]}static getElement(e,t=document){if("string"==typeof e){const i="getElementById"in t?t:void 0;if(!e.length)return null;if(i&&"#"===e[0])return i.getElementById(e.substring(1));if("#"===e[0]||"."===e[0]||"["===e[0])return t.querySelector(e);if(i&&!isNaN(+e[0]))return i.getElementById(e);let s=t.querySelector(e);return i&&!s&&(s=i.getElementById(e)),s||(s=t.querySelector("."+e)),s}return e}static lazyLoad(e){return e.lazyLoad||e.grid?.opts?.lazyLoad&&!1!==e.lazyLoad}static createDiv(e,t){const i=document.createElement("div");return e.forEach(e=>{e&&i.classList.add(e)}),t?.appendChild(i),i}static shouldSizeToContent(e,t=!1){return e?.grid&&(t?!0===e.sizeToContent||!0===e.grid.opts.sizeToContent&&void 0===e.sizeToContent:!!e.sizeToContent||e.grid.opts.sizeToContent&&!1!==e.sizeToContent)}static isIntercepted(e,t){return!(e.y>=t.y+t.h||e.y+e.h<=t.y||e.x+e.w<=t.x||e.x>=t.x+t.w)}static isTouching(e,t){return i.isIntercepted(e,{x:t.x-.5,y:t.y-.5,w:t.w+1,h:t.h+1})}static areaIntercept(e,t){const i=e.x>t.x?e.x:t.x,s=e.x+e.w<t.x+t.w?e.x+e.w:t.x+t.w;if(s<=i)return 0;const o=e.y>t.y?e.y:t.y,n=e.y+e.h<t.y+t.h?e.y+e.h:t.y+t.h;return n<=o?0:(s-i)*(n-o)}static area(e){return e.w*e.h}static sort(e,t=1){const i=1e4;return e.sort((e,s)=>{const o=t*((e.y??i)-(s.y??i));return 0===o?t*((e.x??i)-(s.x??i)):o})}static find(e,t){return t?e.find(e=>e.id===t):void 0}static toBool(e){return"boolean"==typeof e?e:"string"==typeof e?!(""===(e=e.toLowerCase())||"no"===e||"false"===e||"0"===e):Boolean(e)}static toNumber(e){return null===e||0===e.length?void 0:Number(e)}static parseHeight(e){let t,i="px";if("string"==typeof e)if("auto"===e||""===e)t=0;else{const s=e.match(/^(-[0-9]+\.[0-9]+|[0-9]*\.[0-9]+|-[0-9]+|[0-9]+)(px|em|rem|vh|vw|%|cm|mm)?$/);if(!s)throw new Error(`Invalid height val = ${e}`);i=s[2]||"px",t=parseFloat(s[1])}else t=e;return{h:t,unit:i}}static defaults(e,...t){return t.forEach(t=>{for(const s in t){if(!t.hasOwnProperty(s))return;null===e[s]||void 0===e[s]?e[s]=t[s]:"object"==typeof t[s]&&"object"==typeof e[s]&&i.defaults(e[s],t[s])}}),e}static same(e,t){if("object"!=typeof e)return e==t;if(typeof e!=typeof t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(e[i]!==t[i])return!1;return!0}static copyPos(e,t,i=!1){return void 0!==t.x&&(e.x=t.x),void 0!==t.y&&(e.y=t.y),void 0!==t.w&&(e.w=t.w),void 0!==t.h&&(e.h=t.h),i&&(t.minW&&(e.minW=t.minW),t.minH&&(e.minH=t.minH),t.maxW&&(e.maxW=t.maxW),t.maxH&&(e.maxH=t.maxH)),e}static samePos(e,t){return e&&t&&e.x===t.x&&e.y===t.y&&(e.w||1)===(t.w||1)&&(e.h||1)===(t.h||1)}static sanitizeMinMax(e){e.minW||delete e.minW,e.minH||delete e.minH,e.maxW||delete e.maxW,e.maxH||delete e.maxH}static removeInternalAndSame(e,t){if("object"==typeof e&&"object"==typeof t&&!Array.isArray(e)&&!Array.isArray(t))for(let s in e){const o=e[s],n=t[s];"_"===s[0]||o===n?delete e[s]:o&&"object"==typeof o&&void 0!==n&&(i.removeInternalAndSame(o,n),Object.keys(o).length||delete e[s])}}static removeInternalForSave(e,t=!0){for(let t in e)"_"!==t[0]&&null!==e[t]&&void 0!==e[t]||delete e[t];delete e.grid,t&&delete e.el,e.autoPosition||delete e.autoPosition,e.noResize||delete e.noResize,e.noMove||delete e.noMove,e.locked||delete e.locked,1!==e.w&&e.w!==e.minW||delete e.w,1!==e.h&&e.h!==e.minH||delete e.h}static throttle(e,t){let i=!1;return(...s)=>{i||(i=!0,setTimeout(()=>{e(...s),i=!1},t))}}static removePositioningStyles(e){const t=e.style;t.position&&t.removeProperty("position"),t.left&&t.removeProperty("left"),t.top&&t.removeProperty("top"),t.width&&t.removeProperty("width"),t.height&&t.removeProperty("height")}static getScrollElement(e){if(!e)return document.scrollingElement||document.documentElement;const t=getComputedStyle(e).overflowY;return("auto"===t||"scroll"===t)&&e.scrollHeight>e.clientHeight?e:i.getScrollElement(e.parentElement)}static updateScrollResize(e,t,s){const o=i.getScrollElement(t),n=o.clientHeight,r=o===i.getScrollElement()?0:o.getBoundingClientRect().top,a=e.clientY-r,h=a>n-s;a<s?o.scrollBy({behavior:"smooth",top:a-s}):h&&o.scrollBy({behavior:"smooth",top:s-(n-a)})}static clone(e){return null==e||"object"!=typeof e?e:e instanceof Array?[...e]:{...e}}statLine truncated
//# sourceMappingURL=gridstack-all.js.map
@@ -0,0 +1 @@
{"version":3,"file":"hand-platter.js","sources":["../../../src/icons/hand-platter.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name HandPlatter\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgM1YyIiAvPgogIDxwYXRoIGQ9Im0xNS40IDE3LjQgMy4yLTIuOGEyIDIgMCAxIDEgMi44IDIuOWwtMy42IDMuM2MtLjcuOC0xLjcgMS4yLTIuOCAxLjJoLTRjLTEuMSAwLTIuMS0uNC0yLjgtMS4ybC0xLjMwMi0xLjQ2NEExIDEgMCAwIDAgNi4xNTEgMTlINSIgLz4KICA8cGF0aCBkPSJNMiAxNGgxMmEyIDIgMCAwIDEgMCA0aC0yIiAvPgogIDxwYXRoIGQ9Ik00IDEwaDE2IiAvPgogIDxwYXRoIGQ9Ik01IDEwYTcgNyAwIDAgMSAxNCAwIiAvPgogIDxwYXRoIGQ9Ik01IDE0djZhMSAxIDAgMCAxLTEgMUgyIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/hand-platter\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 HandPlatter = createLucideIcon('HandPlatter', [\n ['path', { d: 'M12 3V2', key: 'ar7q03' }],\n [\n 'path',\n {\n d: 'm15.4 17.4 3.2-2.8a2 2 0 1 1 2.8 2.9l-3.6 3.3c-.7.8-1.7 1.2-2.8 1.2h-4c-1.1 0-2.1-.4-2.8-1.2l-1.302-1.464A1 1 0 0 0 6.151 19H5',\n key: 'n2g93r',\n },\n ],\n ['path', { d: 'M2 14h12a2 2 0 0 1 0 4h-2', key: '1o2jem' }],\n ['path', { d: 'M4 10h16', key: 'img6z1' }],\n ['path', { d: 'M5 10a7 7 0 0 1 14 0', key: '1ega1o' }],\n ['path', { d: 'M5 14v6a1 1 0 0 1-1 1H2', key: '1hescx' }],\n]);\n\nexport default HandPlatter;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,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,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,CAAwB,CAAA,CAAA,CAAA,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,CACrD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC1D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,5 @@
import { ZodPipelineDef } from "zod/v3";
import { JsonSchema7Type } from "../parseTypes.js";
import { Refs } from "../Refs.js";
import { JsonSchema7AllOfType } from "./intersection.js";
export declare const parsePipelineDef: (def: ZodPipelineDef<any, any>, refs: Refs) => JsonSchema7AllOfType | JsonSchema7Type | undefined;
@@ -0,0 +1 @@
{"version":3,"names":["_helperCompilationTargets","data","require","resolveBrowserslistConfigFile","browserslistConfigFile","configFilePath","undefined","resolveTargets","options","root","optTargets","targets","Array","isArray","browsers","Object","assign","esmodules","getTargets","ignoreBrowserslistConfig","browserslistEnv"],"sources":["../../src/config/resolve-targets-browser.ts"],"sourcesContent":["/* c8 ignore start */\n\nimport type { InputOptions } from \"./validation/options.ts\";\nimport getTargets, {\n type InputTargets,\n} from \"@babel/helper-compilation-targets\";\n\nimport type { Targets } from \"@babel/helper-compilation-targets\";\n\nexport function resolveBrowserslistConfigFile(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n browserslistConfigFile: string,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n configFilePath: string,\n): string | void {\n return undefined;\n}\n\nexport function resolveTargets(\n options: InputOptions,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n root: string,\n): Targets {\n const optTargets = options.targets;\n let targets: InputTargets;\n\n if (typeof optTargets === \"string\" || Array.isArray(optTargets)) {\n targets = { browsers: optTargets };\n } else if (optTargets) {\n if (\"esmodules\" in optTargets) {\n targets = { ...optTargets, esmodules: \"intersect\" };\n } else {\n // https://github.com/microsoft/TypeScript/issues/17002\n targets = optTargets as InputTargets;\n }\n }\n\n return getTargets(targets, {\n ignoreBrowserslistConfig: true,\n browserslistEnv: options.browserslistEnv,\n });\n}\n"],"mappings":";;;;;;;AAGA,SAAAA,0BAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,yBAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAMO,SAASE,6BAA6BA,CAE3CC,sBAA8B,EAE9BC,cAAsB,EACP;EACf,OAAOC,SAAS;AAClB;AAEO,SAASC,cAAcA,CAC5BC,OAAqB,EAErBC,IAAY,EACH;EACT,MAAMC,UAAU,GAAGF,OAAO,CAACG,OAAO;EAClC,IAAIA,OAAqB;EAEzB,IAAI,OAAOD,UAAU,KAAK,QAAQ,IAAIE,KAAK,CAACC,OAAO,CAACH,UAAU,CAAC,EAAE;IAC/DC,OAAO,GAAG;MAAEG,QAAQ,EAAEJ;IAAW,CAAC;EACpC,CAAC,MAAM,IAAIA,UAAU,EAAE;IACrB,IAAI,WAAW,IAAIA,UAAU,EAAE;MAC7BC,OAAO,GAAAI,MAAA,CAAAC,MAAA,KAAQN,UAAU;QAAEO,SAAS,EAAE;MAAW,EAAE;IACrD,CAAC,MAAM;MAELN,OAAO,GAAGD,UAA0B;IACtC;EACF;EAEA,OAAO,IAAAQ,mCAAU,EAACP,OAAO,EAAE;IACzBQ,wBAAwB,EAAE,IAAI;IAC9BC,eAAe,EAAEZ,OAAO,CAACY;EAC3B,CAAC,CAAC;AACJ;AAAC","ignoreList":[]}
@@ -0,0 +1,230 @@
import type {
KeywordErrorDefinition,
KeywordErrorCxt,
ErrorObject,
AnySchemaObject,
} from "../../types"
import type {SchemaObjCxt} from ".."
import {isJSONType, JSONType} from "../rules"
import {schemaHasRulesForType} from "./applicability"
import {reportError} from "../errors"
import {_, nil, and, not, operators, Code, Name} from "../codegen"
import {toHash, schemaRefOrVal} from "../util"
export enum DataType {
Correct,
Wrong,
}
export function getSchemaTypes(schema: AnySchemaObject): JSONType[] {
const types = getJSONTypes(schema.type)
const hasNull = types.includes("null")
if (hasNull) {
if (schema.nullable === false) throw new Error("type: null contradicts nullable: false")
} else {
if (!types.length && schema.nullable !== undefined) {
throw new Error('"nullable" cannot be used without "type"')
}
if (schema.nullable === true) types.push("null")
}
return types
}
// eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents
export function getJSONTypes(ts: unknown | unknown[]): JSONType[] {
const types: unknown[] = Array.isArray(ts) ? ts : ts ? [ts] : []
if (types.every(isJSONType)) return types
throw new Error("type must be JSONType or JSONType[]: " + types.join(","))
}
export function coerceAndCheckDataType(it: SchemaObjCxt, types: JSONType[]): boolean {
const {gen, data, opts} = it
const coerceTo = coerceToTypes(types, opts.coerceTypes)
const checkTypes =
types.length > 0 &&
!(coerceTo.length === 0 && types.length === 1 && schemaHasRulesForType(it, types[0]))
if (checkTypes) {
const wrongType = checkDataTypes(types, data, opts.strictNumbers, DataType.Wrong)
gen.if(wrongType, () => {
if (coerceTo.length) coerceData(it, types, coerceTo)
else reportTypeError(it)
})
}
return checkTypes
}
const COERCIBLE: Set<JSONType> = new Set(["string", "number", "integer", "boolean", "null"])
function coerceToTypes(types: JSONType[], coerceTypes?: boolean | "array"): JSONType[] {
return coerceTypes
? types.filter((t) => COERCIBLE.has(t) || (coerceTypes === "array" && t === "array"))
: []
}
function coerceData(it: SchemaObjCxt, types: JSONType[], coerceTo: JSONType[]): void {
const {gen, data, opts} = it
const dataType = gen.let("dataType", _`typeof ${data}`)
const coerced = gen.let("coerced", _`undefined`)
if (opts.coerceTypes === "array") {
gen.if(_`${dataType} == 'object' && Array.isArray(${data}) && ${data}.length == 1`, () =>
gen
.assign(data, _`${data}[0]`)
.assign(dataType, _`typeof ${data}`)
.if(checkDataTypes(types, data, opts.strictNumbers), () => gen.assign(coerced, data))
)
}
gen.if(_`${coerced} !== undefined`)
for (const t of coerceTo) {
if (COERCIBLE.has(t) || (t === "array" && opts.coerceTypes === "array")) {
coerceSpecificType(t)
}
}
gen.else()
reportTypeError(it)
gen.endIf()
gen.if(_`${coerced} !== undefined`, () => {
gen.assign(data, coerced)
assignParentData(it, coerced)
})
function coerceSpecificType(t: string): void {
switch (t) {
case "string":
gen
.elseIf(_`${dataType} == "number" || ${dataType} == "boolean"`)
.assign(coerced, _`"" + ${data}`)
.elseIf(_`${data} === null`)
.assign(coerced, _`""`)
return
case "number":
gen
.elseIf(
_`${dataType} == "boolean" || ${data} === null
|| (${dataType} == "string" && ${data} && ${data} == +${data})`
)
.assign(coerced, _`+${data}`)
return
case "integer":
gen
.elseIf(
_`${dataType} === "boolean" || ${data} === null
|| (${dataType} === "string" && ${data} && ${data} == +${data} && !(${data} % 1))`
)
.assign(coerced, _`+${data}`)
return
case "boolean":
gen
.elseIf(_`${data} === "false" || ${data} === 0 || ${data} === null`)
.assign(coerced, false)
.elseIf(_`${data} === "true" || ${data} === 1`)
.assign(coerced, true)
return
case "null":
gen.elseIf(_`${data} === "" || ${data} === 0 || ${data} === false`)
gen.assign(coerced, null)
return
case "array":
gen
.elseIf(
_`${dataType} === "string" || ${dataType} === "number"
|| ${dataType} === "boolean" || ${data} === null`
)
.assign(coerced, _`[${data}]`)
}
}
}
function assignParentData({gen, parentData, parentDataProperty}: SchemaObjCxt, expr: Name): void {
// TODO use gen.property
gen.if(_`${parentData} !== undefined`, () =>
gen.assign(_`${parentData}[${parentDataProperty}]`, expr)
)
}
export function checkDataType(
dataType: JSONType,
data: Name,
strictNums?: boolean | "log",
correct = DataType.Correct
): Code {
const EQ = correct === DataType.Correct ? operators.EQ : operators.NEQ
let cond: Code
switch (dataType) {
case "null":
return _`${data} ${EQ} null`
case "array":
cond = _`Array.isArray(${data})`
break
case "object":
cond = _`${data} && typeof ${data} == "object" && !Array.isArray(${data})`
break
case "integer":
cond = numCond(_`!(${data} % 1) && !isNaN(${data})`)
break
case "number":
cond = numCond()
break
default:
return _`typeof ${data} ${EQ} ${dataType}`
}
return correct === DataType.Correct ? cond : not(cond)
function numCond(_cond: Code = nil): Code {
return and(_`typeof ${data} == "number"`, _cond, strictNums ? _`isFinite(${data})` : nil)
}
}
export function checkDataTypes(
dataTypes: JSONType[],
data: Name,
strictNums?: boolean | "log",
correct?: DataType
): Code {
if (dataTypes.length === 1) {
return checkDataType(dataTypes[0], data, strictNums, correct)
}
let cond: Code
const types = toHash(dataTypes)
if (types.array && types.object) {
const notObj = _`typeof ${data} != "object"`
cond = types.null ? notObj : _`!${data} || ${notObj}`
delete types.null
delete types.array
delete types.object
} else {
cond = nil
}
if (types.number) delete types.integer
for (const t in types) cond = and(cond, checkDataType(t as JSONType, data, strictNums, correct))
return cond
}
export type TypeError = ErrorObject<"type", {type: string}>
const typeError: KeywordErrorDefinition = {
message: ({schema}) => `must be ${schema}`,
params: ({schema, schemaValue}) =>
typeof schema == "string" ? _`{type: ${schema}}` : _`{type: ${schemaValue}}`,
}
export function reportTypeError(it: SchemaObjCxt): void {
const cxt = getTypeErrorContext(it)
reportError(cxt, typeError)
}
function getTypeErrorContext(it: SchemaObjCxt): KeywordErrorCxt {
const {gen, data, schema} = it
const schemaCode = schemaRefOrVal(it, schema, "type")
return {
gen,
keyword: "type",
data,
schema: schema.type,
schemaCode,
schemaValue: schemaCode,
parentSchema: schema,
params: {},
it,
}
}
@@ -0,0 +1,126 @@
'use strict'
/**
* This is a Globally Unique Identifier unique used to validate that the
* endpoint accepts websocket connections.
* @see https://www.rfc-editor.org/rfc/rfc6455.html#section-1.3
* @type {'258EAFA5-E914-47DA-95CA-C5AB0DC85B11'}
*/
const uid = '258EAFA5-E914-47DA-95CA-C5AB0DC85B11'
/**
* @type {PropertyDescriptor}
*/
const staticPropertyDescriptors = {
enumerable: true,
writable: false,
configurable: false
}
/**
* The states of the WebSocket connection.
*
* @readonly
* @enum
* @property {0} CONNECTING
* @property {1} OPEN
* @property {2} CLOSING
* @property {3} CLOSED
*/
const states = {
CONNECTING: 0,
OPEN: 1,
CLOSING: 2,
CLOSED: 3
}
/**
* @readonly
* @enum
* @property {0} NOT_SENT
* @property {1} PROCESSING
* @property {2} SENT
*/
const sentCloseFrameState = {
SENT: 1,
RECEIVED: 2
}
/**
* The WebSocket opcodes.
*
* @readonly
* @enum
* @property {0x0} CONTINUATION
* @property {0x1} TEXT
* @property {0x2} BINARY
* @property {0x8} CLOSE
* @property {0x9} PING
* @property {0xA} PONG
* @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.2
*/
const opcodes = {
CONTINUATION: 0x0,
TEXT: 0x1,
BINARY: 0x2,
CLOSE: 0x8,
PING: 0x9,
PONG: 0xA
}
/**
* The maximum value for an unsigned 16-bit integer.
*
* @type {65535} 2 ** 16 - 1
*/
const maxUnsigned16Bit = 65535
/**
* The states of the parser.
*
* @readonly
* @enum
* @property {0} INFO
* @property {2} PAYLOADLENGTH_16
* @property {3} PAYLOADLENGTH_64
* @property {4} READ_DATA
*/
const parserStates = {
INFO: 0,
PAYLOADLENGTH_16: 2,
PAYLOADLENGTH_64: 3,
READ_DATA: 4
}
/**
* An empty buffer.
*
* @type {Buffer}
*/
const emptyBuffer = Buffer.allocUnsafe(0)
/**
* @readonly
* @property {1} text
* @property {2} typedArray
* @property {3} arrayBuffer
* @property {4} blob
*/
const sendHints = {
text: 1,
typedArray: 2,
arrayBuffer: 3,
blob: 4
}
module.exports = {
uid,
sentCloseFrameState,
staticPropertyDescriptors,
states,
opcodes,
maxUnsigned16Bit,
parserStates,
emptyBuffer,
sendHints
}
@@ -0,0 +1,627 @@
export default `flf2a$ 6 4 20 0 13
Based on cursive(6) by Jan Wolter <janc@crim.eecs.umich.edu> on 24 Jul 1985
Figlet-ized and by Wendell Hicken <whicken@parasoft.com> on 5 Mar 1994
Added missing punctuation and numbers
Ammended by Jerrad Pierce <jpierce@cpan.org> on 8 Aug 2002
Underscore and dash have been updated to more closely match cursive(6)
The '_' character is treated in a special way. It may be
inserted in the text anywhere you wish to lengthen a con-
necting line between two letters.
Changed 2004-02-18: Bugfix in '-' character by Markus Gebhard
Changed 2012-05-21: Update to '-' character by patorjk
$$@
$$@
$$@
$$@
$$@
$$@@
@
/@
/ @
' @
o @
@@
@
o o@
' '@
@
@
@@
/ /@
-/-/-@
-/-/- @
/ / @
@
@@
,-/-@
(_/ @
/ ) @
-/-' @
@
@@
() /@
/ @
/ @
/ ()@
@
@@
() @
/\\ @
( X @
\\/ \\@
@
@@
@
o@
'@
@
@
@@
_/@
/ @
/ @
/ @
@
@@
/@
/@
_/ @
/ @
@
@@
@
\\ / @
--X--@
/ \\ @
@
@@
@
/ @
--/--@
/ @
@
@@
@
@
@
o@
'@
@@
$$$@
$$$@
---@
$$$@
$$$@
$$$@@
@
@
@
o@
@
@@
/@
/ @
/ @
/ @
@
@@
__ @
/ )@
/ / @
(__/ @
@
@@
_@
/@
/ @
/ @
@
@@
__ @
)@
.--' @
(__ @
@
@@
__ @
)@
-/ @
___/ @
@
@@
@
/ /@
'--/ @
/ @
@
@@
___@
/ @
'--. @
___) @
@
@@
@
/ @
/_ @
(__)@
@
@@
___@
/@
-/-@
/ @
@
@@
__ @
( )@
./' @
(__) @
@
@@
__ @
(__)@
/ @
/ @
@
@@
@
@
o@
@
o @
@@
@
@
o@
@
o @
' @@
/@
/ @
\\ @
\\@
@
@@
@
@
---@
---@
@
@@
\\ @
\\@
/@
/ @
@
@@
__ @
__)@
/ @
o @
@
@@
@
_ @
/o\\ @
(____@
@
@@
__ @
/ )@
/--/ @
/ (_ @
@
@@
__ @
/ )@
/--< @
/___/_@
@
@@
__ @
/ )@
/ @
(__/ @
@
@@
__ @
/ )@
/ / @
/__/_ @
@
@@
__ @
/ \`@
/-- @
(___, @
@
@@
_____@
/ '@
,-/-, @
(_/ @
@
@@
() ,@
/\`-'|@
/ / @
/__-<_ @
@
@@
_ ,@
' ) / @
/--/ @
/ (_ @
@
@@
_ @
| )@
,---|/ @
\\_/ \\_@
@
@@
___ @
( >@
__/_@
/ / @
<_/ @
@@
_ ,@
' ) / @
/-< @
/ ) @
@
@@
_@
_//@
/ @
/___@
@
@@
_ _ _ @
' ) ) )@
/ / / @
/ ' (_ @
@
@@
_ __ @
' ) )@
/ / @
/ (_ @
@
@@
__ @
/ ')@
/ / @
(__/ @
@
@@
_ __ @
' ) )@
/--' @
/ @
@
@@
__ @
/ )@
/ / @
(_\\/ @
\` @
@@
_ __ @
' ) )@
/--' @
/ \\_ @
@
@@
() @
/\\ @
/ ) @
/__/__@
@
@@
______@
/ @
--/ @
(_/ @
@
@@
_ __@
' ) / @
/ / @
(__/ @
@
@@
_ _@
' ) / @
( / @
\\/ @
@
@@
_ _@
' ) / @
/ / / @
(_(_/ @
@
@@
_ ,@
' \\ / @
X @
/ \\_@
@
@@
_ ,@
' ) / @
/ / @
(__/_ @
// @
(/ @@
___@
/@
/ @
/__@
@
@@
_@
/ @
/ @
/_ @
@
@@
\\ @
\\ @
\\ @
\\@
@
@@
_@
/@
/ @
_/ @
@
@@
/\\@
@
@
@
@
@@
@
@
@
_@
@
@@
@
o@
\`@
@
@
@@
@
@
__. @
(_/|_@
@
@@
@
/ @
/__@
/_) @
@
@@
@
@
_.@
(__@
@
@@
@
/@
__/ @
(_/_ @
@
@@
@
@
_ @
</_@
@
@@
@
/)@
// @
//_ @
/> @
</ @@
@
@
_, @
(_)_@
/| @
|/ @@
@
/ @
/_ @
/ /_@
@
@@
@
@
o@
<_@
@
@@
@
@
o@
/_@
/ @
-' @@
@
/ @
/_ @
/ <_@
@
@@
_@
//@
// @
</_ @
@
@@
@
@
______ @
/ / / <_@
@
@@
@
@
____ @
/ / <_@
@
@@
@
@
__@
(_)@
@
@@
@
@
_ @
/_)_@
/ @
' @@
@
@
_, @
(_)_@
/> @
|/ @@
@
@
__ @
/ (_@
@
@@
@
@
_ @
/_)_@
@
@@
@
_/_@
/ @
<__ @
@
@@
@
@
. .@
(_/_@
@
@@
@
@
, _@
\\/ @
@
@@
@
@
, , ,@
(_(_/_@
@
@@
@
@
_., @
/ /\\_@
@
@@
@
@
__ ,@
/ (_/_@
/ @
' @@
@
@
__. @
/ |_@
(| @
@@
_/@
_/ @
/ @
/ @
@
@@
/@
/ @
/ @
/ @
@
@@
/ @
/_@
_/ @
/ @
@
@@
_ @
/ \\_/@
@
@
@
@@
o__o@
/ )@
/--/ @
/ (_ @
@
@@
o__o@
/ ')@
/ / @
(__/ @
@
@@
_o o__@
' ) / @
/ / @
(__/ @
@
@@
@
o o @
__. @
(_/|_@
@
@@
@
o o@
__@
(_)@
@
@@
@
o o@
. .@
(_/_@
@
@@
__ @
/ )@
/--< @
_/___/_@
/ @
@@
`
@@ -0,0 +1,23 @@
/**
* creates a Ref object with on change callback
* @param callback
* @returns {RefObject}
*
* @see {@link useCallbackRef}
* @see https://reactjs.org/docs/refs-and-the-dom.html#creating-refs
*/
export function createCallbackRef(callback) {
let current = null;
return {
get current() {
return current;
},
set current(value) {
const last = current;
if (last !== value) {
current = value;
callback(value, last);
}
},
};
}
@@ -0,0 +1,333 @@
'use strict'
const debug = require('../internal/debug')
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
const { safeRe: re, t } = require('../internal/re')
const parseOptions = require('../internal/parse-options')
const { compareIdentifiers } = require('../internal/identifiers')
class SemVer {
constructor (version, options) {
options = parseOptions(options)
if (version instanceof SemVer) {
if (version.loose === !!options.loose &&
version.includePrerelease === !!options.includePrerelease) {
return version
} else {
version = version.version
}
} else if (typeof version !== 'string') {
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
}
if (version.length > MAX_LENGTH) {
throw new TypeError(
`version is longer than ${MAX_LENGTH} characters`
)
}
debug('SemVer', version, options)
this.options = options
this.loose = !!options.loose
// this isn't actually relevant for versions, but keep it so that we
// don't run into trouble passing this.options around.
this.includePrerelease = !!options.includePrerelease
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
if (!m) {
throw new TypeError(`Invalid Version: ${version}`)
}
this.raw = version
// these are actually numbers
this.major = +m[1]
this.minor = +m[2]
this.patch = +m[3]
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
throw new TypeError('Invalid major version')
}
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
throw new TypeError('Invalid minor version')
}
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
throw new TypeError('Invalid patch version')
}
// numberify any prerelease numeric ids
if (!m[4]) {
this.prerelease = []
} else {
this.prerelease = m[4].split('.').map((id) => {
if (/^[0-9]+$/.test(id)) {
const num = +id
if (num >= 0 && num < MAX_SAFE_INTEGER) {
return num
}
}
return id
})
}
this.build = m[5] ? m[5].split('.') : []
this.format()
}
format () {
this.version = `${this.major}.${this.minor}.${this.patch}`
if (this.prerelease.length) {
this.version += `-${this.prerelease.join('.')}`
}
return this.version
}
toString () {
return this.version
}
compare (other) {
debug('SemVer.compare', this.version, this.options, other)
if (!(other instanceof SemVer)) {
if (typeof other === 'string' && other === this.version) {
return 0
}
other = new SemVer(other, this.options)
}
if (other.version === this.version) {
return 0
}
return this.compareMain(other) || this.comparePre(other)
}
compareMain (other) {
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
if (this.major < other.major) {
return -1
}
if (this.major > other.major) {
return 1
}
if (this.minor < other.minor) {
return -1
}
if (this.minor > other.minor) {
return 1
}
if (this.patch < other.patch) {
return -1
}
if (this.patch > other.patch) {
return 1
}
return 0
}
comparePre (other) {
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
// NOT having a prerelease is > having one
if (this.prerelease.length && !other.prerelease.length) {
return -1
} else if (!this.prerelease.length && other.prerelease.length) {
return 1
} else if (!this.prerelease.length && !other.prerelease.length) {
return 0
}
let i = 0
do {
const a = this.prerelease[i]
const b = other.prerelease[i]
debug('prerelease compare', i, a, b)
if (a === undefined && b === undefined) {
return 0
} else if (b === undefined) {
return 1
} else if (a === undefined) {
return -1
} else if (a === b) {
continue
} else {
return compareIdentifiers(a, b)
}
} while (++i)
}
compareBuild (other) {
if (!(other instanceof SemVer)) {
other = new SemVer(other, this.options)
}
let i = 0
do {
const a = this.build[i]
const b = other.build[i]
debug('build compare', i, a, b)
if (a === undefined && b === undefined) {
return 0
} else if (b === undefined) {
return 1
} else if (a === undefined) {
return -1
} else if (a === b) {
continue
} else {
return compareIdentifiers(a, b)
}
} while (++i)
}
// preminor will bump the version up to the next minor release, and immediately
// down to pre-release. premajor and prepatch work the same way.
inc (release, identifier, identifierBase) {
if (release.startsWith('pre')) {
if (!identifier && identifierBase === false) {
throw new Error('invalid increment argument: identifier is empty')
}
// Avoid an invalid semver results
if (identifier) {
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])
if (!match || match[1] !== identifier) {
throw new Error(`invalid identifier: ${identifier}`)
}
}
}
switch (release) {
case 'premajor':
this.prerelease.length = 0
this.patch = 0
this.minor = 0
this.major++
this.inc('pre', identifier, identifierBase)
break
case 'preminor':
this.prerelease.length = 0
this.patch = 0
this.minor++
this.inc('pre', identifier, identifierBase)
break
case 'prepatch':
// If this is already a prerelease, it will bump to the next version
// drop any prereleases that might already exist, since they are not
// relevant at this point.
this.prerelease.length = 0
this.inc('patch', identifier, identifierBase)
this.inc('pre', identifier, identifierBase)
break
// If the input is a non-prerelease version, this acts the same as
// prepatch.
case 'prerelease':
if (this.prerelease.length === 0) {
this.inc('patch', identifier, identifierBase)
}
this.inc('pre', identifier, identifierBase)
break
case 'release':
if (this.prerelease.length === 0) {
throw new Error(`version ${this.raw} is not a prerelease`)
}
this.prerelease.length = 0
break
case 'major':
// If this is a pre-major version, bump up to the same major version.
// Otherwise increment major.
// 1.0.0-5 bumps to 1.0.0
// 1.1.0 bumps to 2.0.0
if (
this.minor !== 0 ||
this.patch !== 0 ||
this.prerelease.length === 0
) {
this.major++
}
this.minor = 0
this.patch = 0
this.prerelease = []
break
case 'minor':
// If this is a pre-minor version, bump up to the same minor version.
// Otherwise increment minor.
// 1.2.0-5 bumps to 1.2.0
// 1.2.1 bumps to 1.3.0
if (this.patch !== 0 || this.prerelease.length === 0) {
this.minor++
}
this.patch = 0
this.prerelease = []
break
case 'patch':
// If this is not a pre-release version, it will increment the patch.
// If it is a pre-release it will bump up to the same patch version.
// 1.2.0-5 patches to 1.2.0
// 1.2.0 patches to 1.2.1
if (this.prerelease.length === 0) {
this.patch++
}
this.prerelease = []
break
// This probably shouldn't be used publicly.
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
case 'pre': {
const base = Number(identifierBase) ? 1 : 0
if (this.prerelease.length === 0) {
this.prerelease = [base]
} else {
let i = this.prerelease.length
while (--i >= 0) {
if (typeof this.prerelease[i] === 'number') {
this.prerelease[i]++
i = -2
}
}
if (i === -1) {
// didn't increment anything
if (identifier === this.prerelease.join('.') && identifierBase === false) {
throw new Error('invalid increment argument: identifier already exists')
}
this.prerelease.push(base)
}
}
if (identifier) {
// 1.2.0-beta.1 bumps to 1.2.0-beta.2,
// 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
let prerelease = [identifier, base]
if (identifierBase === false) {
prerelease = [identifier]
}
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
if (isNaN(this.prerelease[1])) {
this.prerelease = prerelease
}
} else {
this.prerelease = prerelease
}
}
break
}
default:
throw new Error(`invalid increment argument: ${release}`)
}
this.raw = this.format()
if (this.build.length) {
this.raw += `+${this.build.join('.')}`
}
return this
}
}
module.exports = SemVer
@@ -0,0 +1 @@
{"version":3,"file":"arrow-up-right.js","sources":["../../../src/icons/arrow-up-right.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowUpRight\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNyA3aDEwdjEwIiAvPgogIDxwYXRoIGQ9Ik03IDE3IDE3IDciIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/arrow-up-right\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 ArrowUpRight = createLucideIcon('ArrowUpRight', [\n ['path', { d: 'M7 7h10v10', key: '1tivn9' }],\n ['path', { d: 'M7 17 17 7', key: '1vkiza' }],\n]);\n\nexport default ArrowUpRight;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAe,iBAAiB,cAAgB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC7C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,47 @@
{
"name": "pkg-types",
"version": "1.3.1",
"description": "Node.js utilities and TypeScript definitions for `package.json` and `tsconfig.json`",
"license": "MIT",
"main": "./dist/index.cjs",
"sideEffects": false,
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"types": "./dist/index.d.ts",
"repository": "unjs/pkg-types",
"files": [
"dist"
],
"scripts": {
"build": "unbuild",
"prepack": "pnpm build",
"dev": "vitest --typecheck",
"release": "pnpm test && changelogen --release && npm publish && git push --follow-tags",
"lint": "eslint && prettier -c src test",
"lint:fix": "automd && eslint --fix . && prettier -w src test",
"test": "vitest run --typecheck --coverage"
},
"dependencies": {
"confbox": "^0.1.8",
"mlly": "^1.7.4",
"pathe": "^2.0.1"
},
"devDependencies": {
"@types/node": "^22.10.6",
"@vitest/coverage-v8": "^2.1.8",
"automd": "^0.3.12",
"changelogen": "^0.5.7",
"eslint": "^9.18.0",
"eslint-config-unjs": "^0.4.2",
"expect-type": "^1.1.0",
"jiti": "^2.4.2",
"prettier": "^3.4.2",
"typescript": "^5.7.3",
"unbuild": "^3.3.1",
"vitest": "^2.1.8"
},
"packageManager": "pnpm@9.15.4"
}
@@ -0,0 +1 @@
{"version":3,"file":"chevron-left-circle.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}
@@ -0,0 +1,29 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const SquareDashedKanban = createLucideIcon("SquareDashedKanban", [
["path", { d: "M8 7v7", key: "1x2jlm" }],
["path", { d: "M12 7v4", key: "xawao1" }],
["path", { d: "M16 7v9", key: "1hp2iy" }],
["path", { d: "M5 3a2 2 0 0 0-2 2", key: "y57alp" }],
["path", { d: "M9 3h1", key: "1yesri" }],
["path", { d: "M14 3h1", key: "1ec4yj" }],
["path", { d: "M19 3a2 2 0 0 1 2 2", key: "18rm91" }],
["path", { d: "M21 9v1", key: "mxsmne" }],
["path", { d: "M21 14v1", key: "169vum" }],
["path", { d: "M21 19a2 2 0 0 1-2 2", key: "1j7049" }],
["path", { d: "M14 21h1", key: "v9vybs" }],
["path", { d: "M9 21h1", key: "15o7lz" }],
["path", { d: "M5 21a2 2 0 0 1-2-2", key: "sbafld" }],
["path", { d: "M3 14v1", key: "vnatye" }],
["path", { d: "M3 9v1", key: "1r0deq" }]
]);
export { SquareDashedKanban as default };
//# sourceMappingURL=square-dashed-kanban.js.map
@@ -0,0 +1,35 @@
import { MiddlewareHandler } from "../../types.js";
import { Context } from "../../context.js";
//#region src/middleware/request-id/request-id.d.ts
export type RequestIdVariables = {
requestId: string;
};
export type RequestIdOptions = {
limitLength?: number;
headerName?: string;
generator?: (c: Context) => string;
};
/**
* Request ID Middleware for Hono.
*
* @param {object} options - Options for Request ID middleware.
* @param {number} [options.limitLength=255] - The maximum length of request id.
* @param {string} [options.headerName=X-Request-Id] - The header name used in request id.
* @param {generator} [options.generator=() => crypto.randomUUID()] - The request id generation function.
*
* @returns {MiddlewareHandler} The middleware handler function.
*
* @example
* ```ts
* type Variables = RequestIdVariables
* const app = new Hono<{Variables: Variables}>()
*
* app.use(requestId())
* app.get('/', (c) => {
* console.log(c.get('requestId')) // Debug
* return c.text('Hello World!')
* })
* ```
*/
export declare const requestId: ({ limitLength, headerName, generator }?: RequestIdOptions) => MiddlewareHandler;
//#endregion
@@ -0,0 +1,159 @@
/**
* @fileoverview Rule to ensure newline per method call when chaining calls
* @author Rajendra Patil
* @author Burak Yigit Kaya
* @deprecated in ESLint v8.53.0
*/
"use strict";
const astUtils = require("./utils/ast-utils");
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
deprecated: {
message: "Formatting rules are being moved out of ESLint core.",
url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
deprecatedSince: "8.53.0",
availableUntil: "11.0.0",
replacedBy: [
{
message:
"ESLint Stylistic now maintains deprecated stylistic core rules.",
url: "https://eslint.style/guide/migration",
plugin: {
name: "@stylistic/eslint-plugin",
url: "https://eslint.style",
},
rule: {
name: "newline-per-chained-call",
url: "https://eslint.style/rules/newline-per-chained-call",
},
},
],
},
type: "layout",
docs: {
description: "Require a newline after each call in a method chain",
recommended: false,
url: "https://eslint.org/docs/latest/rules/newline-per-chained-call",
},
fixable: "whitespace",
schema: [
{
type: "object",
properties: {
ignoreChainWithDepth: {
type: "integer",
minimum: 1,
maximum: 10,
default: 2,
},
},
additionalProperties: false,
},
],
messages: {
expected: "Expected line break before `{{callee}}`.",
},
},
create(context) {
const options = context.options[0] || {},
ignoreChainWithDepth = options.ignoreChainWithDepth || 2;
const sourceCode = context.sourceCode;
/**
* Get the prefix of a given MemberExpression node.
* If the MemberExpression node is a computed value it returns a
* left bracket. If not it returns a period.
* @param {ASTNode} node A MemberExpression node to get
* @returns {string} The prefix of the node.
*/
function getPrefix(node) {
if (node.computed) {
if (node.optional) {
return "?.[";
}
return "[";
}
if (node.optional) {
return "?.";
}
return ".";
}
/**
* Gets the property text of a given MemberExpression node.
* If the text is multiline, this returns only the first line.
* @param {ASTNode} node A MemberExpression node to get.
* @returns {string} The property text of the node.
*/
function getPropertyText(node) {
const prefix = getPrefix(node);
const lines = sourceCode
.getText(node.property)
.split(astUtils.LINEBREAK_MATCHER);
const suffix = node.computed && lines.length === 1 ? "]" : "";
return prefix + lines[0] + suffix;
}
return {
"CallExpression:exit"(node) {
const callee = astUtils.skipChainExpression(node.callee);
if (callee.type !== "MemberExpression") {
return;
}
let parent = astUtils.skipChainExpression(callee.object);
let depth = 1;
while (parent && parent.callee) {
depth += 1;
parent = astUtils.skipChainExpression(
astUtils.skipChainExpression(parent.callee).object,
);
}
if (
depth > ignoreChainWithDepth &&
astUtils.isTokenOnSameLine(callee.object, callee.property)
) {
const firstTokenAfterObject = sourceCode.getTokenAfter(
callee.object,
astUtils.isNotClosingParenToken,
);
context.report({
node: callee.property,
loc: {
start: firstTokenAfterObject.loc.start,
end: callee.loc.end,
},
messageId: "expected",
data: {
callee: getPropertyText(callee),
},
fix(fixer) {
return fixer.insertTextBefore(
firstTokenAfterObject,
"\n",
);
},
});
}
},
};
},
};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_z","132":"B"},B:{"1":"_7L","132":"_I","513":"_iQ"},C:{"1":"_CQ _dI b","2":"_WI","513":"_zI _WB _sD W","2049":"_H c _oN"},D:{"1":"_BK","2":"_vF","260":"_6B _eG _ED","513":"hC _eC _fE"},E:{"2":"_5C","132":"_LC _lR","513":"C _IQ","1025":"_dE","1537":"_CC RD SD"},F:{"1":"_bJ","2":"_T","513":"_9R"},G:{"2":"_EB","132":"_lC _CP","513":"oD pD qD rD","1025":"_cE","1537":"sD _nI vD"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"2049":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_yD","2":"J","513":"_rI _oM FE"},Q:{"1":"JE"},R:{"1":"KE"},S:{"513":"_C"}},B:4,C:"Referrer Policy",D:true};
@@ -0,0 +1,7 @@
{
"version": 3,
"sources": ["../src/create-context.tsx"],
"sourcesContent": ["import * as React from 'react';\n\ntype ContextProvider<ContextValueType extends object | null> = React.FC<\n ContextValueType & {\n children: React.ReactNode;\n }\n>;\n\ninterface UseAssertedContext<ContextValueType extends object | null> {\n (consumerName: string): ContextValueType;\n}\n\ninterface UseContext<ContextValueType extends object | null> {\n (consumerName: string): ContextValueType;\n (consumerName: string, options: { optional: true }): ContextValueType | undefined;\n}\n\nfunction createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n): readonly [ContextProvider<ContextValueType>, UseContext<ContextValueType>];\nfunction createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext: ContextValueType,\n): readonly [ContextProvider<ContextValueType>, UseAssertedContext<ContextValueType>];\n\nfunction createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType,\n): readonly [ContextProvider<ContextValueType>, UseContext<ContextValueType>] {\n const Context = React.createContext<ContextValueType | undefined>(defaultContext);\n Context.displayName = rootComponentName + 'Context';\n\n const Provider: ContextProvider<ContextValueType> = (props) => {\n const { children, ...context } = props;\n // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = React.useMemo(() => context, Object.values(context)) as ContextValueType;\n return <Context.Provider value={value}>{children}</Context.Provider>;\n };\n\n Provider.displayName = rootComponentName + 'Provider';\n\n function useContext(consumerName: string): ContextValueType;\n function useContext(\n consumerName: string,\n options: { optional: true },\n ): ContextValueType | undefined;\n\n function useContext(\n consumerName: string,\n options: { optional?: boolean } = {},\n ): ContextValueType | undefined {\n const { optional = false } = options;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext;\n if (optional) return undefined;\n // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n\n return [Provider, useContext];\n}\n\n/* -------------------------------------------------------------------------------------------------\n * createContextScope\n * -----------------------------------------------------------------------------------------------*/\n\ntype Scope<C = any> = { [scopeName: string]: React.Context<C>[] } | undefined;\ntype ScopeHook = (scope: Scope) => { [__scopeProp: string]: Scope };\ninterface CreateScope {\n scopeName: string;\n (): ScopeHook;\n}\n\ntype ScopedContextProvider<ContextValueType extends object | null> = React.FC<\n ContextValueType & {\n scope: Scope<ContextValueType>;\n children: React.ReactNode;\n }\n>;\n\ninterface UseScopedContext<ContextValueType extends object | null> {\n (consumerName: string, scope: Scope<ContextValueType | undefined>): ContextValueType;\n (\n consumerName: string,\n scope: Scope<ContextValueType | undefined>,\n options: { optional?: true },\n ): ContextValueType | undefined;\n}\n\ninterface UseAssertedScopedContext<ContextValueType extends object | null> {\n (consumerName: string, scope: Scope<ContextValueType | undefined>): ContextValueType;\n}\n\ninterface CreateScopedContext {\n <ContextValueType extends object | null>(\n rootComponentName: string,\n ): readonly [ScopedContextProvider<ContextValueType>, UseScopedContext<ContextValueType>];\n <ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext: ContextValueType,\n ): readonly [ScopedContextProvider<ContextValueType>, UseAssertedScopedContext<ContextValueType>];\n}\n\nfunction createContextScope(\n scopeName: string,\n createContextScopeDeps: CreateScope[] = [],\n): readonly [CreateScopedContext, CreateScope] {\n let defaultContexts: any[] = [];\n\n /* -----------------------------------------------------------------------------------------------\n * createContext\n * ---------------------------------------------------------------------------------------------*/\n\n function createContext<ContextValueType extends object | null>(\n rootComponentName: string,\n defaultContext?: ContextValueType,\n ) {\n const BaseContext = React.createContext<ContextValueType | undefined>(defaultContext);\n BaseContext.displayName = rootComponentName + 'Context';\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n\n const Provider: ScopedContextProvider<ContextValueType> = (props) => {\n const { scope, children, ...context } = props;\n const ContLine truncated
"mappings": ";AAAA,YAAY,WAAW;AAqCZ;AAZX,SAASA,eACP,mBACA,gBAC4E;AAC5E,QAAM,UAAgB,oBAA4C,cAAc;AAChF,UAAQ,cAAc,oBAAoB;AAE1C,QAAM,WAA8C,CAAC,UAAU;AAC7D,UAAM,EAAE,UAAU,GAAG,QAAQ,IAAI;AAGjC,UAAM,QAAc,cAAQ,MAAM,SAAS,OAAO,OAAO,OAAO,CAAC;AACjE,WAAO,oBAAC,QAAQ,UAAR,EAAiB,OAAe,UAAS;AAAA,EACnD;AAEA,WAAS,cAAc,oBAAoB;AAQ3C,WAASC,YACP,cACA,UAAkC,CAAC,GACL;AAC9B,UAAM,EAAE,WAAW,MAAM,IAAI;AAC7B,UAAM,UAAgB,iBAAW,OAAO;AACxC,QAAI,QAAS,QAAO;AACpB,QAAI,mBAAmB,OAAW,QAAO;AACzC,QAAI,SAAU,QAAO;AAErB,UAAM,IAAI,MAAM,KAAK,YAAY,4BAA4B,iBAAiB,IAAI;AAAA,EACpF;AAEA,SAAO,CAAC,UAAUA,WAAU;AAC9B;AA2CA,SAAS,mBACP,WACA,yBAAwC,CAAC,GACI;AAC7C,MAAI,kBAAyB,CAAC;AAM9B,WAASD,eACP,mBACA,gBACA;AACA,UAAM,cAAoB,oBAA4C,cAAc;AACpF,gBAAY,cAAc,oBAAoB;AAC9C,UAAM,QAAQ,gBAAgB;AAC9B,sBAAkB,CAAC,GAAG,iBAAiB,cAAc;AAErD,UAAM,WAAoD,CAAC,UAAU;AACnE,YAAM,EAAE,OAAO,UAAU,GAAG,QAAQ,IAAI;AACxC,YAAM,UAAU,QAAQ,SAAS,IAAI,KAAK,KAAK;AAG/C,YAAM,QAAc,cAAQ,MAAM,SAAS,OAAO,OAAO,OAAO,CAAC;AACjE,aAAO,oBAAC,QAAQ,UAAR,EAAiB,OAAe,UAAS;AAAA,IACnD;AAEA,aAAS,cAAc,oBAAoB;AAY3C,aAASC,YACP,cACA,OACA,UAAkC,CAAC,GACL;AAC9B,YAAM,EAAE,WAAW,MAAM,IAAI;AAC7B,YAAM,UAAU,QAAQ,SAAS,IAAI,KAAK,KAAK;AAC/C,YAAM,UAAgB,iBAAW,OAAO;AACxC,UAAI,QAAS,QAAO;AACpB,UAAI,mBAAmB,OAAW,QAAO;AACzC,UAAI,SAAU,QAAO;AAErB,YAAM,IAAI,MAAM,KAAK,YAAY,4BAA4B,iBAAiB,IAAI;AAAA,IACpF;AAEA,WAAO,CAAC,UAAUA,WAAU;AAAA,EAC9B;AAMA,QAAM,cAA2B,MAAM;AACrC,UAAM,gBAAgB,gBAAgB,IAAI,CAAC,mBAAmB;AAC5D,aAAa,oBAAc,cAAc;AAAA,IAC3C,CAAC;AACD,WAAO,SAAS,SAAS,OAAc;AACrC,YAAM,WAAW,QAAQ,SAAS,KAAK;AACvC,aAAa;AAAA,QACX,OAAO,EAAE,CAAC,UAAU,SAAS,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,EAAE;AAAA,QACtE,CAAC,OAAO,QAAQ;AAAA,MAClB;AAAA,IACF;AAAA,EACF;AAEA,cAAY,YAAY;AACxB,SAAO,CAACD,gBAAe,qBAAqB,aAAa,GAAG,sBAAsB,CAAC;AACrF;AAMA,SAAS,wBAAwB,QAAsD;AACrF,QAAM,YAAY,OAAO,CAAC;AAC1B,MAAI,OAAO,WAAW,EAAG,QAAO;AAEhC,QAAM,cAA2B,MAAM;AACrC,UAAM,aAAa,OAAO,IAAI,CAACE,kBAAiB;AAAA,MAC9C,UAAUA,aAAY;AAAA,MACtB,WAAWA,aAAY;AAAA,IACzB,EAAE;AAEF,WAAO,SAAS,kBAAkB,gBAAgB;AAChD,YAAM,aAAa,WAAW,OAAO,CAACC,aAAY,EAAE,UAAU,UAAU,MAAM;AAI5E,cAAM,aAAa,SAAS,cAAc;AAC1C,cAAM,eAAe,WAAW,UAAU,SAAS,EAAE;AACrD,eAAO,EAAE,GAAGA,aAAY,GAAG,aAAa;AAAA,MAC1C,GAAG,CAAC,CAAC;AAEL,aAAa,cAAQ,OAAO,EAAE,CAAC,UAAU,UAAU,SAAS,EAAE,GAAG,WAAW,IAAI,CAAC,UAAU,CAAC;AAAA,IAC9F;AAAA,EACF;AAEA,cAAY,YAAY,UAAU;AAClC,SAAO;AACT;",
"names": ["createContext", "useContext", "createScope", "nextScopes"]
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_z","164":"B"},B:{"1":"_K","36":"_I"},C:{"1":"_4L","2":"_VS","36":"_GL _2Q"},D:{"1":"_4J","2":"_9E"},E:{"1":"_QE","2":"_cD"},F:{"1":"_3G","2":"_YI"},G:{"1":"_AD","2":"_YC"},H:{"2":"1D"},I:{"2":"_P"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"A","36":"B"},O:{"1":"bC"},P:{"1":"_U","16":"J"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"_C"}},B:5,C:"Screen Orientation",D:true};