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

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

No files matched your search

@@ -0,0 +1 @@
{"version":3,"file":"use-props.mjs","sources":["../../../../src/render/html/use-props.ts"],"sourcesContent":["\"use client\"\n\nimport { AnyResolvedKeyframe, buildHTMLStyles, isForcedMotionValue, isMotionValue, MotionValue } from \"motion-dom\"\nimport { HTMLProps, useMemo } from \"react\"\nimport { MotionProps } from \"../../motion/types\"\nimport { ResolvedValues } from \"../types\"\nimport { createHtmlRenderState } from \"./utils/create-render-state\"\n\nexport function copyRawValuesOnly(\n target: ResolvedValues,\n source: { [key: string]: AnyResolvedKeyframe | MotionValue },\n props: MotionProps\n) {\n for (const key in source) {\n if (!isMotionValue(source[key]) && !isForcedMotionValue(key, props)) {\n target[key] = source[key] as AnyResolvedKeyframe\n }\n }\n}\n\nfunction useInitialMotionValues(\n { transformTemplate }: MotionProps,\n visualState: ResolvedValues\n) {\n return useMemo(() => {\n const state = createHtmlRenderState()\n\n buildHTMLStyles(state, visualState, transformTemplate)\n\n return Object.assign({}, state.vars, state.style)\n }, [visualState])\n}\n\nfunction useStyle(\n props: MotionProps,\n visualState: ResolvedValues\n): ResolvedValues {\n const styleProp = props.style || {}\n const style = {}\n\n /**\n * Copy non-Motion Values straight into style\n */\n copyRawValuesOnly(style, styleProp as any, props)\n\n Object.assign(style, useInitialMotionValues(props, visualState))\n\n return style\n}\n\nexport function useHTMLProps(\n props: MotionProps & HTMLProps<HTMLElement>,\n visualState: ResolvedValues\n) {\n // The `any` isn't ideal but it is the type of createElement props argument\n const htmlProps: any = {}\n const style = useStyle(props, visualState)\n\n if (props.drag && props.dragListener !== false) {\n // Disable the ghost element when a user drags\n htmlProps.draggable = false\n\n // Disable text selection\n style.userSelect =\n style.WebkitUserSelect =\n style.WebkitTouchCallout =\n \"none\"\n\n // Disable scrolling on the draggable direction\n style.touchAction =\n props.drag === true\n ? \"none\"\n : `pan-${props.drag === \"x\" ? \"y\" : \"x\"}`\n }\n\n if (\n props.tabIndex === undefined &&\n (props.onTap || props.onTapStart || props.whileTap)\n ) {\n htmlProps.tabIndex = 0\n }\n\n htmlProps.style = style\n\n return htmlProps\n}\n"],"names":[],"mappings":";;;;;;AAaI;AACI;;;;AAIR;AAEA;;AAKQ;AAEA;AAEA;AACJ;AACJ;AAEA;AAII;;AAGA;;AAEG;AACH;AAEA;AAEA;AACJ;AAEM;;;;;;AAUE;;AAGA;AACI;AACA;AACI;;AAGR;;AAEQ;AACA;;AAGZ;AAEI;AAEA;;AAGJ;AAEA;AACJ;;"}
@@ -0,0 +1 @@
{"version":3,"file":"ticket-slash.js","sources":["../../../src/icons/ticket-slash.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TicketSlash\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiA5YTMgMyAwIDAgMSAwIDZ2MmEyIDIgMCAwIDAgMiAyaDE2YTIgMiAwIDAgMCAyLTJ2LTJhMyAzIDAgMCAxIDAtNlY3YTIgMiAwIDAgMC0yLTJINGEyIDIgMCAwIDAtMiAyWiIgLz4KICA8cGF0aCBkPSJtOS41IDE0LjUgNS01IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/ticket-slash\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 TicketSlash = createLucideIcon('TicketSlash', [\n [\n 'path',\n {\n d: 'M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z',\n key: 'qn84l0',\n },\n ],\n ['path', { d: 'm9.5 14.5 5-5', key: 'qviqfa' }],\n]);\n\nexport default TicketSlash;\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,CAClD,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;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,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"mouse-pointer.js","sources":["../../../src/icons/mouse-pointer.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MousePointer\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIuNTg2IDEyLjU4NiAxOSAxOSIgLz4KICA8cGF0aCBkPSJNMy42ODggMy4wMzdhLjQ5Ny40OTcgMCAwIDAtLjY1MS42NTFsNi41IDE1Ljk5OWEuNTAxLjUwMSAwIDAgMCAuOTQ3LS4wNjJsMS41NjktNi4wODNhMiAyIDAgMCAxIDEuNDQ4LTEuNDc5bDYuMTI0LTEuNTc5YS41LjUgMCAwIDAgLjA2My0uOTQ3eiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/mouse-pointer\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 MousePointer = createLucideIcon('MousePointer', [\n ['path', { d: 'M12.586 12.586 19 19', key: 'ea5xo7' }],\n [\n 'path',\n {\n d: 'M3.688 3.037a.497.497 0 0 0-.651.651l6.5 15.999a.501.501 0 0 0 .947-.062l1.569-6.083a2 2 0 0 1 1.448-1.479l6.124-1.579a.5.5 0 0 0 .063-.947z',\n key: '277e5u',\n },\n ],\n]);\n\nexport default MousePointer;\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,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,CACrD,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;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,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 ClipboardPlus = createLucideIcon("ClipboardPlus", [
["rect", { width: "8", height: "4", x: "8", y: "2", rx: "1", ry: "1", key: "tgr4d6" }],
[
"path",
{
d: "M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",
key: "116196"
}
],
["path", { d: "M9 14h6", key: "159ibu" }],
["path", { d: "M12 17v-6", key: "1y8rbf" }]
]);
export { ClipboardPlus as default };
//# sourceMappingURL=clipboard-plus.js.map
@@ -0,0 +1,105 @@
# brace-expansion
[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
as known from sh/bash, in JavaScript.
[![CI](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml)
[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion)
## Example
```js
import { expand } from 'brace-expansion'
expand('file-{a,b,c}.jpg')
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
expand('-v{,,}')
// => ['-v', '-v', '-v']
expand('file{0..2}.jpg')
// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
expand('file-{a..c}.jpg')
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
expand('file{2..0}.jpg')
// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
expand('file{0..4..2}.jpg')
// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
expand('file-{a..e..2}.jpg')
// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
expand('file{00..10..5}.jpg')
// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
expand('{{A..C},{a..c}}')
// => ['A', 'B', 'C', 'a', 'b', 'c']
expand('ppp{,config,oe{,conf}}')
// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
```
## API
```js
import { expand } from 'brace-expansion'
```
### const expanded = expand(str, [options])
Return an array of all possible and valid expansions of `str`. If
none are found, `[str]` is returned.
The `options` object can provide a `max` value to cap the number
of expansions allowed. This is limited to `100_000` by default,
to prevent DoS attacks.
```js
const expansions = expand('{1..100}'.repeat(5), {
max: 100,
})
// expansions.length will be 100, not 100^5
```
The `options` object can also provide a `maxLength` value to cap the
total number of characters across all expansions. This is limited to
`4_000_000` by default, to prevent memory exhaustion from inputs whose
result count stays under `max` while each result grows very long.
```js
const expansions = expand('{a,b}'.repeat(1500), {
maxLength: 10_000,
})
```
Valid expansions are:
```js
;/^(.*,)+(.+)?$/
// {a,b,...}
```
A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
```js
;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
// {x..y[..incr]}
```
A numeric sequence from `x` to `y` inclusive, with optional increment.
If `x` or `y` start with a leading `0`, all the numbers will be padded
to have equal length. Negative numbers and backwards iteration work too.
```js
;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
// {x..y[..incr]}
```
An alphabetic sequence from `x` to `y` inclusive, with optional increment.
`x` and `y` must be exactly one character, and if given, `incr` must be a
number.
For compatibility reasons, the string `${` is not eligible for brace expansion.
@@ -0,0 +1 @@
{"version":3,"file":"scoring.cjs","sources":["../../../src/matcher/dictionary/scoring.ts"],"sourcesContent":[null],"names":["rank","reversed","l33t","subs","token","dictionaryName","baseGuesses","uppercaseVariations","uppercaseVariant","l33tVariations","l33tVariant","reversedVariations","calculation"],"mappings":";;;;;AAYA,wBAAe,CAAC;EACdA,IAAI;EACJC,QAAQ;QACRC,MAAI;EACJC,IAAI;EACJC,KAAK;AACLC,EAAAA;AAAc,CACiB,KAAsB;AACrD,EAAA,MAAMC,WAAW,GAAGN,IAAI,CAAA;AACxB,EAAA,MAAMO,mBAAmB,GAAGC,SAAgB,CAACJ,KAAK,CAAC;EACnD,MAAMK,cAAc,GAAGC,IAAW,CAAC;UAAER,MAAI;IAAEC,IAAI;AAAEC,IAAAA;AAAK,GAAE,CAAC;AACzD,EAAA,MAAMO,kBAAkB,GAAIV,QAAQ,IAAI,CAAC,IAAK,CAAC;AAC/C,EAAA,IAAIW,WAAW;EACf,IAAIP,cAAc,KAAK,UAAU,EAAE;AACjC;AACA;AACAO,IAAAA,WAAW,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC;AAC1B,EAAA,CAAC,MAAM;AACLA,IAAAA,WAAW,GACTN,WAAW,GAAGC,mBAAmB,GAAGE,cAAc,GAAGE,kBAAkB;AAC3E,EAAA;EACA,OAAO;IACLL,WAAW;IACXC,mBAAmB;IACnBE,cAAc;AACdG,IAAAA;GACD;AACH,CAAC;;;;"}
@@ -0,0 +1,82 @@
/* (c) 2015 Ari Porad (@ariporad) <http://ariporad.com>. License: ariporad.mit-license.org */
/**
* The hook. Accepts the code of the module and the filename.
*/
declare type Hook = (code: string, filename: string) => string;
/**
* A matcher function, will be called with path to a file.
*
* Should return truthy if the file should be hooked, falsy otherwise.
*/
declare type Matcher = (path: string) => boolean;
/**
* Reverts the hook when called.
*/
declare type RevertFunction = () => void;
interface Options {
/**
* The extensions to hook. Should start with '.' (ex. ['.js']).
*
* Takes precedence over `exts`, `extension` and `ext`.
*
* @alias exts
* @alias extension
* @alias ext
* @default ['.js']
*/
extensions?: ReadonlyArray<string> | string;
/**
* The extensions to hook. Should start with '.' (ex. ['.js']).
*
* Takes precedence over `extension` and `ext`.
*
* @alias extension
* @alias ext
* @default ['.js']
*/
exts?: ReadonlyArray<string> | string;
/**
* The extensions to hook. Should start with '.' (ex. ['.js']).
*
* Takes precedence over `ext`.
*
* @alias ext
* @default ['.js']
*/
extension?: ReadonlyArray<string> | string;
/**
* The extensions to hook. Should start with '.' (ex. ['.js']).
*
* @default ['.js']
*/
ext?: ReadonlyArray<string> | string;
/**
* A matcher function, will be called with path to a file.
*
* Should return truthy if the file should be hooked, falsy otherwise.
*/
matcher?: Matcher | null;
/**
* Auto-ignore node_modules. Independent of any matcher.
*
* @default true
*/
ignoreNodeModules?: boolean;
}
/**
* Add a require hook.
*
* @param hook The hook. Accepts the code of the module and the filename. Required.
* @returns The `revert` function. Reverts the hook when called.
*/
export declare function addHook(hook: Hook, opts?: Options): RevertFunction;
export {};
@@ -0,0 +1,99 @@
import Options from '../../Options'
import { MatchEstimated } from '../../types'
import { ALL_UPPER_INVERTED, START_UPPER } from '../../data/const'
const getDictionaryWarningPassword = (
options: Options,
match: MatchEstimated,
isSoleMatch?: boolean,
) => {
let warning: string | null = null
if (isSoleMatch && !match.l33t && !match.reversed) {
if (match.rank <= 10) {
warning = options.translations.warnings.topTen
} else if (match.rank <= 100) {
warning = options.translations.warnings.topHundred
} else {
warning = options.translations.warnings.common
}
} else if (match.guessesLog10 <= 4) {
warning = options.translations.warnings.similarToCommon
}
return warning
}
const getDictionaryWarningWikipedia = (
options: Options,
match: MatchEstimated,
isSoleMatch?: boolean,
) => {
let warning: string | null = null
if (isSoleMatch) {
warning = options.translations.warnings.wordByItself
}
return warning
}
const getDictionaryWarningNames = (
options: Options,
match: MatchEstimated,
isSoleMatch?: boolean,
) => {
if (isSoleMatch) {
return options.translations.warnings.namesByThemselves
}
return options.translations.warnings.commonNames
}
const getDictionaryWarning = (
options: Options,
match: MatchEstimated,
isSoleMatch?: boolean,
) => {
const dictName = match.dictionaryName
const isAName =
dictName.toLowerCase().includes('lastnames') ||
dictName.toLowerCase().includes('firstnames') ||
dictName.toLowerCase().includes('names')
if (dictName.includes('passwords')) {
return getDictionaryWarningPassword(options, match, isSoleMatch)
}
if (dictName.includes('wikipedia')) {
return getDictionaryWarningWikipedia(options, match, isSoleMatch)
}
if (isAName) {
return getDictionaryWarningNames(options, match, isSoleMatch)
}
if (dictName.includes('userInputs')) {
return options.translations.warnings.userInputs
}
return null
}
export default (
options: Options,
match: MatchEstimated,
isSoleMatch?: boolean,
) => {
const warning = getDictionaryWarning(options, match, isSoleMatch)
const suggestions: string[] = []
const word = match.token
if (word.match(START_UPPER)) {
suggestions.push(options.translations.suggestions.capitalization)
} else if (word.match(ALL_UPPER_INVERTED) && word.toLowerCase() !== word) {
suggestions.push(options.translations.suggestions.allUppercase)
}
if (match.reversed && match.token.length >= 4) {
suggestions.push(options.translations.suggestions.reverseWords)
}
if (match.l33t) {
suggestions.push(options.translations.suggestions.l33t)
}
return {
warning,
suggestions,
}
}
@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _classPrivateFieldBase;
function _classPrivateFieldBase(receiver, privateKey) {
if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
throw new TypeError("attempted to use private field on non-instance");
}
return receiver;
}
//# sourceMappingURL=classPrivateFieldLooseBase.js.map
@@ -0,0 +1,101 @@
# p-limit
> Run multiple promise-returning & async functions with limited concurrency
## Install
```
$ npm install p-limit
```
## Usage
```js
const pLimit = require('p-limit');
const limit = pLimit(1);
const input = [
limit(() => fetchSomething('foo')),
limit(() => fetchSomething('bar')),
limit(() => doSomething())
];
(async () => {
// Only one promise is run at once
const result = await Promise.all(input);
console.log(result);
})();
```
## API
### pLimit(concurrency)
Returns a `limit` function.
#### concurrency
Type: `number`\
Minimum: `1`\
Default: `Infinity`
Concurrency limit.
### limit(fn, ...args)
Returns the promise returned by calling `fn(...args)`.
#### fn
Type: `Function`
Promise-returning/async function.
#### args
Any arguments to pass through to `fn`.
Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions.
### limit.activeCount
The number of promises that are currently running.
### limit.pendingCount
The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
### limit.clearQueue()
Discard pending promises that are waiting to run.
This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.
Note: This does not cancel promises that are already running.
## FAQ
### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package?
This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue.
## Related
- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control
- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions
- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions
- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
- [More…](https://github.com/sindresorhus/promise-fun)
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-p-limit?utm_source=npm-p-limit&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>
@@ -0,0 +1,19 @@
/** Generate a PKCE code challenge from a code verifier
* @param code_verifier
* @returns The base64 url encoded code challenge
*/
export declare function generateChallenge(code_verifier: string): Promise<string>;
/** Generate a PKCE challenge pair
* @param length Length of the verifer (between 43-128). Defaults to 43.
* @returns PKCE challenge pair
*/
export default function pkceChallenge(length?: number): Promise<{
code_verifier: string;
code_challenge: string;
}>;
/** Verify that a code_verifier produces the expected code challenge
* @param code_verifier
* @param expectedChallenge The code challenge to verify
* @returns True if challenges are equal. False otherwise.
*/
export declare function verifyChallenge(code_verifier: string, expectedChallenge: string): Promise<boolean>;
@@ -0,0 +1 @@
{"version":3,"file":"file-video.js","sources":["../../../src/icons/file-video.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileVideo\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgMkg2YTIgMiAwIDAgMC0yIDJ2MTZhMiAyIDAgMCAwIDIgMmgxMmEyIDIgMCAwIDAgMi0yVjdaIiAvPgogIDxwYXRoIGQ9Ik0xNCAydjRhMiAyIDAgMCAwIDIgMmg0IiAvPgogIDxwYXRoIGQ9Im0xMCAxMSA1IDMtNSAzdi02WiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/file-video\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 FileVideo = createLucideIcon('FileVideo', [\n ['path', { d: 'M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z', key: '1rqfz7' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['path', { d: 'm10 11 5 3-5 3v-6Z', key: '7ntvm4' }],\n]);\n\nexport default FileVideo;\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,CAA8D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3F,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAsB,CAAA,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;AACrD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"names":["_tdzError","name","ReferenceError"],"sources":["../../src/helpers/tdz.ts"],"sourcesContent":["/* @minVersion 7.5.5 */\n\nexport default function _tdzError(name: string): never {\n throw new ReferenceError(name + \" is not defined - temporal dead zone\");\n}\n"],"mappings":";;;;;;AAEe,SAASA,SAASA,CAACC,IAAY,EAAS;EACrD,MAAM,IAAIC,cAAc,CAACD,IAAI,GAAG,sCAAsC,CAAC;AACzE","ignoreList":[]}
@@ -0,0 +1,15 @@
import { warnOnce } from 'motion-utils';
import { useScroll } from '../use-scroll.mjs';
/**
* @deprecated useElementScroll is deprecated. Convert to useScroll({ container: ref })
*/
function useElementScroll(ref) {
if (process.env.NODE_ENV === "development") {
warnOnce(false, "useElementScroll is deprecated. Convert to useScroll({ container: ref }).");
}
return useScroll({ container: ref });
}
export { useElementScroll };
//# sourceMappingURL=use-element-scroll.mjs.map
@@ -0,0 +1,121 @@
import type { $ZodStringFormats } from "../core/checks.js";
import type * as errors from "../core/errors.js";
import * as util from "../core/util.js";
const error: () => errors.$ZodErrorMap = () => {
const Sizable: Record<string, { unit: string; verb: string }> = {
string: { unit: "Zeichen", verb: "zu haben" },
file: { unit: "Bytes", verb: "zu haben" },
array: { unit: "Elemente", verb: "zu haben" },
set: { unit: "Elemente", verb: "zu haben" },
map: { unit: "Elemente", verb: "zu haben" },
};
function getSizing(origin: string): { unit: string; verb: string } | null {
return Sizable[origin] ?? null;
}
const FormatDictionary: {
[k in $ZodStringFormats | (string & {})]?: string;
} = {
regex: "Eingabe",
email: "E-Mail-Adresse",
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: "ISO-Datum und -Uhrzeit",
date: "ISO-Datum",
time: "ISO-Uhrzeit",
duration: "ISO-Dauer",
ipv4: "IPv4-Adresse",
ipv6: "IPv6-Adresse",
mac: "MAC-Adresse",
cidrv4: "IPv4-Bereich",
cidrv6: "IPv6-Bereich",
base64: "Base64-codierter String",
base64url: "Base64-URL-codierter String",
json_string: "JSON-String",
e164: "E.164-Nummer",
credit_card: "Kreditkartennummer",
currency_code: "Währungscode",
iban: "IBAN",
jwt: "JWT",
template_literal: "Eingabe",
};
const TypeDictionary: {
[k in errors.$ZodInvalidTypeExpected | (string & {})]?: string;
} = {
nan: "NaN",
number: "Zahl",
array: "Array",
};
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 `Ungültige Eingabe: erwartet instanceof ${issue.expected}, erhalten ${received}`;
}
return `Ungültige Eingabe: erwartet ${expected}, erhalten ${received}`;
}
case "invalid_value":
if (issue.values.length === 1) return `Ungültige Eingabe: erwartet ${util.stringifyPrimitive(issue.values[0])}`;
return `Ungültige Option: erwartet eine von ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing)
return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "Elemente"} hat`;
return `Zu groß: erwartet, dass ${issue.origin ?? "Wert"} ${adj}${issue.maximum.toString()} ist`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} hat`;
}
return `Zu klein: erwartet, dass ${issue.origin} ${adj}${issue.minimum.toString()} ist`;
}
case "invalid_format": {
const _issue = issue as errors.$ZodStringFormatIssues;
if (_issue.format === "starts_with") return `Ungültiger String: muss mit "${_issue.prefix}" beginnen`;
if (_issue.format === "ends_with") return `Ungültiger String: muss mit "${_issue.suffix}" enden`;
if (_issue.format === "includes") return `Ungültiger String: muss "${_issue.includes}" enthalten`;
if (_issue.format === "regex") return `Ungültiger String: muss dem Muster ${_issue.pattern} entsprechen`;
return `Ungültig: ${FormatDictionary[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Ungültige Zahl: muss ein Vielfaches von ${issue.divisor} sein`;
case "unrecognized_keys":
return `${issue.keys.length > 1 ? "Unbekannte Schlüssel" : "Unbekannter Schlüssel"}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Ungültiger Schlüssel in ${issue.origin}`;
case "invalid_union":
return "Ungültige Eingabe";
case "invalid_element":
return `Ungültiger Wert in ${issue.origin}`;
default:
return `Ungültige Eingabe`;
}
};
};
export default function (): { localeError: errors.$ZodErrorMap } {
return {
localeError: error(),
};
}
@@ -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 FileVideo = createLucideIcon("FileVideo", [
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
["path", { d: "m10 11 5 3-5 3v-6Z", key: "7ntvm4" }]
]);
export { FileVideo as default };
//# sourceMappingURL=file-video.js.map
@@ -0,0 +1,6 @@
"use strict";
function addMilliseconds(date, ms) {
date.setTime(+date + ms);
return date;
}
module.exports = addMilliseconds;
@@ -0,0 +1,616 @@
flf2a% 6 6 21 0 3
cosmic.flf by Mike Rosulek <mjr@netins.net>, 7/11/95. Check out my
homepage at: http://www.netins.net/showcase/mikewrld/
---- Modified and corrected by Michel Eftimakis (Michel.Eftimakis@vlsi.com) ----
%%%%#
%%%%#
%%%%#
%%%%#
%%%%#
%%%%##
.:#
;;;#
'[[#
$$#
""#
MM##
%:: ::%#
%"; ;"%#
#
#
#
##
:: :: #
__,;'_,;'_#
''[[''[[''#
,$" ,$" #
o88oo88oo #
,M" ,M" ##
.: #
,;;;. #
[[,,_` #
`"""Yo#
Yo_,d"#
'M' ##
.. .:`#
; ; ,;` #
^^ ,[` #
cP ,, #
,8" 8 8#
,dP "" ##
:\ #
.;;' #
([__ #
c$"" #
"Yo,oP#
"M,##
::#
,'#
#
#
#
##
.:#
,;' #
n[ #
Y$ #
8o,#
"M##
:. #
';,#
[n#
$Y#
,o8 #
M" ##
#
\|/ #
/|\ #
#
#
##
#
#
[ #
%$$$$$%#
8 #
##
#
#
#
#
d8b#
,M"##
#
#
#
%cccc%#
#
##
#
#
#
#
d8b#
YMP##
/:`#
/;` #
n[' #
c$" #
o8" #
mM" ##
#
,;;, #
,[' [n #
$$ $$#
Y8, ,8"#
"YmmP ##
:.#
;;#
[[#
$$#
88#
MM##
.:::. #
,;'``;. #
'' ,[['#
.c$$P' #
d88 _,oo,#
MMMUP*"^^##
.::. #
;'`';;, #
.n[[ #
``"$$$.#
,,o888"#
YMMP" ##
.:: #
,;';; #
,[' [[ #
$P__$$c#
`"""88"#
MM ##
::::::::#
`;;``'';#
[[,_ #
`""*Ycc#
__,od8"#
MMP" ##
.:. #
,;' #
,[[.od8b #
$$$" "$$#
Y8b,,d8P#
"YMP" ##
...:::::#
'''``;;'#
.[' #
,$$' #
888 #
MMM ##
.::::. #
`;. ,;'#
[nn[, #
$" $c#
Yb,_,8P#
"YMP" ##
.,,. #
,;;'`';,#
[[, _,[[#
Y$$P"$$#
,,_,d8"#
"MP" ##
#
,;,#
'['#
#
d8b#
YMP##
#
,;,#
'['#
#
d8b#
,M"##
#
,,#
,[['#
c$ #
"8bo,#
"MP##
#
#
%,,,,,%#
% """"%#
%oooo%#
%""""%##
#
,, #
'[[, #
$c#
,od8"#
YM" ##
.-::::-.#
;;'```;;;#
,n[[' #
d$P" #
"" #
MM ##
.:::''''''':::. #
;;' ,;;;;;;,.; `;.#
:[[ [. .['[[ [[#
$$, 'Y$$$P'Y$$P' #
'Y8o,_ __,oo #
`"YUMMMMMMUY" ##
:::. #
;;`;; #
,[[ '[[, #
c$$$cc$$$c #
888 888,#
YMM ""` ##
:::::::. #
;;;'';;' #
[[[__[[\.#
$$""""Y$$#
_88o,,od8P#
""YUMMMP" ##
.,-::::: #
,;;;'````' #
[[[ #
$$$ #
`88bo,__,o, #
"YUMMMMMP"##
:::::::-. #
;;, `';,#
`[[ [[#
$$, $$#
888_,o8P'#
MMMMP"` ##
.,:::::: #
;;;;'''' #
[[cccc #
$$"""" #
888oo,__ #
""""YUMMM##
.-:::::'#
;;;'''' #
[[[,,== #
`$$$"`` #
888 #
"MM, ##
.,-:::::/ #
,;;-'````' #
[[[ [[[[[[/#
"$$c. "$$ #
`Y8bo,,,o88o#
`'YMUP"YMM##
:: .: #
,;; ;;, #
,[[[,,,[[[ #
"$$$"""$$$ #
888 "88o#
MMM YMM##
:::#
;;;#
[[[#
$$$#
888#
MMM##
....::::::#
;;;;;;;;;````#
''` `[[. #
,,, `$$ #
888boood88 #
"MMMMMMMM" ##
::: . #
;;; .;;,.#
[[[[[/' #
_$$$$, #
"888"88o, #
MMM "MMP"##
::: #
;;; #
[[[ #
$$' #
o88oo,.__#
""""YUMMM##
. : #
;;,. ;;; #
[[[[, ,[[[[, #
$$$$$$$$"$$$ #
888 Y88" 888o#
MMM M' "MMM##
:::. :::.#
`;;;;, `;;;#
[[[[[. '[[#
$$$ "Y$c$$#
888 Y88#
MMM YM##
... #
.;;;;;;;. #
,[[ \[[,#
$$$, $$$#
"888,_ _,88P#
"YMMMMMP" ##
::::::::::. #
`;;;```.;;;#
`]]nnn]]' #
$$$"" #
888o #
YMMMb ##
.::::::. #
,;;'```';;, #
[[[ [[[\#
"$$c cc$$$"#
"*8bo,Y88b,#
"*YP" "M"##
:::::::.. #
;;;;``;;;; #
[[[,/[[[' #
$$$$$$c #
888b "88bo,#
MMMM "W" ##
.::::::. #
;;;` ` #
'[==/[[[[,#
''' $#
88b dP#
"YMmMY" ##
::::::::::::#
;;;;;;;;''''#
[[ #
$$ #
88, #
MMM ##
... :::#
;; ;;;#
[[' [[[#
$$ $$$#
88 .d888#
"YmmMMMM""##
::: .::.#
';;, ,;;;' #
\[[ .[[/ #
Y$c.$$" #
Y88P #
MP ##
.:: . .:::#
';;, ;; ;;;' #
'[[, [[, [[' #
Y$c$$$c$P #
"88"888 #
"M "M" ##
.,:: .:#
`;;;, .,;; #
'[[,,[[' #
Y$$$P #
oP"``"Yo, #
,m" "Mm,##
.-:. ::-.#
';;. ;;;;'#
'[[,[[[' #
c$$" #
,8P"` #
mM" ##
:::::::::#
'`````;;;#
.n[['#
,$$P" #
,888bo,_ #
`""*UMM ##
::::#
;;' #
[[ #
$$ #
88, #
"YMM##
`:\ #
`;\ #
'[n #
"$c #
"8o #
"Mm##
::::#
';;#
[[#
$$#
,88#
MMP"##
.:. #
;' `;#
#
#
#
##
#
#
#
#
#
mmmmmmm##
`:. #
`;,#
#
#
#
##
:::. #
;;`;; #
,[[ '[[, #
c$$$cc$$$c #
888 888,#
YMM ""` ##
:::::::. #
;;;'';;' #
[[[__[[\.#
$$""""Y$$#
_88o,,od8P#
""YUMMMP" ##
.,-::::: #
,;;;'````' #
[[[ #
$$$ #
`88bo,__,o, #
"YUMMMMMP"##
:::::::-. #
;;, `';,#
`[[ [[#
$$, $$#
888_,o8P'#
MMMMP"` ##
.,:::::: #
;;;;'''' #
[[cccc #
$$"""" #
888oo,__ #
""""YUMMM##
.-:::::'#
;;;'''' #
[[[,,== #
`$$$"`` #
888 #
"MM, ##
.,-:::::/ #
,;;-'````' #
[[[ [[[[[[/#
"$$c. "$$ #
`Y8bo,,,o88o#
`'YMUP"YMM##
:: .: #
,;; ;;, #
,[[[,,,[[[ #
"$$$"""$$$ #
888 "88o#
MMM YMM##
:::#
;;;#
[[[#
$$$#
888#
MMM##
....::::::#
;;;;;;;;;````#
''` `[[. #
,,, `$$ #
888boood88 #
"MMMMMMMM" ##
::: . #
;;; .;;,.#
[[[[[/' #
_$$$$, #
"888"88o, #
MMM "MMP"##
::: #
;;; #
[[[ #
$$' #
o88oo,.__#
""""YUMMM##
. : #
;;,. ;;; #
[[[[, ,[[[[, #
$$$$$$$$"$$$ #
888 Y88" 888o#
MMM M' "MMM##
:::. :::.#
`;;;;, `;;;#
[[[[[. '[[#
$$$ "Y$c$$#
888 Y88#
MMM YM##
... #
.;;;;;;;. #
,[[ \[[,#
$$$, $$$#
"888,_ _,88P#
"YMMMMMP" ##
::::::::::. #
`;;;```.;;;#
`]]nnn]]' #
$$$"" #
888o #
YMMMb ##
.::::::. #
,;;'```';;, #
[[[ [[[\#
"$$c cc$$$"#
"*8bo,Y88b,#
"*YP" "M"##
:::::::.. #
;;;;``;;;; #
[[[,/[[[' #
$$$$$$c #
888b "88bo,#
MMMM "W" ##
.::::::. #
;;;` ` #
'[==/[[[[,#
''' $#
88b dP#
"YMmMY" ##
::::::::::::#
;;;;;;;;''''#
[[ #
$$ #
88, #
MMM ##
... :::#
;; ;;;#
[[' [[[#
$$ $$$#
88 .d888#
"YmmMMMM""##
::: .::.#
';;, ,;;;' #
\[[ .[[/ #
Y$c.$$" #
Y88P #
MP ##
.:: . .:::#
';;, ;; ;;;' #
'[[, [[, [[' #
Y$c$$$c$P #
"88"888 #
"M "M" ##
.,:: .:#
`;;;, .,;; #
'[[,,[[' #
Y$$$P #
oP"``"Yo, #
,m" "Mm,##
.-:. ::-.#
';;. ;;;;'#
'[[,[[[' #
c$$" #
,8P"` #
mM" ##
:::::::::#
'`````;;;#
.n[['#
,$$P" #
,888bo,_ #
`""*UMM ##
.:#
;'#
[#
$"#
8 #
"M##
`:#
,;#
[[#
$$#
88#
MM##
:.#
';#
[ #
"$#
8#
M"##
':.:':.#
`;' `;#
#
#
#
##
:: ::. :: #
;;`;; #
,[[ '[[, #
c$$$cc$$$c #
888 888,#
YMM ""` ##
:: ... :: #
.;;;;;;;. #
,[[ \[[,#
$$$, $$$#
"888,_ _,88P#
"YMMMMMP" ##
..:: :: ::#
;; ;;;#
[[' [[[#
$$ $$$#
88 .d888#
"YmmMMMM""##
:: ::. :: #
;;`;; #
,[[ '[[, #
c$$$cc$$$c #
888 888,#
YMM ""` ##
:: ... :: #
.;;;;;;;. #
,[[ \[[,#
$$$, $$$#
"888,_ _,88P#
"YMMMMMP" ##
..:: :: ::#
;; ;;;#
[[' [[[#
$$ $$$#
88 .d888#
"YmmMMMM""##
:::::::. #
;;;'';;' #
[[[__[[\.#
$$""""Y$$#
88o,,od8P#
MM`YMMP" ##
@@ -0,0 +1,22 @@
import * as core from "../core/index.js";
import * as schemas from "./schemas.js";
// @__NO_SIDE_EFFECTS__
export function string(params) {
return core._coercedString(schemas.ZodMiniString, params);
}
// @__NO_SIDE_EFFECTS__
export function number(params) {
return core._coercedNumber(schemas.ZodMiniNumber, params);
}
// @__NO_SIDE_EFFECTS__
export function boolean(params) {
return core._coercedBoolean(schemas.ZodMiniBoolean, params);
}
// @__NO_SIDE_EFFECTS__
export function bigint(params) {
return core._coercedBigint(schemas.ZodMiniBigInt, params);
}
// @__NO_SIDE_EFFECTS__
export function date(params) {
return core._coercedDate(schemas.ZodMiniDate, params);
}
@@ -0,0 +1,60 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var index_exports = {};
__export(index_exports, {
useEffectEvent: () => useEffectEvent
});
module.exports = __toCommonJS(index_exports);
// src/use-effect-event.tsx
var import_react_use_layout_effect = require("@radix-ui/react-use-layout-effect");
var React = __toESM(require("react"));
var useReactEffectEvent = React[" useEffectEvent ".trim().toString()];
var useReactInsertionEffect = React[" useInsertionEffect ".trim().toString()];
function useEffectEvent(callback) {
if (typeof useReactEffectEvent === "function") {
return useReactEffectEvent(callback);
}
const ref = React.useRef(() => {
throw new Error("Cannot call an event handler while rendering.");
});
if (typeof useReactInsertionEffect === "function") {
useReactInsertionEffect(() => {
ref.current = callback;
});
} else {
(0, import_react_use_layout_effect.useLayoutEffect)(() => {
ref.current = callback;
});
}
return React.useMemo(() => ((...args) => ref.current?.(...args)), []);
}
//# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).FloatingUIUtilsDOM={})}(this,(function(t){"use strict";function e(){return"undefined"!=typeof window}function n(t){return i(t)?(t.nodeName||"").toLowerCase():"#document"}function o(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function r(t){var e;return null==(e=(i(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function i(t){return!!e()&&(t instanceof Node||t instanceof o(t).Node)}function l(t){return!!e()&&(t instanceof Element||t instanceof o(t).Element)}function c(t){return!!e()&&(t instanceof HTMLElement||t instanceof o(t).HTMLElement)}function u(t){return!(!e()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof o(t).ShadowRoot)}function s(t){const{overflow:e,overflowX:n,overflowY:o,display:r}=g(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==r&&"contents"!==r}function f(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const a=/transform|translate|scale|rotate|perspective|filter/,d=/paint|layout|strict|content/,m=t=>!!t&&"none"!==t;let p;function w(t){const e=l(t)?g(t):t;return m(e.transform)||m(e.translate)||m(e.scale)||m(e.rotate)||m(e.perspective)||!v()&&(m(e.backdropFilter)||m(e.filter))||a.test(e.willChange||"")||d.test(e.contain||"")}function v(){return null==p&&(p="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),p}function y(t){return/^(html|body|#document)$/.test(n(t))}function g(t){return o(t).getComputedStyle(t)}function h(t){if("html"===n(t))return t;const e=t.assignedSlot||t.parentNode||u(t)&&t.host||r(t);return u(e)?e.host:e}function b(t){const e=h(t);return y(e)?t.ownerDocument?t.ownerDocument.body:t.body:c(e)&&s(e)?e:b(e)}function S(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}t.getComputedStyle=g,t.getContainingBlock=function(t){let e=h(t);for(;c(e)&&!y(e);){if(w(e))return e;if(f(e))return null;e=h(e)}return null},t.getDocumentElement=r,t.getFrameElement=S,t.getNearestOverflowAncestor=b,t.getNodeName=n,t.getNodeScroll=function(t){return l(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}},t.getOverflowAncestors=function t(e,n,r){var i;void 0===n&&(n=[]),void 0===r&&(r=!0);const l=b(e),c=l===(null==(i=e.ownerDocument)?void 0:i.body),u=o(l);if(c){const e=S(u);return n.concat(u,u.visualViewport||[],s(l)?l:[],e&&r?t(e):[])}return n.concat(l,t(l,[],r))},t.getParentNode=h,t.getWindow=o,t.isContainingBlock=w,t.isElement=l,t.isHTMLElement=c,t.isLastTraversableNode=y,t.isNode=i,t.isOverflowElement=s,t.isShadowRoot=u,t.isTableElement=function(t){return/^(table|td|th)$/.test(n(t))},t.isTopLayer=f,t.isWebKit=v}));
@@ -0,0 +1 @@
{"version":3,"file":"arrow-down-right.js","sources":["../../../src/icons/arrow-down-right.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowDownRight\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtNyA3IDEwIDEwIiAvPgogIDxwYXRoIGQ9Ik0xNyA3djEwSDciIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/arrow-down-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 ArrowDownRight = createLucideIcon('ArrowDownRight', [\n ['path', { d: 'm7 7 10 10', key: '1fmybs' }],\n ['path', { d: 'M17 7v10H7', key: '6fjiku' }],\n]);\n\nexport default ArrowDownRight;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,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,7 @@
{
"version": 3,
"sources": ["../src/index.ts", "../src/separator.tsx"],
"sourcesContent": ["export {\n Separator,\n //\n Root,\n} from './separator';\nexport type { SeparatorProps } from './separator';\n", "import * as React from 'react';\nimport { Primitive } from '@radix-ui/react-primitive';\n\n/* -------------------------------------------------------------------------------------------------\n * Separator\n * -----------------------------------------------------------------------------------------------*/\n\nconst NAME = 'Separator';\nconst DEFAULT_ORIENTATION = 'horizontal';\nconst ORIENTATIONS = ['horizontal', 'vertical'] as const;\n\ntype Orientation = (typeof ORIENTATIONS)[number];\ntype SeparatorElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface SeparatorProps extends PrimitiveDivProps {\n /**\n * Either `vertical` or `horizontal`. Defaults to `horizontal`.\n */\n orientation?: Orientation;\n /**\n * Whether or not the component is purely decorative. When true, accessibility-related attributes\n * are updated so that that the rendered element is removed from the accessibility tree.\n */\n decorative?: boolean;\n}\n\nconst Separator = React.forwardRef<SeparatorElement, SeparatorProps>((props, forwardedRef) => {\n const { decorative, orientation: orientationProp = DEFAULT_ORIENTATION, ...domProps } = props;\n const orientation = isValidOrientation(orientationProp) ? orientationProp : DEFAULT_ORIENTATION;\n // `aria-orientation` defaults to `horizontal` so we only need it if `orientation` is vertical\n const ariaOrientation = orientation === 'vertical' ? orientation : undefined;\n const semanticProps = decorative\n ? { role: 'none' }\n : { 'aria-orientation': ariaOrientation, role: 'separator' };\n\n return (\n <Primitive.div\n data-orientation={orientation}\n {...semanticProps}\n {...domProps}\n ref={forwardedRef}\n />\n );\n});\n\nSeparator.displayName = NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction isValidOrientation(orientation: any): orientation is Orientation {\n return ORIENTATIONS.includes(orientation);\n}\n\nconst Root = Separator;\n\nexport {\n Separator,\n //\n Root,\n};\nexport type { SeparatorProps };\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,YAAuB;AACvB,6BAA0B;AAmCtB;AA7BJ,IAAM,OAAO;AACb,IAAM,sBAAsB;AAC5B,IAAM,eAAe,CAAC,cAAc,UAAU;AAiB9C,IAAM,YAAkB,iBAA6C,CAAC,OAAO,iBAAiB;AAC5F,QAAM,EAAE,YAAY,aAAa,kBAAkB,qBAAqB,GAAG,SAAS,IAAI;AACxF,QAAM,cAAc,mBAAmB,eAAe,IAAI,kBAAkB;AAE5E,QAAM,kBAAkB,gBAAgB,aAAa,cAAc;AACnE,QAAM,gBAAgB,aAClB,EAAE,MAAM,OAAO,IACf,EAAE,oBAAoB,iBAAiB,MAAM,YAAY;AAE7D,SACE;AAAA,IAAC,iCAAU;AAAA,IAAV;AAAA,MACC,oBAAkB;AAAA,MACjB,GAAG;AAAA,MACH,GAAG;AAAA,MACJ,KAAK;AAAA;AAAA,EACP;AAEJ,CAAC;AAED,UAAU,cAAc;AAIxB,SAAS,mBAAmB,aAA8C;AACxE,SAAO,aAAa,SAAS,WAAW;AAC1C;AAEA,IAAM,OAAO;",
"names": []
}
@@ -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 FlagOff = createLucideIcon("FlagOff", [
["path", { d: "M8 2c3 0 5 2 8 2s4-1 4-1v11", key: "9rwyz9" }],
["path", { d: "M4 22V4", key: "1plyxx" }],
["path", { d: "M4 15s1-1 4-1 5 2 8 2", key: "1myooe" }],
["line", { x1: "2", x2: "22", y1: "2", y2: "22", key: "a6p6uj" }]
]);
export { FlagOff as default };
//# sourceMappingURL=flag-off.js.map
@@ -0,0 +1,67 @@
{
"name": "@jridgewell/gen-mapping",
"version": "0.3.13",
"description": "Generate source maps",
"keywords": [
"source",
"map"
],
"main": "dist/gen-mapping.umd.js",
"module": "dist/gen-mapping.mjs",
"types": "types/gen-mapping.d.cts",
"files": [
"dist",
"src",
"types"
],
"exports": {
".": [
{
"import": {
"types": "./types/gen-mapping.d.mts",
"default": "./dist/gen-mapping.mjs"
},
"default": {
"types": "./types/gen-mapping.d.cts",
"default": "./dist/gen-mapping.umd.js"
}
},
"./dist/gen-mapping.umd.js"
],
"./package.json": "./package.json"
},
"scripts": {
"benchmark": "run-s build:code benchmark:*",
"benchmark:install": "cd benchmark && npm install",
"benchmark:only": "node --expose-gc benchmark/index.js",
"build": "run-s -n build:code build:types",
"build:code": "node ../../esbuild.mjs gen-mapping.ts",
"build:types": "run-s build:types:force build:types:emit build:types:mts",
"build:types:force": "rimraf tsconfig.build.tsbuildinfo",
"build:types:emit": "tsc --project tsconfig.build.json",
"build:types:mts": "node ../../mts-types.mjs",
"clean": "run-s -n clean:code clean:types",
"clean:code": "tsc --build --clean tsconfig.build.json",
"clean:types": "rimraf dist types",
"test": "run-s -n test:types test:only test:format",
"test:format": "prettier --check '{src,test}/**/*.ts'",
"test:only": "mocha",
"test:types": "eslint '{src,test}/**/*.ts'",
"lint": "run-s -n lint:types lint:format",
"lint:format": "npm run test:format -- --write",
"lint:types": "npm run test:types -- --fix",
"prepublishOnly": "npm run-s -n build test"
},
"homepage": "https://github.com/jridgewell/sourcemaps/tree/main/packages/gen-mapping",
"repository": {
"type": "git",
"url": "git+https://github.com/jridgewell/sourcemaps.git",
"directory": "packages/gen-mapping"
},
"author": "Justin Ridgewell <justin@ridgewell.name>",
"license": "MIT",
"dependencies": {
"@jridgewell/sourcemap-codec": "^1.5.0",
"@jridgewell/trace-mapping": "^0.3.24"
}
}
@@ -0,0 +1 @@
{"version":3,"file":"auth-utils.d.ts","sourceRoot":"","sources":["../../../src/shared/auth-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,GAAG,CAI/D;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,EACjC,iBAAiB,EACjB,kBAAkB,EACrB,EAAE;IACC,iBAAiB,EAAE,GAAG,GAAG,MAAM,CAAC;IAChC,kBAAkB,EAAE,GAAG,GAAG,MAAM,CAAC;CACpC,GAAG,OAAO,CAwBV"}
@@ -0,0 +1,566 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Member = void 0;
exports.analyzeClassMemberUsage = analyzeClassMemberUsage;
const scope_manager_1 = require("@typescript-eslint/scope-manager");
const utils_1 = require("@typescript-eslint/utils");
const __1 = require("..");
const extractComputedName_1 = require("./extractComputedName");
const types_1 = require("./types");
class Member {
/**
* The node that declares this member
*/
node;
/**
* The resolved, unique key for this member.
*/
key;
/**
* The member name, as given in the source code.
*/
name;
/**
* The node that represents the member name in the source code.
* Used for reporting errors.
*/
nameNode;
/**
* The number of writes to this member.
*/
writeCount = 0;
/**
* The number of reads from this member.
*/
readCount = 0;
constructor(node, key, name, nameNode) {
this.node = node;
this.key = key;
this.name = name;
this.nameNode = nameNode;
}
static create(node) {
const name = (0, extractComputedName_1.extractNameForMember)(node);
if (name == null) {
return null;
}
return new Member(node, name.key, name.codeName, name.nameNode);
}
isAccessor() {
if (this.node.type === utils_1.AST_NODE_TYPES.MethodDefinition ||
this.node.type === utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition) {
return this.node.kind === 'set' || this.node.kind === 'get';
}
return (this.node.type === utils_1.AST_NODE_TYPES.AccessorProperty ||
this.node.type === utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty);
}
isHashPrivate() {
return ('key' in this.node &&
this.node.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier);
}
isPrivate() {
return this.node.accessibility === 'private';
}
isStatic() {
return this.node.static;
}
isUsed() {
return (this.readCount > 0 ||
// any usage of an accessor is considered a usage as accessor can have side effects
(this.writeCount > 0 && this.isAccessor()));
}
}
exports.Member = Member;
function isWriteOnlyUsage(node, parent) {
if (parent.type !== utils_1.AST_NODE_TYPES.AssignmentExpression &&
parent.type !== utils_1.AST_NODE_TYPES.ForInStatement &&
parent.type !== utils_1.AST_NODE_TYPES.ForOfStatement &&
parent.type !== utils_1.AST_NODE_TYPES.AssignmentPattern) {
return false;
}
// If it's on the right then it's a read not a write
if (parent.left !== node) {
return false;
}
if (parent.type === utils_1.AST_NODE_TYPES.AssignmentExpression &&
// For any other operator (such as '+=') we still consider it a read operation
parent.operator !== '=') {
// if the read operation is "discarded" in an empty statement, then it is write only.
return parent.parent.type === utils_1.AST_NODE_TYPES.ExpressionStatement;
}
return true;
}
function countReference(identifierParent, member) {
const identifierGrandparent = (0, __1.nullThrows)(identifierParent.parent, __1.NullThrowsReasons.MissingParent);
if (isWriteOnlyUsage(identifierParent, identifierGrandparent)) {
member.writeCount += 1;
return;
}
const identifierGreatGrandparent = identifierGrandparent.parent;
// A statement which only increments (`this.#x++;`)
if (identifierGrandparent.type === utils_1.AST_NODE_TYPES.UpdateExpression &&
identifierGreatGrandparent?.type === utils_1.AST_NODE_TYPES.ExpressionStatement) {
member.writeCount += 1;
return;
}
/*
* ({ x: this.#usedInDestructuring } = bar);
*
* But should treat the following as a read:
* ({ [this.#x]: a } = foo);
*/
if (identifierGrandparent.type === utils_1.AST_NODE_TYPES.Property &&
identifierGreatGrandparent?.type === utils_1.AST_NODE_TYPES.ObjectPattern &&
identifierGrandparent.value === identifierParent) {
member.writeCount += 1;
return;
}
// [...this.#unusedInRestPattern] = bar;
if (identifierGrandparent.type === utils_1.AST_NODE_TYPES.RestElement) {
member.writeCount += 1;
return;
}
// [this.#unusedInAssignmentPattern] = bar;
if (identifierGrandparent.type === utils_1.AST_NODE_TYPES.ArrayPattern) {
member.writeCount += 1;
return;
}
member.readCount += 1;
}
class ThisScope extends scope_manager_1.Visitor {
/**
* True if the context is considered a static context and so `this` refers to
* the class and not an instance (eg a static method or a static block).
*/
isStaticThisContext;
/**
* The classes directly declared within this class -- for example a class declared within a method.
* This does not include grandchild classes.
*/
childScopes = [];
/**
* The scope manager instance used to resolve variables to improve discovery of usages.
*/
scopeManager;
/**
* The parent class scope if one exists.
*/
upper;
/**
* The context of the `this` reference in the current scope.
*/
thisContext;
constructor(scopeManager, upper, thisContext, isStaticThisContext) {
super({});
this.scopeManager = scopeManager;
this.upper = upper;
this.isStaticThisContext = isStaticThisContext;
if (thisContext === 'self') {
if (!(this instanceof ClassScope)) {
throw new Error('Cannot use `self` unless it is in a ClassScope');
}
this.thisContext = this;
}
else if (thisContext === 'none') {
this.thisContext = null;
}
else {
this.thisContext = thisContext;
}
}
findNearestScope(node) {
let currentScope;
let currentNode = node;
do {
currentScope = this.scopeManager.acquire(currentNode);
if (currentNode.parent == null) {
break;
}
currentNode = currentNode.parent;
} while (currentScope == null);
return currentScope;
}
findVariableInScope(node, name) {
let currentScope = this.findNearestScope(node);
let variable = null;
while (currentScope != null) {
variable = currentScope.set.get(name) ?? null;
if (variable != null) {
break;
}
currentScope = currentScope.upper;
}
return variable;
}
getObjectClass(node) {
switch (node.object.type) {
case utils_1.AST_NODE_TYPES.ThisExpression: {
if (this.thisContext == null) {
return null;
}
return {
thisContext: this.thisContext,
type: this.isStaticThisContext ? 'static' : 'instance',
};
}
case utils_1.AST_NODE_TYPES.Identifier: {
const thisContext = this.findClassScopeWithName(node.object.name);
if (thisContext != null) {
return { thisContext, type: 'static' };
}
// the following code does some very rudimentary scope analysis to handle some trivial cases
const variable = this.findVariableInScope(node, node.object.name);
if (variable == null || variable.defs.length === 0) {
return null;
}
const firstDef = variable.defs[0];
switch (firstDef.node.type) {
// detect simple reassignment of `this`
// ```
// class Foo {
// private prop: number;
// method(thing: Foo) {
// const self = this;
// return self.prop;
// }
// }
// ```
case utils_1.AST_NODE_TYPES.VariableDeclarator: {
const value = firstDef.node.init;
if (value?.type !== utils_1.AST_NODE_TYPES.ThisExpression) {
return null;
}
if (variable.references.some(ref => ref.isWrite() && ref.init !== true)) {
// variable is assigned to multiple times so we can't be sure that it's still the same class
return null;
}
// we have a case like `const self = this` or `let self = this` that is not reassigned
// so we can safely assume that it's still the same class!
return {
thisContext: this.thisContext,
type: this.isStaticThisContext ? 'static' : 'instance',
};
}
// Look for variables typed as the current class:
// ```
// class Foo {
// private prop: number;
// method(thing: Foo) {
// // this references the private instance member but not via `this` so we can't see it
// thing.prop = 1;
// }
// }
// ```
default: {
const typeAnnotation = (() => {
if ('typeAnnotation' in firstDef.name &&
firstDef.name.typeAnnotation != null) {
return firstDef.name.typeAnnotation.typeAnnotation;
}
return null;
})();
if (typeAnnotation == null) {
return null;
}
// Cases like `method(thing: Foo) { ... }`
if (typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeReference &&
typeAnnotation.typeName.type === utils_1.AST_NODE_TYPES.Identifier) {
const typeName = typeAnnotation.typeName.name;
const typeScope = this.findClassScopeWithName(typeName);
if (typeScope != null) {
return { thisContext: typeScope, type: 'instance' };
}
}
// Cases like `method(thing: typeof Foo) { ... }`
if (typeAnnotation.type === utils_1.AST_NODE_TYPES.TSTypeQuery &&
typeAnnotation.exprName.type === utils_1.AST_NODE_TYPES.Identifier) {
const exprName = typeAnnotation.exprName.name;
const exprScope = this.findClassScopeWithName(exprName);
if (exprScope != null) {
return { thisContext: exprScope, type: 'static' };
}
}
}
}
return null;
}
case utils_1.AST_NODE_TYPES.MemberExpression:
// TODO - we could probably recurse here to do some more complex analysis and support like `foo.bar.baz` nested references
return null;
default:
return null;
}
}
visitClass(node) {
const classScope = new ClassScope(node, this, this.scopeManager);
this.childScopes.push(classScope);
classScope.visitChildren(node);
}
visitIntermediate(node) {
const intermediateScope = new IntermediateScope(this.scopeManager, this, node);
this.childScopes.push(intermediateScope);
intermediateScope.visitChildren(node);
}
/**
* Gets the nearest class scope with the given name.
*/
findClassScopeWithName(name) {
let currentScope = this;
while (currentScope != null) {
if (currentScope instanceof ClassScope &&
currentScope.className === name) {
return currentScope;
}
currentScope = currentScope.upper;
}
return null;
}
/////////////////////
// Visit selectors //
/////////////////////
AssignmentExpression(node) {
this.visitChildren(node);
if (node.right.type === utils_1.AST_NODE_TYPES.ThisExpression &&
node.left.type === utils_1.AST_NODE_TYPES.ObjectPattern) {
this.handleThisDestructuring(node.left);
}
}
AssignmentPattern(node) {
this.visitChildren(node);
if (node.right.type === utils_1.AST_NODE_TYPES.ThisExpression &&
node.left.type === utils_1.AST_NODE_TYPES.ObjectPattern) {
this.handleThisDestructuring(node.left);
}
}
ClassDeclaration(node) {
this.visitClass(node);
}
ClassExpression(node) {
this.visitClass(node);
}
FunctionDeclaration(node) {
this.visitIntermediate(node);
}
FunctionExpression(node) {
this.visitIntermediate(node);
}
MemberExpression(node) {
this.visitChildren(node);
if (node.property.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) {
// will be handled by the PrivateIdentifier visitor
return;
}
const propertyName = (0, extractComputedName_1.extractNameForMemberExpression)(node);
if (propertyName == null) {
return;
}
const objectClassName = this.getObjectClass(node);
if (objectClassName == null) {
return;
}
if (objectClassName.thisContext == null) {
return;
}
const members = objectClassName.type === 'instance'
? objectClassName.thisContext.members.instance
: objectClassName.thisContext.members.static;
const member = members.get(propertyName.key);
if (member == null) {
return;
}
countReference(node, member);
}
PrivateIdentifier(node) {
this.visitChildren(node);
if ((node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition ||
node.parent.type === utils_1.AST_NODE_TYPES.PropertyDefinition) &&
node.parent.key === node) {
// ignore the member definition
return;
}
// We can actually be pretty loose with our code here thanks to how private
// members are designed.
//
// 1) classes CANNOT have a static and instance private member with the
// same name, so we don't need to match up static access.
// 2) nested classes CANNOT access a private member of their parent class if
// the member has the same name as a private member of the nested class.
//
// together this means that we can just look for the member upwards until we
// find a match and we know that will be the correct match!
let currentScope = this;
const key = (0, types_1.privateKey)(node);
while (currentScope != null) {
if (currentScope.thisContext != null) {
const member = currentScope.thisContext.members.instance.get(key) ??
currentScope.thisContext.members.static.get(key);
if (member != null) {
countReference(node.parent, member);
return;
}
}
currentScope = currentScope.upper;
}
}
StaticBlock(node) {
this.visitIntermediate(node);
}
VariableDeclarator(node) {
this.visitChildren(node);
if (node.init?.type === utils_1.AST_NODE_TYPES.ThisExpression &&
node.id.type === utils_1.AST_NODE_TYPES.ObjectPattern) {
this.handleThisDestructuring(node.id);
}
}
/**
* Handles destructuring from `this` in ObjectPattern.
* Example: const { property } = this;
*/
handleThisDestructuring(pattern) {
if (this.thisContext == null) {
return;
}
for (const prop of pattern.properties) {
if (prop.type !== utils_1.AST_NODE_TYPES.Property) {
continue;
}
if (prop.key.type !== utils_1.AST_NODE_TYPES.Identifier || prop.computed) {
continue;
}
const memberKey = (0, types_1.publicKey)(prop.key.name);
const members = this.isStaticThisContext
? this.thisContext.members.static
: this.thisContext.members.instance;
const member = members.get(memberKey);
if (member == null) {
continue;
}
countReference(prop.key, member);
}
}
}
/**
* Any other scope that is not a class scope
*
* When we visit a function declaration/expression the `this` reference is
* rebound so it no longer refers to the class.
*
* This also supports a function's `this` parameter.
*/
class IntermediateScope extends ThisScope {
constructor(scopeManager, upper, node) {
if (node.type === utils_1.AST_NODE_TYPES.Program) {
super(scopeManager, upper, 'none', false);
return;
}
if (node.type === utils_1.AST_NODE_TYPES.StaticBlock) {
if (upper == null || !(upper instanceof ClassScope)) {
throw new Error('Cannot have a static block without an upper ClassScope');
}
super(scopeManager, upper, upper, true);
return;
}
// method definition
if ((node.parent.type === utils_1.AST_NODE_TYPES.MethodDefinition ||
node.parent.type === utils_1.AST_NODE_TYPES.PropertyDefinition) &&
node.parent.value === node) {
if (upper == null || !(upper instanceof ClassScope)) {
throw new Error('Cannot have a class method/property without an upper ClassScope');
}
super(scopeManager, upper, upper, node.parent.static);
return;
}
// function with a `this` parameter
if (upper != null &&
node.params.length > 0 &&
node.params[0].type === utils_1.AST_NODE_TYPES.Identifier &&
node.params[0].name === 'this') {
const thisType = node.params[0].typeAnnotation?.typeAnnotation;
if (thisType?.type === utils_1.AST_NODE_TYPES.TSTypeReference &&
thisType.typeName.type === utils_1.AST_NODE_TYPES.Identifier) {
const thisContext = upper.findClassScopeWithName(thisType.typeName.name);
if (thisContext != null) {
super(scopeManager, upper, thisContext, false);
return;
}
}
}
super(scopeManager, upper, 'none', false);
}
}
class ClassScope extends ThisScope {
className;
/**
* The class's members, keyed by their name
*/
members = {
instance: new Map(),
static: new Map(),
};
/**
* The node that declares this class.
*/
theClass;
constructor(theClass, upper, scopeManager) {
super(scopeManager, upper, 'self', false);
this.theClass = theClass;
this.className = theClass.id?.name ?? null;
for (const memberNode of theClass.body.body) {
switch (memberNode.type) {
case utils_1.AST_NODE_TYPES.MethodDefinition:
if (memberNode.kind === 'constructor') {
for (const parameter of memberNode.value.params) {
if (parameter.type !== utils_1.AST_NODE_TYPES.TSParameterProperty) {
continue;
}
const member = Member.create(parameter);
if (member == null) {
continue;
}
this.members.instance.set(member.key, member);
}
// break instead of falling through because the constructor is not a "member" we track
break;
}
// intentional fallthrough
case utils_1.AST_NODE_TYPES.AccessorProperty:
case utils_1.AST_NODE_TYPES.PropertyDefinition:
case utils_1.AST_NODE_TYPES.TSAbstractAccessorProperty:
case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition:
case utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition: {
const member = Member.create(memberNode);
if (member == null) {
continue;
}
if (member.isStatic()) {
this.members.static.set(member.key, member);
}
else {
this.members.instance.set(member.key, member);
}
break;
}
case utils_1.AST_NODE_TYPES.StaticBlock:
// static blocks declare no members
continue;
case utils_1.AST_NODE_TYPES.TSIndexSignature:
// index signatures are type signatures only and are fully computed
continue;
}
}
}
}
function analyzeClassMemberUsage(program, scopeManager) {
const rootScope = new IntermediateScope(scopeManager, null, program);
rootScope.visit(program);
return traverseScopes(rootScope);
}
function traverseScopes(currentScope, analysisResults = new Map()) {
if (currentScope instanceof ClassScope) {
analysisResults.set(currentScope.theClass, currentScope);
}
for (const childScope of currentScope.childScopes) {
traverseScopes(childScope, analysisResults);
}
return analysisResults;
}
@@ -0,0 +1 @@
{"version":3,"file":"drum.js","sources":["../../../src/icons/drum.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Drum\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMiAyIDggOCIgLz4KICA8cGF0aCBkPSJtMjIgMi04IDgiIC8+CiAgPGVsbGlwc2UgY3g9IjEyIiBjeT0iOSIgcng9IjEwIiByeT0iNSIgLz4KICA8cGF0aCBkPSJNNyAxMy40djcuOSIgLz4KICA8cGF0aCBkPSJNMTIgMTR2OCIgLz4KICA8cGF0aCBkPSJNMTcgMTMuNHY3LjkiIC8+CiAgPHBhdGggZD0iTTIgOXY4YTEwIDUgMCAwIDAgMjAgMFY5IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/drum\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 Drum = createLucideIcon('Drum', [\n ['path', { d: 'm2 2 8 8', key: '1v6059' }],\n ['path', { d: 'm22 2-8 8', key: '173r8a' }],\n ['ellipse', { cx: '12', cy: '9', rx: '10', ry: '5', key: 'liohsx' }],\n ['path', { d: 'M7 13.4v7.9', key: '1yi6u9' }],\n ['path', { d: 'M12 14v8', key: '1tn2tj' }],\n ['path', { d: 'M17 13.4v7.9', key: 'eqz2v3' }],\n ['path', { d: 'M2 9v8a10 5 0 0 0 20 0V9', key: '1750ul' }],\n]);\n\nexport default Drum;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,iBAAiB,MAAQ,CAAA,CAAA,CAAA;AAAA,CAAA,CACpC,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,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC1C,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACnE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAe,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC5C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC3D,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const Brush = createLucideIcon("Brush", [
["path", { d: "m9.06 11.9 8.07-8.06a2.85 2.85 0 1 1 4.03 4.03l-8.06 8.08", key: "1styjt" }],
[
"path",
{
d: "M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 0 0-3-3.02z",
key: "z0l1mu"
}
]
]);
export { Brush as default };
//# sourceMappingURL=brush.js.map
@@ -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 ArrowLeftToLine = createLucideIcon("ArrowLeftToLine", [
["path", { d: "M3 19V5", key: "rwsyhb" }],
["path", { d: "m13 6-6 6 6 6", key: "1yhaz7" }],
["path", { d: "M7 12h14", key: "uoisry" }]
]);
export { ArrowLeftToLine as default };
//# sourceMappingURL=arrow-left-to-line.js.map
@@ -0,0 +1 @@
{"version":3,"file":"levenshtein.cjs","sources":["../../src/utils/levenshtein.ts"],"sourcesContent":[null],"names":["getUsedThreshold","password","entry","threshold","isPasswordToShort","length","isThresholdLongerThanPassword","shouldUsePasswordLength","Math","ceil","findLevenshteinDistance","rankedDictionary","foundDistance","found","Object","keys","find","usedThreshold","abs","foundEntryDistance","distance","isInThreshold","levenshteinDistance","levenshteinDistanceEntry"],"mappings":";;;;AAGA,MAAMA,gBAAgB,GAAGA,CACvBC,QAAgB,EAChBC,KAAa,EACbC,SAAiB,KACf;EACF,MAAMC,iBAAiB,GAAGH,QAAQ,CAACI,MAAM,IAAIH,KAAK,CAACG,MAAM;AACzD,EAAA,MAAMC,6BAA6B,GAAGL,QAAQ,CAACI,MAAM,IAAIF,SAAS;AAClE,EAAA,MAAMI,uBAAuB,GAC3BH,iBAAiB,IAAIE,6BAA6B;AAEpD;AACA,EAAA,OAAOC,uBAAuB,GAAGC,IAAI,CAACC,IAAI,CAACR,QAAQ,CAACI,MAAM,GAAG,CAAC,CAAC,GAAGF,SAAS;AAC7E,CAAC;AAOD,MAAMO,uBAAuB,GAAGA,CAC9BT,QAAgB,EAChBU,gBAAkC,EAClCR,SAAiB,KACyB;EAC1C,IAAIS,aAAa,GAAG,CAAC;AACrB,EAAA,MAAMC,KAAK,GAAGC,MAAM,CAACC,IAAI,CAACJ,gBAAgB,CAAC,CAACK,IAAI,CAAEd,KAAK,IAAI;IACzD,MAAMe,aAAa,GAAGjB,gBAAgB,CAACC,QAAQ,EAAEC,KAAK,EAAEC,SAAS,CAAC;AAClE,IAAA,IAAIK,IAAI,CAACU,GAAG,CAACjB,QAAQ,CAACI,MAAM,GAAGH,KAAK,CAACG,MAAM,CAAC,GAAGY,aAAa,EAAE;AAC5D,MAAA,OAAO,KAAK;AACd,IAAA;AACA,IAAA,MAAME,kBAAkB,GAAGC,2BAAQ,CAACnB,QAAQ,EAAEC,KAAK,CAAC;AACpD,IAAA,MAAMmB,aAAa,GAAGF,kBAAkB,IAAIF,aAAa;AAEzD,IAAA,IAAII,aAAa,EAAE;AACjBT,MAAAA,aAAa,GAAGO,kBAAkB;AACpC,IAAA;AACA,IAAA,OAAOE,aAAa;AACtB,EAAA,CAAC,CAAC;AACF,EAAA,IAAIR,KAAK,EAAE;IACT,OAAO;AACLS,MAAAA,mBAAmB,EAAEV,aAAa;AAClCW,MAAAA,wBAAwB,EAAEV;KAC3B;AACH,EAAA;AACA,EAAA,OAAO,EAAE;AACX;;;;"}
@@ -0,0 +1,57 @@
import { decode as decodeBase64URL } from '../util/base64url.js';
import { fromSPKI, fromPKCS8, fromX509 } from '../lib/asn1.js';
import { jwkToKey } from '../lib/jwk_to_key.js';
import { JOSENotSupported } from '../util/errors.js';
import { isObject } from '../lib/type_checks.js';
export async function importSPKI(spki, alg, options) {
if (typeof spki !== 'string' || spki.indexOf('-----BEGIN PUBLIC KEY-----') !== 0) {
throw new TypeError('"spki" must be SPKI formatted string');
}
return fromSPKI(spki, alg, options);
}
export async function importX509(x509, alg, options) {
if (typeof x509 !== 'string' || x509.indexOf('-----BEGIN CERTIFICATE-----') !== 0) {
throw new TypeError('"x509" must be X.509 formatted string');
}
return fromX509(x509, alg, options);
}
export async function importPKCS8(pkcs8, alg, options) {
if (typeof pkcs8 !== 'string' || pkcs8.indexOf('-----BEGIN PRIVATE KEY-----') !== 0) {
throw new TypeError('"pkcs8" must be PKCS#8 formatted string');
}
return fromPKCS8(pkcs8, alg, options);
}
export async function importJWK(jwk, alg, options) {
if (!isObject(jwk)) {
throw new TypeError('JWK must be an object');
}
let ext;
alg ??= jwk.alg;
ext ??= options?.extractable ?? jwk.ext;
switch (jwk.kty) {
case 'oct':
if (typeof jwk.k !== 'string' || !jwk.k) {
throw new TypeError('missing "k" (Key Value) Parameter value');
}
return decodeBase64URL(jwk.k);
case 'RSA':
if ('oth' in jwk && jwk.oth !== undefined) {
throw new JOSENotSupported('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');
}
return jwkToKey({ ...jwk, alg, ext });
case 'AKP': {
if (typeof jwk.alg !== 'string' || !jwk.alg) {
throw new TypeError('missing "alg" (Algorithm) Parameter value');
}
if (alg !== undefined && alg !== jwk.alg) {
throw new TypeError('JWK alg and alg option value mismatch');
}
return jwkToKey({ ...jwk, ext });
}
case 'EC':
case 'OKP':
return jwkToKey({ ...jwk, alg, ext });
default:
throw new JOSENotSupported('Unsupported "kty" (Key Type) Parameter value');
}
}
@@ -0,0 +1,8 @@
// packages/core/number/src/number.ts
function clamp(value, [min, max]) {
return Math.min(max, Math.max(min, value));
}
export {
clamp
};
//# sourceMappingURL=index.mjs.map
@@ -0,0 +1,15 @@
import type { ScopeVariable } from '@typescript-eslint/scope-manager';
import { TSESLint } from '@typescript-eslint/utils';
interface VariableAnalysis {
readonly unusedVariables: ReadonlySet<ScopeVariable>;
readonly usedVariables: ReadonlySet<ScopeVariable>;
}
/**
* Collects the set of unused variables for a given context.
*
* Due to complexity, this does not take into consideration:
* - variables within declaration files
* - variables within ambient module declarations
*/
export declare function collectVariables<MessageIds extends string, Options extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<MessageIds, Options>>): VariableAnalysis;
export {};
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"_E"},B:{"1":"_K","2":"_I"},C:{"1":"_pF","2":"_iO","132":"_kN","260":"_TC"},D:{"1":"_LM","2":"_8H","132":"_4M 8B","260":"_nC _JH EC"},E:{"1":"_JB","2":"_RB"},F:{"1":"_vR","2":"_RK","132":"sB _yQ","260":"_mH _bC"},G:{"1":"_9","2":"_OB","16":"kD"},H:{"2":"1D"},I:{"1":"I","2":"_G"},J:{"2":"_B"},K:{"1":"H","2":"_D"},L:{"1":"I"},M:{"1":"YC"},N:{"2":"_A"},O:{"1":"bC"},P:{"1":"_xB","2":"J","260":"_RH"},Q:{"1":"JE"},R:{"1":"KE"},S:{"1":"ME","260":"LE"}},B:2,C:"IndexedDB 2.0",D:true};
@@ -0,0 +1 @@
{"version":3,"file":"file-check-2.js","sources":["../../../src/icons/file-check-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileCheck2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAyMmgxNGEyIDIgMCAwIDAgMi0yVjdsLTUtNUg2YTIgMiAwIDAgMC0yIDJ2NCIgLz4KICA8cGF0aCBkPSJNMTQgMnY0YTIgMiAwIDAgMCAyIDJoNCIgLz4KICA8cGF0aCBkPSJtMyAxNSAyIDIgNC00IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/file-check-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FileCheck2 = createLucideIcon('FileCheck2', [\n ['path', { d: 'M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4', key: '1pf5j1' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n ['path', { d: 'm3 15 2 2 4-4', key: '1lhrkk' }],\n]);\n\nexport default FileCheck2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAa,iBAAiB,YAAc,CAAA,CAAA,CAAA;AAAA,CAAA,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAChF,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,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"streamableHttp.d.ts","sourceRoot":"","sources":["../../../src/client/streamableHttp.ts"],"names":[],"mappings":"AACA,OAAO,EACH,SAAS,EACT,SAAS,EAOZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAwE,cAAc,EAAwB,MAAM,aAAa,CAAC;AACzI,OAAO,EAAkD,mBAAmB,EAAqB,MAAM,WAAW,CAAC;AAWnH,qBAAa,mBAAoB,SAAQ,KAAK;aAEtB,IAAI,EAAE,MAAM,GAAG,SAAS;gBAAxB,IAAI,EAAE,MAAM,GAAG,SAAS,EACxC,OAAO,EAAE,MAAM,GAAG,SAAS;CAIlC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAE5C;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAC9C;;;OAGG;IACH,oBAAoB,EAAE,MAAM,CAAC;IAE7B;;;OAGG;IACH,wBAAwB,EAAE,MAAM,CAAC;IAEjC;;;OAGG;IACH,2BAA2B,EAAE,MAAM,CAAC;IAEpC;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,oCAAoC,GAAG;IAC/C;;;;;;;;;;;;;OAaG;IACH,YAAY,CAAC,EAAE,mBAAmB,CAAC;IAEnC;;OAEG;IACH,WAAW,CAAC,EAAE,WAAW,CAAC;IAE1B;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;;;;;;OAQG;IACH,cAAc,CAAC,EAAE,aAAa,GAAG,QAAQ,CAAC;IAE1C;;OAEG;IACH,mBAAmB,CAAC,EAAE,iCAAiC,CAAC;IAExD;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,qBAAa,6BAA8B,YAAW,SAAS;IAC3D,OAAO,CAAC,gBAAgB,CAAC,CAAkB;IAC3C,OAAO,CAAC,IAAI,CAAM;IAClB,OAAO,CAAC,oBAAoB,CAAC,CAAM;IACnC,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,YAAY,CAAC,CAAc;IACnC,OAAO,CAAC,aAAa,CAAC,CAAsB;IAC5C,OAAO,CAAC,MAAM,CAAC,CAAY;IAC3B,OAAO,CAAC,cAAc,CAAY;IAClC,OAAO,CAAC,gBAAgB,CAAU;IAClC,OAAO,CAAC,UAAU,CAAC,CAAS;IAC5B,OAAO,CAAC,oBAAoB,CAAoC;IAChE,OAAO,CAAC,gBAAgB,CAAC,CAAS;IAClC,OAAO,CAAC,qBAAqB,CAAS;IACtC,OAAO,CAAC,oBAAoB,CAAC,CAAS;IACtC,OAAO,CAAC,cAAc,CAAC,CAAS;IAChC,OAAO,CAAC,oBAAoB,CAAC,CAAgC;IAE7D,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,SAAS,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;gBAElC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,oCAAoC;IAiBjE,yGAAyG;IACzG,OAAO,CAAC,mBAAmB;YAKb,cAAc;YAyBd,cAAc;YAwBd,eAAe;IAkD7B;;;;;OAKG;IACH,OAAO,CAAC,yBAAyB;IAejC;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAwB7B,OAAO,CAAC,gBAAgB;IA+GlB,KAAK;IAUX;;OAEG;IACG,UAAU,CAAC,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAiBpD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAStB,IAAI,CACN,OAAO,EAAE,cAAc,GAAG,cAAc,EAAE,EAC1C,OAAO,CAAC,EAAE;QAAE,eAAe,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,GACpF,OAAO,CAAC,IAAI,CAAC;IA8JhB,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED;;;;;;;;;;OAUG;IACG,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAkCvC,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAGzC,IAAI,eAAe,IAAI,MAAM,GAAG,SAAS,CAExC;IAED;;;;;;OAMG;IACG,YAAY,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CAMpH"}
@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../src/value/index.ts"],"sourcesContent":["import {\n EasingFunction,\n SubscriptionManager,\n velocityPerSecond,\n warnOnce,\n} from \"motion-utils\"\nimport {\n AnimationPlaybackControlsWithThen,\n AnyResolvedKeyframe,\n TransformProperties,\n} from \"../animation/types\"\nimport { frame } from \"../frameloop\"\nimport { time } from \"../frameloop/sync-time\"\n\n/**\n * @public\n */\nexport type Subscriber<T> = (v: T) => void\n\n/**\n * @public\n */\nexport type PassiveEffect<T> = (v: T, safeSetter: (v: T) => void) => void\n\nexport type StartAnimation = (\n complete: () => void\n) => AnimationPlaybackControlsWithThen | undefined\n\nexport interface MotionValueEventCallbacks<V> {\n animationStart: () => void\n animationComplete: () => void\n animationCancel: () => void\n change: (latestValue: V) => void\n destroy: () => void\n}\n\n/**\n * Maximum time between the value of two frames, beyond which we\n * assume the velocity has since been 0.\n */\nconst MAX_VELOCITY_DELTA = 30\n\nconst isFloat = (value: any): value is string => {\n return !isNaN(parseFloat(value))\n}\n\ninterface ResolvedValues {\n [key: string]: AnyResolvedKeyframe\n}\n\nexport interface Owner {\n current: HTMLElement | unknown\n getProps: () => {\n onUpdate?: (latest: ResolvedValues) => void\n transformTemplate?: (\n transform: TransformProperties,\n generatedTransform: string\n ) => string\n }\n}\n\nexport interface AccelerateConfig {\n factory: (animation: AnimationPlaybackControlsWithThen) => VoidFunction\n times: number[]\n keyframes: any[]\n ease?: EasingFunction | EasingFunction[]\n duration: number\n isTransformed?: boolean\n}\n\nexport interface MotionValueOptions {\n owner?: Owner\n}\n\nexport const collectMotionValues: { current: MotionValue[] | undefined } = {\n current: undefined,\n}\n\n/**\n * `MotionValue` is used to track the state and velocity of motion values.\n *\n * @public\n */\nexport class MotionValue<V = any> {\n /**\n * If a MotionValue has an owner, it was created internally within Motion\n * and therefore has no external listeners. It is therefore safe to animate via WAAPI.\n */\n owner?: Owner\n\n /**\n * The current state of the `MotionValue`.\n */\n private current: V | undefined\n\n /**\n * The previous state of the `MotionValue`.\n */\n private prev: V | undefined\n\n /**\n * The previous state of the `MotionValue` at the end of the previous frame.\n */\n private prevFrameValue: V | undefined\n\n /**\n * The last time the `MotionValue` was updated.\n */\n updatedAt: number\n\n /**\n * The time `prevFrameValue` was updated.\n */\n prevUpdatedAt: number | undefined\n\n /**\n * Add a passive effect to this `MotionValue`.\n *\n * A passive effect intercepts calls to `set`. For instance, `useSpring` adds\n * a passive effect that attaches a `spring` to the latest\n * set value. Hypothetically there could be a `useSmooth` that attaches an input smoothing effect.\n *\n * @internal\n */\n private passiveEffect?: PassiveEffect<V>\n private stopPassiveEffect?: VoidFunction\n\n /**\n * Whether the passive effect is active.\n */\n isEffectActive?: boolean\n\n /**\n * A reference to the currently-controlling animation.\n */\n animation?: AnimationPlaybackControlsWithThen\n\n /**\n * Tracks whether this value can output a velocity. Currently this is only true\n * if the value is numerical, but we might be able to widen the scope here and support\n * other value types.\n *\n * @internal\n */\n private canTrackVelocity: boolean | null = null\n\n /**\n * A list of MotionValues whose values are computed from this one.\n * This is a rough start to a proper signal-like dirtying system.\n */\n private dependents: Set<MotionValue> | undefined\n\n /**\n * Tracks whether this value should be removed\n */\n liveStyle?: boolean\n\n /**\n * Scroll timeline acceleration metadata. When set, VisualElement\n * can create a native WAAPI animation attached to a scroll timeline\n * instead of driving updates through JS.\n */\n accelerate?: AccelerateConfig\n\n /**\n * @param init - The initiating value\n * @param config - Optional configuration options\n *\n * - `transformer`: A function to transform incoming values with.\n */\n constructor(init: V, options: MotionValueOptions = {}) {\n this.setCurrent(init)\n this.owner = options.owner\n }\n\n setCurrent(current: V) {\n this.current = current\n this.updatedAt = time.now()\n\n if (this.canTrackVelocity === null && current !== undefined) {\n this.canTrackVelocity = isFloat(this.current)\n }\n }\n\n Line truncated
@@ -0,0 +1,47 @@
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABILITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
interface ObjectConstructor {
/**
* Returns an array of values of the enumerable own properties of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
values<T>(o: { [s: string]: T; } | ArrayLike<T>): T[];
/**
* Returns an array of values of the enumerable own properties of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
values(o: {}): any[];
/**
* Returns an array of key/values of the enumerable own properties of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
entries<T>(o: { [s: string]: T; } | ArrayLike<T>): [string, T][];
/**
* Returns an array of key/values of the enumerable own properties of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
entries(o: {}): [string, any][];
/**
* Returns an object containing all own property descriptors of an object
* @param o Object that contains the properties and methods. This can be an object that you created or an existing Document Object Model (DOM) object.
*/
getOwnPropertyDescriptors<T>(o: T): { [P in keyof T]: TypedPropertyDescriptor<T[P]>; } & { [x: string]: PropertyDescriptor; };
}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"_V","2":"_b"},B:{"1":"_J"},C:{"1":"_S"},D:{"1":"_Q"},E:{"1":"_YB","2":"_k","16":"mB"},F:{"1":"_zG","16":"_mB"},G:{"1":"_t","16":"_d"},H:{"2":"1D"},I:{"1":"_IG _TN","16":"_m","132":"_y"},J:{"1":"_B"},K:{"1":"_N"},L:{"132":"I"},M:{"132":"YC"},N:{"1":"_A"},O:{"1":"bC"},P:{"2":"J","132":"_U"},Q:{"1":"JE"},R:{"132":"KE"},S:{"1":"_C"}},B:7,C:"KeyboardEvent.which",D:true};
@@ -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 './circle-parking.js';
//# sourceMappingURL=parking-circle.js.map
@@ -0,0 +1,60 @@
{
"name": "body-parser",
"description": "Node.js body parsing middleware",
"version": "2.4.0",
"contributors": [
"Douglas Christopher Wilson <doug@somethingdoug.com>",
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
],
"license": "MIT",
"repository": "expressjs/body-parser",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/express"
},
"type": "commonjs",
"exports": {
".": "./index.js",
"./package.json": "./package.json",
"./json": "./lib/types/json.js",
"./raw": "./lib/types/raw.js",
"./text": "./lib/types/text.js",
"./urlencoded": "./lib/types/urlencoded.js",
"./lib/*": "./lib/*.js",
"./lib/*.js": "./lib/*.js",
"./lib/types/*": "./lib/types/*.js",
"./lib/types/*.js": "./lib/types/*.js"
},
"dependencies": {
"bytes": "^3.1.2",
"content-type": "^2.1.0",
"debug": "^4.4.3",
"http-errors": "^2.0.1",
"iconv-lite": "^0.7.3",
"on-finished": "^2.4.1",
"qs": "^6.16.1",
"raw-body": "^3.0.2",
"type-is": "^2.1.0"
},
"devDependencies": {
"eslint": "^9.39.5",
"mocha": "^11.7.6",
"neostandard": "^0.13.0",
"nyc": "^17.1.0",
"supertest": "7.3.0"
},
"files": [
"lib/",
"LICENSE",
"index.js"
],
"engines": {
"node": ">=18"
},
"scripts": {
"lint": "eslint .",
"test": "mocha --reporter spec --check-leaks test/",
"test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
"test-cov": "nyc --reporter=html --reporter=text npm test"
}
}
@@ -0,0 +1,220 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require_client_utils = require("../../client/utils.js");
const require_utils_concurrent = require("../../utils/concurrent.js");
const require_utils_mime = require("../../utils/mime.js");
const require_helper_ssg_utils = require("./utils.js");
const require_helper_ssg_middleware = require("./middleware.js");
const require_helper_ssg_plugins = require("./plugins.js");
//#region src/helper/ssg/ssg.ts
const DEFAULT_CONCURRENCY = 2;
const DEFAULT_CONTENT_TYPE = "text/plain";
const DEFAULT_OUTPUT_DIR = "./static";
const generateFilePath = (routePath, outDir, mimeType, extensionMap) => {
const extension = determineExtension(mimeType, extensionMap);
let filePath;
if (routePath.endsWith(`.${extension}`)) filePath = require_helper_ssg_utils.joinPaths(outDir, routePath);
else if (routePath === "/") filePath = require_helper_ssg_utils.joinPaths(outDir, `index.${extension}`);
else if (routePath.endsWith("/")) filePath = require_helper_ssg_utils.joinPaths(outDir, routePath, `index.${extension}`);
else filePath = require_helper_ssg_utils.joinPaths(outDir, `${routePath}.${extension}`);
require_helper_ssg_utils.ensureWithinOutDir(outDir, filePath);
return filePath;
};
const parseResponseContent = async (response) => {
const contentType = response.headers.get("Content-Type");
try {
if (contentType?.includes("text") || contentType?.includes("json")) return await response.text();
else return await response.arrayBuffer();
} catch (error) {
throw new Error(`Error processing response: ${error instanceof Error ? error.message : "Unknown error"}`);
}
};
const defaultExtensionMap = {
"text/html": "html",
"text/xml": "xml",
"application/xml": "xml",
"application/atom+xml": "xml",
"application/rss+xml": "xml",
"application/yaml": "yaml"
};
const determineExtension = (mimeType, userExtensionMap) => {
const extensionMap = userExtensionMap || defaultExtensionMap;
if (mimeType in extensionMap) return extensionMap[mimeType];
return require_utils_mime.getExtension(mimeType) || "html";
};
const combineBeforeRequestHooks = (hooks) => {
if (!Array.isArray(hooks)) return hooks;
return async (req) => {
let currentReq = req;
for (const hook of hooks) {
const result = await hook(currentReq);
if (result === false) return false;
if (result instanceof Request) currentReq = result;
}
return currentReq;
};
};
const combineAfterResponseHooks = (hooks) => {
if (!Array.isArray(hooks)) return hooks;
return async (res) => {
let currentRes = res;
for (const hook of hooks) {
const result = await hook(currentRes);
if (result === false) return false;
if (result instanceof Response) currentRes = result;
}
return currentRes;
};
};
const combineAfterGenerateHooks = (hooks, fsModule, options) => {
if (!Array.isArray(hooks)) return hooks;
return async (result) => {
for (const hook of hooks) await hook(result, fsModule, options);
};
};
/**
* @experimental
* `fetchRoutesContent` is an experimental feature.
* The API might be changed.
*/
const fetchRoutesContent = function* (app, beforeRequestHook, afterResponseHook, concurrency) {
const baseURL = "http://localhost";
const pool = require_utils_concurrent.createPool({ concurrency });
for (const route of require_helper_ssg_utils.filterStaticGenerateRoutes(app)) {
const thisRouteBaseURL = new URL(route.path, baseURL).toString();
let forGetInfoURLRequest = new Request(thisRouteBaseURL);
yield new Promise(async (resolveGetInfo, rejectGetInfo) => {
try {
if (beforeRequestHook) {
const maybeRequest = await beforeRequestHook(forGetInfoURLRequest);
if (!maybeRequest) {
resolveGetInfo(void 0);
return;
}
forGetInfoURLRequest = maybeRequest;
}
await pool.run(() => app.fetch(forGetInfoURLRequest, { [require_helper_ssg_middleware.SSG_CONTEXT]: true }));
if (!forGetInfoURLRequest.ssgParams) {
if (require_helper_ssg_utils.isDynamicRoute(route.path)) {
resolveGetInfo(void 0);
return;
}
forGetInfoURLRequest.ssgParams = [{}];
}
const requestInit = {
method: forGetInfoURLRequest.method,
headers: forGetInfoURLRequest.headers
};
resolveGetInfo((function* () {
for (const param of forGetInfoURLRequest.ssgParams) yield new Promise(async (resolveReq, rejectReq) => {
try {
const replacedUrlParam = require_client_utils.replaceUrlParam(route.path, param);
let response = await pool.run(() => app.request(replacedUrlParam, requestInit, { [require_helper_ssg_middleware.SSG_CONTEXT]: true }));
if (response.headers.get("x-hono-disable-ssg")) {
resolveReq(void 0);
return;
}
if (afterResponseHook) {
const maybeResponse = await afterResponseHook(response);
if (!maybeResponse) {
resolveReq(void 0);
return;
}
response = maybeResponse;
}
resolveReq({
routePath: replacedUrlParam,
mimeType: response.headers.get("Content-Type")?.split(";")[0] || DEFAULT_CONTENT_TYPE,
content: await parseResponseContent(response)
});
} catch (error) {
rejectReq(error);
}
});
})());
} catch (error) {
rejectGetInfo(error);
}
});
}
};
/**
* @experimental
* `saveContentToFile` is an experimental feature.
* The API might be changed.
*/
const createdDirs = /* @__PURE__ */ new Set();
const saveContentToFile = async (data, fsModule, outDir, extensionMap) => {
const awaitedData = await data;
if (!awaitedData) return;
const { routePath, content, mimeType } = awaitedData;
const filePath = generateFilePath(routePath, outDir, mimeType, extensionMap);
const dirPath = require_helper_ssg_utils.dirname(filePath);
if (dirPath !== "" && !createdDirs.has(dirPath)) {
await fsModule.mkdir(dirPath, { recursive: true });
createdDirs.add(dirPath);
}
if (typeof content === "string") await fsModule.writeFile(filePath, content);
else if (content instanceof ArrayBuffer) await fsModule.writeFile(filePath, new Uint8Array(content));
return filePath;
};
/**
* @experimental
* `toSSG` is an experimental feature.
* The API might be changed.
*/
const toSSG = async (app, fs, options) => {
let result;
const getInfoPromises = [];
const savePromises = [];
const plugins = options?.plugins || [require_helper_ssg_plugins.defaultPlugin()];
const beforeRequestHooks = [];
const afterResponseHooks = [];
const afterGenerateHooks = [];
if (options?.beforeRequestHook) beforeRequestHooks.push(...Array.isArray(options.beforeRequestHook) ? options.beforeRequestHook : [options.beforeRequestHook]);
if (options?.afterResponseHook) afterResponseHooks.push(...Array.isArray(options.afterResponseHook) ? options.afterResponseHook : [options.afterResponseHook]);
if (options?.afterGenerateHook) afterGenerateHooks.push(...Array.isArray(options.afterGenerateHook) ? options.afterGenerateHook : [options.afterGenerateHook]);
for (const plugin of plugins) {
if (plugin.beforeRequestHook) beforeRequestHooks.push(...Array.isArray(plugin.beforeRequestHook) ? plugin.beforeRequestHook : [plugin.beforeRequestHook]);
if (plugin.afterResponseHook) afterResponseHooks.push(...Array.isArray(plugin.afterResponseHook) ? plugin.afterResponseHook : [plugin.afterResponseHook]);
if (plugin.afterGenerateHook) afterGenerateHooks.push(...Array.isArray(plugin.afterGenerateHook) ? plugin.afterGenerateHook : [plugin.afterGenerateHook]);
}
try {
const outputDir = options?.dir ?? "./static";
const concurrency = options?.concurrency ?? DEFAULT_CONCURRENCY;
const combinedBeforeRequestHook = combineBeforeRequestHooks(beforeRequestHooks.length > 0 ? beforeRequestHooks : [(req) => req]);
const combinedAfterResponseHook = combineAfterResponseHooks(afterResponseHooks.length > 0 ? afterResponseHooks : [(req) => req]);
const getInfoGen = fetchRoutesContent(app, combinedBeforeRequestHook, combinedAfterResponseHook, concurrency);
for (const getInfo of getInfoGen) getInfoPromises.push(getInfo.then((getContentGen) => {
if (!getContentGen) return;
for (const content of getContentGen) savePromises.push(saveContentToFile(content, fs, outputDir, options?.extensionMap).catch((e) => e));
}));
await Promise.all(getInfoPromises);
const files = [];
for (const savePromise of savePromises) {
const fileOrError = await savePromise;
if (typeof fileOrError === "string") files.push(fileOrError);
else if (fileOrError) throw fileOrError;
}
result = {
success: true,
files
};
} catch (error) {
result = {
success: false,
files: [],
error: error instanceof Error ? error : new Error(String(error))
};
}
if (afterGenerateHooks.length > 0) await combineAfterGenerateHooks(afterGenerateHooks, fs, options)(result, fs, options);
return result;
};
//#endregion
exports.DEFAULT_OUTPUT_DIR = DEFAULT_OUTPUT_DIR;
exports.combineAfterGenerateHooks = combineAfterGenerateHooks;
exports.combineAfterResponseHooks = combineAfterResponseHooks;
exports.combineBeforeRequestHooks = combineBeforeRequestHooks;
exports.defaultExtensionMap = defaultExtensionMap;
exports.fetchRoutesContent = fetchRoutesContent;
exports.saveContentToFile = saveContentToFile;
exports.toSSG = toSSG;
@@ -0,0 +1,206 @@
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Visual Studio project reader/writer."""
from gyp import easy_xml
# ------------------------------------------------------------------------------
class Tool:
"""Visual Studio tool."""
def __init__(self, name, attrs=None):
"""Initializes the tool.
Args:
name: Tool name.
attrs: Dict of tool attributes; may be None.
"""
self._attrs = attrs or {}
self._attrs["Name"] = name
def _GetSpecification(self):
"""Creates an element for the tool.
Returns:
A new xml.dom.Element for the tool.
"""
return ["Tool", self._attrs]
class Filter:
"""Visual Studio filter - that is, a virtual folder."""
def __init__(self, name, contents=None):
"""Initializes the folder.
Args:
name: Filter (folder) name.
contents: List of filenames and/or Filter objects contained.
"""
self.name = name
self.contents = list(contents or [])
# ------------------------------------------------------------------------------
class Writer:
"""Visual Studio XML project writer."""
def __init__(self, project_path, version, name, guid=None, platforms=None):
"""Initializes the project.
Args:
project_path: Path to the project file.
version: Format version to emit.
name: Name of the project.
guid: GUID to use for project, if not None.
platforms: Array of string, the supported platforms. If null, ['Win32']
"""
self.project_path = project_path
self.version = version
self.name = name
self.guid = guid
# Default to Win32 for platforms.
if not platforms:
platforms = ["Win32"]
# Initialize the specifications of the various sections.
self.platform_section = ["Platforms"]
for platform in platforms:
self.platform_section.append(["Platform", {"Name": platform}])
self.tool_files_section = ["ToolFiles"]
self.configurations_section = ["Configurations"]
self.files_section = ["Files"]
# Keep a dict keyed on filename to speed up access.
self.files_dict = {}
def AddToolFile(self, path):
"""Adds a tool file to the project.
Args:
path: Relative path from project to tool file.
"""
self.tool_files_section.append(["ToolFile", {"RelativePath": path}])
def _GetSpecForConfiguration(self, config_type, config_name, attrs, tools):
"""Returns the specification for a configuration.
Args:
config_type: Type of configuration node.
config_name: Configuration name.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None.
Returns:
"""
# Handle defaults
if not attrs:
attrs = {}
if not tools:
tools = []
# Add configuration node and its attributes
node_attrs = attrs.copy()
node_attrs["Name"] = config_name
specification = [config_type, node_attrs]
# Add tool nodes and their attributes
if tools:
for t in tools:
if isinstance(t, Tool):
specification.append(t._GetSpecification())
else:
specification.append(Tool(t)._GetSpecification())
return specification
def AddConfig(self, name, attrs=None, tools=None):
"""Adds a configuration to the project.
Args:
name: Configuration name.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None.
"""
spec = self._GetSpecForConfiguration("Configuration", name, attrs, tools)
self.configurations_section.append(spec)
def _AddFilesToNode(self, parent, files):
"""Adds files and/or filters to the parent node.
Args:
parent: Destination node
files: A list of Filter objects and/or relative paths to files.
Will call itself recursively, if the files list contains Filter objects.
"""
for f in files:
if isinstance(f, Filter):
node = ["Filter", {"Name": f.name}]
self._AddFilesToNode(node, f.contents)
else:
node = ["File", {"RelativePath": f}]
self.files_dict[f] = node
parent.append(node)
def AddFiles(self, files):
"""Adds files to the project.
Args:
files: A list of Filter objects and/or relative paths to files.
This makes a copy of the file/filter tree at the time of this call. If you
later add files to a Filter object which was passed into a previous call
to AddFiles(), it will not be reflected in this project.
"""
self._AddFilesToNode(self.files_section, files)
# TODO(rspangler) This also doesn't handle adding files to an existing
# filter. That is, it doesn't merge the trees.
def AddFileConfig(self, path, config, attrs=None, tools=None):
"""Adds a configuration to a file.
Args:
path: Relative path to the file.
config: Name of configuration to add.
attrs: Dict of configuration attributes; may be None.
tools: List of tools (strings or Tool objects); may be None.
Raises:
ValueError: Relative path does not match any file added via AddFiles().
"""
# Find the file node with the right relative path
parent = self.files_dict.get(path)
if not parent:
raise ValueError('AddFileConfig: file "%s" not in project.' % path)
# Add the config to the file node
spec = self._GetSpecForConfiguration("FileConfiguration", config, attrs, tools)
parent.append(spec)
def WriteIfChanged(self):
"""Writes the project file."""
# First create XML content definition
content = [
"VisualStudioProject",
{
"ProjectType": "Visual C++",
"Version": self.version.ProjectVersion(),
"Name": self.name,
"ProjectGUID": self.guid,
"RootNamespace": self.name,
"Keyword": "Win32Proj",
},
self.platform_section,
self.tool_files_section,
self.configurations_section,
["References"], # empty section
self.files_section,
["Globals"], # empty section
]
easy_xml.WriteXmlIfChanged(content, self.project_path, encoding="Windows-1252")
@@ -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 MessageCirclePlus = createLucideIcon("MessageCirclePlus", [
["path", { d: "M7.9 20A9 9 0 1 0 4 16.1L2 22Z", key: "vv11sd" }],
["path", { d: "M8 12h8", key: "1wcyev" }],
["path", { d: "M12 8v8", key: "napkw2" }]
]);
export { MessageCirclePlus as default };
//# sourceMappingURL=message-circle-plus.js.map
@@ -0,0 +1 @@
{"version":3,"file":"map-pin-check.js","sources":["../../../src/icons/map-pin-check.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MapPinCheck\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTkuNDMgMTIuOTM1Yy4zNTctLjk2Ny41Ny0xLjk1NS41Ny0yLjkzNWE4IDggMCAwIDAtMTYgMGMwIDQuOTkzIDUuNTM5IDEwLjE5MyA3LjM5OSAxMS43OTlhMSAxIDAgMCAwIDEuMjAyIDAgMzIuMTk3IDMyLjE5NyAwIDAgMCAuODEzLS43MjgiIC8+CiAgPGNpcmNsZSBjeD0iMTIiIGN5PSIxMCIgcj0iMyIgLz4KICA8cGF0aCBkPSJtMTYgMTggMiAyIDQtNCIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/map-pin-check\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst MapPinCheck = createLucideIcon('MapPinCheck', [\n [\n 'path',\n {\n d: 'M19.43 12.935c.357-.967.57-1.955.57-2.935a8 8 0 0 0-16 0c0 4.993 5.539 10.193 7.399 11.799a1 1 0 0 0 1.202 0 32.197 32.197 0 0 0 .813-.728',\n key: '1dq61d',\n },\n ],\n ['circle', { cx: '12', cy: '10', r: '3', key: 'ilqhr7' }],\n ['path', { d: 'm16 18 2 2 4-4', key: '1mkfmb' }],\n]);\n\nexport default MapPinCheck;\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,CAClD,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;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,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,CAAA;AAAA,CAAA,CACxD,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,124 @@
"use strict";
var _utils = require("./utils.js");
(0, _utils.default)("ArgumentPlaceholder", {});
(0, _utils.default)("BindExpression", {
visitor: ["object", "callee"],
aliases: ["Expression"],
fields: !process.env.BABEL_TYPES_8_BREAKING ? {
object: {
validate: Object.assign(() => {}, {
oneOfNodeTypes: ["Expression"]
})
},
callee: {
validate: Object.assign(() => {}, {
oneOfNodeTypes: ["Expression"]
})
}
} : {
object: {
validate: (0, _utils.assertNodeType)("Expression")
},
callee: {
validate: (0, _utils.assertNodeType)("Expression")
}
}
});
(0, _utils.default)("Decorator", {
visitor: ["expression"],
fields: {
expression: {
validate: (0, _utils.assertNodeType)("Expression")
}
}
});
(0, _utils.default)("DoExpression", {
visitor: ["body"],
builder: ["body", "async"],
aliases: ["Expression"],
fields: {
body: {
validate: (0, _utils.assertNodeType)("BlockStatement")
},
async: {
validate: (0, _utils.assertValueType)("boolean"),
default: false
}
}
});
(0, _utils.default)("ExportDefaultSpecifier", {
visitor: ["exported"],
aliases: ["ModuleSpecifier"],
fields: {
exported: {
validate: (0, _utils.assertNodeType)("Identifier")
}
}
});
(0, _utils.default)("RecordExpression", {
visitor: ["properties"],
aliases: ["Expression"],
fields: {
properties: (0, _utils.validateArrayOfType)("ObjectProperty", "SpreadElement")
}
});
(0, _utils.default)("TupleExpression", {
fields: {
elements: {
validate: (0, _utils.arrayOfType)("Expression", "SpreadElement"),
default: []
}
},
visitor: ["elements"],
aliases: ["Expression"]
});
(0, _utils.default)("DecimalLiteral", {
builder: ["value"],
fields: {
value: {
validate: (0, _utils.assertValueType)("string")
}
},
aliases: ["Expression", "Pureish", "Literal", "Immutable"]
});
(0, _utils.default)("ModuleExpression", {
visitor: ["body"],
fields: {
body: {
validate: (0, _utils.assertNodeType)("Program")
}
},
aliases: ["Expression"]
});
(0, _utils.default)("TopicReference", {
aliases: ["Expression"]
});
(0, _utils.default)("PipelineTopicExpression", {
builder: ["expression"],
visitor: ["expression"],
fields: {
expression: {
validate: (0, _utils.assertNodeType)("Expression")
}
},
aliases: ["Expression"]
});
(0, _utils.default)("PipelineBareFunction", {
builder: ["callee"],
visitor: ["callee"],
fields: {
callee: {
validate: (0, _utils.assertNodeType)("Expression")
}
},
aliases: ["Expression"]
});
(0, _utils.default)("PipelinePrimaryTopicReference", {
aliases: ["Expression"]
});
(0, _utils.default)("VoidPattern", {
aliases: ["Pattern", "PatternLike", "FunctionParameter"]
});
//# sourceMappingURL=experimental.js.map
@@ -0,0 +1,173 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.config = exports.configs = exports.plugin = exports.parser = void 0;
const eslint_plugin_1 = __importDefault(require("@typescript-eslint/eslint-plugin"));
const raw_plugin_1 = __importDefault(require("@typescript-eslint/eslint-plugin/use-at-your-own-risk/raw-plugin"));
const typescript_estree_1 = require("@typescript-eslint/typescript-estree");
const config_helper_1 = require("./config-helper");
const getTSConfigRootDirFromStack_1 = require("./getTSConfigRootDirFromStack");
exports.parser = raw_plugin_1.default.parser;
/*
we could build a plugin object here without the `configs` key - but if we do
that then we create a situation in which
```
require('typescript-eslint').plugin !== require('@typescript-eslint/eslint-plugin')
```
This is bad because it means that 3rd party configs would be required to use
`typescript-eslint` or else they would break a user's config if the user either
used `tseslint.configs.recommended` et al or
```
{
plugins: {
'@typescript-eslint': tseslint.plugin,
},
}
```
This might be something we could consider okay (eg 3rd party flat configs must
use our new package); however legacy configs consumed via `@eslint/eslintrc`
would never be able to satisfy this constraint and thus users would be blocked
from using them.
*/
exports.plugin = eslint_plugin_1.default;
exports.configs = createConfigsGetters({
/**
* Enables each the rules provided as a part of typescript-eslint. Note that many rules are not applicable in all codebases, or are meant to be configured.
* @see {@link https://typescript-eslint.io/users/configs#all}
*/
all: raw_plugin_1.default.flatConfigs['flat/all'],
/**
* A minimal ruleset that sets only the required parser and plugin options needed to run typescript-eslint.
* We don't recommend using this directly; instead, extend from an earlier recommended rule.
* @see {@link https://typescript-eslint.io/users/configs#base}
*/
base: raw_plugin_1.default.flatConfigs['flat/base'],
/**
* A utility ruleset that will disable type-aware linting and all type-aware rules available in our project.
* @see {@link https://typescript-eslint.io/users/configs#disable-type-checked}
*/
disableTypeChecked: raw_plugin_1.default.flatConfigs['flat/disable-type-checked'],
/**
* This is a compatibility ruleset that:
* - disables rules from eslint:recommended which are already handled by TypeScript.
* - enables rules that make sense due to TS's typechecking / transpilation.
* @see {@link https://typescript-eslint.io/users/configs/#eslint-recommended}
*/
eslintRecommended: raw_plugin_1.default.flatConfigs['flat/eslint-recommended'],
/**
* Recommended rules for code correctness that you can drop in without additional configuration.
* @see {@link https://typescript-eslint.io/users/configs#recommended}
*/
recommended: raw_plugin_1.default.flatConfigs['flat/recommended'],
/**
* Contains all of `recommended` along with additional recommended rules that require type information.
* @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked}
*/
recommendedTypeChecked: raw_plugin_1.default.flatConfigs['flat/recommended-type-checked'],
/**
* A version of `recommended` that only contains type-checked rules and disables of any corresponding core ESLint rules.
* @see {@link https://typescript-eslint.io/users/configs#recommended-type-checked-only}
*/
recommendedTypeCheckedOnly: raw_plugin_1.default.flatConfigs['flat/recommended-type-checked-only'],
/**
* Contains all of `recommended`, as well as additional strict rules that can also catch bugs.
* @see {@link https://typescript-eslint.io/users/configs#strict}
*/
strict: raw_plugin_1.default.flatConfigs['flat/strict'],
/**
* Contains all of `recommended`, `recommended-type-checked`, and `strict`, along with additional strict rules that require type information.
* @see {@link https://typescript-eslint.io/users/configs#strict-type-checked}
*/
strictTypeChecked: raw_plugin_1.default.flatConfigs['flat/strict-type-checked'],
/**
* A version of `strict` that only contains type-checked rules and disables of any corresponding core ESLint rules.
* @see {@link https://typescript-eslint.io/users/configs#strict-type-checked-only}
*/
strictTypeCheckedOnly: raw_plugin_1.default.flatConfigs['flat/strict-type-checked-only'],
/**
* Rules considered to be best practice for modern TypeScript codebases, but that do not impact program logic.
* @see {@link https://typescript-eslint.io/users/configs#stylistic}
*/
stylistic: raw_plugin_1.default.flatConfigs['flat/stylistic'],
/**
* Contains all of `stylistic`, along with additional stylistic rules that require type information.
* @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked}
*/
stylisticTypeChecked: raw_plugin_1.default.flatConfigs['flat/stylistic-type-checked'],
/**
* A version of `stylistic` that only contains type-checked rules and disables of any corresponding core ESLint rules.
* @see {@link https://typescript-eslint.io/users/configs#stylistic-type-checked-only}
*/
stylisticTypeCheckedOnly: raw_plugin_1.default.flatConfigs['flat/stylistic-type-checked-only'],
});
function createConfigsGetters(values) {
const configs = {};
Object.defineProperties(configs, Object.fromEntries(Object.entries(values).map(([key, value]) => [
key,
{
enumerable: true,
get: () => {
const candidateRootDir = (0, getTSConfigRootDirFromStack_1.getTSConfigRootDirFromStack)();
if (candidateRootDir) {
(0, typescript_estree_1.addCandidateTSConfigRootDir)(candidateRootDir);
}
return value;
},
},
])));
return configs;
}
/*
we do both a default and named exports to allow people to use this package from
both CJS and ESM in very natural ways.
EG it means that all of the following are valid:
```ts
import tseslint from 'typescript-eslint';
export default tseslint.config(
...tseslint.configs.recommended,
);
```
```ts
import { config, parser, plugin } from 'typescript-eslint';
export default config(
{
languageOptions: { parser }
plugins: { ts: plugin },
}
);
```
```ts
const tseslint = require('typescript-eslint');
module.exports = tseslint.config(
...tseslint.configs.recommended,
);
```
```ts
const { config, parser, plugin } = require('typescript-eslint');
module.exports = config(
{
languageOptions: { parser }
plugins: { ts: plugin },
}
);
```
*/
exports.default = {
config: config_helper_1.config,
configs: exports.configs,
parser: exports.parser,
plugin: exports.plugin,
};
var config_helper_2 = require("./config-helper");
// eslint-disable-next-line @typescript-eslint/no-deprecated
Object.defineProperty(exports, "config", { enumerable: true, get: function () { return config_helper_2.config; } });
@@ -0,0 +1,460 @@
// @ts-check
const path = require('path');
const fs = require('fs');
const os = require('os');
const url = require('url');
const fsReadFileAsync = fs.promises.readFile;
/** @type {(name: string, sync: boolean) => string[]} */
function getDefaultSearchPlaces(name, sync) {
return [
'package.json',
`.${name}rc.json`,
`.${name}rc.js`,
`.${name}rc.cjs`,
...(sync ? [] : [`.${name}rc.mjs`]),
`.config/${name}rc`,
`.config/${name}rc.json`,
`.config/${name}rc.js`,
`.config/${name}rc.cjs`,
...(sync ? [] : [`.config/${name}rc.mjs`]),
`${name}.config.js`,
`${name}.config.cjs`,
...(sync ? [] : [`${name}.config.mjs`]),
];
}
/**
* @type {(p: string) => string}
*
* see #17
* On *nix, if cwd is not under homedir,
* the last path will be '', ('/build' -> '')
* but it should be '/' actually.
* And on Windows, this will never happen. ('C:\build' -> 'C:')
*/
function parentDir(p) {
return path.dirname(p) || path.sep;
}
/** @type {import('./index').LoaderSync} */
const jsonLoader = (_, content) => JSON.parse(content);
// Use plain require in webpack context for dynamic import
const requireFunc =
typeof __webpack_require__ === 'function' ? __non_webpack_require__ : require;
/** @type {import('./index').LoadersSync} */
const defaultLoadersSync = Object.freeze({
'.js': requireFunc,
'.json': requireFunc,
'.cjs': requireFunc,
noExt: jsonLoader,
});
module.exports.defaultLoadersSync = defaultLoadersSync;
/** @type {import('./index').Loader} */
const dynamicImport = async id => {
try {
const fileUrl = url.pathToFileURL(id).href;
const mod = await import(/* webpackIgnore: true */ fileUrl);
return mod.default;
} catch (e) {
try {
return requireFunc(id);
} catch (/** @type {any} */ requireE) {
if (
requireE.code === 'ERR_REQUIRE_ESM' ||
(requireE instanceof SyntaxError &&
requireE
.toString()
.includes('Cannot use import statement outside a module'))
) {
throw e;
}
throw requireE;
}
}
};
/** @type {import('./index').Loaders} */
const defaultLoaders = Object.freeze({
'.js': dynamicImport,
'.mjs': dynamicImport,
'.cjs': dynamicImport,
'.json': jsonLoader,
noExt: jsonLoader,
});
module.exports.defaultLoaders = defaultLoaders;
/**
* @param {string} name
* @param {import('./index').Options | import('./index').OptionsSync} options
* @param {boolean} sync
* @returns {Required<import('./index').Options | import('./index').OptionsSync>}
*/
function getOptions(name, options, sync) {
/** @type {Required<import('./index').Options>} */
const conf = {
stopDir: os.homedir(),
searchPlaces: getDefaultSearchPlaces(name, sync),
ignoreEmptySearchPlaces: true,
cache: true,
transform: x => x,
packageProp: [name],
...options,
loaders: {
...(sync ? defaultLoadersSync : defaultLoaders),
...options.loaders,
},
};
conf.searchPlaces.forEach(place => {
const key = path.extname(place) || 'noExt';
const loader = conf.loaders[key];
if (!loader) {
throw new Error(`Missing loader for extension "${place}"`);
}
if (typeof loader !== 'function') {
throw new Error(
`Loader for extension "${place}" is not a function: Received ${typeof loader}.`,
);
}
});
return conf;
}
/** @type {(props: string | string[], obj: Record<string, any>) => unknown} */
function getPackageProp(props, obj) {
if (typeof props === 'string' && props in obj) return obj[props];
return (
(Array.isArray(props) ? props : props.split('.')).reduce(
(acc, prop) => (acc === undefined ? acc : acc[prop]),
obj,
) || null
);
}
/** @param {string} filepath */
function validateFilePath(filepath) {
if (!filepath) throw new Error('load must pass a non-empty string');
}
/** @type {(loader: import('./index').Loader, ext: string) => void} */
function validateLoader(loader, ext) {
if (!loader) throw new Error(`No loader specified for extension "${ext}"`);
if (typeof loader !== 'function') throw new Error('loader is not a function');
}
/** @type {(enableCache: boolean) => <T>(c: Map<string, T>, filepath: string, res: T) => T} */
const makeEmplace = enableCache => (c, filepath, res) => {
if (enableCache) c.set(filepath, res);
return res;
};
/** @type {import('./index').lilconfig} */
module.exports.lilconfig = function lilconfig(name, options) {
const {
ignoreEmptySearchPlaces,
loaders,
packageProp,
searchPlaces,
stopDir,
transform,
cache,
} = getOptions(name, options ?? {}, false);
const searchCache = new Map();
const loadCache = new Map();
const emplace = makeEmplace(cache);
return {
async search(searchFrom = process.cwd()) {
/** @type {import('./index').LilconfigResult} */
const result = {
config: null,
filepath: '',
};
/** @type {Set<string>} */
const visited = new Set();
let dir = searchFrom;
dirLoop: while (true) {
if (cache) {
const r = searchCache.get(dir);
if (r !== undefined) {
for (const p of visited) searchCache.set(p, r);
return r;
}
visited.add(dir);
}
for (const searchPlace of searchPlaces) {
const filepath = path.join(dir, searchPlace);
try {
await fs.promises.access(filepath);
} catch {
continue;
}
const content = String(await fsReadFileAsync(filepath));
const loaderKey = path.extname(searchPlace) || 'noExt';
const loader = loaders[loaderKey];
// handle package.json
if (searchPlace === 'package.json') {
const pkg = await loader(filepath, content);
const maybeConfig = getPackageProp(packageProp, pkg);
if (maybeConfig != null) {
result.config = maybeConfig;
result.filepath = filepath;
break dirLoop;
}
continue;
}
// handle other type of configs
const isEmpty = content.trim() === '';
if (isEmpty && ignoreEmptySearchPlaces) continue;
if (isEmpty) {
result.isEmpty = true;
result.config = undefined;
} else {
validateLoader(loader, loaderKey);
result.config = await loader(filepath, content);
}
result.filepath = filepath;
break dirLoop;
}
if (dir === stopDir || dir === parentDir(dir)) break dirLoop;
dir = parentDir(dir);
}
const transformed =
// not found
result.filepath === '' && result.config === null
? transform(null)
: transform(result);
if (cache) {
for (const p of visited) searchCache.set(p, transformed);
}
return transformed;
},
async load(filepath) {
validateFilePath(filepath);
const absPath = path.resolve(process.cwd(), filepath);
if (cache && loadCache.has(absPath)) {
return loadCache.get(absPath);
}
const {base, ext} = path.parse(absPath);
const loaderKey = ext || 'noExt';
const loader = loaders[loaderKey];
validateLoader(loader, loaderKey);
const content = String(await fsReadFileAsync(absPath));
if (base === 'package.json') {
const pkg = await loader(absPath, content);
return emplace(
loadCache,
absPath,
transform({
config: getPackageProp(packageProp, pkg),
filepath: absPath,
}),
);
}
/** @type {import('./index').LilconfigResult} */
const result = {
config: null,
filepath: absPath,
};
// handle other type of configs
const isEmpty = content.trim() === '';
if (isEmpty && ignoreEmptySearchPlaces)
return emplace(
loadCache,
absPath,
transform({
config: undefined,
filepath: absPath,
isEmpty: true,
}),
);
// cosmiconfig returns undefined for empty files
result.config = isEmpty ? undefined : await loader(absPath, content);
return emplace(
loadCache,
absPath,
transform(isEmpty ? {...result, isEmpty, config: undefined} : result),
);
},
clearLoadCache() {
if (cache) loadCache.clear();
},
clearSearchCache() {
if (cache) searchCache.clear();
},
clearCaches() {
if (cache) {
loadCache.clear();
searchCache.clear();
}
},
};
};
/** @type {import('./index').lilconfigSync} */
module.exports.lilconfigSync = function lilconfigSync(name, options) {
const {
ignoreEmptySearchPlaces,
loaders,
packageProp,
searchPlaces,
stopDir,
transform,
cache,
} = getOptions(name, options ?? {}, true);
const searchCache = new Map();
const loadCache = new Map();
const emplace = makeEmplace(cache);
return {
search(searchFrom = process.cwd()) {
/** @type {import('./index').LilconfigResult} */
const result = {
config: null,
filepath: '',
};
/** @type {Set<string>} */
const visited = new Set();
let dir = searchFrom;
dirLoop: while (true) {
if (cache) {
const r = searchCache.get(dir);
if (r !== undefined) {
for (const p of visited) searchCache.set(p, r);
return r;
}
visited.add(dir);
}
for (const searchPlace of searchPlaces) {
const filepath = path.join(dir, searchPlace);
try {
fs.accessSync(filepath);
} catch {
continue;
}
const loaderKey = path.extname(searchPlace) || 'noExt';
const loader = loaders[loaderKey];
const content = String(fs.readFileSync(filepath));
// handle package.json
if (searchPlace === 'package.json') {
const pkg = loader(filepath, content);
const maybeConfig = getPackageProp(packageProp, pkg);
if (maybeConfig != null) {
result.config = maybeConfig;
result.filepath = filepath;
break dirLoop;
}
continue;
}
// handle other type of configs
const isEmpty = content.trim() === '';
if (isEmpty && ignoreEmptySearchPlaces) continue;
if (isEmpty) {
result.isEmpty = true;
result.config = undefined;
} else {
validateLoader(loader, loaderKey);
result.config = loader(filepath, content);
}
result.filepath = filepath;
break dirLoop;
}
if (dir === stopDir || dir === parentDir(dir)) break dirLoop;
dir = parentDir(dir);
}
const transformed =
// not found
result.filepath === '' && result.config === null
? transform(null)
: transform(result);
if (cache) {
for (const p of visited) searchCache.set(p, transformed);
}
return transformed;
},
load(filepath) {
validateFilePath(filepath);
const absPath = path.resolve(process.cwd(), filepath);
if (cache && loadCache.has(absPath)) {
return loadCache.get(absPath);
}
const {base, ext} = path.parse(absPath);
const loaderKey = ext || 'noExt';
const loader = loaders[loaderKey];
validateLoader(loader, loaderKey);
const content = String(fs.readFileSync(absPath));
if (base === 'package.json') {
const pkg = loader(absPath, content);
return transform({
config: getPackageProp(packageProp, pkg),
filepath: absPath,
});
}
const result = {
config: null,
filepath: absPath,
};
// handle other type of configs
const isEmpty = content.trim() === '';
if (isEmpty && ignoreEmptySearchPlaces)
return emplace(
loadCache,
absPath,
transform({
filepath: absPath,
config: undefined,
isEmpty: true,
}),
);
// cosmiconfig returns undefined for empty files
result.config = isEmpty ? undefined : loader(absPath, content);
return emplace(
loadCache,
absPath,
transform(isEmpty ? {...result, isEmpty, config: undefined} : result),
);
},
clearLoadCache() {
if (cache) loadCache.clear();
},
clearSearchCache() {
if (cache) searchCache.clear();
},
clearCaches() {
if (cache) {
loadCache.clear();
searchCache.clear();
}
},
};
};
@@ -0,0 +1,78 @@
import { __assign } from "tslib";
function ItoI(a) {
return a;
}
function innerCreateMedium(defaults, middleware) {
if (middleware === void 0) { middleware = ItoI; }
var buffer = [];
var assigned = false;
var medium = {
read: function () {
if (assigned) {
throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');
}
if (buffer.length) {
return buffer[buffer.length - 1];
}
return defaults;
},
useMedium: function (data) {
var item = middleware(data, assigned);
buffer.push(item);
return function () {
buffer = buffer.filter(function (x) { return x !== item; });
};
},
assignSyncMedium: function (cb) {
assigned = true;
while (buffer.length) {
var cbs = buffer;
buffer = [];
cbs.forEach(cb);
}
buffer = {
push: function (x) { return cb(x); },
filter: function () { return buffer; },
};
},
assignMedium: function (cb) {
assigned = true;
var pendingQueue = [];
if (buffer.length) {
var cbs = buffer;
buffer = [];
cbs.forEach(cb);
pendingQueue = buffer;
}
var executeQueue = function () {
var cbs = pendingQueue;
pendingQueue = [];
cbs.forEach(cb);
};
var cycle = function () { return Promise.resolve().then(executeQueue); };
cycle();
buffer = {
push: function (x) {
pendingQueue.push(x);
cycle();
},
filter: function (filter) {
pendingQueue = pendingQueue.filter(filter);
return buffer;
},
};
},
};
return medium;
}
export function createMedium(defaults, middleware) {
if (middleware === void 0) { middleware = ItoI; }
return innerCreateMedium(defaults, middleware);
}
// eslint-disable-next-line @typescript-eslint/ban-types
export function createSidecarMedium(options) {
if (options === void 0) { options = {}; }
var medium = innerCreateMedium(null);
medium.options = __assign({ async: true, ssr: false }, options);
return medium;
}
@@ -0,0 +1,288 @@
'use strict';
require('node:util');
const g = require('node:process');
const f = require('node:readline');
const tty = require('node:tty');
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
const g__default = /*#__PURE__*/_interopDefaultCompat(g);
const f__default = /*#__PURE__*/_interopDefaultCompat(f);
function getDefaultExportFromCjs (x) {
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
}
var src;
var hasRequiredSrc;
function requireSrc () {
if (hasRequiredSrc) return src;
hasRequiredSrc = 1;
const ESC = '\x1B';
const CSI = `${ESC}[`;
const beep = '\u0007';
const cursor = {
to(x, y) {
if (!y) return `${CSI}${x + 1}G`;
return `${CSI}${y + 1};${x + 1}H`;
},
move(x, y) {
let ret = '';
if (x < 0) ret += `${CSI}${-x}D`;
else if (x > 0) ret += `${CSI}${x}C`;
if (y < 0) ret += `${CSI}${-y}A`;
else if (y > 0) ret += `${CSI}${y}B`;
return ret;
},
up: (count = 1) => `${CSI}${count}A`,
down: (count = 1) => `${CSI}${count}B`,
forward: (count = 1) => `${CSI}${count}C`,
backward: (count = 1) => `${CSI}${count}D`,
nextLine: (count = 1) => `${CSI}E`.repeat(count),
prevLine: (count = 1) => `${CSI}F`.repeat(count),
left: `${CSI}G`,
hide: `${CSI}?25l`,
show: `${CSI}?25h`,
save: `${ESC}7`,
restore: `${ESC}8`
};
const scroll = {
up: (count = 1) => `${CSI}S`.repeat(count),
down: (count = 1) => `${CSI}T`.repeat(count)
};
const erase = {
screen: `${CSI}2J`,
up: (count = 1) => `${CSI}1J`.repeat(count),
down: (count = 1) => `${CSI}J`.repeat(count),
line: `${CSI}2K`,
lineEnd: `${CSI}K`,
lineStart: `${CSI}1K`,
lines(count) {
let clear = '';
for (let i = 0; i < count; i++)
clear += this.line + (i < count - 1 ? cursor.up() : '');
if (count)
clear += cursor.left;
return clear;
}
};
src = { cursor, scroll, erase, beep };
return src;
}
var srcExports = requireSrc();
var picocolors = {exports: {}};
var hasRequiredPicocolors;
function requirePicocolors () {
if (hasRequiredPicocolors) return picocolors.exports;
hasRequiredPicocolors = 1;
let p = process || {}, argv = p.argv || [], env = p.env || {};
let isColorSupported =
!(!!env.NO_COLOR || argv.includes("--no-color")) &&
(!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || ((p.stdout || {}).isTTY && env.TERM !== "dumb") || !!env.CI);
let formatter = (open, close, replace = open) =>
input => {
let string = "" + input, index = string.indexOf(close, open.length);
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close
};
let replaceClose = (string, close, replace, index) => {
let result = "", cursor = 0;
do {
result += string.substring(cursor, index) + replace;
cursor = index + close.length;
index = string.indexOf(close, cursor);
} while (~index)
return result + string.substring(cursor)
};
let createColors = (enabled = isColorSupported) => {
let f = enabled ? formatter : () => String;
return {
isColorSupported: enabled,
reset: f("\x1b[0m", "\x1b[0m"),
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
italic: f("\x1b[3m", "\x1b[23m"),
underline: f("\x1b[4m", "\x1b[24m"),
inverse: f("\x1b[7m", "\x1b[27m"),
hidden: f("\x1b[8m", "\x1b[28m"),
strikethrough: f("\x1b[9m", "\x1b[29m"),
black: f("\x1b[30m", "\x1b[39m"),
red: f("\x1b[31m", "\x1b[39m"),
green: f("\x1b[32m", "\x1b[39m"),
yellow: f("\x1b[33m", "\x1b[39m"),
blue: f("\x1b[34m", "\x1b[39m"),
magenta: f("\x1b[35m", "\x1b[39m"),
cyan: f("\x1b[36m", "\x1b[39m"),
white: f("\x1b[37m", "\x1b[39m"),
gray: f("\x1b[90m", "\x1b[39m"),
bgBlack: f("\x1b[40m", "\x1b[49m"),
bgRed: f("\x1b[41m", "\x1b[49m"),
bgGreen: f("\x1b[42m", "\x1b[49m"),
bgYellow: f("\x1b[43m", "\x1b[49m"),
bgBlue: f("\x1b[44m", "\x1b[49m"),
bgMagenta: f("\x1b[45m", "\x1b[49m"),
bgCyan: f("\x1b[46m", "\x1b[49m"),
bgWhite: f("\x1b[47m", "\x1b[49m"),
blackBright: f("\x1b[90m", "\x1b[39m"),
redBright: f("\x1b[91m", "\x1b[39m"),
greenBright: f("\x1b[92m", "\x1b[39m"),
yellowBright: f("\x1b[93m", "\x1b[39m"),
blueBright: f("\x1b[94m", "\x1b[39m"),
magentaBright: f("\x1b[95m", "\x1b[39m"),
cyanBright: f("\x1b[96m", "\x1b[39m"),
whiteBright: f("\x1b[97m", "\x1b[39m"),
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
bgRedBright: f("\x1b[101m", "\x1b[49m"),
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
bgWhiteBright: f("\x1b[107m", "\x1b[49m"),
}
};
picocolors.exports = createColors();
picocolors.exports.createColors = createColors;
return picocolors.exports;
}
var picocolorsExports = /*@__PURE__*/ requirePicocolors();
const e = /*@__PURE__*/getDefaultExportFromCjs(picocolorsExports);
function J({onlyFirst:t=false}={}){const F=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(F,t?void 0:"g")}const Q=J();function T$1(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(Q,"")}function O(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var P$1={exports:{}};(function(t){var u={};t.exports=u,u.eastAsianWidth=function(e){var s=e.charCodeAt(0),i=e.length==2?e.charCodeAt(1):0,D=s;return 55296<=s&&s<=56319&&56320<=i&&i<=57343&&(s&=1023,i&=1023,D=s<<10|i,D+=65536),D==12288||65281<=D&&D<=65376||65504<=D&&D<=65510?"F":D==8361||65377<=D&&D<=65470||65474<=D&&D<=65479||65482<=D&&D<=65487||65490<=D&&D<=65495||65498<=D&&D<=65500||65512<=D&&D<=65518?"H":4352<=D&&D<=4447||4515<=D&&D<=4519||4602<=D&&D<=4607||9001<=D&&D<=9002||11904<=D&&D<=11929||11931<=D&&D<=12019||12032<=D&&D<=12245||12272<=D&&D<=12283||12289<=D&&D<=12350||12353<=D&&D<=12438||12441<=D&&D<=12543||12549<=D&&D<=12589||12593<=D&&D<=12686||12688<=D&&D<=12730||12736<=D&&D<=12771||12784<=D&&D<=12830||12832<=D&&D<=12871||12880<=D&&D<=13054||13056<=D&&D<=19903||19968<=D&&D<=42124||42128<=D&&D<=42182||43360<=D&&D<=43388||44032<=D&&D<=55203||55216<=D&&D<=55238||55243<=D&&D<=55291||63744<=D&&D<=64255||65040<=D&&D<=65049||65072<=D&&D<=65106||65108<=D&&D<=65126||65128<=D&&D<=65131||110592<=D&&D<=110593||127488<=D&&D<=127490||127504<=D&&D<=127546||127552<=D&&D<=127560||127568<=D&&D<=127569||131072<=D&&D<=194367||177984<=D&&D<=196605||196608<=D&&D<=262141?"W":32<=D&&D<=126||162<=D&&D<=163||165<=D&&D<=166||D==172||D==175||10214<=D&&D<=10221||10629<=D&&D<=10630?"Na":D==161||D==164||167<=D&&D<=168||D==170||173<=D&&D<=174||176<=D&&D<=180||182<=D&&D<=186||188<=D&&D<=191||D==198||D==208||215<=D&&D<=216||222<=D&&D<=225||D==230||232<=D&&D<=234||236<=D&&D<=237||D==240||242<=D&&D<=243||247<=D&&D<=250||D==252||D==254||D==257||D==273||D==275||D==283||294<=D&&D<=295||D==299||305<=D&&D<=307||D==312||319<=D&&D<=322||D==324||328<=D&&D<=331||D==333||338<=D&&D<=339||358<=D&&D<=359||D==363||D==462||D==464||D==466||D==468||D==470||D==472||D==474||D==476||D==593||D==609||D==708||D==711||713<=D&&D<=715||D==717||D==720||728<=D&&D<=731||D==733||D==735||768<=D&&D<=879||913<=D&&D<=929||931<=D&&D<=937||945<=D&&D<=961||963<=D&&D<=969||D==1025||1040<=D&&D<=1103||D==1105||D==8208||8211<=D&&D<=8214||8216<=D&&D<=8217||8220<=D&&D<=8221||8224<=D&&D<=8226||8228<=D&&D<=8231||D==8240||8242<=D&&D<=8243||D==8245||D==8251||D==8254||D==8308||D==8319||8321<=D&&D<=8324||D==8364||D==8451||D==8453||D==8457||D==8467||D==8470||8481<=D&&D<=8482||D==8486||D==8491||8531<=D&&D<=8532||8539<=D&&D<=8542||8544<=D&&D<=8555||8560<=D&&D<=8569||D==8585||8592<=D&&D<=8601||8632<=D&&D<=8633||D==8658||D==8660||D==8679||D==8704||8706<=D&&D<=8707||8711<=D&&D<=8712||D==8715||D==8719||D==8721||D==8725||D==8730||8733<=D&&D<=8736||D==8739||D==8741||8743<=D&&D<=8748||D==8750||8756<=D&&D<=8759||8764<=D&&D<=8765||D==8776||D==8780||D==8786||8800<=D&&D<=8801||8804<=D&&D<=8807||8810<=D&&D<=8811||8814<=D&&D<=8815||8834<=D&&D<=8835||8838<=D&&D<=8839||D==8853||D==8857||D==8869||D==8895||D==8978||9312<=D&&D<=9449||9451<=D&&D<=9547||9552<=D&&D<=9587||9600<=D&&D<=9615||9618<=D&&D<=9621||9632<=D&&D<=9633||9635<=D&&D<=9641||9650<=D&&D<=9651||9654<=D&&D<=9655||9660<=D&&D<=9661||9664<=D&&D<=9665||9670<=D&&D<=9672||D==9675||9678<=D&&D<=9681||9698<=D&&D<=9701||D==9711||9733<=D&&D<=9734||D==9737||9742<=D&&D<=9743||9748<=D&&D<=9749||D==9756||D==9758||D==9792||D==9794||9824<=D&&D<=9825||9827<=D&&D<=9829||9831<=D&&D<=9834||9836<=D&&D<=9837||D==9839||9886<=D&&D<=9887||9918<=D&&D<=9919||9924<=D&&D<=9933||9935<=D&&D<=9953||D==9955||9960<=D&&D<=9983||D==10045||D==10071||10102<=D&&D<=10111||11093<=D&&D<=11097||12872<=D&&D<=12879||57344<=D&&D<=63743||65024<=D&&D<=65039||D==65533||127232<=D&&D<=127242||127248<=D&&D<=127277||127280<=D&&D<=127337||127344<=D&&D<=127386||917760<=D&&D<=917999||983040<=D&&D<=1048573||1048576<=D&&D<=1114109?"A":"N"},u.characterLength=function(e){var s=this.eastAsianWidth(e);return s=="F"||s=="W"||s=="A"?2:1};function F(e){return e.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}u.length=function(e){for(var s=F(e),i=0,D=0;D<s.length;D++)i=i+this.characterLength(s[D]);return i},u.slice=function(e,s,i){textLen=u.length(e),s=s||0,i=i||1,s<0&&(s=textLen+s),i<0&&(i=textLen+i);for(var D="",C=0,o=F(e),E=0;E<o.length;E++){var a=o[E],n=u.length(a);if(C>=s-(n==2?1:0))if(C+n<=i)D+=a;else break;C+=n;}return D};})(P$1);var X=P$1.exports;const DD=O(X);var uD=function(){return /\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uLine truncated
`)];for(const[E,a]of o.entries()){if(e+=a,v.has(a)){const{groups:B}=new RegExp(`(?:\\${W$1}(?<code>\\d+)m|\\${y}(?<uri>.*)${w$1})`).exec(o.slice(E).join(""))||{groups:{}};if(B.code!==void 0){const p=Number.parseFloat(B.code);s=p===CD?void 0:p;}else B.uri!==void 0&&(i=B.uri.length===0?void 0:B.uri);}const n=iD.codes.get(Number(s));o[E+1]===`
`?(i&&(e+=z("")),s&&n&&(e+=V$1(n))):a===`
`&&(s&&n&&(e+=V$1(s)),i&&(e+=z(i)));}return e};function G(t,u,F){return String(t).normalize().replace(/\r\n/g,`
`).split(`
`).map(e=>oD(e,u,F)).join(`
`)}const aD=["up","down","left","right","space","enter","cancel"],c={actions:new Set(aD),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["","cancel"],["escape","cancel"]])};function k$1(t,u){if(typeof t=="string")return c.aliases.get(t)===u;for(const F of t)if(F!==void 0&&k$1(F,u))return true;return false}function lD(t,u){if(t===u)return;const F=t.split(`
`),e=u.split(`
`),s=[];for(let i=0;i<Math.max(F.length,e.length);i++)F[i]!==e[i]&&s.push(i);return s}globalThis.process.platform.startsWith("win");const S=Symbol("clack:cancel");function d$1(t,u){const F=t;F.isTTY&&F.setRawMode(u);}var AD=Object.defineProperty,pD=(t,u,F)=>u in t?AD(t,u,{enumerable:true,configurable:true,writable:true,value:F}):t[u]=F,h=(t,u,F)=>(pD(t,typeof u!="symbol"?u+"":u,F),F);class x{constructor(u,F=true){h(this,"input"),h(this,"output"),h(this,"_abortSignal"),h(this,"rl"),h(this,"opts"),h(this,"_render"),h(this,"_track",false),h(this,"_prevFrame",""),h(this,"_subscribers",new Map),h(this,"_cursor",0),h(this,"state","initial"),h(this,"error",""),h(this,"value");const{input:e=g.stdin,output:s=g.stdout,render:i,signal:D,...C}=u;this.opts=C,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=i.bind(this),this._track=F,this._abortSignal=D,this.input=e,this.output=s;}unsubscribe(){this._subscribers.clear();}setSubscriber(u,F){const e=this._subscribers.get(u)??[];e.push(F),this._subscribers.set(u,e);}on(u,F){this.setSubscriber(u,{cb:F});}once(u,F){this.setSubscriber(u,{cb:F,once:true});}emit(u,...F){const e=this._subscribers.get(u)??[],s=[];for(const i of e)i.cb(...F),i.once&&s.push(()=>e.splice(e.indexOf(i),1));for(const i of s)i();}prompt(){return new Promise((u,F)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),u(S);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close();},{once:true});}const e=new tty.WriteStream(0);e._write=(s,i,D)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),D();},this.input.pipe(e),this.rl=f__default.createInterface({input:this.input,output:e,tabSize:2,prompt:"",escapeCodeTimeout:50}),f__default.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),d$1(this.input,true),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(srcExports.cursor.show),this.output.off("resize",this.render),d$1(this.input,false),u(this.value);}),this.once("cancel",()=>{this.output.write(srcExports.cursor.show),this.output.off("resize",this.render),d$1(this.input,false),u(S);});})}onKeypress(u,F){if(this.state==="error"&&(this.state="active"),F?.name&&(!this._track&&c.aliases.has(F.name)&&this.emit("cursor",c.aliases.get(F.name)),c.actions.has(F.name)&&this.emit("cursor",F.name)),u&&(u.toLowerCase()==="y"||u.toLowerCase()==="n")&&this.emit("confirm",u.toLowerCase()==="y"),u===" "&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),u&&this.emit("key",u.toLowerCase()),F?.name==="return"){if(this.opts.validate){const e=this.opts.validate(this.value);e&&(this.error=e instanceof Error?e.message:e,this.state="error",this.rl?.write(this.value));}this.state!=="error"&&(this.state="submit");}k$1([u,F?.name,F?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close();}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
`),d$1(this.input,false),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe();}restoreCursor(){const u=G(this._prevFrame,process.stdout.columns,{hard:true}).split(`
`).length-1;this.output.write(srcExports.cursor.move(-999,u*-1));}render(){const u=G(this._render(this)??"",process.stdout.columns,{hard:true});if(u!==this._prevFrame){if(this.state==="initial")this.output.write(srcExports.cursor.hide);else {const F=lD(this._prevFrame,u);if(this.restoreCursor(),F&&F?.length===1){const e=F[0];this.output.write(srcExports.cursor.move(0,e)),this.output.write(srcExports.erase.lines(1));const s=u.split(`
`);this.output.write(s[e]),this._prevFrame=u,this.output.write(srcExports.cursor.move(0,s.length-e-1));return}if(F&&F?.length>1){const e=F[0];this.output.write(srcExports.cursor.move(0,e)),this.output.write(srcExports.erase.down());const s=u.split(`
`).slice(e);this.output.write(s.join(`
`)),this._prevFrame=u;return}this.output.write(srcExports.erase.down());}this.output.write(u),this.state==="initial"&&(this.state="active"),this._prevFrame=u;}}}class fD extends x{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(u){super(u,false),this.value=!!u.initialValue,this.on("value",()=>{this.value=this._value;}),this.on("confirm",F=>{this.output.write(srcExports.cursor.move(0,-1)),this.value=F,this.state="submit",this.close();}),this.on("cursor",()=>{this.value=!this.value;});}}var bD=Object.defineProperty,mD=(t,u,F)=>u in t?bD(t,u,{enumerable:true,configurable:true,writable:true,value:F}):t[u]=F,Y=(t,u,F)=>(mD(t,typeof u!="symbol"?u+"":u,F),F);let wD=class extends x{constructor(u){super(u,false),Y(this,"options"),Y(this,"cursor",0),this.options=u.options,this.value=[...u.initialValues??[]],this.cursor=Math.max(this.options.findIndex(({value:F})=>F===u.cursorAt),0),this.on("key",F=>{F==="a"&&this.toggleAll();}),this.on("cursor",F=>{switch(F){case "left":case "up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case "down":case "right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break;case "space":this.toggleValue();break}});}get _value(){return this.options[this.cursor].value}toggleAll(){const u=this.value.length===this.options.length;this.value=u?[]:this.options.map(F=>F.value);}toggleValue(){const u=this.value.includes(this._value);this.value=u?this.value.filter(F=>F!==this._value):[...this.value,this._value];}};var SD=Object.defineProperty,$D=(t,u,F)=>u in t?SD(t,u,{enumerable:true,configurable:true,writable:true,value:F}):t[u]=F,q=(t,u,F)=>($D(t,typeof u!="symbol"?u+"":u,F),F);class jD extends x{constructor(u){super(u,false),q(this,"options"),q(this,"cursor",0),this.options=u.options,this.cursor=this.options.findIndex(({value:F})=>F===u.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",F=>{switch(F){case "left":case "up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case "down":case "right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue();});}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value;}}class PD extends x{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return `${this.value}\u2588`;const u=this.value.slice(0,this.cursor),[F,...e$1]=this.value.slice(this.cursor);return `${u}${e.inverse(F)}${e$1.join("")}`}get cursor(){return this._cursor}constructor(u){super(u),this.on("finalize",()=>{this.value||(this.value=u.defaultValue);});}}
function ce(){return g__default.platform!=="win32"?g__default.env.TERM!=="linux":!!g__default.env.CI||!!g__default.env.WT_SESSION||!!g__default.env.TERMINUS_SUBLIME||g__default.env.ConEmuTask==="{cmd::Cmder}"||g__default.env.TERM_PROGRAM==="Terminus-Sublime"||g__default.env.TERM_PROGRAM==="vscode"||g__default.env.TERM==="xterm-256color"||g__default.env.TERM==="alacritty"||g__default.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const V=ce(),u=(t,n)=>V?t:n,le=u("❯", ">"),L=u("■", "x"),W=u("▲", "x"),C=u("✔", "√"),o=u(""),d=u(""),k=u("\u25CF",">"),P=u("\u25CB"," "),A=u("\u25FB","[\u2022]"),T=u("\u25FC","[+]"),F=u("\u25FB","[ ]"),w=t=>{switch(t){case "initial":case "active":return e.cyan(le);case "cancel":return e.red(L);case "error":return e.yellow(W);case "submit":return e.green(C)}},B=t=>{const{cursor:n,options:s,style:r}=t,i=t.maxItems??Number.POSITIVE_INFINITY,a=Math.max(process.stdout.rows-4,0),c=Math.min(a,Math.max(i,5));let l=0;n>=l+c-3?l=Math.max(Math.min(n-c+3,s.length-c),0):n<l+2&&(l=Math.max(n-2,0));const $=c<s.length&&l>0,p=c<s.length&&l+c<s.length;return s.slice(l,l+c).map((M,v,x)=>{const j=v===0&&$,E=v===x.length-1&&p;return j||E?e.dim("..."):r(M,v+l===n)})},he=t=>new PD({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,render(){const n=`${e.gray(o)}
${w(this.state)} ${t.message}
`,s=t.placeholder?e.inverse(t.placeholder[0])+e.dim(t.placeholder.slice(1)):e.inverse(e.hidden("_")),r=this.value?this.valueWithCursor:s;switch(this.state){case "error":return `${n.trim()}
${e.yellow(o)} ${r}
${e.yellow(d)} ${e.yellow(this.error)}
`;case "submit":return `${n}${e.gray(o)} ${e.dim(this.value||t.placeholder)}`;case "cancel":return `${n}${e.gray(o)} ${e.strikethrough(e.dim(this.value??""))}${this.value?.trim()?`
${e.gray(o)}`:""}`;default:return `${n}${e.cyan(o)} ${r}
${e.cyan(d)}
`}}}).prompt(),ye=t=>{const n=t.active??"Yes",s=t.inactive??"No";return new fD({active:n,inactive:s,initialValue:t.initialValue??true,render(){const r=`${e.gray(o)}
${w(this.state)} ${t.message}
`,i=this.value?n:s;switch(this.state){case "submit":return `${r}${e.gray(o)} ${e.dim(i)}`;case "cancel":return `${r}${e.gray(o)} ${e.strikethrough(e.dim(i))}
${e.gray(o)}`;default:return `${r}${e.cyan(o)} ${this.value?`${e.green(k)} ${n}`:`${e.dim(P)} ${e.dim(n)}`} ${e.dim("/")} ${this.value?`${e.dim(P)} ${e.dim(s)}`:`${e.green(k)} ${s}`}
${e.cyan(d)}
`}}}).prompt()},ve=t=>{const n=(s,r)=>{const i=s.label??String(s.value);switch(r){case "selected":return `${e.dim(i)}`;case "active":return `${e.green(k)} ${i} ${s.hint?e.dim(`(${s.hint})`):""}`;case "cancelled":return `${e.strikethrough(e.dim(i))}`;default:return `${e.dim(P)} ${e.dim(i)}`}};return new jD({options:t.options,initialValue:t.initialValue,render(){const s=`${e.gray(o)}
${w(this.state)} ${t.message}
`;switch(this.state){case "submit":return `${s}${e.gray(o)} ${n(this.options[this.cursor],"selected")}`;case "cancel":return `${s}${e.gray(o)} ${n(this.options[this.cursor],"cancelled")}
${e.gray(o)}`;default:return `${s}${e.cyan(o)} ${B({cursor:this.cursor,options:this.options,maxItems:t.maxItems,style:(r,i)=>n(r,i?"active":"inactive")}).join(`
${e.cyan(o)} `)}
${e.cyan(d)}
`}}}).prompt()},fe=t=>{const n=(s,r)=>{const i=s.label??String(s.value);return r==="active"?`${e.cyan(A)} ${i} ${s.hint?e.dim(`(${s.hint})`):""}`:r==="selected"?`${e.green(T)} ${e.dim(i)}`:r==="cancelled"?`${e.strikethrough(e.dim(i))}`:r==="active-selected"?`${e.green(T)} ${i} ${s.hint?e.dim(`(${s.hint})`):""}`:r==="submitted"?`${e.dim(i)}`:`${e.dim(F)} ${e.dim(i)}`};return new wD({options:t.options,initialValues:t.initialValues,required:t.required??true,cursorAt:t.cursorAt,validate(s){if(this.required&&s.length===0)return `Please select at least one option.
${e.reset(e.dim(`Press ${e.gray(e.bgWhite(e.inverse(" space ")))} to select, ${e.gray(e.bgWhite(e.inverse(" enter ")))} to submit`))}`},render(){const s=`${e.gray(o)}
${w(this.state)} ${t.message}
`,r=(i,a)=>{const c=this.value.includes(i.value);return a&&c?n(i,"active-selected"):c?n(i,"selected"):n(i,a?"active":"inactive")};switch(this.state){case "submit":return `${s}${e.gray(o)} ${this.options.filter(({value:i})=>this.value.includes(i)).map(i=>n(i,"submitted")).join(e.dim(", "))||e.dim("none")}`;case "cancel":{const i=this.options.filter(({value:a})=>this.value.includes(a)).map(a=>n(a,"cancelled")).join(e.dim(", "));return `${s}${e.gray(o)} ${i.trim()?`${i}
${e.gray(o)}`:""}`}case "error":{const i=this.error.split(`
`).map((a,c)=>c===0?`${e.yellow(d)} ${e.yellow(a)}`:` ${a}`).join(`
`);return `${s+e.yellow(o)} ${B({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(`
${e.yellow(o)} `)}
${i}
`}default:return `${s}${e.cyan(o)} ${B({options:this.options,cursor:this.cursor,maxItems:t.maxItems,style:r}).join(`
${e.cyan(o)} `)}
${e.cyan(d)}
`}}}).prompt()};`${e.gray(o)} `;
const kCancel = Symbol.for("cancel");
async function prompt(message, opts = {}) {
const handleCancel = (value) => {
if (typeof value !== "symbol" || value.toString() !== "Symbol(clack:cancel)") {
return value;
}
switch (opts.cancel) {
case "reject": {
const error = new Error("Prompt cancelled.");
error.name = "ConsolaPromptCancelledError";
if (Error.captureStackTrace) {
Error.captureStackTrace(error, prompt);
}
throw error;
}
case "undefined": {
return void 0;
}
case "null": {
return null;
}
case "symbol": {
return kCancel;
}
default:
case "default": {
return opts.default ?? opts.initial;
}
}
};
if (!opts.type || opts.type === "text") {
return await he({
message,
defaultValue: opts.default,
placeholder: opts.placeholder,
initialValue: opts.initial
}).then(handleCancel);
}
if (opts.type === "confirm") {
return await ye({
message,
initialValue: opts.initial
}).then(handleCancel);
}
if (opts.type === "select") {
return await ve({
message,
options: opts.options.map(
(o) => typeof o === "string" ? { value: o, label: o } : o
),
initialValue: opts.initial
}).then(handleCancel);
}
if (opts.type === "multiselect") {
return await fe({
message,
options: opts.options.map(
(o) => typeof o === "string" ? { value: o, label: o } : o
),
required: opts.required,
initialValues: opts.initial
}).then(handleCancel);
}
throw new Error(`Unknown prompt type: ${opts.type}`);
}
exports.kCancel = kCancel;
exports.prompt = prompt;
@@ -0,0 +1 @@
{"version":3,"file":"copy-x.js","sources":["../../../src/icons/copy-x.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CopyX\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iMTIiIHgyPSIxOCIgeTE9IjEyIiB5Mj0iMTgiIC8+CiAgPGxpbmUgeDE9IjEyIiB4Mj0iMTgiIHkxPSIxOCIgeTI9IjEyIiAvPgogIDxyZWN0IHdpZHRoPSIxNCIgaGVpZ2h0PSIxNCIgeD0iOCIgeT0iOCIgcng9IjIiIHJ5PSIyIiAvPgogIDxwYXRoIGQ9Ik00IDE2Yy0xLjEgMC0yLS45LTItMlY0YzAtMS4xLjktMiAyLTJoMTBjMS4xIDAgMiAuOSAyIDIiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/copy-x\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CopyX = createLucideIcon('CopyX', [\n ['line', { x1: '12', x2: '18', y1: '12', y2: '18', key: '1rg63v' }],\n ['line', { x1: '12', x2: '18', y1: '18', y2: '12', key: 'ebkxgr' }],\n ['rect', { width: '14', height: '14', x: '8', y: '8', rx: '2', ry: '2', key: '17jyea' }],\n ['path', { d: 'M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2', key: 'zix9uf' }],\n]);\n\nexport default CopyX;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,iBAAiB,OAAS,CAAA,CAAA,CAAA;AAAA,CACtC,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,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAClE,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,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAClE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,KAAO,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,EAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,KAAK,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAA,EAAI,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAU,CAAA,CAAA;AAAA,CAAA,CACvF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2D,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC1F,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,431 @@
/**
* SHA3 (keccak) hash function, based on a new "Sponge function" design.
* Different from older hashes, the internal state is bigger than output size.
*
* Check out
* {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf | FIPS-202},
* {@link https://keccak.team/keccak.html | Website}, and
* {@link https://crypto.stackexchange.com/q/15727 | the differences between
* SHA-3 and Keccak}.
*
* Check out `sha3-addons` module for cSHAKE, k12, and others.
* @module
*/
import { rotlBH, rotlBL, rotlSH, rotlSL, split } from "./_u64.js";
// prettier-ignore
import { abytes, aexists, anumber, aoutput, clean, createHasher, oidNist, swap32IfBE, u32 } from "./utils.js";
// No __PURE__ annotations in sha3 header:
// EVERYTHING is in fact used on every export.
// Various per round constants calculations
const _0n = BigInt(0);
const _1n = BigInt(1);
const _2n = BigInt(2);
const _7n = BigInt(7);
const _256n = BigInt(256);
// FIPS 202 Algorithm 5 rc(): when the outgoing bit is 1, the 8-bit LFSR xors
// taps 0, 4, 5, and 6, which compresses to the feedback mask `0x71`.
const _0x71n = BigInt(0x71);
const SHA3_PI = [];
const SHA3_ROTL = [];
const _SHA3_IOTA = []; // no pure annotation: var is always used
for (let round = 0, R = _1n, x = 1, y = 0; round < 24; round++) {
// Pi
[x, y] = [y, (2 * x + 3 * y) % 5];
SHA3_PI.push(2 * (5 * y + x));
// Rotational
SHA3_ROTL.push((((round + 1) * (round + 2)) / 2) % 64);
// Iota
let t = _0n;
for (let j = 0; j < 7; j++) {
R = ((R << _1n) ^ ((R >> _7n) * _0x71n)) % _256n;
if (R & _2n)
t ^= _1n << ((_1n << BigInt(j)) - _1n);
}
_SHA3_IOTA.push(t);
}
const IOTAS = split(_SHA3_IOTA, true);
// `split(..., true)` keeps the local little-endian lane-word layout used by
// `state32`, so these `H` / `L` tables follow the file's first-word /
// second-word lane slots rather than `_u64.ts`'s usual high/low naming.
const SHA3_IOTA_H = IOTAS[0];
const SHA3_IOTA_L = IOTAS[1];
// Left rotation (without 0, 32, 64)
const rotlH = (h, l, s) => (s > 32 ? rotlBH(h, l, s) : rotlSH(h, l, s));
const rotlL = (h, l, s) => (s > 32 ? rotlBL(h, l, s) : rotlSL(h, l, s));
/**
* `keccakf1600` internal permutation, additionally allows adjusting the round count.
* @param s - 5x5 Keccak state encoded as 25 lanes split into 50 uint32 words
* in this file's local little-endian lane-word order
* @param rounds - number of rounds to execute
* @throws If `rounds` is outside the supported `1..24` range. {@link Error}
* @example
* Permute a Keccak state with the default 24 rounds.
* ```ts
* keccakP(new Uint32Array(50));
* ```
*/
export function keccakP(s, rounds = 24) {
anumber(rounds, 'rounds');
// This implementation precomputes only the standard Keccak-f[1600] 24-round Iota table.
if (rounds < 1 || rounds > 24)
throw new Error('"rounds" expected integer 1..24');
const B = new Uint32Array(5 * 2);
// NOTE: all indices are x2 since we store state as u32 instead of u64 (bigints to slow in js)
for (let round = 24 - rounds; round < 24; round++) {
// Theta θ
for (let x = 0; x < 10; x++)
B[x] = s[x] ^ s[x + 10] ^ s[x + 20] ^ s[x + 30] ^ s[x + 40];
for (let x = 0; x < 10; x += 2) {
const idx1 = (x + 8) % 10;
const idx0 = (x + 2) % 10;
const B0 = B[idx0];
const B1 = B[idx0 + 1];
const Th = rotlH(B0, B1, 1) ^ B[idx1];
const Tl = rotlL(B0, B1, 1) ^ B[idx1 + 1];
for (let y = 0; y < 50; y += 10) {
s[x + y] ^= Th;
s[x + y + 1] ^= Tl;
}
}
// Rho (ρ) and Pi (π)
let curH = s[2];
let curL = s[3];
for (let t = 0; t < 24; t++) {
const shift = SHA3_ROTL[t];
const Th = rotlH(curH, curL, shift);
const Tl = rotlL(curH, curL, shift);
const PI = SHA3_PI[t];
curH = s[PI];
curL = s[PI + 1];
s[PI] = Th;
s[PI + 1] = Tl;
}
// Chi (χ)
// Same as:
// for (let x = 0; x < 10; x++) B[x] = s[y + x];
// for (let x = 0; x < 10; x++) s[y + x] ^= ~B[(x + 2) % 10] & B[(x + 4) % 10];
for (let y = 0; y < 50; y += 10) {
const b0 = s[y], b1 = s[y + 1], b2 = s[y + 2], b3 = s[y + 3];
s[y] ^= ~s[y + 2] & s[y + 4];
s[y + 1] ^= ~s[y + 3] & s[y + 5];
s[y + 2] ^= ~s[y + 4] & s[y + 6];
s[y + 3] ^= ~s[y + 5] & s[y + 7];
s[y + 4] ^= ~s[y + 6] & s[y + 8];
s[y + 5] ^= ~s[y + 7] & s[y + 9];
s[y + 6] ^= ~s[y + 8] & b0;
s[y + 7] ^= ~s[y + 9] & b1;
s[y + 8] ^= ~b0 & b2;
s[y + 9] ^= ~b1 & b3;
}
// Iota (ι)
s[0] ^= SHA3_IOTA_H[round];
s[1] ^= SHA3_IOTA_L[round];
}
clean(B);
}
/**
* Keccak sponge function.
* @param blockLen - absorb/squeeze rate in bytes
* @param suffix - domain separation suffix byte
* @param outputLen - default digest length in bytes. This base sponge only
* requires a non-negative integer; wrappers that need positive output
* lengths must enforce that themselves.
* @param enableXOF - whether XOF output is allowed
* @param rounds - number of Keccak-f rounds
* @example
* Build a sponge state, absorb bytes, then finalize a digest.
* ```ts
* const hash = new Keccak(136, 0x06, 32);
* hash.update(new Uint8Array([1, 2, 3]));
* hash.digest();
* ```
*/
export class Keccak {
state;
pos = 0;
posOut = 0;
finished = false;
state32;
destroyed = false;
blockLen;
suffix;
outputLen;
canXOF;
enableXOF = false;
rounds;
// NOTE: we accept arguments in bytes instead of bits here.
constructor(blockLen, suffix, outputLen, enableXOF = false, rounds = 24) {
this.blockLen = blockLen;
this.suffix = suffix;
this.outputLen = outputLen;
this.enableXOF = enableXOF;
this.canXOF = enableXOF;
this.rounds = rounds;
// Can be passed from user as dkLen
anumber(outputLen, 'outputLen');
// 1600 = 5x5 matrix of 64bit. 1600 bits === 200 bytes
// 0 < blockLen < 200
if (!(0 < blockLen && blockLen < 200))
throw new Error('only keccak-f1600 function is supported');
this.state = new Uint8Array(200);
this.state32 = u32(this.state);
}
clone() {
return this._cloneInto();
}
keccak() {
swap32IfBE(this.state32);
keccakP(this.state32, this.rounds);
swap32IfBE(this.state32);
this.posOut = 0;
this.pos = 0;
}
update(data) {
aexists(this);
abytes(data);
const { blockLen, state } = this;
const len = data.length;
for (let pos = 0; pos < len;) {
const take = Math.min(blockLen - this.pos, len - pos);
for (let i = 0; i < take; i++)
state[this.pos++] ^= data[pos++];
if (this.pos === blockLen)
this.keccak();
}
return this;
}
finish() {
if (this.finished)
return;
this.finished = true;
const { state, suffix, pos, blockLen } = this;
// FIPS 202 appends the SHA3/SHAKE domain-separation suffix before pad10*1.
// These byte values already include the first padding bit, while the
// final `0x80` below supplies the closing `1` bit in the last rate byte.
state[pos] ^= suffix;
// If that combined suffix lands in the last rate byte and already sets
// bit 7, absorb it first so the final pad10*1 bit can be xored into a
// fresh block.
if ((suffix & 0x80) !== 0 && pos === blockLen - 1)
this.keccak();
state[blockLen - 1] ^= 0x80;
this.keccak();
}
writeInto(out) {
aexists(this, false);
abytes(out);
this.finish();
const bufferOut = this.state;
const { blockLen } = this;
for (let pos = 0, len = out.length; pos < len;) {
if (this.posOut >= blockLen)
this.keccak();
const take = Math.min(blockLen - this.posOut, len - pos);
out.set(bufferOut.subarray(this.posOut, this.posOut + take), pos);
this.posOut += take;
pos += take;
}
return out;
}
xofInto(out) {
// Plain SHA3/Keccak usage with XOF is probably a mistake, but this base
// class is also reused by SHAKE/cSHAKE/KMAC/TupleHash/ParallelHash/
// TurboSHAKE/KangarooTwelve wrappers that intentionally enable XOF.
if (!this.enableXOF)
throw new Error('XOF is not possible for this instance');
return this.writeInto(out);
}
xof(bytes) {
anumber(bytes);
return this.xofInto(new Uint8Array(bytes));
}
digestInto(out) {
aoutput(out, this);
if (this.finished)
throw new Error('digest() was already called');
// `aoutput(...)` allows oversized buffers; digestInto() must fill only the advertised digest.
this.writeInto(out.subarray(0, this.outputLen));
this.destroy();
}
digest() {
const out = new Uint8Array(this.outputLen);
this.digestInto(out);
return out;
}
destroy() {
this.destroyed = true;
clean(this.state);
}
_cloneInto(to) {
const { blockLen, suffix, outputLen, rounds, enableXOF } = this;
to ||= new Keccak(blockLen, suffix, outputLen, enableXOF, rounds);
// Reused destinations can come from a different rate/capacity variant, so clone must rewrite
// the sponge geometry as well as the state words.
to.blockLen = blockLen;
to.state32.set(this.state32);
to.pos = this.pos;
to.posOut = this.posOut;
to.finished = this.finished;
to.rounds = rounds;
// Suffix can change in cSHAKE
to.suffix = suffix;
to.outputLen = outputLen;
to.enableXOF = enableXOF;
// Clones must preserve the public capability bit too; `_KMAC` reuses this path and deep clone
// tests compare instance fields directly, so leaving `canXOF` behind makes the clone lie.
to.canXOF = this.canXOF;
to.destroyed = this.destroyed;
return to;
}
}
const genKeccak = (suffix, blockLen, outputLen, info = {}) => createHasher(() => new Keccak(blockLen, suffix, outputLen), info);
/**
* SHA3-224 hash function.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with SHA3-224.
* ```ts
* sha3_224(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha3_224 = /* @__PURE__ */ genKeccak(0x06, 144, 28,
/* @__PURE__ */ oidNist(0x07));
/**
* SHA3-256 hash function. Different from keccak-256.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with SHA3-256.
* ```ts
* sha3_256(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha3_256 = /* @__PURE__ */ genKeccak(0x06, 136, 32,
/* @__PURE__ */ oidNist(0x08));
/**
* SHA3-384 hash function.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with SHA3-384.
* ```ts
* sha3_384(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha3_384 = /* @__PURE__ */ genKeccak(0x06, 104, 48,
/* @__PURE__ */ oidNist(0x09));
/**
* SHA3-512 hash function.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with SHA3-512.
* ```ts
* sha3_512(new Uint8Array([97, 98, 99]));
* ```
*/
export const sha3_512 = /* @__PURE__ */ genKeccak(0x06, 72, 64,
/* @__PURE__ */ oidNist(0x0a));
/**
* Keccak-224 hash function.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with Keccak-224.
* ```ts
* keccak_224(new Uint8Array([97, 98, 99]));
* ```
*/
export const keccak_224 = /* @__PURE__ */ genKeccak(0x01, 144, 28);
/**
* Keccak-256 hash function. Different from SHA3-256.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with Keccak-256.
* ```ts
* keccak_256(new Uint8Array([97, 98, 99]));
* ```
*/
export const keccak_256 = /* @__PURE__ */ genKeccak(0x01, 136, 32);
/**
* Keccak-384 hash function.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with Keccak-384.
* ```ts
* keccak_384(new Uint8Array([97, 98, 99]));
* ```
*/
export const keccak_384 = /* @__PURE__ */ genKeccak(0x01, 104, 48);
/**
* Keccak-512 hash function.
* @param msg - message bytes to hash
* @returns Digest bytes.
* @example
* Hash a message with Keccak-512.
* ```ts
* keccak_512(new Uint8Array([97, 98, 99]));
* ```
*/
export const keccak_512 = /* @__PURE__ */ genKeccak(0x01, 72, 64);
const genShake = (suffix, blockLen, outputLen, info = {}) => createHasher((opts = {}) => new Keccak(blockLen, suffix, opts.dkLen === undefined ? outputLen : opts.dkLen, true), info);
/**
* SHAKE128 XOF with 128-bit security and a 16-byte default output.
* @param msg - message bytes to hash
* @param opts - Optional output-length override. See {@link ShakeOpts}.
* @returns Digest bytes.
* @example
* Hash a message with SHAKE128.
* ```ts
* shake128(new Uint8Array([97, 98, 99]), { dkLen: 32 });
* ```
*/
export const shake128 =
/* @__PURE__ */
genShake(0x1f, 168, 16, /* @__PURE__ */ oidNist(0x0b));
/**
* SHAKE256 XOF with 256-bit security and a 32-byte default output.
* @param msg - message bytes to hash
* @param opts - Optional output-length override. See {@link ShakeOpts}.
* @returns Digest bytes.
* @example
* Hash a message with SHAKE256.
* ```ts
* shake256(new Uint8Array([97, 98, 99]), { dkLen: 64 });
* ```
*/
export const shake256 =
/* @__PURE__ */
genShake(0x1f, 136, 32, /* @__PURE__ */ oidNist(0x0c));
/**
* SHAKE128 XOF with 256-bit output (NIST version).
* @param msg - message bytes to hash
* @param opts - Optional output-length override. See {@link ShakeOpts}.
* @returns Digest bytes.
* @example
* Hash a message with SHAKE128 using a 32-byte default output.
* ```ts
* shake128_32(new Uint8Array([97, 98, 99]), { dkLen: 32 });
* ```
*/
export const shake128_32 =
/* @__PURE__ */
genShake(0x1f, 168, 32, /* @__PURE__ */ oidNist(0x0b));
/**
* SHAKE256 XOF with 512-bit output (NIST version).
* @param msg - message bytes to hash
* @param opts - Optional output-length override. See {@link ShakeOpts}.
* @returns Digest bytes.
* @example
* Hash a message with SHAKE256 using a 64-byte default output.
* ```ts
* shake256_64(new Uint8Array([97, 98, 99]), { dkLen: 64 });
* ```
*/
export const shake256_64 =
/* @__PURE__ */
genShake(0x1f, 136, 64, /* @__PURE__ */ oidNist(0x0c));
//# sourceMappingURL=sha3.js.map
@@ -0,0 +1,179 @@
import { chownr, chownrSync } from 'chownr';
import fs from 'node:fs';
import fsp from 'node:fs/promises';
import path from 'node:path';
import { CwdError } from './cwd-error.js';
import { normalizeWindowsPath } from './normalize-windows-path.js';
import { SymlinkError } from './symlink-error.js';
const checkCwd = (dir, cb) => {
fs.stat(dir, (er, st) => {
if (er || !st.isDirectory()) {
er = new CwdError(dir, er?.code || 'ENOTDIR');
}
cb(er);
});
};
/**
* Wrapper around fs/promises.mkdir for tar's needs.
*
* The main purpose is to avoid creating directories if we know that
* they already exist (and track which ones exist for this purpose),
* and prevent entries from being extracted into symlinked folders,
* if `preservePaths` is not set.
*/
export const mkdir = (dir, opt, cb) => {
dir = normalizeWindowsPath(dir);
// if there's any overlap between mask and mode,
// then we'll need an explicit chmod
/* c8 ignore next */
const umask = opt.umask ?? 0o22;
const mode = opt.mode | 0o0700;
const needChmod = (mode & umask) !== 0;
const uid = opt.uid;
const gid = opt.gid;
const doChown = typeof uid === 'number' &&
typeof gid === 'number' &&
(uid !== opt.processUid || gid !== opt.processGid);
const preserve = opt.preserve;
const unlink = opt.unlink;
const cwd = normalizeWindowsPath(opt.cwd);
const done = (er, created) => {
if (er) {
cb(er);
}
else {
if (created && doChown) {
chownr(created, uid, gid, er => done(er));
}
else if (needChmod) {
fs.chmod(dir, mode, cb);
}
else {
cb();
}
}
};
if (dir === cwd) {
return checkCwd(dir, done);
}
if (preserve) {
return fsp.mkdir(dir, { mode, recursive: true }).then(made => done(null, made ?? undefined), // oh, ts
done);
}
const sub = normalizeWindowsPath(path.relative(cwd, dir));
const parts = sub.split('/');
mkdir_(cwd, parts, mode, unlink, cwd, undefined, done);
};
const mkdir_ = (base, parts, mode, unlink, cwd, created, cb) => {
if (parts.length === 0) {
return cb(null, created);
}
const p = parts.shift();
const part = normalizeWindowsPath(path.resolve(base + '/' + p));
fs.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
};
const onmkdir = (part, parts, mode, unlink, cwd, created, cb) => (er) => {
if (er) {
fs.lstat(part, (statEr, st) => {
if (statEr) {
statEr.path = statEr.path && normalizeWindowsPath(statEr.path);
cb(statEr);
}
else if (st.isDirectory()) {
mkdir_(part, parts, mode, unlink, cwd, created, cb);
}
else if (unlink) {
fs.unlink(part, er => {
if (er) {
return cb(er);
}
fs.mkdir(part, mode, onmkdir(part, parts, mode, unlink, cwd, created, cb));
});
}
else if (st.isSymbolicLink()) {
return cb(new SymlinkError(part, part + '/' + parts.join('/')));
}
else {
cb(er);
}
});
}
else {
created = created || part;
mkdir_(part, parts, mode, unlink, cwd, created, cb);
}
};
const checkCwdSync = (dir) => {
let ok = false;
let code;
try {
ok = fs.statSync(dir).isDirectory();
}
catch (er) {
code = er?.code;
}
finally {
if (!ok) {
throw new CwdError(dir, code ?? 'ENOTDIR');
}
}
};
export const mkdirSync = (dir, opt) => {
dir = normalizeWindowsPath(dir);
// if there's any overlap between mask and mode,
// then we'll need an explicit chmod
/* c8 ignore next */
const umask = opt.umask ?? 0o22;
const mode = opt.mode | 0o700;
const needChmod = (mode & umask) !== 0;
const uid = opt.uid;
const gid = opt.gid;
const doChown = typeof uid === 'number' &&
typeof gid === 'number' &&
(uid !== opt.processUid || gid !== opt.processGid);
const preserve = opt.preserve;
const unlink = opt.unlink;
const cwd = normalizeWindowsPath(opt.cwd);
const done = (created) => {
if (created && doChown) {
chownrSync(created, uid, gid);
}
if (needChmod) {
fs.chmodSync(dir, mode);
}
};
if (dir === cwd) {
checkCwdSync(cwd);
return done();
}
if (preserve) {
return done(fs.mkdirSync(dir, { mode, recursive: true }) ?? undefined);
}
const sub = normalizeWindowsPath(path.relative(cwd, dir));
const parts = sub.split('/');
let created;
for (let p = parts.shift(), part = cwd; p && (part += '/' + p); p = parts.shift()) {
part = normalizeWindowsPath(path.resolve(part));
try {
fs.mkdirSync(part, mode);
created = created || part;
}
catch {
const st = fs.lstatSync(part);
if (st.isDirectory()) {
continue;
}
else if (unlink) {
fs.unlinkSync(part);
fs.mkdirSync(part, mode);
created = created || part;
continue;
}
else if (st.isSymbolicLink()) {
return new SymlinkError(part, part + '/' + parts.join('/'));
}
}
}
return done(created);
};
//# sourceMappingURL=mkdir.js.map
@@ -0,0 +1 @@
{"version":3,"names":["_regeneratorValues","iterable","iteratorMethod","Symbol","iterator","i","call","next","isNaN","length","undefined","value","done","TypeError"],"sources":["../../src/helpers/regeneratorValues.ts"],"sourcesContent":["/* @minVersion 7.18.0 */\n/* @mangleFns */\n\nexport default function _regeneratorValues(iterable: any) {\n if (iterable != null) {\n var iteratorMethod =\n iterable[\n (typeof Symbol === \"function\" && Symbol.iterator) || \"@@iterator\"\n ],\n i = 0;\n\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n return {\n next: function () {\n if (iterable && i >= iterable.length) iterable = undefined;\n return { value: iterable && iterable[i++], done: !iterable };\n },\n };\n }\n }\n\n throw new TypeError(typeof iterable + \" is not iterable\");\n}\n"],"mappings":";;;;;;AAGe,SAASA,kBAAkBA,CAACC,QAAa,EAAE;EACxD,IAAIA,QAAQ,IAAI,IAAI,EAAE;IACpB,IAAIC,cAAc,GACdD,QAAQ,CACL,OAAOE,MAAM,KAAK,UAAU,IAAIA,MAAM,CAACC,QAAQ,IAAK,YAAY,CAClE;MACHC,CAAC,GAAG,CAAC;IAEP,IAAIH,cAAc,EAAE;MAClB,OAAOA,cAAc,CAACI,IAAI,CAACL,QAAQ,CAAC;IACtC;IAEA,IAAI,OAAOA,QAAQ,CAACM,IAAI,KAAK,UAAU,EAAE;MACvC,OAAON,QAAQ;IACjB;IAEA,IAAI,CAACO,KAAK,CAACP,QAAQ,CAACQ,MAAM,CAAC,EAAE;MAC3B,OAAO;QACLF,IAAI,EAAE,SAAAA,CAAA,EAAY;UAChB,IAAIN,QAAQ,IAAII,CAAC,IAAIJ,QAAQ,CAACQ,MAAM,EAAER,QAAQ,GAAGS,SAAS;UAC1D,OAAO;YAAEC,KAAK,EAAEV,QAAQ,IAAIA,QAAQ,CAACI,CAAC,EAAE,CAAC;YAAEO,IAAI,EAAE,CAACX;UAAS,CAAC;QAC9D;MACF,CAAC;IACH;EACF;EAEA,MAAM,IAAIY,SAAS,CAAC,OAAOZ,QAAQ,GAAG,kBAAkB,CAAC;AAC3D","ignoreList":[]}
@@ -0,0 +1 @@
{"version":3,"file":"TimeEstimates.mjs","sources":["../src/TimeEstimates.ts"],"sourcesContent":[null],"names":["SECOND","MINUTE","HOUR","DAY","MONTH","YEAR","CENTURY","times","second","minute","hour","day","month","year","century","timeEstimationValuesDefaults","scoring","attackTime","onlineThrottlingXPerHour","onlineNoThrottlingXPerSecond","offlineSlowHashingXPerSecond","offlineFastHashingXPerSecond","checkTimeEstimationValues","timeEstimationValues","Object","entries","forEach","key","data","subKey","value","Error","TimeEstimates","constructor","options","estimateAttackTimes","guesses","crackTimesSeconds","calculateCrackTimesSeconds","crackTimes","keys","crackTime","usedScenario","seconds","base","displayStr","displayTime","display","translate","score","guessesToScore","attackTimesOptions","scoringOptions","DELTA","timeKeys","foundIndex","findIndex","time","Math","round","timeEstimation","translations","translation","replace"],"mappings":"AAQA,MAAMA,MAAM,GAAG,CAAC;AAChB,MAAMC,MAAM,GAAGD,MAAM,GAAG,EAAE;AAC1B,MAAME,IAAI,GAAGD,MAAM,GAAG,EAAE;AACxB,MAAME,GAAG,GAAGD,IAAI,GAAG,EAAE;AACrB,MAAME,KAAK,GAAGD,GAAG,GAAG,EAAE;AACtB,MAAME,IAAI,GAAGD,KAAK,GAAG,EAAE;AACvB,MAAME,OAAO,GAAGD,IAAI,GAAG,GAAG;AAE1B,MAAME,KAAK,GAAG;AACZC,EAAAA,MAAM,EAAER,MAAM;AACdS,EAAAA,MAAM,EAAER,MAAM;AACdS,EAAAA,IAAI,EAAER,IAAI;AACVS,EAAAA,GAAG,EAAER,GAAG;AACRS,EAAAA,KAAK,EAAER,KAAK;AACZS,EAAAA,IAAI,EAAER,IAAI;AACVS,EAAAA,OAAO,EAAER;CACV;AAEM,MAAMS,4BAA4B,GAAyB;AAChEC,EAAAA,OAAO,EAAE;AACP,IAAA,CAAC,EAAE,GAAG;AACN,IAAA,CAAC,EAAE,GAAG;AACN,IAAA,CAAC,EAAE,GAAG;AACN,IAAA,CAAC,EAAE;GACJ;AACDC,EAAAA,UAAU,EAAE;AACVC,IAAAA,wBAAwB,EAAE,GAAG;AAC7BC,IAAAA,4BAA4B,EAAE,EAAE;AAChCC,IAAAA,4BAA4B,EAAE,GAAG;AACjCC,IAAAA,4BAA4B,EAAE;AAC/B;;AAGI,MAAMC,yBAAyB,GACpCC,oBAA0C,IACxC;AACFC,EAAAA,MAAM,CAACC,OAAO,CAACF,oBAAoB,CAAC,CAACG,OAAO,CAAC,CAAC,CAACC,GAAG,EAAEC,IAAI,CAAC,KAAI;AAC3DJ,IAAAA,MAAM,CAACC,OAAO,CAACG,IAAI,CAAC,CAACF,OAAO,CAAC,CAAC,CAACG,MAAM,EAAEC,KAAK,CAAC,KAAI;AAC/C;MACA,IAAIA,KAAK,GAAGf,4BAA4B,CAACY,GAAG,CAAC,CAACE,MAAM,CAAC,EAAE;AACrD,QAAA,MAAM,IAAIE,KAAK,CACb,sEAAsE,CACvE;AACH,MAAA;AACF,IAAA,CAAC,CAAC;AACJ,EAAA,CAAC,CAAC;AACJ;AAEA;;;;AAIG;MACUC,aAAa,CAAA;EACxBC,WAAAA,CAAoBC,OAAgB,EAAA;IAAhB,IAAA,CAAAA,OAAO,GAAPA,OAAO;AAAY,EAAA;EAEhCC,mBAAmBA,CAACC,OAAe,EAAA;AACxC,IAAA,MAAMC,iBAAiB,GAAG,IAAI,CAACC,0BAA0B,CAACF,OAAO,CAAC;IAClE,MAAMG,UAAU,GAAG,EAAgB;IAEnCf,MAAM,CAACgB,IAAI,CAACH,iBAAiB,CAAC,CAACX,OAAO,CAAEe,SAAS,IAAI;MACnD,MAAMC,YAAY,GAAGD,SAAoC;AACzD,MAAA,MAAME,OAAO,GAAGN,iBAAiB,CAACK,YAAY,CAAC;MAC/C,MAAM;QAAEE,IAAI;AAAEC,QAAAA;AAAU,OAAE,GAAG,IAAI,CAACC,WAAW,CAACH,OAAO,CAAC;MAEtDJ,UAAU,CAACG,YAAY,CAAC,GAAG;QACzBE,IAAI;QACJD,OAAO;AACPI,QAAAA,OAAO,EAAE,IAAI,CAACC,SAAS,CAACH,UAAU,EAAED,IAAI;OACzC;AACH,IAAA,CAAC,CAAC;IAEF,OAAO;MACLL,UAAU;AACVU,MAAAA,KAAK,EAAE,IAAI,CAACC,cAAc,CAACd,OAAO;KACnC;AACH,EAAA;EAEQE,0BAA0BA,CAACF,OAAe,EAAA;IAChD,MAAMe,kBAAkB,GAAG,IAAI,CAACjB,OAAO,CAACX,oBAAoB,CAACN,UAAU;IACvE,OAAO;MACLC,wBAAwB,EACtBkB,OAAO,IAAIe,kBAAkB,CAACjC,wBAAwB,GAAG,IAAI,CAAC;AAChEC,MAAAA,4BAA4B,EAC1BiB,OAAO,GAAGe,kBAAkB,CAAChC,4BAA4B;AAC3DC,MAAAA,4BAA4B,EAC1BgB,OAAO,GAAGe,kBAAkB,CAAC/B,4BAA4B;AAC3DC,MAAAA,4BAA4B,EAC1Be,OAAO,GAAGe,kBAAkB,CAAC9B;KAChC;AACH,EAAA;EAEQ6B,cAAcA,CAACd,OAAe,EAAA;IACpC,MAAMgB,cAAc,GAAG,IAAI,CAAClB,OAAO,CAACX,oBAAoB,CAACP,OAAO;IAChE,MAAMqC,KAAK,GAAG,CAAC;IACf,IAAIjB,OAAO,GAAGgB,cAAc,CAAC,CAAC,CAAC,GAAGC,KAAK,EAAE;AACvC;AACA,MAAA,OAAO,CAAC;AACV,IAAA;IACA,IAAIjB,OAAO,GAAGgB,cAAc,CAAC,CAAC,CAAC,GAAGC,KAAK,EAAE;AACvC;AACA,MAAA,OAAO,CAAC;AACV,IAAA;IACA,IAAIjB,OAAO,GAAGgB,cAAc,CAAC,CAAC,CAAC,GAAGC,KAAK,EAAE;AACvC;AACA,MAAA,OAAO,CAAC;AACV,IAAA;IACA,IAAIjB,OAAO,GAAGgB,cAAc,CAAC,CAAC,CAAC,GAAGC,KAAK,EAAE;AACvC;AACA;AACA,MAAA,OAAO,CAAC;AACV,IAAA;AACA;AACA,IAAA,OAAO,CAAC;AACV,EAAA;EAEQP,WAAWA,CAACH,OAAe,EAAA;IACjC,IAAIE,UAAU,GAAG,WAAW;IAC5B,IAAID,IAAI,GAAG,IAAI;AACf,IAAA,MAAMU,QAAQ,GAAG9B,MAAM,CAACgB,IAAI,CAACjC,KAAK,CAAC;AACnC,IAAA,MAAMgD,UAAU,GAAGD,QAAQ,CAACE,SAAS,CAClCC,IAAI,IAAKd,OAAO,GAAGpC,KAAK,CAACkD,IAA0B,CAAC,CACtD;AACD,IAAA,IAAIF,UAAU,GAAG,EAAE,EAAE;AACnBV,MAAAA,UAAU,GAAGS,QAAQ,CAACC,UAAU,GAAG,CAAC,CAAC;MACrC,IAAIA,UAAU,KAAK,CAAC,EAAE;QACpBX,IAAI,GAAGc,IAAI,CAACC,KAAK,CAAChB,OAAO,GAAGpC,KAAK,CAACsC,UAAgC,CAAC,CAAC;AACtE,MAAA,CAAC,MAAM;AACLA,QAAAA,UAAU,GAAG,UAAU;AACzB,MAAA;AACF,IAAA;IACA,OAAO;MACLD,IAAI;AACJC,MAAAA;KACD;AACH,EAAA;AAEQG,EAAAA,SAASA,CAACH,UAAkB,EAAEf,KAAoB,EAAA;IACxD,IAAIH,GAAG,GAAGkB,UAAU;AACpB,IAAA,IAAIf,KAAK,KAAK,IAAI,IAAIA,KAAK,KAAK,CAAC,EAAE;AACjCH,MAAAA,GAAG,IAAI,GAAG;AACZ,IAAA;IACA,MAAM;AAAEiC,MAAAA;AAAc,KAAE,GAAG,IAAI,CAAC1B,OAAO,CAAC2B,YAAY;AACpD,IAAA,MAAMC,WAAW,GAAGF,cAAc,CAACjC,GAAkC,CAAC;AACtE,IAAA,IAAI,OAAOmC,WAAW,KAAK,UAAU,EAAE;MACrC,OAAOA,WAAW,CAAChC,KAAM,CAAC;AAC5B,IAAA;IACA,OAAOgC,WAAW,CAACC,OAAO,CAAC,QAAQ,EAAE,CAAA,EAAGjC,KAAK,CAAA,CAAE,CAAC;AAClD,EAAA;AACD;;;;"}
@@ -0,0 +1,150 @@
/**
* @fileoverview Rule to suggest using "Reflect" api over Function/Object methods
* @author Keith Cirkel <http://keithcirkel.co.uk>
* @deprecated in ESLint v3.9.0
*/
"use strict";
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
meta: {
type: "suggestion",
docs: {
description: "Require `Reflect` methods where applicable",
recommended: false,
url: "https://eslint.org/docs/latest/rules/prefer-reflect",
},
deprecated: {
message: "The original intention of this rule was misguided.",
deprecatedSince: "3.9.0",
availableUntil: null,
replacedBy: [],
},
schema: [
{
type: "object",
properties: {
exceptions: {
type: "array",
items: {
enum: [
"apply",
"call",
"delete",
"defineProperty",
"getOwnPropertyDescriptor",
"getPrototypeOf",
"setPrototypeOf",
"isExtensible",
"getOwnPropertyNames",
"preventExtensions",
],
},
uniqueItems: true,
},
},
additionalProperties: false,
},
],
messages: {
preferReflect:
"Avoid using {{existing}}, instead use {{substitute}}.",
},
},
create(context) {
const existingNames = {
apply: "Function.prototype.apply",
call: "Function.prototype.call",
defineProperty: "Object.defineProperty",
getOwnPropertyDescriptor: "Object.getOwnPropertyDescriptor",
getPrototypeOf: "Object.getPrototypeOf",
setPrototypeOf: "Object.setPrototypeOf",
isExtensible: "Object.isExtensible",
getOwnPropertyNames: "Object.getOwnPropertyNames",
preventExtensions: "Object.preventExtensions",
};
const reflectSubstitutes = {
apply: "Reflect.apply",
call: "Reflect.apply",
defineProperty: "Reflect.defineProperty",
getOwnPropertyDescriptor: "Reflect.getOwnPropertyDescriptor",
getPrototypeOf: "Reflect.getPrototypeOf",
setPrototypeOf: "Reflect.setPrototypeOf",
isExtensible: "Reflect.isExtensible",
getOwnPropertyNames: "Reflect.getOwnPropertyNames",
preventExtensions: "Reflect.preventExtensions",
};
const exceptions = (context.options[0] || {}).exceptions || [];
/**
* Reports the Reflect violation based on the `existing` and `substitute`
* @param {Object} node The node that violates the rule.
* @param {string} existing The existing method name that has been used.
* @param {string} substitute The Reflect substitute that should be used.
* @returns {void}
*/
function report(node, existing, substitute) {
context.report({
node,
messageId: "preferReflect",
data: {
existing,
substitute,
},
});
}
return {
CallExpression(node) {
const methodName = (node.callee.property || {}).name;
const isReflectCall =
(node.callee.object || {}).name === "Reflect";
const hasReflectSubstitute = Object.hasOwn(
reflectSubstitutes,
methodName,
);
const userConfiguredException = exceptions.includes(methodName);
if (
hasReflectSubstitute &&
!isReflectCall &&
!userConfiguredException
) {
report(
node,
existingNames[methodName],
reflectSubstitutes[methodName],
);
}
},
UnaryExpression(node) {
const isDeleteOperator = node.operator === "delete";
const targetsIdentifier = node.argument.type === "Identifier";
const userConfiguredException = exceptions.includes("delete");
if (
isDeleteOperator &&
!targetsIdentifier &&
!userConfiguredException
) {
report(
node,
"the delete keyword",
"Reflect.deleteProperty",
);
}
},
};
},
};
@@ -0,0 +1,4 @@
const singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;
export { singleColorRegex };
//# sourceMappingURL=single-color-regex.mjs.map
@@ -0,0 +1 @@
{"version":3,"file":"Item.mjs","sources":["../../../../src/components/Reorder/Item.tsx"],"sourcesContent":["\"use client\"\n\nimport { isMotionValue } from \"motion-dom\"\nimport { invariant } from \"motion-utils\"\nimport * as React from \"react\"\nimport { forwardRef, FunctionComponent, useContext } from \"react\"\nimport { ReorderContext } from \"../../context/ReorderContext\"\nimport { motion } from \"../../render/components/motion/proxy\"\nimport { HTMLMotionProps } from \"../../render/html/types\"\nimport { useConstant } from \"../../utils/use-constant\"\nimport { useMotionValue } from \"../../value/use-motion-value\"\nimport { useTransform } from \"../../value/use-transform\"\n\nimport { DefaultItemElement, ReorderElementTag } from \"./types\"\nimport {\n autoScrollIfNeeded,\n resetAutoScrollState,\n} from \"./utils/auto-scroll\"\n\nexport interface Props<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> {\n /**\n * A HTML element to render this component as. Defaults to `\"li\"`.\n *\n * @public\n */\n as?: TagName\n\n /**\n * The value in the list that this component represents.\n *\n * @public\n */\n value: V\n\n /**\n * A subset of layout options primarily used to disable layout=\"size\"\n *\n * @public\n * @default true\n */\n layout?: true | \"position\"\n}\n\nfunction useDefaultMotionValue(value: any, defaultValue: number = 0) {\n return isMotionValue(value) ? value : useMotionValue(defaultValue)\n}\n\ntype ReorderItemProps<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n> = Props<V, TagName> &\n Omit<HTMLMotionProps<TagName>, \"value\" | \"layout\"> &\n React.PropsWithChildren<{}>\n\nexport function ReorderItemComponent<\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n {\n children,\n style = {},\n value,\n as = \"li\" as TagName,\n onDrag,\n onDragEnd,\n layout = true,\n ...props\n }: ReorderItemProps<V, TagName>,\n externalRef?: React.ForwardedRef<any>\n): React.JSX.Element {\n const Component = useConstant(\n () => motion[as as keyof typeof motion]\n ) as FunctionComponent<\n React.PropsWithChildren<HTMLMotionProps<any> & { ref?: React.Ref<any> }>\n >\n\n const context = useContext(ReorderContext)\n const point = {\n x: useDefaultMotionValue(style.x),\n y: useDefaultMotionValue(style.y),\n }\n\n const zIndex = useTransform([point.x, point.y], ([latestX, latestY]) =>\n latestX || latestY ? 1 : \"unset\"\n )\n\n invariant(\n Boolean(context),\n \"Reorder.Item must be a child of Reorder.Group\",\n \"reorder-item-child\"\n )\n\n const { axis, registerItem, updateOrder, groupRef } = context!\n\n return (\n <Component\n drag={axis}\n {...props}\n dragSnapToOrigin\n style={{ ...style, x: point.x, y: point.y, zIndex }}\n layout={layout}\n onDrag={(event, gesturePoint) => {\n const { velocity, point: pointerPoint } = gesturePoint\n const offset = point[axis].get()\n\n // Always attempt to update order - checkReorder handles the logic\n updateOrder(value, offset, velocity[axis])\n\n autoScrollIfNeeded(\n groupRef.current,\n pointerPoint[axis],\n axis,\n velocity[axis]\n )\n\n onDrag && onDrag(event, gesturePoint)\n }}\n onDragEnd={(event, gesturePoint) => {\n resetAutoScrollState()\n onDragEnd && onDragEnd(event, gesturePoint)\n }}\n onLayoutMeasure={(measured) => {\n registerItem(value, measured)\n }}\n ref={externalRef}\n ignoreStrict\n >\n {children}\n </Component>\n )\n}\n\nexport const ReorderItem = /*@__PURE__*/ forwardRef(ReorderItemComponent) as <\n V,\n TagName extends ReorderElementTag = DefaultItemElement\n>(\n props: ReorderItemProps<V, TagName> & { ref?: React.ForwardedRef<any> }\n) => ReturnType<typeof ReorderItemComponent>\n"],"names":[],"mappings":";;;;;;;;;;;;AA8CA;AACI;AACJ;AASM;AAgBF;AAMA;AACA;AACI;AACA;;AAGJ;;;;;;;;AA0BY;AAOA;;AAGA;AACA;AACJ;AAEI;;AAQhB;AAEO;;"}
@@ -0,0 +1,44 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = deprecationWarning;
const warnings = new Set();
function deprecationWarning(oldName, newName, prefix = "", cacheKey = oldName) {
if (warnings.has(cacheKey)) return;
warnings.add(cacheKey);
const {
internal,
trace
} = captureShortStackTrace(1, 2);
if (internal) {
return;
}
console.warn(`${prefix}\`${oldName}\` has been deprecated, please migrate to \`${newName}\`\n${trace}`);
}
function captureShortStackTrace(skip, length) {
const {
stackTraceLimit,
prepareStackTrace
} = Error;
let stackTrace;
Error.stackTraceLimit = 1 + skip + length;
Error.prepareStackTrace = function (err, stack) {
stackTrace = stack;
};
new Error().stack;
Error.stackTraceLimit = stackTraceLimit;
Error.prepareStackTrace = prepareStackTrace;
if (!stackTrace) return {
internal: false,
trace: ""
};
const shortStackTrace = stackTrace.slice(1 + skip, 1 + skip + length);
return {
internal: /[\\/]@babel[\\/]/.test(shortStackTrace[1].getFileName()),
trace: shortStackTrace.map(frame => ` at ${frame}`).join("\n")
};
}
//# sourceMappingURL=deprecationWarning.js.map
@@ -0,0 +1,24 @@
import { RequestHandler } from 'express';
import { OAuthServerProvider } from '../provider.js';
import { Options as RateLimitOptions } from 'express-rate-limit';
export type AuthorizationHandlerOptions = {
provider: OAuthServerProvider;
/**
* Rate limiting configuration for the authorization endpoint.
* Set to false to disable rate limiting for this endpoint.
*/
rateLimit?: Partial<RateLimitOptions> | false;
};
/**
* Validates a requested redirect_uri against a registered one.
*
* Per RFC 8252 §7.3 (OAuth 2.0 for Native Apps), authorization servers MUST
* allow any port for loopback redirect URIs (localhost, 127.0.0.1, [::1]) to
* accommodate native clients that obtain an ephemeral port from the OS. For
* non-loopback URIs, exact match is required.
*
* @see https://datatracker.ietf.org/doc/html/rfc8252#section-7.3
*/
export declare function redirectUriMatches(requested: string, registered: string): boolean;
export declare function authorizationHandler({ provider, rateLimit: rateLimitConfig }: AuthorizationHandlerOptions): RequestHandler;
//# sourceMappingURL=authorize.d.ts.map
@@ -0,0 +1,22 @@
/**
* @license lucide-react v0.469.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const TicketMinus = createLucideIcon("TicketMinus", [
[
"path",
{
d: "M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",
key: "qn84l0"
}
],
["path", { d: "M9 12h6", key: "1c52cq" }]
]);
export { TicketMinus as default };
//# sourceMappingURL=ticket-minus.js.map
@@ -0,0 +1,2 @@
declare function isPromise<T, S>(obj: PromiseLike<T> | S): obj is PromiseLike<T>;
export default isPromise;
@@ -0,0 +1,124 @@
import { GET_MATCH_RESULT } from "../../request/constants.js";
import { getPattern, splitRoutingPath } from "../../utils/url.js";
//#region src/helper/route/index.ts
/**
* Get matched routes in the handler
*
* @param {Context} c - The context object
* @returns An array of matched routes
*
* @example
* ```ts
* import { matchedRoutes } from 'hono/route'
*
* app.use('*', async function logger(c, next) {
* await next()
* matchedRoutes(c).forEach(({ handler, method, path }, i) => {
* const name = handler.name || (handler.length < 2 ? '[handler]' : '[middleware]')
* console.log(
* method,
* ' ',
* path,
* ' '.repeat(Math.max(10 - path.length, 0)),
* name,
* i === c.req.routeIndex ? '<- respond from here' : ''
* )
* })
* })
* ```
*/
const matchedRoutes = (c) => c.req[GET_MATCH_RESULT][0].map(([[, route]]) => route);
/**
* Get the route path registered within the handler
*
* @param {Context} c - The context object
* @param {number} index - The index of the route from which to retrieve the path, similar to Array.prototype.at(), where a negative number is the index counted from the end of the matching route. Defaults to the current route index.
* @returns The route path registered within the handler
*
* @example
* ```ts
* import { routePath } from 'hono/route'
*
* app.use('*', (c, next) => {
* console.log(routePath(c)) // '*'
* console.log(routePath(c, -1)) // '/posts/:id'
* return next()
* })
*
* app.get('/posts/:id', (c) => {
* return c.text(routePath(c)) // '/posts/:id'
* })
* ```
*/
const routePath = (c, index) => matchedRoutes(c).at(index ?? c.req.routeIndex)?.path ?? "";
/**
* Get the basePath of the as-is route specified by routing.
*
* @param {Context} c - The context object
* @param {number} index - The index of the route from which to retrieve the path, similar to Array.prototype.at(), where a negative number is the index counted from the end of the matching route. Defaults to the current route index.
* @returns The basePath of the as-is route specified by routing.
*
* @example
* ```ts
* import { baseRoutePath } from 'hono/route'
*
* const app = new Hono()
*
* const subApp = new Hono()
* subApp.get('/posts/:id', (c) => {
* return c.text(baseRoutePath(c)) // '/:sub'
* })
*
* app.route('/:sub', subApp)
* ```
*/
const baseRoutePath = (c, index) => matchedRoutes(c).at(index ?? c.req.routeIndex)?.basePath ?? "";
/**
* Get the basePath with embedded parameters
*
* @param {Context} c - The context object
* @param {number} index - The index of the route from which to retrieve the path, similar to Array.prototype.at(), where a negative number is the index counted from the end of the matching route. Defaults to the current route index.
* @returns The basePath with embedded parameters.
*
* @example
* ```ts
* import { basePath } from 'hono/route'
*
* const app = new Hono()
*
* const subApp = new Hono()
* subApp.get('/posts/:id', (c) => {
* return c.text(basePath(c)) // '/requested-sub-app-path'
* })
*
* app.route('/:sub', subApp)
* ```
*/
const basePathCacheMap = /* @__PURE__ */ new WeakMap();
const basePath = (c, index) => {
index ??= c.req.routeIndex;
const cache = basePathCacheMap.get(c) || [];
if (typeof cache[index] === "string") return cache[index];
let result;
const rp = baseRoutePath(c, index);
if (!/[:*]/.test(rp)) result = rp;
else {
const paths = splitRoutingPath(rp);
const reqPath = c.req.path;
let basePathLength = 0;
for (let i = 0, len = paths.length; i < len; i++) {
const pattern = getPattern(paths[i], paths[i + 1]);
if (pattern) {
const re = pattern[2] === true || pattern === "*" ? /[^\/]+/ : pattern[2];
basePathLength += reqPath.substring(basePathLength + 1).match(re)?.[0].length || 0;
} else basePathLength += paths[i].length;
basePathLength += 1;
}
result = reqPath.substring(0, basePathLength);
}
cache[index] = result;
basePathCacheMap.set(c, cache);
return result;
};
//#endregion
export { basePath, baseRoutePath, matchedRoutes, routePath };
@@ -0,0 +1,3 @@
# `react-slot`
View docs [here](https://radix-ui.com/primitives/docs/utilities/slot).
@@ -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 Tally4 = createLucideIcon("Tally4", [
["path", { d: "M4 4v16", key: "6qkkli" }],
["path", { d: "M9 4v16", key: "81ygyz" }],
["path", { d: "M14 4v16", key: "12vmem" }],
["path", { d: "M19 4v16", key: "8ij5ei" }]
]);
export { Tally4 as default };
//# sourceMappingURL=tally-4.js.map
@@ -0,0 +1,2 @@
import type { LibDefinition } from '../variable';
export declare const es2018_promise: LibDefinition;
@@ -0,0 +1,2 @@
export * from 'framer-motion';
export { m, motion } from 'framer-motion';
@@ -0,0 +1,30 @@
const require_useMatch = require("./useMatch.cjs");
//#region src/useParams.tsx
/**
* Access the current route's path parameters with type-safety.
*
* Options:
* - `from`/`strict`: Specify the matched route and whether to enforce strict typing
* - `select`: Project the params object to a derived value for memoized renders
* - `structuralSharing`: Enable structural sharing for stable references
* - `shouldThrow`: Throw if the route is not found in strict contexts
*
* @returns The params object (or selected value) for the matched route.
* @link https://tanstack.com/router/latest/docs/framework/react/api/router/useParamsHook
*/
function useParams(opts) {
return require_useMatch.useMatch({
from: opts.from,
shouldThrow: opts.shouldThrow,
structuralSharing: opts.structuralSharing,
strict: opts.strict,
select: (match) => {
const params = opts.strict === false ? match.params : match._strictParams;
return opts.select ? opts.select(params) : params;
}
});
}
//#endregion
exports.useParams = useParams;
//# sourceMappingURL=useParams.cjs.map
@@ -0,0 +1 @@
{"version":3,"file":"default.mjs","sources":["../../../../../src/animation/keyframes/offsets/default.ts"],"sourcesContent":["import { fillOffset } from \"./fill\"\n\nexport function defaultOffset(arr: any[]): number[] {\n const offset = [0]\n fillOffset(offset, arr.length - 1)\n return offset\n}\n"],"names":[],"mappings":";;AAEM,SAAU,aAAa,CAAC,GAAU,EAAA;AACpC,IAAA,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC;IAClB,UAAU,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC;AAClC,IAAA,OAAO,MAAM;AACjB;;;;"}
@@ -0,0 +1 @@
{"version":3,"file":"locate.js","sources":["../../../src/icons/locate.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Locate\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iMiIgeDI9IjUiIHkxPSIxMiIgeTI9IjEyIiAvPgogIDxsaW5lIHgxPSIxOSIgeDI9IjIyIiB5MT0iMTIiIHkyPSIxMiIgLz4KICA8bGluZSB4MT0iMTIiIHgyPSIxMiIgeTE9IjIiIHkyPSI1IiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMTkiIHkyPSIyMiIgLz4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSI3IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/locate\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 Locate = createLucideIcon('Locate', [\n ['line', { x1: '2', x2: '5', y1: '12', y2: '12', key: 'bvdh0s' }],\n ['line', { x1: '19', x2: '22', y1: '12', y2: '12', key: '1tbv5k' }],\n ['line', { x1: '12', x2: '12', y1: '2', y2: '5', key: '11lu5j' }],\n ['line', { x1: '12', x2: '12', y1: '19', y2: '22', key: 'x3vr5v' }],\n ['circle', { cx: '12', cy: '12', r: '7', key: 'fim9np' }],\n]);\n\nexport default Locate;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CACxC,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAChE,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,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAClE,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,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,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAClE,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;;"}